From 17105cf6ee98f4748394fdcc34f2e4c71713ce63 Mon Sep 17 00:00:00 2001 From: Last2014 Date: Wed, 17 Dec 2025 18:03:58 +0900 Subject: [PATCH 01/17] Feat: default env / Fix: unable to start / Enhance: Improved line break code conversion / Del: entrypoint / Fix: config.json value types --- .env.example | 4 ++-- Dockerfile | 28 +++++++++++++++++++++------- README.md | 2 +- 3 files changed, 24 insertions(+), 10 deletions(-) diff --git a/.env.example b/.env.example index 8171cde..ebfae2b 100644 --- a/.env.example +++ b/.env.example @@ -1,10 +1,10 @@ # Warn: 全ての値は必須です。指定しないで動くかは知りません。 -# uwuzuサーバーへの接続 +# uwuzuサーバーへの接続(必須) UWUZU_HOST=uwuzu.example.com # uwuzuサーバーのホスト名+":"+ポート(:ポートは任意)です。originではないのでHTTPSが必須になっています。stringです。 UWUZU_TOKEN=APITOKEN # uwuzuサーバーのアカウントで使えるAPIトークンです。全権限を与えることが推奨されているらしいです。stringです。 -# Botの挙動 +# Botの挙動(任意) TWEET_ENABLED=true # 3分から3時間での間隔でランダムなつぶやきをユーズとして投稿するかどうかを指定できます。booleanです。 CHECK_INTERVAL=300 # メンション/返信を確認する間隔です。number(second)です。 THINK_OUTPUT_ENABLED=false # 人工無能の脳内をconsole.log()するかどうかを指定できます。量が多いため非推奨らしいです。booleanです。 \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 1587a81..d834e97 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,11 @@ +# Load Node.js FROM --platform=$BUILDPLATFORM node:24.12.0-alpine3.23 +# Set default env +ENV TWEET_ENABLED=true +ENV CHECK_INTERVAL=300 +ENV THINK_OUTPUT_ENABLED=false + # Set working directory WORKDIR /app @@ -15,13 +21,21 @@ COPY ./src ./ # Create replied_ids.json RUN touch replied_ids.json -# Setup entrypoint -COPY ./entrypoint.sh /entrypoint.sh -RUN chmod +x /entrypoint.sh +# Create config.json +RUN cat < /app/config.json +{ + "host": "${UWUZU_HOST}", + "api_token": "${UWUZU_TOKEN}", + "random_ueuse": ${TWEET_ENABLED}, + "check_interval": ${CHECK_INTERVAL}, + "rana_core_log": ${THINK_OUTPUT_ENABLED} +} +EOF # Change line break -RUN sed -i 's/\r$//' /entrypoint.sh \ - && find /app -type f -exec sed -i 's/\r$//' {} \; +RUN find /app -type f -print0 \ + | xargs -0 grep -Il "$(printf '\r')" \ + | xargs -0 sed -i 's/\r$//' -# Run entrypoint -ENTRYPOINT ["/entrypoint.sh"] \ No newline at end of file +# Run +CMD [ "npm", "start" ] \ No newline at end of file diff --git a/README.md b/README.md index 863eeec..a52c6ff 100644 --- a/README.md +++ b/README.md @@ -10,4 +10,4 @@ docker run -d --restart=always -v ./memory.db:/app/memory.db -e UWUZU_HOST=uwuzu で動きます。 /app/memory.dbが記憶になっているのでvolumesにしてください。 環境変数への値は`.env.example`を確認してください。 -全ての環境変数は必須です。指定しないで動くかは知りません。 \ No newline at end of file +UWUZU_*の環境変数は必須です。指定しないで動くかは知りません。 \ No newline at end of file From 172c7801fe8a2c77793cf2b2dbda94e22e7ac084 Mon Sep 17 00:00:00 2001 From: Last2014 Date: Wed, 17 Dec 2025 18:05:52 +0900 Subject: [PATCH 02/17] Del(file): entrypoint.sh --- entrypoint.sh | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 entrypoint.sh diff --git a/entrypoint.sh b/entrypoint.sh deleted file mode 100644 index 32910df..0000000 --- a/entrypoint.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -# Create config.json -cat < /app/config.json -{ - "host": "${UWUZU_HOST}", - "api_token": "${UWUZU_TOKEN}", - "random_ueuse": "${TWEET_ENABLED}", - "check_interval": "${CHECK_INTERVAL}", - "rana_core_log": "${THINK_OUTPUT_ENABLED}" -} -EOF - -# Run -exec npm start From df715a8502e2c70d9fabdc6d3397c22beeb87850 Mon Sep 17 00:00:00 2001 From: Last2014 Date: Wed, 17 Dec 2025 18:11:34 +0900 Subject: [PATCH 03/17] Del: Improved line feed code conversion --- Dockerfile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index d834e97..7408c3f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -33,9 +33,7 @@ RUN cat < /app/config.json EOF # Change line break -RUN find /app -type f -print0 \ - | xargs -0 grep -Il "$(printf '\r')" \ - | xargs -0 sed -i 's/\r$//' +RUN find /app -type f -exec sed -i 's/\r$//' {} \; # Run CMD [ "npm", "start" ] \ No newline at end of file From 6f7f53fc9b2aab2fc29595856a3029207b29d294 Mon Sep 17 00:00:00 2001 From: Last2014 Date: Wed, 17 Dec 2025 18:23:02 +0900 Subject: [PATCH 04/17] Chg: README --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index a52c6ff..659c45f 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,12 @@ ## Usage ```bash +touch memory.db docker run -d --restart=always -v ./memory.db:/app/memory.db -e UWUZU_HOST=uwuzu.example.com -e UWUZU_TOKEN=APITOKEN -e TWEET_ENABLED=true -e CHECK_INTERVAL=300 -e THINK_OUTPUT_ENABLED=false --name rana gitea.last2014.com/last2014/rana-for-docker:latest ``` で動きます。 /app/memory.dbが記憶になっているのでvolumesにしてください。 +> **WARNING** +> [#3](https://gitea.last2014.com/last2014/rana-for-docker/issues/3)の通り`touch`コマンドをサボると起動できません。 環境変数への値は`.env.example`を確認してください。 UWUZU_*の環境変数は必須です。指定しないで動くかは知りません。 \ No newline at end of file From 0513e8599c5160b9b00e31a1c41d282f79c7144b Mon Sep 17 00:00:00 2001 From: Last2014 Date: Wed, 17 Dec 2025 18:23:48 +0900 Subject: [PATCH 05/17] Chg: README #3 --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 659c45f..c51e2e2 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,11 @@ touch memory.db docker run -d --restart=always -v ./memory.db:/app/memory.db -e UWUZU_HOST=uwuzu.example.com -e UWUZU_TOKEN=APITOKEN -e TWEET_ENABLED=true -e CHECK_INTERVAL=300 -e THINK_OUTPUT_ENABLED=false --name rana gitea.last2014.com/last2014/rana-for-docker:latest ``` で動きます。 -/app/memory.dbが記憶になっているのでvolumesにしてください。 +/app/memory.dbが記憶になっているのでvolumesにしてください。 + > **WARNING** > [#3](https://gitea.last2014.com/last2014/rana-for-docker/issues/3)の通り`touch`コマンドをサボると起動できません。 -環境変数への値は`.env.example`を確認してください。 + +> **WARNING** +>環境変数への値は`.env.example`を確認してください。 UWUZU_*の環境変数は必須です。指定しないで動くかは知りません。 \ No newline at end of file From 19a9a66251d7d57718b62f31df44d0ec978ce825 Mon Sep 17 00:00:00 2001 From: Last2014 Date: Wed, 17 Dec 2025 18:44:02 +0900 Subject: [PATCH 06/17] Fix: unable to start(#4) --- Dockerfile | 4 +- src/package-lock.json | 509 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 511 insertions(+), 2 deletions(-) create mode 100644 src/package-lock.json diff --git a/Dockerfile b/Dockerfile index 7408c3f..618b9b5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,10 +10,10 @@ ENV THINK_OUTPUT_ENABLED=false WORKDIR /app # Copy package.json -COPY ./src/package.json ./ +COPY ./src/package*.json ./ # Install dependencies -RUN npm install +RUN npm ci --unsafe-perm # Copy source COPY ./src ./ diff --git a/src/package-lock.json b/src/package-lock.json new file mode 100644 index 0000000..d828372 --- /dev/null +++ b/src/package-lock.json @@ -0,0 +1,509 @@ +{ + "name": "rana", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "rana", + "version": "1.0.0", + "license": "UPUL", + "dependencies": { + "better-sqlite3": "^12.5.0", + "kuromoji": "^0.1.2" + } + }, + "node_modules/async": { + "version": "2.6.4", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz", + "integrity": "sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==", + "license": "MIT", + "dependencies": { + "lodash": "^4.17.14" + } + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/better-sqlite3": { + "version": "12.5.0", + "resolved": "https://registry.npmjs.org/better-sqlite3/-/better-sqlite3-12.5.0.tgz", + "integrity": "sha512-WwCZ/5Diz7rsF29o27o0Gcc1Du+l7Zsv7SYtVPG0X3G/uUI1LqdxrQI7c9Hs2FWpqXXERjW9hp6g3/tH7DlVKg==", + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "bindings": "^1.5.0", + "prebuild-install": "^7.1.1" + }, + "engines": { + "node": "20.x || 22.x || 23.x || 24.x || 25.x" + } + }, + "node_modules/bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "license": "MIT", + "dependencies": { + "file-uri-to-path": "1.0.0" + } + }, + "node_modules/bl": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "license": "MIT", + "dependencies": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, + "node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, + "node_modules/chownr": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", + "license": "ISC" + }, + "node_modules/decompress-response": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", + "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", + "license": "MIT", + "dependencies": { + "mimic-response": "^3.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "license": "MIT", + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/detect-libc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, + "node_modules/doublearray": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/doublearray/-/doublearray-0.0.2.tgz", + "integrity": "sha512-aw55FtZzT6AmiamEj2kvmR6BuFqvYgKZUkfQ7teqVRNqD5UE0rw8IeW/3gieHNKQ5sPuDKlljWEn4bzv5+1bHw==", + "license": "MIT" + }, + "node_modules/end-of-stream": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz", + "integrity": "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==", + "license": "MIT", + "dependencies": { + "once": "^1.4.0" + } + }, + "node_modules/expand-template": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", + "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==", + "license": "(MIT OR WTFPL)", + "engines": { + "node": ">=6" + } + }, + "node_modules/file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "license": "MIT" + }, + "node_modules/fs-constants": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", + "license": "MIT" + }, + "node_modules/github-from-package": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", + "integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==", + "license": "MIT" + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "BSD-3-Clause" + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, + "node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "license": "ISC" + }, + "node_modules/kuromoji": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/kuromoji/-/kuromoji-0.1.2.tgz", + "integrity": "sha512-V0dUf+C2LpcPEXhoHLMAop/bOht16Dyr+mDiIE39yX3vqau7p80De/koFqpiTcL1zzdZlc3xuHZ8u5gjYRfFaQ==", + "license": "Apache-2.0", + "dependencies": { + "async": "^2.0.1", + "doublearray": "0.0.2", + "zlibjs": "^0.3.1" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "license": "MIT" + }, + "node_modules/mimic-response": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", + "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/mkdirp-classic": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", + "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==", + "license": "MIT" + }, + "node_modules/napi-build-utils": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-2.0.0.tgz", + "integrity": "sha512-GEbrYkbfF7MoNaoh2iGG84Mnf/WZfB0GdGEsM8wz7Expx/LlWf5U8t9nvJKXSp3qr5IsEbK04cBGhol/KwOsWA==", + "license": "MIT" + }, + "node_modules/node-abi": { + "version": "3.85.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.85.0.tgz", + "integrity": "sha512-zsFhmbkAzwhTft6nd3VxcG0cvJsT70rL+BIGHWVq5fi6MwGrHwzqKaxXE+Hl2GmnGItnDKPPkO5/LQqjVkIdFg==", + "license": "MIT", + "dependencies": { + "semver": "^7.3.5" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/prebuild-install": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.3.tgz", + "integrity": "sha512-8Mf2cbV7x1cXPUILADGI3wuhfqWvtiLA1iclTDbFRZkgRQS0NqsPZphna9V+HyTEadheuPmjaJMsbzKQFOzLug==", + "license": "MIT", + "dependencies": { + "detect-libc": "^2.0.0", + "expand-template": "^2.0.3", + "github-from-package": "0.0.0", + "minimist": "^1.2.3", + "mkdirp-classic": "^0.5.3", + "napi-build-utils": "^2.0.0", + "node-abi": "^3.3.0", + "pump": "^3.0.0", + "rc": "^1.2.7", + "simple-get": "^4.0.0", + "tar-fs": "^2.0.0", + "tunnel-agent": "^0.6.0" + }, + "bin": { + "prebuild-install": "bin.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/pump": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.3.tgz", + "integrity": "sha512-todwxLMY7/heScKmntwQG8CXVkWUOdYxIvY2s0VWAAMh/nd8SoYiRaKjlr7+iCs984f2P8zvrfWcDDYVb73NfA==", + "license": "MIT", + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "node_modules/rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "license": "(BSD-2-Clause OR MIT OR Apache-2.0)", + "dependencies": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "bin": { + "rc": "cli.js" + } + }, + "node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/semver": { + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", + "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/simple-concat": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", + "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/simple-get": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz", + "integrity": "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "decompress-response": "^6.0.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/tar-fs": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.4.tgz", + "integrity": "sha512-mDAjwmZdh7LTT6pNleZ05Yt65HC3E+NiQzl672vQG38jIrehtJk/J3mNwIg+vShQPcLF/LV7CMnDW6vjj6sfYQ==", + "license": "MIT", + "dependencies": { + "chownr": "^1.1.1", + "mkdirp-classic": "^0.5.2", + "pump": "^3.0.0", + "tar-stream": "^2.1.4" + } + }, + "node_modules/tar-stream": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", + "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", + "license": "MIT", + "dependencies": { + "bl": "^4.0.3", + "end-of-stream": "^1.4.1", + "fs-constants": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", + "license": "Apache-2.0", + "dependencies": { + "safe-buffer": "^5.0.1" + }, + "engines": { + "node": "*" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "license": "MIT" + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "license": "ISC" + }, + "node_modules/zlibjs": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/zlibjs/-/zlibjs-0.3.1.tgz", + "integrity": "sha512-+J9RrgTKOmlxFSDHo0pI1xM6BLVUv+o0ZT9ANtCxGkjIVCCUdx9alUF8Gm+dGLKbkkkidWIHFDZHDMpfITt4+w==", + "license": "MIT", + "engines": { + "node": "*" + } + } + } +} \ No newline at end of file From ed22ac88eeda31d350837b5916ae580b0d356a20 Mon Sep 17 00:00:00 2001 From: Last2014 Date: Wed, 17 Dec 2025 19:02:32 +0900 Subject: [PATCH 07/17] Chg: alpine > bullseye-slim --- Dockerfile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 618b9b5..4f4e333 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Load Node.js -FROM --platform=$BUILDPLATFORM node:24.12.0-alpine3.23 +FROM --platform=$BUILDPLATFORM node:24.12.0-bullseye-slim # Set default env ENV TWEET_ENABLED=true @@ -9,6 +9,12 @@ ENV THINK_OUTPUT_ENABLED=false # Set working directory WORKDIR /app +# Install packages +RUN apt-get update +RUN apt-get install -y build-essential +RUN apt-get install -y python3 +RUN rm -rf /var/lib/apt/lists/* + # Copy package.json COPY ./src/package*.json ./ From ba868f23222116d63e29cba118cfc4a0ab7b1829 Mon Sep 17 00:00:00 2001 From: Last2014 Date: Wed, 17 Dec 2025 19:20:30 +0900 Subject: [PATCH 08/17] Fix: #5 #6 --- Dockerfile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4f4e333..af024a6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,12 @@ # Load Node.js FROM --platform=$BUILDPLATFORM node:24.12.0-bullseye-slim -# Set default env -ENV TWEET_ENABLED=true -ENV CHECK_INTERVAL=300 -ENV THINK_OUTPUT_ENABLED=false +# Set required/default env +ENV UWUZU_HOST=${UWUZU_HOST} +ENV UWUZU_TOKEN=${UWUZU_TOKEN} +ENV TWEET_ENABLED=${TWEET_ENABLED:-true} +ENV CHECK_INTERVAL=${CHECK_INTERVAL:-300} +ENV THINK_OUTPUT_ENABLED=${THINK_OUTPUT_ENABLED:-false} # Set working directory WORKDIR /app From 7ae4c53a5a46a6a56f960c57b3ebff8b0470384f Mon Sep 17 00:00:00 2001 From: Last2014 Date: Wed, 17 Dec 2025 19:34:48 +0900 Subject: [PATCH 09/17] Del: default env value / Fix: #5 --- .env.example | 6 +++--- Dockerfile | 16 +++++++--------- README.md | 2 +- entrypoint.sh | 23 +++++++++++++++++++++++ 4 files changed, 34 insertions(+), 13 deletions(-) create mode 100644 entrypoint.sh diff --git a/.env.example b/.env.example index ebfae2b..a285ec8 100644 --- a/.env.example +++ b/.env.example @@ -1,10 +1,10 @@ -# Warn: 全ての値は必須です。指定しないで動くかは知りません。 +# Warn: 全ての値は必須です。 -# uwuzuサーバーへの接続(必須) +# uwuzuサーバーへの接続 UWUZU_HOST=uwuzu.example.com # uwuzuサーバーのホスト名+":"+ポート(:ポートは任意)です。originではないのでHTTPSが必須になっています。stringです。 UWUZU_TOKEN=APITOKEN # uwuzuサーバーのアカウントで使えるAPIトークンです。全権限を与えることが推奨されているらしいです。stringです。 -# Botの挙動(任意) +# Botの挙動 TWEET_ENABLED=true # 3分から3時間での間隔でランダムなつぶやきをユーズとして投稿するかどうかを指定できます。booleanです。 CHECK_INTERVAL=300 # メンション/返信を確認する間隔です。number(second)です。 THINK_OUTPUT_ENABLED=false # 人工無能の脳内をconsole.log()するかどうかを指定できます。量が多いため非推奨らしいです。booleanです。 \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index af024a6..f0503f8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,6 @@ # Load Node.js FROM --platform=$BUILDPLATFORM node:24.12.0-bullseye-slim -# Set required/default env -ENV UWUZU_HOST=${UWUZU_HOST} -ENV UWUZU_TOKEN=${UWUZU_TOKEN} -ENV TWEET_ENABLED=${TWEET_ENABLED:-true} -ENV CHECK_INTERVAL=${CHECK_INTERVAL:-300} -ENV THINK_OUTPUT_ENABLED=${THINK_OUTPUT_ENABLED:-false} - # Set working directory WORKDIR /app @@ -40,8 +33,13 @@ RUN cat < /app/config.json } EOF +# Copy entrypoint +COPY ./entrypoint.sh /app/docker-entrypoint.sh +RUN chmod +x /app/docker-entrypoint.sh + # Change line break -RUN find /app -type f -exec sed -i 's/\r$//' {} \; +RUN sed -i 's/\r$//' /entrypoint.sh \ + && find /app -type f -exec sed -i 's/\r$//' {} \; # Run -CMD [ "npm", "start" ] \ No newline at end of file +ENTRYPOINT ["/app/docker-entrypoint.sh"] \ No newline at end of file diff --git a/README.md b/README.md index c51e2e2..7ca6015 100644 --- a/README.md +++ b/README.md @@ -16,4 +16,4 @@ docker run -d --restart=always -v ./memory.db:/app/memory.db -e UWUZU_HOST=uwuzu > **WARNING** >環境変数への値は`.env.example`を確認してください。 -UWUZU_*の環境変数は必須です。指定しないで動くかは知りません。 \ No newline at end of file +全ての環境変数は必須です。 \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000..345360e --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,23 @@ +#!/bin/sh +set -e + +# Check required env +if [ -z "$UWUZU_HOST" ] || [ -z "$UWUZU_TOKEN" ] || + [ -z "$TWEET_ENABLED" ] || [ -z "$CHECK_INTERVAL" ] || [ -z "$THINK_OUTPUT_ENABLED" ]; then + echo "Error: The environment variable is not set" + exit 1 +fi + +# Create config.json +cat < /app/config.json +{ + "host": "${UWUZU_HOST}", + "api_token": "${UWUZU_TOKEN}", + "random_ueuse": ${TWEET_ENABLED}, + "check_interval": ${CHECK_INTERVAL}, + "rana_core_log": ${THINK_OUTPUT_ENABLED} +} +EOF + +# Run +exec npm start From ef75c995beb429b1e9acd397a4bf22b9b17af62a Mon Sep 17 00:00:00 2001 From: Last2014 Date: Wed, 17 Dec 2025 19:43:34 +0900 Subject: [PATCH 10/17] Fix: path / Del: create config.json as dockerfile --- Dockerfile | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index f0503f8..23f7627 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,23 +22,12 @@ COPY ./src ./ # Create replied_ids.json RUN touch replied_ids.json -# Create config.json -RUN cat < /app/config.json -{ - "host": "${UWUZU_HOST}", - "api_token": "${UWUZU_TOKEN}", - "random_ueuse": ${TWEET_ENABLED}, - "check_interval": ${CHECK_INTERVAL}, - "rana_core_log": ${THINK_OUTPUT_ENABLED} -} -EOF - # Copy entrypoint COPY ./entrypoint.sh /app/docker-entrypoint.sh RUN chmod +x /app/docker-entrypoint.sh # Change line break -RUN sed -i 's/\r$//' /entrypoint.sh \ +RUN sed -i 's/\r$//' /app/docker-entrypoint.sh \ && find /app -type f -exec sed -i 's/\r$//' {} \; # Run From c8922ac2af67690302a5c015ecd7b76ba6e331f9 Mon Sep 17 00:00:00 2001 From: Last2014 Date: Thu, 18 Dec 2025 17:06:40 +0900 Subject: [PATCH 11/17] Fix: memory / Add: libsqlite3-dev(apt-get) / Add: run as root / Chg: node-24.12.0 > node-20-lts --- Dockerfile | 11 ++++++++++- src/{memory.db => memory.default.db} | Bin 2 files changed, 10 insertions(+), 1 deletion(-) rename src/{memory.db => memory.default.db} (100%) diff --git a/Dockerfile b/Dockerfile index 23f7627..36c9180 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,17 @@ # Load Node.js -FROM --platform=$BUILDPLATFORM node:24.12.0-bullseye-slim +FROM --platform=$BUILDPLATFORM node:20-bullseye-slim # Set working directory WORKDIR /app +# Run as root +USER root + # Install packages RUN apt-get update RUN apt-get install -y build-essential RUN apt-get install -y python3 +RUN apt-get install -y libsqlite3-dev RUN rm -rf /var/lib/apt/lists/* # Copy package.json @@ -19,6 +23,11 @@ RUN npm ci --unsafe-perm # Copy source COPY ./src ./ +# Copy default memory +RUN if [ ! -s /app/memory.db ]; then \ + cp /app/memory.default.db /app/memory.db; \ + fi + # Create replied_ids.json RUN touch replied_ids.json diff --git a/src/memory.db b/src/memory.default.db similarity index 100% rename from src/memory.db rename to src/memory.default.db From add327ddfe4b88e32649749f54bceb275e1e4853 Mon Sep 17 00:00:00 2001 From: Last2014 Date: Thu, 18 Dec 2025 19:19:24 +0900 Subject: [PATCH 12/17] Migrate: /app change line break --- Dockerfile | 6 +----- entrypoint.sh | 6 ++++++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 36c9180..8e9ac45 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,9 +17,6 @@ RUN rm -rf /var/lib/apt/lists/* # Copy package.json COPY ./src/package*.json ./ -# Install dependencies -RUN npm ci --unsafe-perm - # Copy source COPY ./src ./ @@ -36,8 +33,7 @@ COPY ./entrypoint.sh /app/docker-entrypoint.sh RUN chmod +x /app/docker-entrypoint.sh # Change line break -RUN sed -i 's/\r$//' /app/docker-entrypoint.sh \ - && find /app -type f -exec sed -i 's/\r$//' {} \; +RUN sed -i 's/\r$//' /app/docker-entrypoint.sh # Run ENTRYPOINT ["/app/docker-entrypoint.sh"] \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh index 345360e..d0598de 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -8,6 +8,12 @@ if [ -z "$UWUZU_HOST" ] || [ -z "$UWUZU_TOKEN" ] || exit 1 fi +# Install dependencies +RUN npm ci --unsafe-perm + +# Change line break +find /app -type f -exec sed -i 's/\r$//' {} \; + # Create config.json cat < /app/config.json { From f1480776973b2b45a63bf06ff5ba8c4dc7b857cd Mon Sep 17 00:00:00 2001 From: Last2014 Date: Thu, 18 Dec 2025 20:00:05 +0900 Subject: [PATCH 13/17] Migrate: copy default memory --- Dockerfile | 5 ----- entrypoint.sh | 6 ++++++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8e9ac45..493549d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,11 +20,6 @@ COPY ./src/package*.json ./ # Copy source COPY ./src ./ -# Copy default memory -RUN if [ ! -s /app/memory.db ]; then \ - cp /app/memory.default.db /app/memory.db; \ - fi - # Create replied_ids.json RUN touch replied_ids.json diff --git a/entrypoint.sh b/entrypoint.sh index d0598de..e3c1cfe 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -14,6 +14,12 @@ RUN npm ci --unsafe-perm # Change line break find /app -type f -exec sed -i 's/\r$//' {} \; +# Copy default memory +if [ ! -s /app/memory.db ]; then \ + cp /app/memory.default.db /app/memory.db; \ + rm -f /app/memory.default.db; \ + fi + # Create config.json cat < /app/config.json { From 486397ebed65c21260f5af945c4cede5f65b2add Mon Sep 17 00:00:00 2001 From: Last2014 Date: Thu, 18 Dec 2025 22:34:32 +0900 Subject: [PATCH 14/17] Fix: entrypoint command --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index e3c1cfe..83d2df8 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -9,7 +9,7 @@ if [ -z "$UWUZU_HOST" ] || [ -z "$UWUZU_TOKEN" ] || fi # Install dependencies -RUN npm ci --unsafe-perm +npm ci --unsafe-perm # Change line break find /app -type f -exec sed -i 's/\r$//' {} \; From f977458e6356a9d30fb60ac6c4472f166623dd42 Mon Sep 17 00:00:00 2001 From: Last2014 Date: Thu, 18 Dec 2025 22:37:03 +0900 Subject: [PATCH 15/17] Chg: README --- README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7ca6015..6baea68 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ 中身は[f970f75](https://github.com/Daichimarukana/rana/commit/f970f75b3ff9babe6c711d3b6c2ecf9bd8bfa622)です。 ## Usage +### Use public image ```bash touch memory.db docker run -d --restart=always -v ./memory.db:/app/memory.db -e UWUZU_HOST=uwuzu.example.com -e UWUZU_TOKEN=APITOKEN -e TWEET_ENABLED=true -e CHECK_INTERVAL=300 -e THINK_OUTPUT_ENABLED=false --name rana gitea.last2014.com/last2014/rana-for-docker:latest @@ -16,4 +17,11 @@ docker run -d --restart=always -v ./memory.db:/app/memory.db -e UWUZU_HOST=uwuzu > **WARNING** >環境変数への値は`.env.example`を確認してください。 -全ての環境変数は必須です。 \ No newline at end of file +全ての環境変数は必須です。 + +### Local build +```bash +docker buildx build --platform linux/amd64,linux/arm64 --no-cache -t push-to --push . +``` +でbuild/pushできます。 +ローカル保存は試したことがないので知りません。 \ No newline at end of file From fe27faf3d927fd7ea781b52aff45c666bdb5fecd Mon Sep 17 00:00:00 2001 From: Last2014 Date: Thu, 18 Dec 2025 23:11:23 +0900 Subject: [PATCH 16/17] Del: fast copy(package*.json) / Fix: touch > echo(init) --- Dockerfile | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 493549d..0d929af 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,14 +14,11 @@ RUN apt-get install -y python3 RUN apt-get install -y libsqlite3-dev RUN rm -rf /var/lib/apt/lists/* -# Copy package.json -COPY ./src/package*.json ./ - # Copy source COPY ./src ./ -# Create replied_ids.json -RUN touch replied_ids.json +# Init replied_ids.json +RUN echo "[]" > replied_ids.json # Copy entrypoint COPY ./entrypoint.sh /app/docker-entrypoint.sh From 3af5b5f87c0e19eb8c703d1862563472f0a19360 Mon Sep 17 00:00:00 2001 From: Last2014 Date: Thu, 18 Dec 2025 23:18:30 +0900 Subject: [PATCH 17/17] Migrate: entrypoint > dockerfile(npm ci) / Fix: ignore node_modules(sed) --- Dockerfile | 3 +++ entrypoint.sh | 6 ++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0d929af..dca0e37 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,6 +17,9 @@ RUN rm -rf /var/lib/apt/lists/* # Copy source COPY ./src ./ +# Install dependencies +RUN npm ci --unsafe-perm + # Init replied_ids.json RUN echo "[]" > replied_ids.json diff --git a/entrypoint.sh b/entrypoint.sh index 83d2df8..63271c4 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -8,11 +8,9 @@ if [ -z "$UWUZU_HOST" ] || [ -z "$UWUZU_TOKEN" ] || exit 1 fi -# Install dependencies -npm ci --unsafe-perm - # Change line break -find /app -type f -exec sed -i 's/\r$//' {} \; +find /app -type d -name "node_modules" -prune -o \ + -type f -name "*.js" -exec sed -i 's/\r$//' {} \; # Copy default memory if [ ! -s /app/memory.db ]; then \