From 4550cb2af55878bbf58bd32704780b096c70db16 Mon Sep 17 00:00:00 2001 From: zaphkito Date: Tue, 9 Jan 2024 15:31:03 +0000 Subject: [PATCH 1/2] delete "ADD config config" (#83) this is because everywhere about docker build write to create and use configs/config folder, not config, if we follow docker installation guide, there will not exist config folder in artemis root. Even if the folder exists, the folder will not be mapped inside the container, then we will get a build error about config not exist in docker-compose.yml ``` app: hostname: ma.app build: . volumes: - ./aime:/app/aime - ./configs/config:/app/config ``` in INSTALL_DOCKER.md - Create 'aime', 'configs', 'AimeDB', and 'logs' folder in ARTEMiS root folder (where all source files exist) - Inside configs folder, create 'config' folder, and copy all .yaml files from example_config to config (thats all files without nginx_example.conf) - Edit .yaml files inside configs/config to suit your server needs - Edit core.yaml inside configs/config I checked this file history in https://gitea.tendokyu.moe/Hay1tsme/artemis/commit/d1259509ad2bad2b43d2cf5164841775b10502f2, phantomlan already delete this, but don't know why it come back between https://gitea.tendokyu.moe/Hay1tsme/artemis/commit/040742a9a4e00efa162f55450a370a79ece91d53 and https://gitea.tendokyu.moe/Hay1tsme/artemis/commit/565dc38e9a4becf3ea4ddeeaf268d1648cb7eb6c, maybe git bug? However, now delete it again Reviewed-on: https://gitea.tendokyu.moe/Hay1tsme/artemis/pulls/83 Co-authored-by: zaphkito Co-committed-by: zaphkito --- Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index f946002..81252b1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,7 +15,6 @@ COPY dbutils.py dbutils.py COPY read.py read.py ADD core core ADD titles titles -ADD config config ADD logs logs ADD cert cert From 0c3924a8f0e54883848a99b0631095a4ce3ed4d4 Mon Sep 17 00:00:00 2001 From: Hay1tsme Date: Tue, 9 Jan 2024 10:33:48 -0500 Subject: [PATCH 2/2] aimedb: fix lookup with banned or locked access code --- changelog.md | 7 +++++++ core/aimedb.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 3fc6125..8f088ff 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,13 @@ # Changelog Documenting updates to ARTEMiS, to be updated every time the master branch is pushed to. +## 20240109 +### System ++ Removed `ADD config config` from dockerfile + +### Aimedb ++ Fixed an error that resulted from trying to scan a banned or locked card + ## 20240108 ### System + Change how the underlying system handles URLs diff --git a/core/aimedb.py b/core/aimedb.py index e65c2c7..6d6615a 100644 --- a/core/aimedb.py +++ b/core/aimedb.py @@ -149,13 +149,13 @@ class AimedbProtocol(Protocol): is_banned = self.data.card.get_card_banned(req.access_code) is_locked = self.data.card.get_card_locked(req.access_code) + ret = ADBLookupResponse.from_req(req.head, user_id) if is_banned and is_locked: ret.head.status = ADBStatus.BAN_SYS_USER elif is_banned: ret.head.status = ADBStatus.BAN_SYS elif is_locked: ret.head.status = ADBStatus.LOCK_USER - ret = ADBLookupResponse.from_req(req.head, user_id) self.logger.info( f"access_code {req.access_code} -> user_id {ret.user_id}"