Fix: remove build: from compose.yml; clean up debug logs
All checks were successful
Deploy / deploy (push) Successful in 57s
All checks were successful
Deploy / deploy (push) Successful in 57s
podman-compose was rebuilding the image on every service restart using the Containerfile, but without --build-arg WEBMENTION_TOKEN. This silently discarded the token that the CI build had baked in. Removing the build: block means restarts reuse the pre-built image tagged by CI. Also removes all temporary debug console.log statements. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
a379e65c7a
commit
46701e959f
4 changed files with 1 additions and 13 deletions
|
|
@ -37,12 +37,7 @@ jobs:
|
||||||
sudo podman build \
|
sudo podman build \
|
||||||
--no-cache \
|
--no-cache \
|
||||||
--build-arg WEBMENTION_TOKEN="${{ secrets.WEBMENTION_TOKEN }}" \
|
--build-arg WEBMENTION_TOKEN="${{ secrets.WEBMENTION_TOKEN }}" \
|
||||||
-t localhost/adrian-altner.de:latest . 2>&1 | tee /tmp/podman-build.log
|
-t localhost/adrian-altner.de:latest .
|
||||||
echo "--- token-len check ---"
|
|
||||||
grep 'token-len=' /tmp/podman-build.log || echo "(no token-len in build output)"
|
|
||||||
echo "--- webmentions check ---"
|
|
||||||
sudo podman run --rm localhost/adrian-altner.de:latest sh -c \
|
|
||||||
'grep -c "section class=\"webmentions\"" /app/dist/client/setting-up-forgejo-actions-runner/index.html 2>/dev/null && echo WEBMENTIONS_OK || echo WEBMENTIONS_MISSING'
|
|
||||||
|
|
||||||
- name: Restart service
|
- name: Restart service
|
||||||
run: sudo systemctl restart podman-compose@adrian-altner.de.service
|
run: sudo systemctl restart podman-compose@adrian-altner.de.service
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@ import node from '@astrojs/node';
|
||||||
const envMode = process.env.NODE_ENV === 'production' ? 'production' : 'development';
|
const envMode = process.env.NODE_ENV === 'production' ? 'production' : 'development';
|
||||||
const envVars = loadEnv(envMode, process.cwd(), '');
|
const envVars = loadEnv(envMode, process.cwd(), '');
|
||||||
const WEBMENTION_TOKEN = envVars.WEBMENTION_TOKEN || process.env.WEBMENTION_TOKEN || '';
|
const WEBMENTION_TOKEN = envVars.WEBMENTION_TOKEN || process.env.WEBMENTION_TOKEN || '';
|
||||||
console.log(`[astro.config] token-len=${WEBMENTION_TOKEN.length} envVars-len=${(envVars.WEBMENTION_TOKEN||'').length} proc-len=${(process.env.WEBMENTION_TOKEN||'').length}`);
|
|
||||||
|
|
||||||
// https://astro.build/config
|
// https://astro.build/config
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,6 @@ name: adrian-altner-de
|
||||||
|
|
||||||
services:
|
services:
|
||||||
website:
|
website:
|
||||||
build:
|
|
||||||
context: .
|
|
||||||
dockerfile: Containerfile
|
|
||||||
image: localhost/adrian-altner.de:latest
|
image: localhost/adrian-altner.de:latest
|
||||||
container_name: adrian-altner.de
|
container_name: adrian-altner.de
|
||||||
ports:
|
ports:
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@ declare global {
|
||||||
}
|
}
|
||||||
const tokenRaw = (globalThis as unknown as { __WEBMENTION_TOKEN__?: string }).__WEBMENTION_TOKEN__;
|
const tokenRaw = (globalThis as unknown as { __WEBMENTION_TOKEN__?: string }).__WEBMENTION_TOKEN__;
|
||||||
const WEBMENTION_TOKEN = typeof tokenRaw === 'string' ? tokenRaw : '';
|
const WEBMENTION_TOKEN = typeof tokenRaw === 'string' ? tokenRaw : '';
|
||||||
console.log(`[Webmentions] tokenRaw type=${typeof tokenRaw} len=${WEBMENTION_TOKEN.length} raw="${String(tokenRaw).slice(0,4)}..."`);
|
|
||||||
|
|
||||||
interface WMAuthor {
|
interface WMAuthor {
|
||||||
name?: string;
|
name?: string;
|
||||||
|
|
@ -43,10 +42,8 @@ async function fetchMentions(target: string): Promise<WMEntry[]> {
|
||||||
url.searchParams.set('token', token);
|
url.searchParams.set('token', token);
|
||||||
url.searchParams.set('per-page', '100');
|
url.searchParams.set('per-page', '100');
|
||||||
const res = await fetch(url);
|
const res = await fetch(url);
|
||||||
console.log(`[Webmentions] fetch ${t.slice(-40)} → ${res.status}`);
|
|
||||||
if (!res.ok) return [] as WMEntry[];
|
if (!res.ok) return [] as WMEntry[];
|
||||||
const json = (await res.json()) as { children?: WMEntry[] };
|
const json = (await res.json()) as { children?: WMEntry[] };
|
||||||
console.log(`[Webmentions] children=${json.children?.length ?? 0}`);
|
|
||||||
return json.children ?? [];
|
return json.children ?? [];
|
||||||
};
|
};
|
||||||
const [a, b] = await Promise.all([fetchOne(withSlash), fetchOne(withoutSlash)]);
|
const [a, b] = await Promise.all([fetchOne(withSlash), fetchOne(withoutSlash)]);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue