Skip to content

Commit

Permalink
Merge pull request #255 from ShaneIsrael/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
ShaneIsrael authored Apr 29, 2024
2 parents e3ff3b2 + a176815 commit 44f41c5
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 14 deletions.
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

0 comments on commit 44f41c5

Please sign in to comment.