diff options
author | unref (Nikolai G) <unref@inbox.ru> | 2022-08-25 18:01:06 +0300 |
---|---|---|
committer | unref (Nikolai G) <unref@inbox.ru> | 2022-08-25 18:20:50 +0300 |
commit | 818b2154757ab810e9678cd0c76519500e1fb951 (patch) | |
tree | 5dfc57786ad14eb7c94000717a4320b82a99f5c4 /app | |
parent | upgraded yt-dlp (diff) | |
download | metube-818b2154757ab810e9678cd0c76519500e1fb951.tar.gz metube-818b2154757ab810e9678cd0c76519500e1fb951.tar.bz2 metube-818b2154757ab810e9678cd0c76519500e1fb951.zip |
add couple env variables
Diffstat (limited to 'app')
-rw-r--r-- | app/main.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/app/main.py b/app/main.py index 9fbdf19..4602ef9 100644 --- a/app/main.py +++ b/app/main.py @@ -21,6 +21,9 @@ class Config: 'OUTPUT_TEMPLATE': '%(title)s.%(ext)s',
'OUTPUT_TEMPLATE_CHAPTER': '%(title)s - %(section_number)s %(section_title)s.%(ext)s',
'YTDL_OPTIONS': '{}',
+ 'HOST': '0.0.0.0',
+ 'PORT': '8081',
+ 'BASE_DIR': ''
}
def __init__(self):
@@ -99,7 +102,7 @@ async def connect(sid, environ): @routes.get(config.URL_PREFIX)
def index(request):
- return web.FileResponse('ui/dist/metube/index.html')
+ return web.FileResponse(os.path.join(config.BASE_DIR, 'ui/dist/metube/index.html'))
if config.URL_PREFIX != '/':
@routes.get('/')
@@ -110,9 +113,9 @@ if config.URL_PREFIX != '/': def index_redirect_dir(request):
return web.HTTPFound(config.URL_PREFIX)
-routes.static(config.URL_PREFIX + 'favicon/', 'favicon')
+routes.static(config.URL_PREFIX + 'favicon/', os.path.join(config.BASE_DIR, 'favicon'))
routes.static(config.URL_PREFIX + 'download/', config.DOWNLOAD_DIR)
-routes.static(config.URL_PREFIX, 'ui/dist/metube')
+routes.static(config.URL_PREFIX, os.path.join(config.BASE_DIR, 'ui/dist/metube'))
app.add_routes(routes)
@@ -134,4 +137,4 @@ app.on_response_prepare.append(on_prepare) if __name__ == '__main__':
logging.basicConfig(level=logging.DEBUG)
- web.run_app(app, port=8081)
+ web.run_app(app, host=config.HOST, port=config.PORT, reuse_port=True)
|