From f084d89eabb14bcafe3aab2802fc83ae9b0d3eb7 Mon Sep 17 00:00:00 2001 From: huty Date: Thu, 10 Oct 2024 17:18:00 +0000 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=83=A8=E5=88=86=E9=95=9C?= =?UTF-8?q?=E5=83=8F=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/caddy/compose.yaml | 2 +- examples/drawio/compose.yaml | 4 +- examples/filebrowser/compose.yaml | 2 +- examples/mariadb/10/compose/compose.yaml | 2 +- examples/mariadb/10/stack/compose.yaml | 2 +- examples/mysql/8/compose/compose.yaml | 2 +- examples/mysql/8/stack/compose.yaml | 2 +- examples/portainer/compose.yaml | 2 +- examples/wikijs/compose.yaml | 2 +- examples/xbrowsersync/compose.yaml | 53 +++++++++++++++++++++++ examples/xbrowsersync/conf/healthcheck.js | 44 +++++++++++++++++++ examples/xbrowsersync/conf/mongoconfig.js | 3 ++ examples/xbrowsersync/conf/settings.json | 16 +++++++ 13 files changed, 126 insertions(+), 10 deletions(-) create mode 100644 examples/xbrowsersync/compose.yaml create mode 100644 examples/xbrowsersync/conf/healthcheck.js create mode 100644 examples/xbrowsersync/conf/mongoconfig.js create mode 100644 examples/xbrowsersync/conf/settings.json diff --git a/examples/caddy/compose.yaml b/examples/caddy/compose.yaml index 0bcdc8f..c174e87 100644 --- a/examples/caddy/compose.yaml +++ b/examples/caddy/compose.yaml @@ -2,7 +2,7 @@ version: "3.9" services: caddy: - image: caddy:2.7.6-alpine + image: caddy:2.8.4-alpine container_name: caddy hostname: caddy restart: always diff --git a/examples/drawio/compose.yaml b/examples/drawio/compose.yaml index 7544464..8ec5b18 100644 --- a/examples/drawio/compose.yaml +++ b/examples/drawio/compose.yaml @@ -2,7 +2,7 @@ version: "3.9" services: drawio: - image: jgraph/drawio:24.3.1 + image: jgraph/drawio:24.7.17 container_name: drawio hostname: drawio restart: always @@ -27,7 +27,7 @@ services: environment: - DRAWIO_SERVER_URL="drawio:8080" plantuml-server: - image: plantuml/plantuml-server:v1.2024.4 + image: plantuml/plantuml-server:v1.2024.7 container_name: plantuml-server restart: always networks: diff --git a/examples/filebrowser/compose.yaml b/examples/filebrowser/compose.yaml index 1a71b1c..3df385c 100644 --- a/examples/filebrowser/compose.yaml +++ b/examples/filebrowser/compose.yaml @@ -2,7 +2,7 @@ version: "3.9" services: filebrowser: - image: filebrowser/filebrowser:v2.29.0 + image: filebrowser/filebrowser:v2.31.2 container_name: filebrowser hostname: filebrowser restart: always diff --git a/examples/mariadb/10/compose/compose.yaml b/examples/mariadb/10/compose/compose.yaml index 50c584b..55394c2 100644 --- a/examples/mariadb/10/compose/compose.yaml +++ b/examples/mariadb/10/compose/compose.yaml @@ -2,7 +2,7 @@ version: "3.9" services: mariadb: - image: mariadb:10.11.7 + image: mariadb:11.5.2 container_name: mariadb hostname: mariadb restart: always diff --git a/examples/mariadb/10/stack/compose.yaml b/examples/mariadb/10/stack/compose.yaml index cc5755e..ad1debd 100644 --- a/examples/mariadb/10/stack/compose.yaml +++ b/examples/mariadb/10/stack/compose.yaml @@ -2,7 +2,7 @@ version: "3.9" services: mariadb: - image: mariadb:10.11.7 + image: mariadb:11.5.2 container_name: mariadb hostname: mariadb restart: always diff --git a/examples/mysql/8/compose/compose.yaml b/examples/mysql/8/compose/compose.yaml index a477c87..7b14bca 100644 --- a/examples/mysql/8/compose/compose.yaml +++ b/examples/mysql/8/compose/compose.yaml @@ -2,7 +2,7 @@ version: "3.9" services: mysql: - image: mysql:8.0.37 + image: mysql:8.0.39 container_name: mysql hostname: mysql restart: always diff --git a/examples/mysql/8/stack/compose.yaml b/examples/mysql/8/stack/compose.yaml index 2447dd2..6b6add8 100644 --- a/examples/mysql/8/stack/compose.yaml +++ b/examples/mysql/8/stack/compose.yaml @@ -2,7 +2,7 @@ version: "3.9" services: mysql: - image: mysql:8.0.37 + image: mysql:8.0.39 container_name: mysql hostname: mysql restart: always diff --git a/examples/portainer/compose.yaml b/examples/portainer/compose.yaml index bf09497..6eae99f 100644 --- a/examples/portainer/compose.yaml +++ b/examples/portainer/compose.yaml @@ -2,7 +2,7 @@ version: "3.9" services: portainer: - image: portainer/portainer-ce:2.20.2-alpine + image: portainer/portainer-ce:2.22.0-alpine container_name: portainer hostname: portainer restart: always diff --git a/examples/wikijs/compose.yaml b/examples/wikijs/compose.yaml index ac6f2a7..08667ce 100644 --- a/examples/wikijs/compose.yaml +++ b/examples/wikijs/compose.yaml @@ -2,7 +2,7 @@ version: "3.9" services: wikijs: - image: requarks/wiki:2.5.302 + image: requarks/wiki:2.5.304 container_name: wikijs hostname: wikijs restart: always diff --git a/examples/xbrowsersync/compose.yaml b/examples/xbrowsersync/compose.yaml new file mode 100644 index 0000000..ee28a81 --- /dev/null +++ b/examples/xbrowsersync/compose.yaml @@ -0,0 +1,53 @@ +version: "3.9" + +services: + xbrowsersync-db: + #image: mongo:4.4.29 + image: mongo:7.0.11 + container_name: xbrowsersync-db + restart: always + networks: + - app_network + - site_network + volumes: + - /usr/share/zoneinfo/Asia/Shanghai:/etc/localtime:ro + - ./db:/data/db + - ./backup:/data/backups + - ./conf/mongoconfig.js:/docker-entrypoint-initdb.d/mongoconfig.js + environment: + - "MONGO_INITDB_DATABASE=xbrowsersync" + - "MONGO_INITDB_ROOT_USERNAME=xbrowsersync" + - "MONGO_INITDB_ROOT_PASSWORD=12345678" + - "XBS_DB_NAME=xbrowsersync" + - "XBS_DB_USERNAME=xbrowsersync" + - "XBS_DB_PASSWORD=123456" + xbrowsersync: + image: xbrowsersync/api:1.1.13-node20.14.0-alpine + container_name: xbrowsersync + restart: always + networks: + - app_network + - site_network + volumes: + - /usr/share/zoneinfo/Asia/Shanghai:/etc/localtime:ro + #- ./conf/settings.json:/opt/xbs/1.1.13/conf/settings.json + #- ./logs:/var/log/xBrowserSync + - ./conf/settings.json:/usr/src/api/config/settings.json + - ./conf/healthcheck.js:/usr/src/api/healthcheck.js + - ./logs:/var/log/xBrowserSync + depends_on: + - "xbrowsersync-db" + healthcheck: + test: [ "CMD", "node", "/usr/src/api/healthcheck.js" ] + interval: "1m" + timeout: "10s" + retries: "5" + start_period: "30s" + +networks: + app_network: + external: true + name: app_network + site_network: + external: true + name: site_network diff --git a/examples/xbrowsersync/conf/healthcheck.js b/examples/xbrowsersync/conf/healthcheck.js new file mode 100644 index 0000000..f8fafb9 --- /dev/null +++ b/examples/xbrowsersync/conf/healthcheck.js @@ -0,0 +1,44 @@ +const http = require('http'); + +const response = http.request( + { + host: '0.0.0.0', + method: 'GET', + path: '/info', + port: 8080, + timeout: 2000, + }, + (res) => { + let body = ''; + res.setEncoding('utf8'); + + res.on('data', (chunk) => { + body += chunk; + }); + + res.on('end', () => { + if (res.statusCode === 200) { + const payload = JSON.parse(body); + switch (payload.status) { + case 1: + case 3: + console.log('HEALTHCHECK: online'); + process.exit(0); + case 2: + default: + console.log('HEALTHCHECK: offline'); + } + } else { + console.log('HEALTHCHECK: offline'); + } + process.exit(1); + }); + } +); + +response.on('error', function (err) { + console.log('HEALTHCHECK: offline'); + process.exit(1); +}); + +response.end(); diff --git a/examples/xbrowsersync/conf/mongoconfig.js b/examples/xbrowsersync/conf/mongoconfig.js new file mode 100644 index 0000000..c6b8cf3 --- /dev/null +++ b/examples/xbrowsersync/conf/mongoconfig.js @@ -0,0 +1,3 @@ +db.newsynclogs.createIndex( { "expiresAt": 1 }, { expireAfterSeconds: 0 } ); +db.newsynclogs.createIndex( { "ipAddress": 1 } ); +db.bookmarks.createIndex( { "lastAccessed": 1 }, { expireAfterSeconds: 21*86400 } ); \ No newline at end of file diff --git a/examples/xbrowsersync/conf/settings.json b/examples/xbrowsersync/conf/settings.json new file mode 100644 index 0000000..dad1d30 --- /dev/null +++ b/examples/xbrowsersync/conf/settings.json @@ -0,0 +1,16 @@ +{ + "location": "JP", + "maxSyncs": "10000", + "maxSyncSize": "10485760", + "db": { + "host": "xbrowsersync-db", + "name": "xbrowsersync", + "username": "xbrowsersync", + "password": "aP7xvybVU6ZdVKWkTp7NjbcYuFdH5YR6Gi3aFrvdT4kbJ3aKwFqB4GnxYyao5DgR" + }, + "status": { + "allowNewSyncs": "true", + "online": "true", + "message": "Welcome to the HTY1024 xBrowserSync service! We run the latest version of the xBrowserSync API and take database backups daily." + } +}