From 4b9c13e1fd6158359b8812e4ac28c48f104f0e99 Mon Sep 17 00:00:00 2001 From: Ryjek Date: Thu, 2 Jul 2026 11:48:00 +0200 Subject: [PATCH] hermes testgs --- docker-compose.test.yml | 27 +++++++++++++++++++++++++++ php-test/Dockerfile | 6 ++++++ public/index.html | 35 ++++++++++++++++++++--------------- src/storage.js | 13 +++++++++---- 4 files changed, 62 insertions(+), 19 deletions(-) create mode 100644 docker-compose.test.yml create mode 100644 php-test/Dockerfile diff --git a/docker-compose.test.yml b/docker-compose.test.yml new file mode 100644 index 0000000..0e1ef53 --- /dev/null +++ b/docker-compose.test.yml @@ -0,0 +1,27 @@ +services: + push: + build: + context: . + dockerfile: ./Dockerfile + restart: unless-stopped + environment: + PORT: 8080 + DEV: "1" + ports: + - "8201:8080" + volumes: + - ./src:/srv/app + - ./storage:/storage + - ./database:/database + + php: + build: + context: . + dockerfile: ./php-test/Dockerfile + restart: unless-stopped + depends_on: + - push + ports: + - "8123:80" + volumes: + - ./public/:/var/www/html diff --git a/php-test/Dockerfile b/php-test/Dockerfile new file mode 100644 index 0000000..fc117d4 --- /dev/null +++ b/php-test/Dockerfile @@ -0,0 +1,6 @@ +FROM php:8.2-apache + +RUN apt-get update \ + && apt-get install -y --no-install-recommends libcurl4-openssl-dev \ + && docker-php-ext-install curl \ + && rm -rf /var/lib/apt/lists/* diff --git a/public/index.html b/public/index.html index 3ca54dd..a77edc5 100644 --- a/public/index.html +++ b/public/index.html @@ -1,20 +1,25 @@ - -
diff --git a/src/storage.js b/src/storage.js
index 1702166..751ea79 100644
--- a/src/storage.js
+++ b/src/storage.js
@@ -74,10 +74,15 @@ class Storage {
 		});
 	}
 	async readQueueAll() {
-		const all = await fsp.readFile(this.fileName,"utf-8");
-		return all.split("\n")
-			.filter(line => line.trim())
-			.map(line => JSON.parse(line));
+		let ret = [];
+		try {
+			const all = await fsp.readFile(this.fileName,"utf-8");
+			ret = all.split("\n")
+				.filter(line => line.trim())
+				.map(line => JSON.parse(line));
+		} catch (err) {}
+
+		return ret;
 	}
 
 	async readConfig() {