Add settings example

This commit is contained in:
2026-02-07 11:52:26 -07:00
parent b534efd93b
commit 55cc7d3310
2 changed files with 14 additions and 4 deletions

View File

@@ -15,7 +15,6 @@ import hashlib
import settings
NAVIDROME_CONTAINER = getattr(settings, 'NAVIDROME_CONTAINER', 'navidrome-navidrome-1')
STAR_UNSTAR_WINDOW = timedelta(seconds=4)
# A dictionary to store the timestamp of when a song was starred.
@@ -101,9 +100,9 @@ async def main():
docker = None
try:
docker = aiodocker.Docker()
container = await docker.containers.get(NAVIDROME_CONTAINER)
container = await docker.containers.get(settings.NAVIDROME_CONTAINER)
logging.info(f"Monitoring logs for container '{NAVIDROME_CONTAINER}'...")
logging.info(f"Monitoring logs for container '{settings.NAVIDROME_CONTAINER}'...")
logs = container.log(
stdout=True,
stderr=True,
@@ -132,7 +131,7 @@ async def main():
except aiodocker.exceptions.DockerError as e:
if e.status == 404:
logging.error(f"Container '{NAVIDROME_CONTAINER}' not found.")
logging.error(f"Container '{settings.NAVIDROME_CONTAINER}' not found.")
else:
logging.error(f"Error connecting to Docker or getting container: {e}")
except Exception as e:

11
settings.py.example Normal file
View File

@@ -0,0 +1,11 @@
NAVIDROME_CONTAINER = 'navidrome-navidrome-1'
NAVIDROME_URL = 'https://navidrome.example.com'
NAVIDROME_USER = ''
# Set this one:
NAVIDROME_PASSWORD = ''
# or these two:
SUBSONIC_SALT = ''
SUBSONIC_TOKEN = ''