From 84b0c2e861e728b491b88924f54c8b1de8a25cfa Mon Sep 17 00:00:00 2001 From: Jett Jackson Date: Tue, 30 Oct 2018 14:15:49 +0800 Subject: [PATCH 1/3] Added docker support --- .gitignore | 2 + Dockerfile | 17 +++++ readme.md => README.md | 6 ++ {YtManager => app/YtManager}/__init__.py | 0 {YtManager => app/YtManager}/settings.py | 11 ++-- {YtManager => app/YtManager}/urls.py | 0 {YtManager => app/YtManager}/wsgi.py | 0 .../YtManagerApp}/__init__.py | 0 {YtManagerApp => app/YtManagerApp}/admin.py | 0 .../YtManagerApp}/appconfig.py | 0 {YtManagerApp => app/YtManagerApp}/appmain.py | 0 {YtManagerApp => app/YtManagerApp}/apps.py | 0 .../YtManagerApp}/management/__init__.py | 0 .../YtManagerApp}/management/downloader.py | 0 .../YtManagerApp}/management/jobs/__init__.py | 0 .../management/jobs/delete_video.py | 0 .../management/jobs/download_video.py | 0 .../management/jobs/synchronize.py | 0 .../YtManagerApp}/management/subscriptions.py | 0 .../YtManagerApp}/management/videos.py | 0 .../YtManagerApp}/migrations/0001_initial.py | 0 .../0002_subscriptionfolder_user.py | 0 .../migrations/0003_auto_20181013_2018.py | 0 .../migrations/0004_auto_20181014_1702.py | 0 .../migrations/0005_auto_20181026_2013.py | 0 .../migrations/0006_auto_20181027_0256.py | 0 .../migrations/0007_auto_20181029_1638.py | 0 .../YtManagerApp}/migrations/__init__.py | 0 {YtManagerApp => app/YtManagerApp}/models.py | 0 .../YtManagerApp}/scheduler.py | 0 .../static/YtManagerApp/css/login.css | 0 .../static/YtManagerApp/css/login.css.map | 0 .../static/YtManagerApp/css/login.scss | 0 .../static/YtManagerApp/css/style.css | 0 .../static/YtManagerApp/css/style.css.map | 0 .../static/YtManagerApp/css/style.scss | 0 .../YtManagerApp/img/baseline-folder-24px.svg | 0 .../YtManagerApp/img/baseline-person-24px.svg | 0 .../YtManagerApp/import/typicons/LICENCE.md | 0 .../YtManagerApp/import/typicons/demo.html | 0 .../YtManagerApp/import/typicons/typicons.css | 0 .../YtManagerApp/import/typicons/typicons.eot | Bin .../import/typicons/typicons.min.css | 0 .../YtManagerApp/import/typicons/typicons.svg | 0 .../YtManagerApp/import/typicons/typicons.ttf | Bin .../import/typicons/typicons.woff | Bin .../controls/folder_create_modal.html | 0 .../controls/folder_delete_modal.html | 0 .../controls/folder_update_modal.html | 0 .../YtManagerApp/controls/modal.html | 0 .../controls/subscription_create_modal.html | 0 .../controls/subscription_delete_modal.html | 0 .../controls/subscription_update_modal.html | 0 .../templates/YtManagerApp/index.html | 0 .../YtManagerApp/index_unauthenticated.html | 0 .../templates/YtManagerApp/index_videos.html | 0 .../templates/YtManagerApp/js/common.js | 0 .../templates/YtManagerApp/js/index.js | 0 .../YtManagerApp/master_default.html | 0 .../templates/YtManagerApp/settings.html | 0 .../templates/registration/logged_out.html | 0 .../templates/registration/login.html | 0 .../registration/password_reset_complete.html | 0 .../registration/password_reset_confirm.html | 0 .../registration/password_reset_done.html | 0 .../registration/password_reset_email.html | 0 .../registration/password_reset_form.html | 0 .../templates/registration/register.html | 0 .../templates/registration/register_done.html | 0 .../YtManagerApp}/templatetags/__init__.py | 0 .../YtManagerApp}/templatetags/common.py | 0 .../YtManagerApp}/templatetags/ratings.py | 0 {YtManagerApp => app/YtManagerApp}/tests.py | 0 {YtManagerApp => app/YtManagerApp}/urls.py | 0 .../YtManagerApp}/utils/__init__.py | 0 .../utils/extended_interpolation_with_env.py | 0 .../YtManagerApp}/utils/youtube.py | 0 .../YtManagerApp}/views/__init__.py | 0 .../YtManagerApp}/views/actions.py | 0 .../YtManagerApp}/views/auth.py | 0 .../YtManagerApp}/views/controls/__init__.py | 0 .../YtManagerApp}/views/controls/modal.py | 0 .../YtManagerApp}/views/index.py | 0 .../YtManagerApp}/views/settings.py | 0 app/config/config.ini | 59 ++++++++++++++++++ app/config/defaults.ini | 59 ++++++++++++++++++ {external => app/external}/__init__.py | 0 {external => app/external}/pytaw/.gitignore | 0 {external => app/external}/pytaw/.pytaw.conf | 0 {external => app/external}/pytaw/README.md | 0 {external => app/external}/pytaw/__init__.py | 0 .../external}/pytaw/docs/Makefile | 0 {external => app/external}/pytaw/docs/conf.py | 0 .../external}/pytaw/docs/index.rst | 0 .../external}/pytaw/docs/make.bat | 0 {external => app/external}/pytaw/main_test.py | 0 .../external}/pytaw/pytaw/__init__.py | 0 .../external}/pytaw/pytaw/utils.py | 0 .../external}/pytaw/pytaw/youtube.py | 0 {external => app/external}/pytaw/setup.py | 0 .../external}/pytaw/tests/__init__.py | 0 .../external}/pytaw/tests/test_pytaw.py | 0 app/init.sh | 4 ++ manage.py => app/manage.py | 0 app/requirements.txt | 10 +++ config/config.ini | 24 +++---- docker-compose.yml | 33 ++++++++++ nginx/nginx.conf | 31 +++++++++ 108 files changed, 240 insertions(+), 16 deletions(-) create mode 100644 Dockerfile rename readme.md => README.md (94%) rename {YtManager => app/YtManager}/__init__.py (100%) rename {YtManager => app/YtManager}/settings.py (95%) rename {YtManager => app/YtManager}/urls.py (100%) rename {YtManager => app/YtManager}/wsgi.py (100%) rename {YtManagerApp => app/YtManagerApp}/__init__.py (100%) rename {YtManagerApp => app/YtManagerApp}/admin.py (100%) rename {YtManagerApp => app/YtManagerApp}/appconfig.py (100%) rename {YtManagerApp => app/YtManagerApp}/appmain.py (100%) rename {YtManagerApp => app/YtManagerApp}/apps.py (100%) rename {YtManagerApp => app/YtManagerApp}/management/__init__.py (100%) rename {YtManagerApp => app/YtManagerApp}/management/downloader.py (100%) rename {YtManagerApp => app/YtManagerApp}/management/jobs/__init__.py (100%) rename {YtManagerApp => app/YtManagerApp}/management/jobs/delete_video.py (100%) rename {YtManagerApp => app/YtManagerApp}/management/jobs/download_video.py (100%) rename {YtManagerApp => app/YtManagerApp}/management/jobs/synchronize.py (100%) rename {YtManagerApp => app/YtManagerApp}/management/subscriptions.py (100%) rename {YtManagerApp => app/YtManagerApp}/management/videos.py (100%) rename {YtManagerApp => app/YtManagerApp}/migrations/0001_initial.py (100%) rename {YtManagerApp => app/YtManagerApp}/migrations/0002_subscriptionfolder_user.py (100%) rename {YtManagerApp => app/YtManagerApp}/migrations/0003_auto_20181013_2018.py (100%) rename {YtManagerApp => app/YtManagerApp}/migrations/0004_auto_20181014_1702.py (100%) rename {YtManagerApp => app/YtManagerApp}/migrations/0005_auto_20181026_2013.py (100%) rename {YtManagerApp => app/YtManagerApp}/migrations/0006_auto_20181027_0256.py (100%) rename {YtManagerApp => app/YtManagerApp}/migrations/0007_auto_20181029_1638.py (100%) rename {YtManagerApp => app/YtManagerApp}/migrations/__init__.py (100%) rename {YtManagerApp => app/YtManagerApp}/models.py (100%) rename {YtManagerApp => app/YtManagerApp}/scheduler.py (100%) rename {YtManagerApp => app/YtManagerApp}/static/YtManagerApp/css/login.css (100%) rename {YtManagerApp => app/YtManagerApp}/static/YtManagerApp/css/login.css.map (100%) rename {YtManagerApp => app/YtManagerApp}/static/YtManagerApp/css/login.scss (100%) rename {YtManagerApp => app/YtManagerApp}/static/YtManagerApp/css/style.css (100%) rename {YtManagerApp => app/YtManagerApp}/static/YtManagerApp/css/style.css.map (100%) rename {YtManagerApp => app/YtManagerApp}/static/YtManagerApp/css/style.scss (100%) rename {YtManagerApp => app/YtManagerApp}/static/YtManagerApp/img/baseline-folder-24px.svg (100%) rename {YtManagerApp => app/YtManagerApp}/static/YtManagerApp/img/baseline-person-24px.svg (100%) rename {YtManagerApp => app/YtManagerApp}/static/YtManagerApp/import/typicons/LICENCE.md (100%) rename {YtManagerApp => app/YtManagerApp}/static/YtManagerApp/import/typicons/demo.html (100%) rename {YtManagerApp => app/YtManagerApp}/static/YtManagerApp/import/typicons/typicons.css (100%) rename {YtManagerApp => app/YtManagerApp}/static/YtManagerApp/import/typicons/typicons.eot (100%) rename {YtManagerApp => app/YtManagerApp}/static/YtManagerApp/import/typicons/typicons.min.css (100%) rename {YtManagerApp => app/YtManagerApp}/static/YtManagerApp/import/typicons/typicons.svg (100%) rename {YtManagerApp => app/YtManagerApp}/static/YtManagerApp/import/typicons/typicons.ttf (100%) rename {YtManagerApp => app/YtManagerApp}/static/YtManagerApp/import/typicons/typicons.woff (100%) rename {YtManagerApp => app/YtManagerApp}/templates/YtManagerApp/controls/folder_create_modal.html (100%) rename {YtManagerApp => app/YtManagerApp}/templates/YtManagerApp/controls/folder_delete_modal.html (100%) rename {YtManagerApp => app/YtManagerApp}/templates/YtManagerApp/controls/folder_update_modal.html (100%) rename {YtManagerApp => app/YtManagerApp}/templates/YtManagerApp/controls/modal.html (100%) rename {YtManagerApp => app/YtManagerApp}/templates/YtManagerApp/controls/subscription_create_modal.html (100%) rename {YtManagerApp => app/YtManagerApp}/templates/YtManagerApp/controls/subscription_delete_modal.html (100%) rename {YtManagerApp => app/YtManagerApp}/templates/YtManagerApp/controls/subscription_update_modal.html (100%) rename {YtManagerApp => app/YtManagerApp}/templates/YtManagerApp/index.html (100%) rename {YtManagerApp => app/YtManagerApp}/templates/YtManagerApp/index_unauthenticated.html (100%) rename {YtManagerApp => app/YtManagerApp}/templates/YtManagerApp/index_videos.html (100%) rename {YtManagerApp => app/YtManagerApp}/templates/YtManagerApp/js/common.js (100%) rename {YtManagerApp => app/YtManagerApp}/templates/YtManagerApp/js/index.js (100%) rename {YtManagerApp => app/YtManagerApp}/templates/YtManagerApp/master_default.html (100%) rename {YtManagerApp => app/YtManagerApp}/templates/YtManagerApp/settings.html (100%) rename {YtManagerApp => app/YtManagerApp}/templates/registration/logged_out.html (100%) rename {YtManagerApp => app/YtManagerApp}/templates/registration/login.html (100%) rename {YtManagerApp => app/YtManagerApp}/templates/registration/password_reset_complete.html (100%) rename {YtManagerApp => app/YtManagerApp}/templates/registration/password_reset_confirm.html (100%) rename {YtManagerApp => app/YtManagerApp}/templates/registration/password_reset_done.html (100%) rename {YtManagerApp => app/YtManagerApp}/templates/registration/password_reset_email.html (100%) rename {YtManagerApp => app/YtManagerApp}/templates/registration/password_reset_form.html (100%) rename {YtManagerApp => app/YtManagerApp}/templates/registration/register.html (100%) rename {YtManagerApp => app/YtManagerApp}/templates/registration/register_done.html (100%) rename {YtManagerApp => app/YtManagerApp}/templatetags/__init__.py (100%) rename {YtManagerApp => app/YtManagerApp}/templatetags/common.py (100%) rename {YtManagerApp => app/YtManagerApp}/templatetags/ratings.py (100%) rename {YtManagerApp => app/YtManagerApp}/tests.py (100%) rename {YtManagerApp => app/YtManagerApp}/urls.py (100%) rename {YtManagerApp => app/YtManagerApp}/utils/__init__.py (100%) rename {YtManagerApp => app/YtManagerApp}/utils/extended_interpolation_with_env.py (100%) rename {YtManagerApp => app/YtManagerApp}/utils/youtube.py (100%) rename {YtManagerApp => app/YtManagerApp}/views/__init__.py (100%) rename {YtManagerApp => app/YtManagerApp}/views/actions.py (100%) rename {YtManagerApp => app/YtManagerApp}/views/auth.py (100%) rename {YtManagerApp => app/YtManagerApp}/views/controls/__init__.py (100%) rename {YtManagerApp => app/YtManagerApp}/views/controls/modal.py (100%) rename {YtManagerApp => app/YtManagerApp}/views/index.py (100%) rename {YtManagerApp => app/YtManagerApp}/views/settings.py (100%) create mode 100644 app/config/config.ini create mode 100644 app/config/defaults.ini rename {external => app/external}/__init__.py (100%) rename {external => app/external}/pytaw/.gitignore (100%) rename {external => app/external}/pytaw/.pytaw.conf (100%) rename {external => app/external}/pytaw/README.md (100%) rename {external => app/external}/pytaw/__init__.py (100%) rename {external => app/external}/pytaw/docs/Makefile (100%) rename {external => app/external}/pytaw/docs/conf.py (100%) rename {external => app/external}/pytaw/docs/index.rst (100%) rename {external => app/external}/pytaw/docs/make.bat (100%) rename {external => app/external}/pytaw/main_test.py (100%) rename {external => app/external}/pytaw/pytaw/__init__.py (100%) rename {external => app/external}/pytaw/pytaw/utils.py (100%) rename {external => app/external}/pytaw/pytaw/youtube.py (100%) rename {external => app/external}/pytaw/setup.py (100%) rename {external => app/external}/pytaw/tests/__init__.py (100%) rename {external => app/external}/pytaw/tests/test_pytaw.py (100%) create mode 100755 app/init.sh rename manage.py => app/manage.py (100%) create mode 100644 app/requirements.txt create mode 100644 docker-compose.yml create mode 100644 nginx/nginx.conf diff --git a/.gitignore b/.gitignore index 5ce42cd..62681d9 100644 --- a/.gitignore +++ b/.gitignore @@ -113,3 +113,5 @@ venv.bak/ .mypy_cache/ .dmypy.json dmypy.json + +media/ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..df016b9 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM python:3 + +WORKDIR /usr/src/app + +RUN apt-get update +RUN apt-get install ffmpeg -y + +COPY ./app/requirements.txt ./ +RUN pip install --no-cache-dir -r requirements.txt + +COPY ./app/ . +COPY ./config/ ./config/ + +#RUN python manage.py migrate + +CMD ["python", "./manage.py", "runserver", "8000", "--noreload"] +#CMD ["gunicorn", "YtManager.wsgi", "--bind", "0.0.0.0:8000"] diff --git a/readme.md b/README.md similarity index 94% rename from readme.md rename to README.md index c0aef34..ecc812e 100644 --- a/readme.md +++ b/README.md @@ -20,6 +20,12 @@ This is what still needs to be done: * Improve stability * Bonus: Plex integration +# Docker + +To run with docker, edit the config file (config/config.ini) and then run `docker-compose up -d`, it will bind to port 80. + +You can edit the default download locations in the docker-compose.yml file. + ## Dependencies * python3: `$ apt install python3` diff --git a/YtManager/__init__.py b/app/YtManager/__init__.py similarity index 100% rename from YtManager/__init__.py rename to app/YtManager/__init__.py diff --git a/YtManager/settings.py b/app/YtManager/settings.py similarity index 95% rename from YtManager/settings.py rename to app/YtManager/settings.py index 348292f..35bbb2f 100644 --- a/YtManager/settings.py +++ b/app/YtManager/settings.py @@ -26,7 +26,7 @@ YOUTUBE_API_KEY = "AIzaSyBabzE4Bup77WexdLMa9rN9z-wJidEfNX8" # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True -ALLOWED_HOSTS = [] +ALLOWED_HOSTS = ['*'] SESSION_COOKIE_AGE = 3600 * 30 # one month @@ -81,11 +81,14 @@ WSGI_APPLICATION = 'YtManager.wsgi.application' DATABASES = { 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), + 'ENGINE': 'django.db.backends.postgresql', + 'NAME': 'postgres', + 'USER': 'postgres', + 'HOST': 'db', + 'PORT': 5432, } -} +} # Password validation # https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators diff --git a/YtManager/urls.py b/app/YtManager/urls.py similarity index 100% rename from YtManager/urls.py rename to app/YtManager/urls.py diff --git a/YtManager/wsgi.py b/app/YtManager/wsgi.py similarity index 100% rename from YtManager/wsgi.py rename to app/YtManager/wsgi.py diff --git a/YtManagerApp/__init__.py b/app/YtManagerApp/__init__.py similarity index 100% rename from YtManagerApp/__init__.py rename to app/YtManagerApp/__init__.py diff --git a/YtManagerApp/admin.py b/app/YtManagerApp/admin.py similarity index 100% rename from YtManagerApp/admin.py rename to app/YtManagerApp/admin.py diff --git a/YtManagerApp/appconfig.py b/app/YtManagerApp/appconfig.py similarity index 100% rename from YtManagerApp/appconfig.py rename to app/YtManagerApp/appconfig.py diff --git a/YtManagerApp/appmain.py b/app/YtManagerApp/appmain.py similarity index 100% rename from YtManagerApp/appmain.py rename to app/YtManagerApp/appmain.py diff --git a/YtManagerApp/apps.py b/app/YtManagerApp/apps.py similarity index 100% rename from YtManagerApp/apps.py rename to app/YtManagerApp/apps.py diff --git a/YtManagerApp/management/__init__.py b/app/YtManagerApp/management/__init__.py similarity index 100% rename from YtManagerApp/management/__init__.py rename to app/YtManagerApp/management/__init__.py diff --git a/YtManagerApp/management/downloader.py b/app/YtManagerApp/management/downloader.py similarity index 100% rename from YtManagerApp/management/downloader.py rename to app/YtManagerApp/management/downloader.py diff --git a/YtManagerApp/management/jobs/__init__.py b/app/YtManagerApp/management/jobs/__init__.py similarity index 100% rename from YtManagerApp/management/jobs/__init__.py rename to app/YtManagerApp/management/jobs/__init__.py diff --git a/YtManagerApp/management/jobs/delete_video.py b/app/YtManagerApp/management/jobs/delete_video.py similarity index 100% rename from YtManagerApp/management/jobs/delete_video.py rename to app/YtManagerApp/management/jobs/delete_video.py diff --git a/YtManagerApp/management/jobs/download_video.py b/app/YtManagerApp/management/jobs/download_video.py similarity index 100% rename from YtManagerApp/management/jobs/download_video.py rename to app/YtManagerApp/management/jobs/download_video.py diff --git a/YtManagerApp/management/jobs/synchronize.py b/app/YtManagerApp/management/jobs/synchronize.py similarity index 100% rename from YtManagerApp/management/jobs/synchronize.py rename to app/YtManagerApp/management/jobs/synchronize.py diff --git a/YtManagerApp/management/subscriptions.py b/app/YtManagerApp/management/subscriptions.py similarity index 100% rename from YtManagerApp/management/subscriptions.py rename to app/YtManagerApp/management/subscriptions.py diff --git a/YtManagerApp/management/videos.py b/app/YtManagerApp/management/videos.py similarity index 100% rename from YtManagerApp/management/videos.py rename to app/YtManagerApp/management/videos.py diff --git a/YtManagerApp/migrations/0001_initial.py b/app/YtManagerApp/migrations/0001_initial.py similarity index 100% rename from YtManagerApp/migrations/0001_initial.py rename to app/YtManagerApp/migrations/0001_initial.py diff --git a/YtManagerApp/migrations/0002_subscriptionfolder_user.py b/app/YtManagerApp/migrations/0002_subscriptionfolder_user.py similarity index 100% rename from YtManagerApp/migrations/0002_subscriptionfolder_user.py rename to app/YtManagerApp/migrations/0002_subscriptionfolder_user.py diff --git a/YtManagerApp/migrations/0003_auto_20181013_2018.py b/app/YtManagerApp/migrations/0003_auto_20181013_2018.py similarity index 100% rename from YtManagerApp/migrations/0003_auto_20181013_2018.py rename to app/YtManagerApp/migrations/0003_auto_20181013_2018.py diff --git a/YtManagerApp/migrations/0004_auto_20181014_1702.py b/app/YtManagerApp/migrations/0004_auto_20181014_1702.py similarity index 100% rename from YtManagerApp/migrations/0004_auto_20181014_1702.py rename to app/YtManagerApp/migrations/0004_auto_20181014_1702.py diff --git a/YtManagerApp/migrations/0005_auto_20181026_2013.py b/app/YtManagerApp/migrations/0005_auto_20181026_2013.py similarity index 100% rename from YtManagerApp/migrations/0005_auto_20181026_2013.py rename to app/YtManagerApp/migrations/0005_auto_20181026_2013.py diff --git a/YtManagerApp/migrations/0006_auto_20181027_0256.py b/app/YtManagerApp/migrations/0006_auto_20181027_0256.py similarity index 100% rename from YtManagerApp/migrations/0006_auto_20181027_0256.py rename to app/YtManagerApp/migrations/0006_auto_20181027_0256.py diff --git a/YtManagerApp/migrations/0007_auto_20181029_1638.py b/app/YtManagerApp/migrations/0007_auto_20181029_1638.py similarity index 100% rename from YtManagerApp/migrations/0007_auto_20181029_1638.py rename to app/YtManagerApp/migrations/0007_auto_20181029_1638.py diff --git a/YtManagerApp/migrations/__init__.py b/app/YtManagerApp/migrations/__init__.py similarity index 100% rename from YtManagerApp/migrations/__init__.py rename to app/YtManagerApp/migrations/__init__.py diff --git a/YtManagerApp/models.py b/app/YtManagerApp/models.py similarity index 100% rename from YtManagerApp/models.py rename to app/YtManagerApp/models.py diff --git a/YtManagerApp/scheduler.py b/app/YtManagerApp/scheduler.py similarity index 100% rename from YtManagerApp/scheduler.py rename to app/YtManagerApp/scheduler.py diff --git a/YtManagerApp/static/YtManagerApp/css/login.css b/app/YtManagerApp/static/YtManagerApp/css/login.css similarity index 100% rename from YtManagerApp/static/YtManagerApp/css/login.css rename to app/YtManagerApp/static/YtManagerApp/css/login.css diff --git a/YtManagerApp/static/YtManagerApp/css/login.css.map b/app/YtManagerApp/static/YtManagerApp/css/login.css.map similarity index 100% rename from YtManagerApp/static/YtManagerApp/css/login.css.map rename to app/YtManagerApp/static/YtManagerApp/css/login.css.map diff --git a/YtManagerApp/static/YtManagerApp/css/login.scss b/app/YtManagerApp/static/YtManagerApp/css/login.scss similarity index 100% rename from YtManagerApp/static/YtManagerApp/css/login.scss rename to app/YtManagerApp/static/YtManagerApp/css/login.scss diff --git a/YtManagerApp/static/YtManagerApp/css/style.css b/app/YtManagerApp/static/YtManagerApp/css/style.css similarity index 100% rename from YtManagerApp/static/YtManagerApp/css/style.css rename to app/YtManagerApp/static/YtManagerApp/css/style.css diff --git a/YtManagerApp/static/YtManagerApp/css/style.css.map b/app/YtManagerApp/static/YtManagerApp/css/style.css.map similarity index 100% rename from YtManagerApp/static/YtManagerApp/css/style.css.map rename to app/YtManagerApp/static/YtManagerApp/css/style.css.map diff --git a/YtManagerApp/static/YtManagerApp/css/style.scss b/app/YtManagerApp/static/YtManagerApp/css/style.scss similarity index 100% rename from YtManagerApp/static/YtManagerApp/css/style.scss rename to app/YtManagerApp/static/YtManagerApp/css/style.scss diff --git a/YtManagerApp/static/YtManagerApp/img/baseline-folder-24px.svg b/app/YtManagerApp/static/YtManagerApp/img/baseline-folder-24px.svg similarity index 100% rename from YtManagerApp/static/YtManagerApp/img/baseline-folder-24px.svg rename to app/YtManagerApp/static/YtManagerApp/img/baseline-folder-24px.svg diff --git a/YtManagerApp/static/YtManagerApp/img/baseline-person-24px.svg b/app/YtManagerApp/static/YtManagerApp/img/baseline-person-24px.svg similarity index 100% rename from YtManagerApp/static/YtManagerApp/img/baseline-person-24px.svg rename to app/YtManagerApp/static/YtManagerApp/img/baseline-person-24px.svg diff --git a/YtManagerApp/static/YtManagerApp/import/typicons/LICENCE.md b/app/YtManagerApp/static/YtManagerApp/import/typicons/LICENCE.md similarity index 100% rename from YtManagerApp/static/YtManagerApp/import/typicons/LICENCE.md rename to app/YtManagerApp/static/YtManagerApp/import/typicons/LICENCE.md diff --git a/YtManagerApp/static/YtManagerApp/import/typicons/demo.html b/app/YtManagerApp/static/YtManagerApp/import/typicons/demo.html similarity index 100% rename from YtManagerApp/static/YtManagerApp/import/typicons/demo.html rename to app/YtManagerApp/static/YtManagerApp/import/typicons/demo.html diff --git a/YtManagerApp/static/YtManagerApp/import/typicons/typicons.css b/app/YtManagerApp/static/YtManagerApp/import/typicons/typicons.css similarity index 100% rename from YtManagerApp/static/YtManagerApp/import/typicons/typicons.css rename to app/YtManagerApp/static/YtManagerApp/import/typicons/typicons.css diff --git a/YtManagerApp/static/YtManagerApp/import/typicons/typicons.eot b/app/YtManagerApp/static/YtManagerApp/import/typicons/typicons.eot similarity index 100% rename from YtManagerApp/static/YtManagerApp/import/typicons/typicons.eot rename to app/YtManagerApp/static/YtManagerApp/import/typicons/typicons.eot diff --git a/YtManagerApp/static/YtManagerApp/import/typicons/typicons.min.css b/app/YtManagerApp/static/YtManagerApp/import/typicons/typicons.min.css similarity index 100% rename from YtManagerApp/static/YtManagerApp/import/typicons/typicons.min.css rename to app/YtManagerApp/static/YtManagerApp/import/typicons/typicons.min.css diff --git a/YtManagerApp/static/YtManagerApp/import/typicons/typicons.svg b/app/YtManagerApp/static/YtManagerApp/import/typicons/typicons.svg similarity index 100% rename from YtManagerApp/static/YtManagerApp/import/typicons/typicons.svg rename to app/YtManagerApp/static/YtManagerApp/import/typicons/typicons.svg diff --git a/YtManagerApp/static/YtManagerApp/import/typicons/typicons.ttf b/app/YtManagerApp/static/YtManagerApp/import/typicons/typicons.ttf similarity index 100% rename from YtManagerApp/static/YtManagerApp/import/typicons/typicons.ttf rename to app/YtManagerApp/static/YtManagerApp/import/typicons/typicons.ttf diff --git a/YtManagerApp/static/YtManagerApp/import/typicons/typicons.woff b/app/YtManagerApp/static/YtManagerApp/import/typicons/typicons.woff similarity index 100% rename from YtManagerApp/static/YtManagerApp/import/typicons/typicons.woff rename to app/YtManagerApp/static/YtManagerApp/import/typicons/typicons.woff diff --git a/YtManagerApp/templates/YtManagerApp/controls/folder_create_modal.html b/app/YtManagerApp/templates/YtManagerApp/controls/folder_create_modal.html similarity index 100% rename from YtManagerApp/templates/YtManagerApp/controls/folder_create_modal.html rename to app/YtManagerApp/templates/YtManagerApp/controls/folder_create_modal.html diff --git a/YtManagerApp/templates/YtManagerApp/controls/folder_delete_modal.html b/app/YtManagerApp/templates/YtManagerApp/controls/folder_delete_modal.html similarity index 100% rename from YtManagerApp/templates/YtManagerApp/controls/folder_delete_modal.html rename to app/YtManagerApp/templates/YtManagerApp/controls/folder_delete_modal.html diff --git a/YtManagerApp/templates/YtManagerApp/controls/folder_update_modal.html b/app/YtManagerApp/templates/YtManagerApp/controls/folder_update_modal.html similarity index 100% rename from YtManagerApp/templates/YtManagerApp/controls/folder_update_modal.html rename to app/YtManagerApp/templates/YtManagerApp/controls/folder_update_modal.html diff --git a/YtManagerApp/templates/YtManagerApp/controls/modal.html b/app/YtManagerApp/templates/YtManagerApp/controls/modal.html similarity index 100% rename from YtManagerApp/templates/YtManagerApp/controls/modal.html rename to app/YtManagerApp/templates/YtManagerApp/controls/modal.html diff --git a/YtManagerApp/templates/YtManagerApp/controls/subscription_create_modal.html b/app/YtManagerApp/templates/YtManagerApp/controls/subscription_create_modal.html similarity index 100% rename from YtManagerApp/templates/YtManagerApp/controls/subscription_create_modal.html rename to app/YtManagerApp/templates/YtManagerApp/controls/subscription_create_modal.html diff --git a/YtManagerApp/templates/YtManagerApp/controls/subscription_delete_modal.html b/app/YtManagerApp/templates/YtManagerApp/controls/subscription_delete_modal.html similarity index 100% rename from YtManagerApp/templates/YtManagerApp/controls/subscription_delete_modal.html rename to app/YtManagerApp/templates/YtManagerApp/controls/subscription_delete_modal.html diff --git a/YtManagerApp/templates/YtManagerApp/controls/subscription_update_modal.html b/app/YtManagerApp/templates/YtManagerApp/controls/subscription_update_modal.html similarity index 100% rename from YtManagerApp/templates/YtManagerApp/controls/subscription_update_modal.html rename to app/YtManagerApp/templates/YtManagerApp/controls/subscription_update_modal.html diff --git a/YtManagerApp/templates/YtManagerApp/index.html b/app/YtManagerApp/templates/YtManagerApp/index.html similarity index 100% rename from YtManagerApp/templates/YtManagerApp/index.html rename to app/YtManagerApp/templates/YtManagerApp/index.html diff --git a/YtManagerApp/templates/YtManagerApp/index_unauthenticated.html b/app/YtManagerApp/templates/YtManagerApp/index_unauthenticated.html similarity index 100% rename from YtManagerApp/templates/YtManagerApp/index_unauthenticated.html rename to app/YtManagerApp/templates/YtManagerApp/index_unauthenticated.html diff --git a/YtManagerApp/templates/YtManagerApp/index_videos.html b/app/YtManagerApp/templates/YtManagerApp/index_videos.html similarity index 100% rename from YtManagerApp/templates/YtManagerApp/index_videos.html rename to app/YtManagerApp/templates/YtManagerApp/index_videos.html diff --git a/YtManagerApp/templates/YtManagerApp/js/common.js b/app/YtManagerApp/templates/YtManagerApp/js/common.js similarity index 100% rename from YtManagerApp/templates/YtManagerApp/js/common.js rename to app/YtManagerApp/templates/YtManagerApp/js/common.js diff --git a/YtManagerApp/templates/YtManagerApp/js/index.js b/app/YtManagerApp/templates/YtManagerApp/js/index.js similarity index 100% rename from YtManagerApp/templates/YtManagerApp/js/index.js rename to app/YtManagerApp/templates/YtManagerApp/js/index.js diff --git a/YtManagerApp/templates/YtManagerApp/master_default.html b/app/YtManagerApp/templates/YtManagerApp/master_default.html similarity index 100% rename from YtManagerApp/templates/YtManagerApp/master_default.html rename to app/YtManagerApp/templates/YtManagerApp/master_default.html diff --git a/YtManagerApp/templates/YtManagerApp/settings.html b/app/YtManagerApp/templates/YtManagerApp/settings.html similarity index 100% rename from YtManagerApp/templates/YtManagerApp/settings.html rename to app/YtManagerApp/templates/YtManagerApp/settings.html diff --git a/YtManagerApp/templates/registration/logged_out.html b/app/YtManagerApp/templates/registration/logged_out.html similarity index 100% rename from YtManagerApp/templates/registration/logged_out.html rename to app/YtManagerApp/templates/registration/logged_out.html diff --git a/YtManagerApp/templates/registration/login.html b/app/YtManagerApp/templates/registration/login.html similarity index 100% rename from YtManagerApp/templates/registration/login.html rename to app/YtManagerApp/templates/registration/login.html diff --git a/YtManagerApp/templates/registration/password_reset_complete.html b/app/YtManagerApp/templates/registration/password_reset_complete.html similarity index 100% rename from YtManagerApp/templates/registration/password_reset_complete.html rename to app/YtManagerApp/templates/registration/password_reset_complete.html diff --git a/YtManagerApp/templates/registration/password_reset_confirm.html b/app/YtManagerApp/templates/registration/password_reset_confirm.html similarity index 100% rename from YtManagerApp/templates/registration/password_reset_confirm.html rename to app/YtManagerApp/templates/registration/password_reset_confirm.html diff --git a/YtManagerApp/templates/registration/password_reset_done.html b/app/YtManagerApp/templates/registration/password_reset_done.html similarity index 100% rename from YtManagerApp/templates/registration/password_reset_done.html rename to app/YtManagerApp/templates/registration/password_reset_done.html diff --git a/YtManagerApp/templates/registration/password_reset_email.html b/app/YtManagerApp/templates/registration/password_reset_email.html similarity index 100% rename from YtManagerApp/templates/registration/password_reset_email.html rename to app/YtManagerApp/templates/registration/password_reset_email.html diff --git a/YtManagerApp/templates/registration/password_reset_form.html b/app/YtManagerApp/templates/registration/password_reset_form.html similarity index 100% rename from YtManagerApp/templates/registration/password_reset_form.html rename to app/YtManagerApp/templates/registration/password_reset_form.html diff --git a/YtManagerApp/templates/registration/register.html b/app/YtManagerApp/templates/registration/register.html similarity index 100% rename from YtManagerApp/templates/registration/register.html rename to app/YtManagerApp/templates/registration/register.html diff --git a/YtManagerApp/templates/registration/register_done.html b/app/YtManagerApp/templates/registration/register_done.html similarity index 100% rename from YtManagerApp/templates/registration/register_done.html rename to app/YtManagerApp/templates/registration/register_done.html diff --git a/YtManagerApp/templatetags/__init__.py b/app/YtManagerApp/templatetags/__init__.py similarity index 100% rename from YtManagerApp/templatetags/__init__.py rename to app/YtManagerApp/templatetags/__init__.py diff --git a/YtManagerApp/templatetags/common.py b/app/YtManagerApp/templatetags/common.py similarity index 100% rename from YtManagerApp/templatetags/common.py rename to app/YtManagerApp/templatetags/common.py diff --git a/YtManagerApp/templatetags/ratings.py b/app/YtManagerApp/templatetags/ratings.py similarity index 100% rename from YtManagerApp/templatetags/ratings.py rename to app/YtManagerApp/templatetags/ratings.py diff --git a/YtManagerApp/tests.py b/app/YtManagerApp/tests.py similarity index 100% rename from YtManagerApp/tests.py rename to app/YtManagerApp/tests.py diff --git a/YtManagerApp/urls.py b/app/YtManagerApp/urls.py similarity index 100% rename from YtManagerApp/urls.py rename to app/YtManagerApp/urls.py diff --git a/YtManagerApp/utils/__init__.py b/app/YtManagerApp/utils/__init__.py similarity index 100% rename from YtManagerApp/utils/__init__.py rename to app/YtManagerApp/utils/__init__.py diff --git a/YtManagerApp/utils/extended_interpolation_with_env.py b/app/YtManagerApp/utils/extended_interpolation_with_env.py similarity index 100% rename from YtManagerApp/utils/extended_interpolation_with_env.py rename to app/YtManagerApp/utils/extended_interpolation_with_env.py diff --git a/YtManagerApp/utils/youtube.py b/app/YtManagerApp/utils/youtube.py similarity index 100% rename from YtManagerApp/utils/youtube.py rename to app/YtManagerApp/utils/youtube.py diff --git a/YtManagerApp/views/__init__.py b/app/YtManagerApp/views/__init__.py similarity index 100% rename from YtManagerApp/views/__init__.py rename to app/YtManagerApp/views/__init__.py diff --git a/YtManagerApp/views/actions.py b/app/YtManagerApp/views/actions.py similarity index 100% rename from YtManagerApp/views/actions.py rename to app/YtManagerApp/views/actions.py diff --git a/YtManagerApp/views/auth.py b/app/YtManagerApp/views/auth.py similarity index 100% rename from YtManagerApp/views/auth.py rename to app/YtManagerApp/views/auth.py diff --git a/YtManagerApp/views/controls/__init__.py b/app/YtManagerApp/views/controls/__init__.py similarity index 100% rename from YtManagerApp/views/controls/__init__.py rename to app/YtManagerApp/views/controls/__init__.py diff --git a/YtManagerApp/views/controls/modal.py b/app/YtManagerApp/views/controls/modal.py similarity index 100% rename from YtManagerApp/views/controls/modal.py rename to app/YtManagerApp/views/controls/modal.py diff --git a/YtManagerApp/views/index.py b/app/YtManagerApp/views/index.py similarity index 100% rename from YtManagerApp/views/index.py rename to app/YtManagerApp/views/index.py diff --git a/YtManagerApp/views/settings.py b/app/YtManagerApp/views/settings.py similarity index 100% rename from YtManagerApp/views/settings.py rename to app/YtManagerApp/views/settings.py diff --git a/app/config/config.ini b/app/config/config.ini new file mode 100644 index 0000000..c3d0f48 --- /dev/null +++ b/app/config/config.ini @@ -0,0 +1,59 @@ +; Use $ to use the value of an environment variable. +; The global section contains settings that apply to the entire server +[global] +; YouTube API key - get this from your user account +YoutubeApiKey=AIzaSyAonB6T-DrKjfGxBGuHyFMg0x_d0T9nlP8 + +; Specifies the synchronization schedule, in crontab format. +; Format: +SynchronizationSchedule=5 * * * * + +; Number of threads running the scheduler +; Since most of the jobs scheduled are downloads, there is no advantage to having +; a higher concurrency +SchedulerConcurrency=1 + +; Log level +LogLevel=DEBUG + +; Default user settings +[user] +; When a video is deleted on the system, it will be marked as 'watched' +MarkDeletedAsWatched=True + +; Videos marked as watched are automatically deleted +DeleteWatched=True + +; Enable automatic downloading +AutoDownload=True + +; Limit the total number of videos downloaded (-1 or empty = no limit) +DownloadGlobalLimit=10 + +; Limit the numbers of videos per subscription (-1 or empty = no limit) +DownloadSubscriptionLimit=5 + +; Number of download attempts +DownloadMaxAttempts=3 + +; Download order +; Options: newest, oldest, playlist, playlist_reverse, popularity, rating +DownloadOrder=playlist + +; Path where downloaded videos are stored +DownloadPath=data/media/videos + +; A pattern which describes how downloaded files are organized. Extensions are automatically appended. +; Supported fields: channel, channel_id, playlist, playlist_id, playlist_index, title, id +; The default pattern should work pretty well with Plex +;DownloadFilePattern=${channel}/${playlist}/S01E${playlist_index} - ${title} [${id}] + +; Download format that will be passed to youtube-dl. See the youtube-dl documentation for more details. +DownloadFormat=bestvideo+bestaudio + +; Subtitles - these options match the youtube-dl options +;DownloadSubtitles=True +;DownloadAutogeneratedSubtitles=False +;DownloadSubtitlesAll=False +;DownloadSubtitlesLangs=en,ro +;DownloadSubtitlesFormat= diff --git a/app/config/defaults.ini b/app/config/defaults.ini new file mode 100644 index 0000000..a4a0b30 --- /dev/null +++ b/app/config/defaults.ini @@ -0,0 +1,59 @@ +; Use $ to use the value of an environment variable. +; The global section contains settings that apply to the entire server +[global] +; YouTube API key - get this from your user account +YoutubeApiKey=AIzaSyBabzE4Bup77WexdLMa9rN9z-wJidEfNX8 + +; Specifies the synchronization schedule, in crontab format. +; Format: +SynchronizationSchedule=0 * * * * + +; Number of threads running the scheduler +; Since most of the jobs scheduled are downloads, there is no advantage to having +; a higher concurrency +SchedulerConcurrency=2 + +; Log level +LogLevel=INFO + +; Default user settings +[user] +; When a video is deleted on the system, it will be marked as 'watched' +MarkDeletedAsWatched=True + +; Videos marked as watched are automatically deleted +DeleteWatched=True + +; Enable automatic downloading +AutoDownload=True + +; Limit the total number of videos downloaded (-1 or empty = no limit) +DownloadGlobalLimit= + +; Limit the numbers of videos per subscription (-1 or empty = no limit) +DownloadSubscriptionLimit=5 + +; Number of download attempts +DownloadMaxAttempts=3 + +; Download order +; Options: newest, oldest, playlist, playlist_reverse, popularity, rating +DownloadOrder=playlist + +; Path where downloaded videos are stored +DownloadPath=${env:USERPROFILE}${env:HOME}/Downloads + +; A pattern which describes how downloaded files are organized. Extensions are automatically appended. +; Supported fields: channel, channel_id, playlist, playlist_id, playlist_index, title, id +; The default pattern should work pretty well with Plex +DownloadFilePattern=${channel}/${playlist}/S01E${playlist_index} - ${title} [${id}] + +; Download format that will be passed to youtube-dl. See the youtube-dl documentation for more details. +DownloadFormat=bestvideo+bestaudio + +; Subtitles - these options match the youtube-dl options +DownloadSubtitles=True +DownloadAutogeneratedSubtitles=False +DownloadSubtitlesAll=False +DownloadSubtitlesLangs=en,ro +DownloadSubtitlesFormat= diff --git a/external/__init__.py b/app/external/__init__.py similarity index 100% rename from external/__init__.py rename to app/external/__init__.py diff --git a/external/pytaw/.gitignore b/app/external/pytaw/.gitignore similarity index 100% rename from external/pytaw/.gitignore rename to app/external/pytaw/.gitignore diff --git a/external/pytaw/.pytaw.conf b/app/external/pytaw/.pytaw.conf similarity index 100% rename from external/pytaw/.pytaw.conf rename to app/external/pytaw/.pytaw.conf diff --git a/external/pytaw/README.md b/app/external/pytaw/README.md similarity index 100% rename from external/pytaw/README.md rename to app/external/pytaw/README.md diff --git a/external/pytaw/__init__.py b/app/external/pytaw/__init__.py similarity index 100% rename from external/pytaw/__init__.py rename to app/external/pytaw/__init__.py diff --git a/external/pytaw/docs/Makefile b/app/external/pytaw/docs/Makefile similarity index 100% rename from external/pytaw/docs/Makefile rename to app/external/pytaw/docs/Makefile diff --git a/external/pytaw/docs/conf.py b/app/external/pytaw/docs/conf.py similarity index 100% rename from external/pytaw/docs/conf.py rename to app/external/pytaw/docs/conf.py diff --git a/external/pytaw/docs/index.rst b/app/external/pytaw/docs/index.rst similarity index 100% rename from external/pytaw/docs/index.rst rename to app/external/pytaw/docs/index.rst diff --git a/external/pytaw/docs/make.bat b/app/external/pytaw/docs/make.bat similarity index 100% rename from external/pytaw/docs/make.bat rename to app/external/pytaw/docs/make.bat diff --git a/external/pytaw/main_test.py b/app/external/pytaw/main_test.py similarity index 100% rename from external/pytaw/main_test.py rename to app/external/pytaw/main_test.py diff --git a/external/pytaw/pytaw/__init__.py b/app/external/pytaw/pytaw/__init__.py similarity index 100% rename from external/pytaw/pytaw/__init__.py rename to app/external/pytaw/pytaw/__init__.py diff --git a/external/pytaw/pytaw/utils.py b/app/external/pytaw/pytaw/utils.py similarity index 100% rename from external/pytaw/pytaw/utils.py rename to app/external/pytaw/pytaw/utils.py diff --git a/external/pytaw/pytaw/youtube.py b/app/external/pytaw/pytaw/youtube.py similarity index 100% rename from external/pytaw/pytaw/youtube.py rename to app/external/pytaw/pytaw/youtube.py diff --git a/external/pytaw/setup.py b/app/external/pytaw/setup.py similarity index 100% rename from external/pytaw/setup.py rename to app/external/pytaw/setup.py diff --git a/external/pytaw/tests/__init__.py b/app/external/pytaw/tests/__init__.py similarity index 100% rename from external/pytaw/tests/__init__.py rename to app/external/pytaw/tests/__init__.py diff --git a/external/pytaw/tests/test_pytaw.py b/app/external/pytaw/tests/test_pytaw.py similarity index 100% rename from external/pytaw/tests/test_pytaw.py rename to app/external/pytaw/tests/test_pytaw.py diff --git a/app/init.sh b/app/init.sh new file mode 100755 index 0000000..374b374 --- /dev/null +++ b/app/init.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +#./manage.py runserver 0.0.0.0:8000 --noreload +gunicorn -b 0.0.0.0:8000 -w 4 YtManager.wsgi diff --git a/manage.py b/app/manage.py similarity index 100% rename from manage.py rename to app/manage.py diff --git a/app/requirements.txt b/app/requirements.txt new file mode 100644 index 0000000..df7ef7c --- /dev/null +++ b/app/requirements.txt @@ -0,0 +1,10 @@ +apscheduler +gunicorn +django +django-crispy-forms +youtube-dl +google-api-python-client +google_auth_oauthlib +oauth2client +psycopg2-binary +python-dateutil diff --git a/config/config.ini b/config/config.ini index 39e85ab..c3d0f48 100644 --- a/config/config.ini +++ b/config/config.ini @@ -2,16 +2,16 @@ ; The global section contains settings that apply to the entire server [global] ; YouTube API key - get this from your user account -;YoutubeApiKey=AIzaSyBabzE4Bup77WexdLMa9rN9z-wJidEfNX8 +YoutubeApiKey=AIzaSyAonB6T-DrKjfGxBGuHyFMg0x_d0T9nlP8 ; Specifies the synchronization schedule, in crontab format. ; Format: -;SynchronizationSchedule=0 * * * * +SynchronizationSchedule=5 * * * * ; Number of threads running the scheduler ; Since most of the jobs scheduled are downloads, there is no advantage to having ; a higher concurrency -;SchedulerConcurrency=2 +SchedulerConcurrency=1 ; Log level LogLevel=DEBUG @@ -19,29 +19,29 @@ LogLevel=DEBUG ; Default user settings [user] ; When a video is deleted on the system, it will be marked as 'watched' -;MarkDeletedAsWatched=True +MarkDeletedAsWatched=True ; Videos marked as watched are automatically deleted -;DeleteWatched=True +DeleteWatched=True ; Enable automatic downloading -;AutoDownload=True +AutoDownload=True ; Limit the total number of videos downloaded (-1 or empty = no limit) -;DownloadGlobalLimit= +DownloadGlobalLimit=10 ; Limit the numbers of videos per subscription (-1 or empty = no limit) -;DownloadSubscriptionLimit=5 +DownloadSubscriptionLimit=5 ; Number of download attempts -;DownloadMaxAttempts=3 +DownloadMaxAttempts=3 ; Download order ; Options: newest, oldest, playlist, playlist_reverse, popularity, rating -;DownloadOrder=playlist +DownloadOrder=playlist ; Path where downloaded videos are stored -DownloadPath=temp/download +DownloadPath=data/media/videos ; A pattern which describes how downloaded files are organized. Extensions are automatically appended. ; Supported fields: channel, channel_id, playlist, playlist_id, playlist_index, title, id @@ -49,7 +49,7 @@ DownloadPath=temp/download ;DownloadFilePattern=${channel}/${playlist}/S01E${playlist_index} - ${title} [${id}] ; Download format that will be passed to youtube-dl. See the youtube-dl documentation for more details. -DownloadFormat=worstvideo+bestaudio +DownloadFormat=bestvideo+bestaudio ; Subtitles - these options match the youtube-dl options ;DownloadSubtitles=True diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..751e3ad --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,33 @@ +version: '3.1' + +services: + nginx: + image: nginx:latest + volumes: + - ./nginx:/etc/nginx/conf.d/ + - ./app/YtManagerApp/static:/www/static + ports: + - "80:80" + depends_on: + - web + + db: + image: postgres + restart: always + volumes: + - /var/lib/postgresql/data + environment: + POSTGRES_PASSWORD: postgres + POSTGRES_DB: ytmanager + + web: + build: . + tty: true + command: ./init.sh + ports: + - "8000:8000" + volumes: + - ./media:/usr/src/app/data/media + depends_on: + - db + diff --git a/nginx/nginx.conf b/nginx/nginx.conf new file mode 100644 index 0000000..1b60a84 --- /dev/null +++ b/nginx/nginx.conf @@ -0,0 +1,31 @@ +# nginx.conf +upstream djangoA { + server web:8000 max_fails=3 fail_timeout=0; +} +server { + include mime.types; + # The port your site will be served on + listen 80; + # the domain name it will serve for + server_name 0.0.0.0;# substitute your machine's IP address or FQDN + charset utf-8; + #Max upload size + client_max_body_size 512M; # adjust to taste + location /static { + alias /www/static; + expires 30d; + } + + location / { + try_files $uri @proxy_to_app; + } + + # Finally, send all non-media requests to the Django server. + location @proxy_to_app { + proxy_set_header X-Real-IP $remote_addr; + proxy_redirect off; + proxy_set_header Host $host; + proxy_pass http://djangoA; + } +} + From 9b88a75ed489991a5ab1e2552d62bd5784a28ad0 Mon Sep 17 00:00:00 2001 From: Jett Jackson Date: Tue, 30 Oct 2018 14:18:11 +0800 Subject: [PATCH 2/3] redact --- app/config/config.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/config/config.ini b/app/config/config.ini index c3d0f48..f3c10a6 100644 --- a/app/config/config.ini +++ b/app/config/config.ini @@ -2,7 +2,7 @@ ; The global section contains settings that apply to the entire server [global] ; YouTube API key - get this from your user account -YoutubeApiKey=AIzaSyAonB6T-DrKjfGxBGuHyFMg0x_d0T9nlP8 +;YoutubeApiKey= ; Specifies the synchronization schedule, in crontab format. ; Format: From 7364ca8fc76c6e26fe57503d1e9733a4e4450355 Mon Sep 17 00:00:00 2001 From: Jett Jackson Date: Tue, 30 Oct 2018 14:19:14 +0800 Subject: [PATCH 3/3] Fix missing migrate --- app/init.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/app/init.sh b/app/init.sh index 374b374..e0ede49 100755 --- a/app/init.sh +++ b/app/init.sh @@ -1,4 +1,5 @@ #!/bin/bash #./manage.py runserver 0.0.0.0:8000 --noreload +./manage.py migrate gunicorn -b 0.0.0.0:8000 -w 4 YtManager.wsgi