send_from_directory, flash, get_flashed_messages
from werkzeug.utils import secure_filename
-DATA_DIR = Path(".")
+DATA_DIR = Path(os.environ["DATA_DIR"]) if "DATA_DIR" in os.environ else Path(".")
################################################################################
# Logging
################################################################################
app = Flask(__name__)
-app.secret_key = "dev"
+app.secret_key = os.environ["SECRET_KEY"] if "SECRET_KEY" in os.environ else "dev"
app.config["MAX_CONTENT_LENGTH"] = 50 * 1024 * 1024
app.logger.addHandler(handler)
--- /dev/null
+[Unit]
+Description=Little Song Place Production Server
+After=multi-user.target
+
+[Service]
+WorkingDirectory=/var/www/littlesongplace
+ExecStart=/var/www/littlesongplace/service/run.sh 8080 /var/www/littlesongplace-data
+Restart=always
+
+[Install]
+WantedBy=multi-user.target
+
--- /dev/null
+[Unit]
+Description=Little Song Place Test Server
+After=multi-user.target
+
+[Service]
+WorkingDirectory=/var/www/littlesongplace-test
+ExecStart=/var/www/littlesongplace-test/service/run.sh 8081 /var/www/littlesongplace-test-data
+Restart=always
+
+[Install]
+WantedBy=multi-user.target
+