diff --git a/.gitignore b/.gitignore index 02eeead..070756a 100644 --- a/.gitignore +++ b/.gitignore @@ -163,7 +163,6 @@ cython_debug/ # television data/ logs/ -docker-compose.yml -certbot.env +variables.env haproxy.cfg *.json diff --git a/certbot.env.dist b/certbot.env.dist deleted file mode 100644 index 11e6b2b..0000000 --- a/certbot.env.dist +++ /dev/null @@ -1,2 +0,0 @@ -BASE_URL=example.com -EMAIL=info@example.com diff --git a/docker-compose.yml.dist b/docker-compose.yml similarity index 88% rename from docker-compose.yml.dist rename to docker-compose.yml index c73ae3b..210a35c 100644 --- a/docker-compose.yml.dist +++ b/docker-compose.yml @@ -41,10 +41,8 @@ services: restreamer: image: datarhei/restreamer:2.7.0 - environment: - - CORE_LOG_LEVEL=warn - - CORE_API_AUTH_USERNAME=admin - - CORE_API_AUTH_PASSWORD=pass + env_file: + - "variables.env" ports: - "6000:6000/udp" volumes: @@ -61,11 +59,8 @@ services: - "restreamer" build: ./src/scheduler image: stream-scheduler:latest - environment: - - LOG_LEVEL=info - - CORE_API_HOSTNAME=stream.example.com - - CORE_API_USERNAME=admin - - CORE_API_PASSWORD=pass + env_file: + - "variables.env" restart: unless-stopped networks: - net diff --git a/renew-certificates.sh b/renew-certificates.sh index e0fcda3..0ea05c5 100755 --- a/renew-certificates.sh +++ b/renew-certificates.sh @@ -1,6 +1,6 @@ #!/bin/bash -source certbot.env +source variables.env CB=`docker ps | grep certbot | cut -d ' ' -f 1` diff --git a/src/scheduler/app.py b/src/scheduler/app.py index d15e9aa..5fa7fc1 100644 --- a/src/scheduler/app.py +++ b/src/scheduler/app.py @@ -15,8 +15,8 @@ database = {} # Environment api_hostname = os.environ.get('CORE_API_HOSTNAME') api_port = os.environ.get('CORE_API_PORT') -api_username = os.environ.get('CORE_API_USERNAME') -api_password=os.environ.get('CORE_API_PASSWORD') +api_username = os.environ.get('CORE_API_AUTH_USERNAME') +api_password=os.environ.get('CORE_API_AUTH_PASSWORD') iway = { "head": "https://stream.deflax.net/memfs/ac2172fa-d8d5-4487-8bc6-5347dcf7c0dc.m3u8" @@ -110,7 +110,7 @@ manager.register_task(name="read_database", job=analyze_db).period(35).start() @app.route('/', methods=['GET']) def root_query(): - playhead = obs + playhead = iway return jsonify(playhead) def create_app(): diff --git a/variables.env.dist b/variables.env.dist new file mode 100644 index 0000000..5301b5f --- /dev/null +++ b/variables.env.dist @@ -0,0 +1,7 @@ +BASE_URL=example.com +EMAIL=info@example.com +CORE_LOG_LEVEL=warn +CORE_API_HOSTNAME=stream.example.com +CORE_API_AUTH_USERNAME=admin +CORE_API_AUTH_PASSWORD=changeme +SCHEDULER_LOG_LEVEL=info