Skip to content

Commit 887eced

Browse files
authored
Merge pull request #244 from ShaneIsrael/develop
Develop
2 parents 9c2fc4b + 1751f24 commit 887eced

File tree

8 files changed

+16
-9
lines changed

8 files changed

+16
-9
lines changed

.env.dev

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
export FLASK_APP="app/server/fireshare:create_app()"
22
export FLASK_DEBUG=1
33
export ENVIRONMENT=dev
4+
export DOMAIN=""
45
export THUMBNAIL_VIDEO_LOCATION=50
56
export SECRET_KEY=dev-test-key
67
export DATA_DIRECTORY=$(pwd)/dev_root/dev_data/

.env.prod

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ export VIDEO_DIRECTORY=/videos/
44
export PROCESSED_DIRECTORY=/processed/
55
export TEMPLATE_PATH=/app/server/fireshare/templates
66
export ENVIRONMENT=production
7+
export DOMAIN=""
78
export THUMBNAIL_VIDEO_LOCATION=0
89
export ADMIN_PASSWORD=admin
910
export ADMIN_USERNAME=admin

app/client/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "fireshare",
3-
"version": "1.2.18",
3+
"version": "1.2.19",
44
"private": true,
55
"dependencies": {
66
"@emotion/react": "^11.9.0",

app/client/src/components/admin/UploadCard.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const UploadCard = ({ authenticated, feedView = false, publicUpload = false, fet
6060
}
6161
handleAlert({
6262
type: 'success',
63-
message: 'Your upload will be in a few seconds.',
63+
message: 'Your upload will be available in a few seconds.',
6464
autohideDuration: 3500,
6565
open: true,
6666
onClose: () => fetchVideos(),

app/server/fireshare/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ def create_app(init_schedule=False):
6262
raise Exception("DATA_DIRECTORY not found in environment")
6363

6464
app.config['ENVIRONMENT'] = os.getenv('ENVIRONMENT')
65+
app.config['DOMAIN'] = os.getenv('DOMAIN')
6566
app.config['THUMBNAIL_VIDEO_LOCATION'] = int(os.getenv('THUMBNAIL_VIDEO_LOCATION') or 0)
6667
app.config['SECRET_KEY'] = os.getenv('SECRET_KEY', secrets.token_hex(32))
6768
app.config['DATA_DIRECTORY'] = os.getenv('DATA_DIRECTORY')

app/server/fireshare/api.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,11 @@ def get_video_path(id, subid=None):
3434
@api.route('/w/<video_id>')
3535
def video_metadata(video_id):
3636
video = Video.query.filter_by(video_id=video_id).first()
37+
domain = f"https://{current_app.config['DOMAIN']}" if current_app.config['DOMAIN'] else ""
3738
if video:
38-
return render_template('metadata.html', video=video.json())
39+
return render_template('metadata.html', video=video.json(), domain=domain)
3940
else:
40-
return redirect('/#/w/{}'.format(video_id), code=302)
41+
return redirect('{}/#/w/{}'.format(domain, video_id), code=302)
4142

4243
@api.route('/api/config')
4344
def config():

app/server/fireshare/templates/metadata.html

+5-4
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,15 @@
1717
<link rel="apple-touch-icon" href="/logo192.png">
1818
<link rel="manifest" href="/manifest.json">
1919
<meta property="og:type" content="video" data-react-helmet="true">
20-
<meta property="og:url" content="/#/w/{{ video.video_id }}" data-react-helmet="true">
21-
<meta property="og:image" content="/_content/derived/{{ video.video_id }}/poster.jpg" data-react-helmet="true">
22-
<meta property="og:video" content="/_content/video/{{ video.video_id }}{{ video.extension }}" data-react-helmet="true">
20+
<meta property="og:url" content="{{ domain }}/#/w/{{ video.video_id }}" data-react-helmet="true">
21+
<meta property="og:image" content="{{ domain }}/_content/derived/{{ video.video_id }}/poster.jpg" data-react-helmet="true">
22+
<meta property="og:video" content="{{ domain }}/_content/video/{{ video.video_id }}{{ video.extension }}" data-react-helmet="true">
23+
<meta property="og:video:secure_url" content="{{ domain }}/_content/video/{{ video.video_id }}{{ video.extension }}" data-react-helmet="true">
2324
<meta property="og:site_name" content="Fireshare" data-react-helmet="true">
2425
<meta property="og:title" content="{{ video.info.title }}" data-react-helmet="true">
2526
<meta property="og:video:width" content="{{ video.info.width }}" data-react-helmet="true">
2627
<meta property="og:video:height" content="{{ video.info.height }}" data-react-helmet="true">
27-
<link itemprop="thumbnailUrl" href="/_content/derived/{{ video.video_id }}/poster.jpg">
28+
<link itemprop="thumbnailUrl" href="{{ domain }}/_content/derived/{{ video.video_id }}/poster.jpg">
2829
<title>{{ video.info.title }}</title>
2930
</head>
3031

docker-compose.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ services:
1414
- ADMIN_PASSWORD=admin
1515
- SECRET_KEY=replace_this_with_some_random_string
1616
- MINUTES_BETWEEN_VIDEO_SCANS=5
17-
# The location video thumbnails are generated. A value between 0-100 where 50 would be the frame in the middle of the video file and 0 would be the first frame of the video.
17+
# The location in the video thumbnails are generated. A value between 0-100 where 50 would be the frame in the middle of the video file and 0 would be the first frame of the video.
1818
- THUMBNAIL_VIDEO_LOCATION=0
19+
# The domain your instance is hosted at. (do not add http or https) e.x: v.fireshare.net, this is required for opengraph to work correctly for shared links.
20+
- DOMAIN=""
1921
- PUID=1000
2022
- PGID=1000

0 commit comments

Comments
 (0)