Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #255

Merged
merged 7 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,15 @@
<a href="https://github.com/shaneisrael/fireshare/actions">
<img alt="Docker Build" src="https://github.com/shaneisrael/fireshare/actions/workflows/docker-publish-main.yml/badge.svg" />
</a>
<a href="https://hub.docker.com/r/shaneisrael/fireshare">
<img alt="Docker Pulls" src="https://img.shields.io/docker/pulls/shaneisrael/fireshare?label=docker%20pulls">
</a>
<a href="https://hub.docker.com/r/shaneisrael/fireshare/tags?page=1&ordering=last_updated">
<img alt="GitHub tag (latest SemVer)" src="https://img.shields.io/github/v/tag/shaneisrael/fireshare?label=version">
</a>
<a href="https://github.com/shaneisrael/fireshare/stargazers">
<img alt="GitHub stars" src="https://img.shields.io/github/stars/shaneisrael/fireshare">
</a>
<a href="https://github.com/shaneisrael/fireshare/issues">
<img alt="Issues" src="https://img.shields.io/github/issues/shaneisrael/fireshare?color=0088ff" />
</a>
<a href="https://github.com/shaneisrael/fireshare/pulls">
<img alt="GitHub pull requests" src="https://img.shields.io/github/issues-pr/shaneisrael/fireshare?color=0088ff" />
</a>
<br />
<br />
<a href="https://v.fireshare.net">Live Demo</a>
Expand Down
2 changes: 1 addition & 1 deletion app/client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fireshare",
"version": "1.2.19",
"version": "1.2.20",
"private": true,
"dependencies": {
"@emotion/react": "^11.9.0",
Expand Down
11 changes: 6 additions & 5 deletions app/client/src/common/utils.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import React from 'react'

let isLocalhost = (window.location.hostname.indexOf('localhost') >= 0 || window.location.hostname.indexOf('127.0.0.1') >= 0) && window.location.port !== '';
export const getServedBy = () => {
return (window.location.hostname.indexOf('localhost') >= 0 && window.location.port !== '')
return isLocalhost
? 'flask'
: 'nginx'
}

export const getUrl = () => {
const portWithColon = window.location.port ? `:${window.location.port}` : ''
return (window.location.hostname.indexOf('localhost') >= 0 && window.location.port !== '')
? `http://localhost:${process.env.REACT_APP_SERVER_PORT || window.location.port}`
return isLocalhost
? `http://${window.location.hostname}:${process.env.REACT_APP_SERVER_PORT || window.location.port}`
: `${window.location.protocol}//${window.location.hostname}${portWithColon}`
}

Expand All @@ -19,8 +20,8 @@ export const getPublicWatchUrl = () => {
return `${shareableLinkDomain}/w/`
}
const portWithColon = window.location.port ? `:${window.location.port}` : ''
return (window.location.hostname.indexOf('localhost') >= 0 && window.location.port !== '')
? `http://localhost:${process.env.REACT_APP_SERVER_PORT || window.location.port}/#/w/`
return isLocalhost
? `http://${window.location.hostname}:${process.env.REACT_APP_SERVER_PORT || window.location.port}/#/w/`
: `${window.location.protocol}//${window.location.hostname}${portWithColon}/w/`
}

Expand Down
2 changes: 1 addition & 1 deletion app/nginx/prod.conf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ http {

access_log /var/log/nginx/access.log main;

sendfile on;
sendfile off;
sendfile_max_chunk 512k;
tcp_nopush on;

Expand Down
2 changes: 1 addition & 1 deletion app/server/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Flask-Migrate==3.1.0
Flask-SQLAlchemy==2.5.1
Flask-WTF==1.0.1
future==0.18.2
greenlet==1.1.2
greenlet==3.0.3
gunicorn==20.1.0
importlib-metadata==4.11.3
itsdangerous==2.1.2
Expand Down
Loading