diff --git a/README.md b/README.md index 16af539..5edacc9 100644 --- a/README.md +++ b/README.md @@ -14,18 +14,15 @@ Docker Build + + Docker Pulls + GitHub tag (latest SemVer) GitHub stars - - Issues - - - GitHub pull requests -

Live Demo diff --git a/app/client/package.json b/app/client/package.json index 819bc14..31fc2e8 100644 --- a/app/client/package.json +++ b/app/client/package.json @@ -1,6 +1,6 @@ { "name": "fireshare", - "version": "1.2.19", + "version": "1.2.20", "private": true, "dependencies": { "@emotion/react": "^11.9.0", diff --git a/app/client/src/common/utils.js b/app/client/src/common/utils.js index fa10788..c392e28 100644 --- a/app/client/src/common/utils.js +++ b/app/client/src/common/utils.js @@ -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}` } @@ -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/` } diff --git a/app/nginx/prod.conf b/app/nginx/prod.conf index c58f730..313caa4 100644 --- a/app/nginx/prod.conf +++ b/app/nginx/prod.conf @@ -23,7 +23,7 @@ http { access_log /var/log/nginx/access.log main; - sendfile on; + sendfile off; sendfile_max_chunk 512k; tcp_nopush on; diff --git a/app/server/requirements.txt b/app/server/requirements.txt index 4e9ee6a..af1b2f3 100644 --- a/app/server/requirements.txt +++ b/app/server/requirements.txt @@ -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