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 #244

Merged
merged 3 commits into from
Dec 30, 2023
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
1 change: 1 addition & 0 deletions .env.dev
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export FLASK_APP="app/server/fireshare:create_app()"
export FLASK_DEBUG=1
export ENVIRONMENT=dev
export DOMAIN=""
export THUMBNAIL_VIDEO_LOCATION=50
export SECRET_KEY=dev-test-key
export DATA_DIRECTORY=$(pwd)/dev_root/dev_data/
Expand Down
1 change: 1 addition & 0 deletions .env.prod
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export VIDEO_DIRECTORY=/videos/
export PROCESSED_DIRECTORY=/processed/
export TEMPLATE_PATH=/app/server/fireshare/templates
export ENVIRONMENT=production
export DOMAIN=""
export THUMBNAIL_VIDEO_LOCATION=0
export ADMIN_PASSWORD=admin
export ADMIN_USERNAME=admin
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.18",
"version": "1.2.19",
"private": true,
"dependencies": {
"@emotion/react": "^11.9.0",
Expand Down
2 changes: 1 addition & 1 deletion app/client/src/components/admin/UploadCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const UploadCard = ({ authenticated, feedView = false, publicUpload = false, fet
}
handleAlert({
type: 'success',
message: 'Your upload will be in a few seconds.',
message: 'Your upload will be available in a few seconds.',
autohideDuration: 3500,
open: true,
onClose: () => fetchVideos(),
Expand Down
1 change: 1 addition & 0 deletions app/server/fireshare/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def create_app(init_schedule=False):
raise Exception("DATA_DIRECTORY not found in environment")

app.config['ENVIRONMENT'] = os.getenv('ENVIRONMENT')
app.config['DOMAIN'] = os.getenv('DOMAIN')
app.config['THUMBNAIL_VIDEO_LOCATION'] = int(os.getenv('THUMBNAIL_VIDEO_LOCATION') or 0)
app.config['SECRET_KEY'] = os.getenv('SECRET_KEY', secrets.token_hex(32))
app.config['DATA_DIRECTORY'] = os.getenv('DATA_DIRECTORY')
Expand Down
5 changes: 3 additions & 2 deletions app/server/fireshare/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@ def get_video_path(id, subid=None):
@api.route('/w/<video_id>')
def video_metadata(video_id):
video = Video.query.filter_by(video_id=video_id).first()
domain = f"https://{current_app.config['DOMAIN']}" if current_app.config['DOMAIN'] else ""
if video:
return render_template('metadata.html', video=video.json())
return render_template('metadata.html', video=video.json(), domain=domain)
else:
return redirect('/#/w/{}'.format(video_id), code=302)
return redirect('{}/#/w/{}'.format(domain, video_id), code=302)

@api.route('/api/config')
def config():
Expand Down
9 changes: 5 additions & 4 deletions app/server/fireshare/templates/metadata.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@
<link rel="apple-touch-icon" href="/logo192.png">
<link rel="manifest" href="/manifest.json">
<meta property="og:type" content="video" data-react-helmet="true">
<meta property="og:url" content="/#/w/{{ video.video_id }}" data-react-helmet="true">
<meta property="og:image" content="/_content/derived/{{ video.video_id }}/poster.jpg" data-react-helmet="true">
<meta property="og:video" content="/_content/video/{{ video.video_id }}{{ video.extension }}" data-react-helmet="true">
<meta property="og:url" content="{{ domain }}/#/w/{{ video.video_id }}" data-react-helmet="true">
<meta property="og:image" content="{{ domain }}/_content/derived/{{ video.video_id }}/poster.jpg" data-react-helmet="true">
<meta property="og:video" content="{{ domain }}/_content/video/{{ video.video_id }}{{ video.extension }}" data-react-helmet="true">
<meta property="og:video:secure_url" content="{{ domain }}/_content/video/{{ video.video_id }}{{ video.extension }}" data-react-helmet="true">
<meta property="og:site_name" content="Fireshare" data-react-helmet="true">
<meta property="og:title" content="{{ video.info.title }}" data-react-helmet="true">
<meta property="og:video:width" content="{{ video.info.width }}" data-react-helmet="true">
<meta property="og:video:height" content="{{ video.info.height }}" data-react-helmet="true">
<link itemprop="thumbnailUrl" href="/_content/derived/{{ video.video_id }}/poster.jpg">
<link itemprop="thumbnailUrl" href="{{ domain }}/_content/derived/{{ video.video_id }}/poster.jpg">
<title>{{ video.info.title }}</title>
</head>

Expand Down
4 changes: 3 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ services:
- ADMIN_PASSWORD=admin
- SECRET_KEY=replace_this_with_some_random_string
- MINUTES_BETWEEN_VIDEO_SCANS=5
# 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.
# 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.
- THUMBNAIL_VIDEO_LOCATION=0
# 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.
- DOMAIN=""
- PUID=1000
- PGID=1000
Loading