From cc56dec27008939806d5ba3dd443f20a8af75525 Mon Sep 17 00:00:00 2001 From: randogoth Date: Sat, 27 Sep 2025 13:55:46 +0300 Subject: [PATCH] fix --- userdb/Dockerfile | 4 ---- userdb/db.py | 6 +++--- userdb/docker-compose.yml | 5 ++--- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/userdb/Dockerfile b/userdb/Dockerfile index 9d996bf..01f35d8 100644 --- a/userdb/Dockerfile +++ b/userdb/Dockerfile @@ -29,10 +29,6 @@ RUN adduser --disabled-password --gecos "" appuser \ USER appuser -# Default cache dir (override with TEXTS_CACHE_DIR env if you want) -ENV DB_DIR=/usr/src/app/db -RUN mkdir -p "$DB_DIR" - # Expose the service port EXPOSE 5000 diff --git a/userdb/db.py b/userdb/db.py index d88553c..da3582a 100644 --- a/userdb/db.py +++ b/userdb/db.py @@ -24,8 +24,8 @@ def track(): ua = str(request.args.get('ua')) url = str(request.values.get("url") or request.headers.get("Referer")) - if os.path.exists('db/db.json'): - with open('db/db.json', 'r') as db: + if os.path.exists('db.json'): + with open('db.json', 'r') as db: db = json.loads(db.read()) else: db = {} @@ -45,7 +45,7 @@ def track(): send_msg(f'User <{hash}> visited { url } on { ua } ({ str(len(db[hash][cat])) })') - with open('db/db.json', 'w+') as dbw: + with open('db.json', 'w+') as dbw: dbw.write(json.dumps(db, indent=4)) return str(len(db[hash][cat])) diff --git a/userdb/docker-compose.yml b/userdb/docker-compose.yml index ff2c609..89c11f2 100644 --- a/userdb/docker-compose.yml +++ b/userdb/docker-compose.yml @@ -1,11 +1,10 @@ services: - wordonaut: + tagbot: build: . - container_name: tagbot ports: - "8001:5000" environment: - - FLASK_APP=wordonaut.py + - FLASK_APP=db.py - FLASK_RUN_HOST=0.0.0.0 volumes: - .:/usr/src/app \ No newline at end of file