From 2c12bf57971fca79df41d19fb6a770580f8ea72e Mon Sep 17 00:00:00 2001 From: meeb Date: Wed, 11 Dec 2024 23:04:14 +1100 Subject: [PATCH] tidy up settings and readme --- README.md | 39 ++++++++----------- tubesync/tubesync/local_settings.py.container | 3 ++ tubesync/tubesync/settings.py | 4 +- 3 files changed, 21 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 9a565c29..a01f9830 100644 --- a/README.md +++ b/README.md @@ -361,30 +361,23 @@ There are a number of other environment variables you can set. These are, mostly **NOT** required to be set in the default container installation, they are really only useful if you are manually installing TubeSync in some other environment. These are: -| Name | What | Example | -| --------------------------- | ------------------------------------------------------------ |--------------------------------------| -| DJANGO_SECRET_KEY | Django's SECRET_KEY | YJySXnQLB7UVZw2dXKDWxI5lEZaImK6l | -| DJANGO_URL_PREFIX | Run TubeSync in a sub-URL on the web server | /somepath/ | -| TUBESYNC_DEBUG | Enable debugging | True | -| TUBESYNC_WORKERS | Number of background workers, default is 2, max allowed is 8 | 2 | -| TUBESYNC_HOSTS | Django's ALLOWED_HOSTS, defaults to `*` | tubesync.example.com,otherhost.com | -| TUBESYNC_RESET_DOWNLOAD_DIR | Toggle resetting `/downloads` permissions, defaults to True | True | -| GUNICORN_WORKERS | Number of gunicorn workers to spawn | 3 | -| LISTEN_HOST | IP address for gunicorn to listen on | 127.0.0.1 | -| LISTEN_PORT | Port number for gunicorn to listen on | 8080 | -| HTTP_USER | Sets the username for HTTP basic authentication | some-username | -| HTTP_PASS | Sets the password for HTTP basic authentication | some-secure-password | -| DATABASE_CONNECTION | Optional external database connection details | mysql://user:pass@host:port/database | -| VIDEO_HEIGHT_CUTOFF | Smallest video height in pixels permitted to download | 240 | -| TUBESYNC_DIRECTORY_PREFIX | Controls how downloaded files are organized. | true | +| Name | What | Example | +| ---------------------------- | ------------------------------------------------------------- |--------------------------------------| +| DJANGO_SECRET_KEY | Django's SECRET_KEY | YJySXnQLB7UVZw2dXKDWxI5lEZaImK6l | +| DJANGO_URL_PREFIX | Run TubeSync in a sub-URL on the web server | /somepath/ | +| TUBESYNC_DEBUG | Enable debugging | True | +| TUBESYNC_WORKERS | Number of background workers, default is 2, max allowed is 8 | 2 | +| TUBESYNC_HOSTS | Django's ALLOWED_HOSTS, defaults to `*` | tubesync.example.com,otherhost.com | +| TUBESYNC_RESET_DOWNLOAD_DIR | Toggle resetting `/downloads` permissions, defaults to True | True | +| TUBESYNC_VIDEO_HEIGHT_CUTOFF | Smallest video height in pixels permitted to download | 240 | +| TUBESYNC_DIRECTORY_PREFIX | Enable `video` and `audio` directory prefixes in `/downloads` | True | +| GUNICORN_WORKERS | Number of gunicorn workers to spawn | 3 | +| LISTEN_HOST | IP address for gunicorn to listen on | 127.0.0.1 | +| LISTEN_PORT | Port number for gunicorn to listen on | 8080 | +| HTTP_USER | Sets the username for HTTP basic authentication | some-username | +| HTTP_PASS | Sets the password for HTTP basic authentication | some-secure-password | +| DATABASE_CONNECTION | Optional external database connection details | mysql://user:pass@host:port/database | -# TubeSync Directory Mode - -Controls how downloaded files are organized. - -Values: -- true: Audio files go to `audio`, video files to `video`. -- false: All files are placed in the root of DOWNLOAD_DIR. # Manual, non-containerised, installation diff --git a/tubesync/tubesync/local_settings.py.container b/tubesync/tubesync/local_settings.py.container index 96a2e600..7b79c5ce 100644 --- a/tubesync/tubesync/local_settings.py.container +++ b/tubesync/tubesync/local_settings.py.container @@ -84,3 +84,6 @@ else: SOURCE_DOWNLOAD_DIRECTORY_PREFIX = os.getenv('TUBESYNC_DIRECTORY_PREFIX', 'True').strip().lower() + + +VIDEO_HEIGHT_CUTOFF = int(os.getenv("TUBESYNC_VIDEO_HEIGHT_CUTOFF", "240")) diff --git a/tubesync/tubesync/settings.py b/tubesync/tubesync/settings.py index d08f2cdb..57ea2bea 100644 --- a/tubesync/tubesync/settings.py +++ b/tubesync/tubesync/settings.py @@ -154,8 +154,8 @@ MEDIA_THUMBNAIL_WIDTH = 430 # Width in pixels to resize thumbnai MEDIA_THUMBNAIL_HEIGHT = 240 # Height in pixels to resize thumbnails to -VIDEO_HEIGHT_CUTOFF = int(os.getenv("VIDEO_HEIGHT_CUTOFF", "240")) # Smallest resolution in pixels permitted to download -VIDEO_HEIGHT_IS_HD = 500 # Height in pixels to count as 'HD' +VIDEO_HEIGHT_CUTOFF = 240 # Smallest resolution in pixels permitted to download +VIDEO_HEIGHT_IS_HD = 500 # Height in pixels to count as 'HD'