revert: hardcode email and umami id, drop build step
Coolify does not propagate service-level env vars to the Nixpacks build phase, so the [EMAIL_ADDRESS]/[UMAMI_WEBSITE_ID] substitution mechanism doesn't work in this setup. Reverted to literal values: - [EMAIL_ADDRESS] -> contacto@posidonia.eivissaenvironmentalwatch.es - [UMAMI_WEBSITE_ID] -> 8ba9afa3-f6d3-45d9-b2ad-d98f0c25fdbf Also removed scripts/build.sh, public/ from .gitignore, and reverted README/CHANGELOG to the pre-build-step state. The privacy goal of keeping email out of repo is abandoned for deployment reliability. To revisit later, see CHANGELOG 0.5.1.
This commit is contained in:
+1
-4
@@ -2,7 +2,4 @@
|
||||
*.log
|
||||
.DS_Store
|
||||
.env
|
||||
.env.local
|
||||
|
||||
# Build output
|
||||
public/
|
||||
.env.local
|
||||
@@ -1,5 +1,17 @@
|
||||
# Changelog
|
||||
|
||||
## [0.5.1] — 2026-07-30
|
||||
|
||||
### Reverted
|
||||
- placeholder substitution build step (`[EMAIL_ADDRESS]`, `[UMAMI_WEBSITE_ID]`) — reverted because Coolify does not propagate service env vars to the Nixpacks build phase
|
||||
- `scripts/build.sh` removed
|
||||
- `.gitignore` reverted to pre-build-step minimal state
|
||||
- README reverted to "no build step required"
|
||||
|
||||
### Note
|
||||
The email (`contacto@posidonia.eivissaenvironmentalwatch.es`) and Umami website id (`8ba9afa3-...`) are now hardcoded again in the HTML files. The privacy goal "no email in repo" was abandoned for build reliability. To revisit, options are: (a) custom Dockerfile with ARG, (b) commit build output to a separate branch served by Coolify, (c) external secret-injector before commit.
|
||||
|
||||
|
||||
## 0.5.0 — 2026-07-30
|
||||
|
||||
### Changed
|
||||
|
||||
@@ -8,15 +8,13 @@ Sitio editorial estático en catalán y español sobre el seguimiento de la *Pos
|
||||
|
||||
```
|
||||
/
|
||||
├── index.html # Català (primari, x-default) — contiene placeholders
|
||||
├── index.html # Català (primari, x-default)
|
||||
├── es/
|
||||
│ └── index.html # Castellano — contiene placeholders
|
||||
│ └── index.html # Castellano
|
||||
├── og-image-ca.jpg # 1200×630, imatge social per a /
|
||||
├── og-image-es.jpg # 1200×630, imatge social per a /es/
|
||||
├── robots.txt
|
||||
├── sitemap.xml # enumera / i /es/ amb hreflang complet
|
||||
└── scripts/
|
||||
└── build.sh # sed envsubst → ./public/
|
||||
```
|
||||
|
||||
- `/` és l'idioma principal (`hreflang="x-default"`).
|
||||
@@ -26,23 +24,9 @@ Sitio editorial estático en catalán y español sobre el seguimiento de la *Pos
|
||||
|
||||
## Build & Deploy
|
||||
|
||||
This site uses a small build step that substitutes two placeholders — `[EMAIL_ADDRESS]` and `[UMAMI_WEBSITE_ID]` — with values supplied via Coolify environment variables. The build output goes to `./public/`, which Coolify serves as the static site root. The real email and Umami UUID never appear in the repo.
|
||||
No build step required. The `index.html`, `es/index.html`, `og-image-*.jpg`, `umami.js`, `robots.txt`, and `sitemap.xml` in the repo root are deployed as-is.
|
||||
|
||||
**Coolify service config:**
|
||||
- Build command: `bash scripts/build.sh`
|
||||
- Publish directory: `public`
|
||||
- Environment variables (set in Coolify service "Environment" tab):
|
||||
- `CONTACT_EMAIL` — your real contact email (e.g. `hello@example.com`)
|
||||
- `UMAMI_WEBSITE_ID` — your Umami website UUID (e.g. `8ba9afa3-f6d3-45d9-b2ad-…`)
|
||||
|
||||
**Local build for testing:**
|
||||
|
||||
```bash
|
||||
CONTACT_EMAIL=hello@example.com UMAMI_WEBSITE_ID=8ba9afa3-… bash scripts/build.sh
|
||||
python3 -m http.server --directory public 8000 # preview
|
||||
```
|
||||
|
||||
The build is just a `sed` substitution; no Node toolchain required. The output `./public/` is gitignored.
|
||||
Coolify: configure as a **Static Site** service with **Publish directory** = `.` (the repo root). No Dockerfile, no build command.
|
||||
|
||||
## Deploy
|
||||
|
||||
|
||||
+2
-2
File diff suppressed because one or more lines are too long
+3
-3
@@ -72,7 +72,7 @@
|
||||
<script
|
||||
defer
|
||||
src="/umami.js"
|
||||
data-website-id="[UMAMI_WEBSITE_ID]"
|
||||
data-website-id="8ba9afa3-f6d3-45d9-b2ad-d98f0c25fdbf"
|
||||
data-host-url="https://stats.itziarzameza.dev"
|
||||
></script>
|
||||
<style>
|
||||
@@ -1079,7 +1079,7 @@
|
||||
</p>
|
||||
<p class="contacte">
|
||||
¿Alguna cosa a corregir? Escriu-me a
|
||||
<a href="mailto:[EMAIL_ADDRESS]">Itziar ZG</a>.
|
||||
<a href="mailto:contacto@posidonia.eivissaenvironmentalwatch.es">Itziar ZG</a>.
|
||||
</p>
|
||||
<p class="legal">
|
||||
Aquesta web utilitza Umami, analítica autoallotjada i sense galetes
|
||||
@@ -1111,7 +1111,7 @@
|
||||
<p>
|
||||
Mantenguda per
|
||||
<!-- TODO: [reemplazar amb correu electrònic real del mantenidor si és diferent] --><a
|
||||
href="mailto:[EMAIL_ADDRESS]"
|
||||
href="mailto:contacto@posidonia.eivissaenvironmentalwatch.es"
|
||||
>Itziar ZG</a
|
||||
>
|
||||
</p>
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
# Build script for Coolify: substitute [EMAIL_ADDRESS] and [UMAMI_WEBSITE_ID]
|
||||
# placeholders using environment variables, then output to ./public/
|
||||
#
|
||||
# Required env vars:
|
||||
# CONTACT_EMAIL — the actual email address
|
||||
# UMAMI_WEBSITE_ID — the umami website UUID
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
: "${CONTACT_EMAIL:?Need CONTACT_EMAIL env var}"
|
||||
: "${UMAMI_WEBSITE_ID:?Need UMAMI_WEBSITE_ID env var}"
|
||||
|
||||
mkdir -p public
|
||||
|
||||
# Substitute placeholders in both language files
|
||||
sed \
|
||||
-e "s|\[EMAIL_ADDRESS\]|${CONTACT_EMAIL}|g" \
|
||||
-e "s|\[UMAMI_WEBSITE_ID\]|${UMAMI_WEBSITE_ID}|g" \
|
||||
index.html > public/index.html
|
||||
|
||||
mkdir -p public/es
|
||||
sed \
|
||||
-e "s|\[EMAIL_ADDRESS\]|${CONTACT_EMAIL}|g" \
|
||||
-e "s|\[UMAMI_WEBSITE_ID\]|${UMAMI_WEBSITE_ID}|g" \
|
||||
es/index.html > public/es/index.html
|
||||
|
||||
# Copy static assets unchanged
|
||||
cp -v og-image-*.jpg umami.js robots.txt sitemap.xml public/ 2>/dev/null || true
|
||||
|
||||
echo "✅ Build complete. Output in ./public/"
|
||||
echo " HTML pages: $(find public -name '*.html' | wc -l)"
|
||||
echo " Total size: $(du -sh public | cut -f1)"
|
||||
Reference in New Issue
Block a user