thepopebot 1.2.4 → 1.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/postinstall.js
CHANGED
|
@@ -38,6 +38,23 @@ function walk(dir) {
|
|
|
38
38
|
return files;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
+
// Write THEPOPEBOT_VERSION to .env so docker-compose can pin the image tag
|
|
42
|
+
const envPath = path.join(projectRoot, '.env');
|
|
43
|
+
if (fs.existsSync(envPath)) {
|
|
44
|
+
const ownPkgPath = path.join(__dirname, '..', 'package.json');
|
|
45
|
+
try {
|
|
46
|
+
const ownPkg = JSON.parse(fs.readFileSync(ownPkgPath, 'utf8'));
|
|
47
|
+
const version = ownPkg.version;
|
|
48
|
+
let envContent = fs.readFileSync(envPath, 'utf8');
|
|
49
|
+
if (envContent.match(/^THEPOPEBOT_VERSION=.*/m)) {
|
|
50
|
+
envContent = envContent.replace(/^THEPOPEBOT_VERSION=.*/m, `THEPOPEBOT_VERSION=${version}`);
|
|
51
|
+
} else {
|
|
52
|
+
envContent = envContent.trimEnd() + `\nTHEPOPEBOT_VERSION=${version}\n`;
|
|
53
|
+
}
|
|
54
|
+
fs.writeFileSync(envPath, envContent);
|
|
55
|
+
} catch {}
|
|
56
|
+
}
|
|
57
|
+
|
|
41
58
|
const changed = [];
|
|
42
59
|
for (const relPath of walk(templatesDir)) {
|
|
43
60
|
const src = path.join(templatesDir, relPath);
|
package/package.json
CHANGED
package/templates/.env.example
CHANGED
|
@@ -49,6 +49,9 @@ TELEGRAM_CHAT_ID=
|
|
|
49
49
|
# If not set, Traefik uses a self-signed certificate
|
|
50
50
|
# LETSENCRYPT_EMAIL=
|
|
51
51
|
|
|
52
|
-
#
|
|
52
|
+
# thepopebot version — auto-set by postinstall, used by docker-compose for image tags
|
|
53
|
+
# THEPOPEBOT_VERSION=
|
|
54
|
+
|
|
55
|
+
# Custom Docker images (optional, overrides the default stephengpope/thepopebot images)
|
|
53
56
|
# EVENT_HANDLER_IMAGE_URL=
|
|
54
57
|
# JOB_IMAGE_URL=
|
|
@@ -20,7 +20,7 @@ services:
|
|
|
20
20
|
restart: unless-stopped
|
|
21
21
|
|
|
22
22
|
event_handler:
|
|
23
|
-
image: ${EVENT_HANDLER_IMAGE_URL:-stephengpope/thepopebot
|
|
23
|
+
image: ${EVENT_HANDLER_IMAGE_URL:-stephengpope/thepopebot:event-handler-${THEPOPEBOT_VERSION:-latest}}
|
|
24
24
|
volumes:
|
|
25
25
|
- ./.env:/app/.env
|
|
26
26
|
- ./config:/app/config
|