From e3cfeb1d7ead8e40fb7238a9fd7638e242cb6390 Mon Sep 17 00:00:00 2001 From: Nico Miguelino Date: Thu, 10 Oct 2024 11:09:14 -0700 Subject: [PATCH] Clean up unused/untraversed steps during server startup (#2088) --- bin/start_server.sh | 11 ----------- server.py | 9 +-------- 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/bin/start_server.sh b/bin/start_server.sh index 158820138..bd268b495 100755 --- a/bin/start_server.sh +++ b/bin/start_server.sh @@ -11,17 +11,6 @@ cp -n /usr/src/app/ansible/roles/screenly/files/screenly.conf /data/.screenly/sc cp -n /usr/src/app/ansible/roles/screenly/files/default_assets.yml /data/.screenly/default_assets.yml cp -n /usr/src/app/ansible/roles/screenly/files/screenly.db /data/.screenly/screenly.db -if [ -n "${OVERWRITE_CONFIG}" ]; then - echo "Requested to overwrite Anthias config file." - cp /usr/src/app/ansible/roles/screenly/files/screenly.conf "/data/.screenly/screenly.conf" -fi - -# Set management page's user and password from environment variables, -# but only if both of them are provided. Can have empty values provided. -if [ -n "${MANAGEMENT_USER+x}" ] && [ -n "${MANAGEMENT_PASSWORD+x}" ]; then - sed -i -e "s/^user=.*/user=${MANAGEMENT_USER}/" -e "s/^password=.*/password=${MANAGEMENT_PASSWORD}/" /data/.screenly/screenly.conf -fi - echo "Running migration..." python ./bin/migrate.py diff --git a/server.py b/server.py index 5c870f7ba..f16459d8a 100755 --- a/server.py +++ b/server.py @@ -7,7 +7,7 @@ __copyright__ = "Copyright 2012-2023, Screenly, Inc" __license__ = "Dual License: GPLv2 and Commercial License" -from os import getenv, makedirs, mkdir, path, stat +from os import getenv, path, stat from flask import ( Flask, @@ -165,13 +165,6 @@ def static_with_mime(path): @app.before_first_request def main(): - # Make sure the asset folder exist. If not, create it - if not path.isdir(settings['assetdir']): - mkdir(settings['assetdir']) - # Create config dir if it doesn't exist - if not path.isdir(settings.get_configdir()): - makedirs(settings.get_configdir()) - with db.conn(settings['database']) as conn: with db.cursor(conn) as cursor: cursor.execute(queries.exists_table)