decidim: decidim.hacktivism.ch behind Caddy :9027
This commit is contained in:
parent
d519fb3c80
commit
609056615e
24 changed files with 840 additions and 24 deletions
13
configs/decidim/.env.example
Normal file
13
configs/decidim/.env.example
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
POSTGRES_PASSWORD=@inline-secret@
|
||||
SECRET_KEY_BASE=@inline-secret@
|
||||
DECIDIM_APPLICATION_NAME=hacktivism
|
||||
DECIDIM_MAILER_SENDER=noreply@hacktivism.ch
|
||||
DECIDIM_AVAILABLE_LOCALES=en,de,fr
|
||||
DECIDIM_DEFAULT_LOCALE=en
|
||||
DECIDIM_HOST=decidim.hacktivism.ch
|
||||
SMTP_ADDRESS=127.0.0.1
|
||||
SMTP_DOMAIN=hacktivism.ch
|
||||
SMTP_USERNAME=unused
|
||||
SMTP_PASSWORD=unused
|
||||
SMTP_PORT=25
|
||||
QUEUE_ADAPTER=sidekiq
|
||||
25
configs/decidim/README.md
Normal file
25
configs/decidim/README.md
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
# Decidim — decidim.hacktivism.ch
|
||||
|
||||
| Item | Value |
|
||||
|------|--------|
|
||||
| Live | `/home/hernani/koopa-decidim/` |
|
||||
| Compose | `compose.yml` (mirror, no secrets) |
|
||||
| Port | **9027** → Caddy |
|
||||
| Site | https://decidim.hacktivism.ch/ |
|
||||
| Image | `decidim/decidim:0.30.8` + postgres 16 + redis 7 + sidekiq |
|
||||
|
||||
Secrets: host `~/koopa-decidim/{.env,users.env}` (mode 600). Not in this repo.
|
||||
|
||||
Theme: `theme/hacktivism.css` + `theme/hacktivism.rb` (same exchange-dark palette as Lemmy/Bonfire). Analog stack: `configs/lemmy/`.
|
||||
|
||||
Privacy: no third-party trackers. Stock GDPR banner is hidden (`#dc-dialog-wrapper`); `theme/hacktivism-consent.js` sets essential-only `decidim-consent`.
|
||||
|
||||
```bash
|
||||
cd ~/koopa-decidim && set -a && source .env && set +a && podman-compose up -d
|
||||
scripts/decidim/install-systemd.sh
|
||||
scripts/decidim/apply-branding.sh
|
||||
```
|
||||
|
||||
Caddy: `sudo /home/hernani/koopa-caddy/apply.sh`
|
||||
|
||||
Daylog: `2026/2026-08-17--decidim.md`.
|
||||
90
configs/decidim/assets/img/favicon.svg
Normal file
90
configs/decidim/assets/img/favicon.svg
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128" width="128" height="128" role="img" aria-label="Wizard flying on magic wand, blue robe">
|
||||
<!-- Original Kamek-inspired mark; not Nintendo art. No filters/transforms for clean raster. -->
|
||||
|
||||
<!-- motion streaks -->
|
||||
<line x1="4" y1="64" x2="22" y2="64" stroke="#5eead4" stroke-width="2.5" stroke-linecap="round" opacity="0.55"/>
|
||||
<line x1="6" y1="74" x2="20" y2="74" stroke="#38bdf8" stroke-width="2" stroke-linecap="round" opacity="0.45"/>
|
||||
<line x1="8" y1="54" x2="20" y2="54" stroke="#fde68a" stroke-width="2" stroke-linecap="round" opacity="0.45"/>
|
||||
|
||||
<!-- ground shadow -->
|
||||
<ellipse cx="64" cy="118" rx="30" ry="5" fill="#000" opacity="0.2"/>
|
||||
|
||||
<!-- ===== MAGIC WAND (mount) — diagonal, thick gold shaft ===== -->
|
||||
<!-- sits under the rider from lower-left to upper-right -->
|
||||
<line x1="6" y1="100" x2="108" y2="72" stroke="#92400e" stroke-width="11" stroke-linecap="round"/>
|
||||
<line x1="6" y1="100" x2="108" y2="72" stroke="#e8a838" stroke-width="7" stroke-linecap="round"/>
|
||||
<line x1="6" y1="100" x2="108" y2="72" stroke="#fde68a" stroke-width="2" stroke-linecap="round" opacity="0.75"/>
|
||||
|
||||
<!-- wand jewel (front tip) -->
|
||||
<circle cx="112" cy="70" r="13" fill="#f59e0b" stroke="#fff7ed" stroke-width="3"/>
|
||||
<circle cx="108" cy="66" r="4.5" fill="#fef9c3"/>
|
||||
<!-- sparkles at tip -->
|
||||
<polygon points="120,54 121.6,58.5 126,60 121.6,61.5 120,66 118.4,61.5 114,60 118.4,58.5" fill="#fef08a"/>
|
||||
<polygon points="102,56 103,59 106,60 103,61 102,64 101,61 98,60 101,59" fill="#5eead4"/>
|
||||
<circle cx="118" cy="78" r="2" fill="#bae6fd"/>
|
||||
|
||||
<!-- ===== RIDER on top of wand ===== -->
|
||||
<!-- blue cape fluttering left -->
|
||||
<path d="M38 78 C18 82, 10 98, 8 110 C22 98, 34 96, 40 92 Z" fill="#1e3a8a"/>
|
||||
<path d="M40 80 C22 88, 14 104, 12 112 C28 100, 36 98, 42 94 Z" fill="#1d4ed8"/>
|
||||
|
||||
<!-- BLUE ROBE (body sitting ON shaft) -->
|
||||
<ellipse cx="54" cy="86" rx="28" ry="22" fill="#1d4ed8"/>
|
||||
<ellipse cx="54" cy="84" rx="24" ry="18" fill="#2563eb"/>
|
||||
<!-- white trim -->
|
||||
<path d="M32 74 Q54 94 76 74" fill="none" stroke="#f8fafc" stroke-width="4" stroke-linecap="round"/>
|
||||
<path d="M36 82 Q54 98 72 82" fill="none" stroke="#e2e8f0" stroke-width="2.5" stroke-linecap="round"/>
|
||||
|
||||
<!-- green shell -->
|
||||
<ellipse cx="66" cy="92" rx="13" ry="11" fill="#16a34a"/>
|
||||
<ellipse cx="66" cy="92" rx="6" ry="5" fill="#86efac" opacity="0.75"/>
|
||||
|
||||
<!-- legs over the wand -->
|
||||
<ellipse cx="42" cy="100" rx="10" ry="7" fill="#1e40af"/>
|
||||
<ellipse cx="60" cy="102" rx="10" ry="7" fill="#1e40af"/>
|
||||
<!-- yellow feet hanging past shaft -->
|
||||
<ellipse cx="38" cy="106" rx="7" ry="4.5" fill="#fbbf24"/>
|
||||
<ellipse cx="64" cy="108" rx="7" ry="4.5" fill="#fbbf24"/>
|
||||
|
||||
<!-- left arm forward -->
|
||||
<ellipse cx="30" cy="82" rx="9" ry="7" fill="#1d4ed8"/>
|
||||
<circle cx="24" cy="78" r="5.5" fill="#fbbf24"/>
|
||||
<!-- right arm up -->
|
||||
<ellipse cx="74" cy="74" rx="9" ry="7" fill="#1d4ed8"/>
|
||||
<circle cx="80" cy="68" r="5.5" fill="#fbbf24"/>
|
||||
<circle cx="82" cy="60" r="5" fill="#38bdf8"/>
|
||||
<circle cx="81" cy="58" r="1.8" fill="#e0f2fe"/>
|
||||
|
||||
<!-- ===== HEAD ===== -->
|
||||
<ellipse cx="54" cy="50" rx="26" ry="24" fill="#fbbf24"/>
|
||||
<ellipse cx="54" cy="53" rx="21" ry="17" fill="#fcd34d"/>
|
||||
<ellipse cx="34" cy="54" rx="6" ry="4" fill="#fb923c" opacity="0.4"/>
|
||||
<ellipse cx="74" cy="54" rx="6" ry="4" fill="#fb923c" opacity="0.4"/>
|
||||
|
||||
<!-- glasses -->
|
||||
<circle cx="42" cy="50" r="10" fill="#bae6fd" fill-opacity="0.4" stroke="#0f172a" stroke-width="3"/>
|
||||
<circle cx="66" cy="50" r="10" fill="#bae6fd" fill-opacity="0.4" stroke="#0f172a" stroke-width="3"/>
|
||||
<line x1="52" y1="50" x2="56" y2="50" stroke="#0f172a" stroke-width="3"/>
|
||||
<line x1="32" y1="47" x2="24" y2="42" stroke="#0f172a" stroke-width="2.5" stroke-linecap="round"/>
|
||||
<line x1="76" y1="47" x2="84" y2="42" stroke="#0f172a" stroke-width="2.5" stroke-linecap="round"/>
|
||||
<circle cx="44" cy="50" r="3" fill="#0f172a"/>
|
||||
<circle cx="68" cy="50" r="3" fill="#0f172a"/>
|
||||
<circle cx="45.2" cy="48.8" r="1.1" fill="#fff"/>
|
||||
<circle cx="69.2" cy="48.8" r="1.1" fill="#fff"/>
|
||||
|
||||
<!-- snout + mustache -->
|
||||
<ellipse cx="54" cy="62" rx="8" ry="5" fill="#f59e0b"/>
|
||||
<path d="M36 64 Q46 74 54 70 Q62 74 72 64 Q64 72 54 74 Q44 72 36 64 Z" fill="#f8fafc"/>
|
||||
<path d="M44 66 Q54 74 64 66" fill="none" stroke="#92400e" stroke-width="2.2" stroke-linecap="round"/>
|
||||
|
||||
<!-- BLUE pointed hat -->
|
||||
<path d="M28 44 L54 2 L80 44 Z" fill="#1d4ed8"/>
|
||||
<path d="M36 44 L54 10 L72 44 Z" fill="#3b82f6" opacity="0.5"/>
|
||||
<ellipse cx="54" cy="44" rx="30" ry="8" fill="#1e40af"/>
|
||||
<ellipse cx="54" cy="42.5" rx="26" ry="5" fill="#2563eb"/>
|
||||
<ellipse cx="54" cy="44" rx="30" ry="8" fill="none" stroke="#f8fafc" stroke-width="2.2"/>
|
||||
<polygon points="54,12 55.6,16.8 60.5,18.4 55.6,20 54,24.8 52.4,20 47.5,18.4 52.4,16.8" fill="#f8fafc"/>
|
||||
<polygon points="42,22 43.1,25.2 46.2,26.4 43.1,27.6 42,30.8 40.9,27.6 37.8,26.4 40.9,25.2" fill="#fef08a"/>
|
||||
<circle cx="54" cy="4" r="6" fill="#f8fafc"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 4.9 KiB |
90
configs/decidim/assets/img/logo.svg
Normal file
90
configs/decidim/assets/img/logo.svg
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128" width="128" height="128" role="img" aria-label="Wizard flying on magic wand, blue robe">
|
||||
<!-- Original Kamek-inspired mark; not Nintendo art. No filters/transforms for clean raster. -->
|
||||
|
||||
<!-- motion streaks -->
|
||||
<line x1="4" y1="64" x2="22" y2="64" stroke="#5eead4" stroke-width="2.5" stroke-linecap="round" opacity="0.55"/>
|
||||
<line x1="6" y1="74" x2="20" y2="74" stroke="#38bdf8" stroke-width="2" stroke-linecap="round" opacity="0.45"/>
|
||||
<line x1="8" y1="54" x2="20" y2="54" stroke="#fde68a" stroke-width="2" stroke-linecap="round" opacity="0.45"/>
|
||||
|
||||
<!-- ground shadow -->
|
||||
<ellipse cx="64" cy="118" rx="30" ry="5" fill="#000" opacity="0.2"/>
|
||||
|
||||
<!-- ===== MAGIC WAND (mount) — diagonal, thick gold shaft ===== -->
|
||||
<!-- sits under the rider from lower-left to upper-right -->
|
||||
<line x1="6" y1="100" x2="108" y2="72" stroke="#92400e" stroke-width="11" stroke-linecap="round"/>
|
||||
<line x1="6" y1="100" x2="108" y2="72" stroke="#e8a838" stroke-width="7" stroke-linecap="round"/>
|
||||
<line x1="6" y1="100" x2="108" y2="72" stroke="#fde68a" stroke-width="2" stroke-linecap="round" opacity="0.75"/>
|
||||
|
||||
<!-- wand jewel (front tip) -->
|
||||
<circle cx="112" cy="70" r="13" fill="#f59e0b" stroke="#fff7ed" stroke-width="3"/>
|
||||
<circle cx="108" cy="66" r="4.5" fill="#fef9c3"/>
|
||||
<!-- sparkles at tip -->
|
||||
<polygon points="120,54 121.6,58.5 126,60 121.6,61.5 120,66 118.4,61.5 114,60 118.4,58.5" fill="#fef08a"/>
|
||||
<polygon points="102,56 103,59 106,60 103,61 102,64 101,61 98,60 101,59" fill="#5eead4"/>
|
||||
<circle cx="118" cy="78" r="2" fill="#bae6fd"/>
|
||||
|
||||
<!-- ===== RIDER on top of wand ===== -->
|
||||
<!-- blue cape fluttering left -->
|
||||
<path d="M38 78 C18 82, 10 98, 8 110 C22 98, 34 96, 40 92 Z" fill="#1e3a8a"/>
|
||||
<path d="M40 80 C22 88, 14 104, 12 112 C28 100, 36 98, 42 94 Z" fill="#1d4ed8"/>
|
||||
|
||||
<!-- BLUE ROBE (body sitting ON shaft) -->
|
||||
<ellipse cx="54" cy="86" rx="28" ry="22" fill="#1d4ed8"/>
|
||||
<ellipse cx="54" cy="84" rx="24" ry="18" fill="#2563eb"/>
|
||||
<!-- white trim -->
|
||||
<path d="M32 74 Q54 94 76 74" fill="none" stroke="#f8fafc" stroke-width="4" stroke-linecap="round"/>
|
||||
<path d="M36 82 Q54 98 72 82" fill="none" stroke="#e2e8f0" stroke-width="2.5" stroke-linecap="round"/>
|
||||
|
||||
<!-- green shell -->
|
||||
<ellipse cx="66" cy="92" rx="13" ry="11" fill="#16a34a"/>
|
||||
<ellipse cx="66" cy="92" rx="6" ry="5" fill="#86efac" opacity="0.75"/>
|
||||
|
||||
<!-- legs over the wand -->
|
||||
<ellipse cx="42" cy="100" rx="10" ry="7" fill="#1e40af"/>
|
||||
<ellipse cx="60" cy="102" rx="10" ry="7" fill="#1e40af"/>
|
||||
<!-- yellow feet hanging past shaft -->
|
||||
<ellipse cx="38" cy="106" rx="7" ry="4.5" fill="#fbbf24"/>
|
||||
<ellipse cx="64" cy="108" rx="7" ry="4.5" fill="#fbbf24"/>
|
||||
|
||||
<!-- left arm forward -->
|
||||
<ellipse cx="30" cy="82" rx="9" ry="7" fill="#1d4ed8"/>
|
||||
<circle cx="24" cy="78" r="5.5" fill="#fbbf24"/>
|
||||
<!-- right arm up -->
|
||||
<ellipse cx="74" cy="74" rx="9" ry="7" fill="#1d4ed8"/>
|
||||
<circle cx="80" cy="68" r="5.5" fill="#fbbf24"/>
|
||||
<circle cx="82" cy="60" r="5" fill="#38bdf8"/>
|
||||
<circle cx="81" cy="58" r="1.8" fill="#e0f2fe"/>
|
||||
|
||||
<!-- ===== HEAD ===== -->
|
||||
<ellipse cx="54" cy="50" rx="26" ry="24" fill="#fbbf24"/>
|
||||
<ellipse cx="54" cy="53" rx="21" ry="17" fill="#fcd34d"/>
|
||||
<ellipse cx="34" cy="54" rx="6" ry="4" fill="#fb923c" opacity="0.4"/>
|
||||
<ellipse cx="74" cy="54" rx="6" ry="4" fill="#fb923c" opacity="0.4"/>
|
||||
|
||||
<!-- glasses -->
|
||||
<circle cx="42" cy="50" r="10" fill="#bae6fd" fill-opacity="0.4" stroke="#0f172a" stroke-width="3"/>
|
||||
<circle cx="66" cy="50" r="10" fill="#bae6fd" fill-opacity="0.4" stroke="#0f172a" stroke-width="3"/>
|
||||
<line x1="52" y1="50" x2="56" y2="50" stroke="#0f172a" stroke-width="3"/>
|
||||
<line x1="32" y1="47" x2="24" y2="42" stroke="#0f172a" stroke-width="2.5" stroke-linecap="round"/>
|
||||
<line x1="76" y1="47" x2="84" y2="42" stroke="#0f172a" stroke-width="2.5" stroke-linecap="round"/>
|
||||
<circle cx="44" cy="50" r="3" fill="#0f172a"/>
|
||||
<circle cx="68" cy="50" r="3" fill="#0f172a"/>
|
||||
<circle cx="45.2" cy="48.8" r="1.1" fill="#fff"/>
|
||||
<circle cx="69.2" cy="48.8" r="1.1" fill="#fff"/>
|
||||
|
||||
<!-- snout + mustache -->
|
||||
<ellipse cx="54" cy="62" rx="8" ry="5" fill="#f59e0b"/>
|
||||
<path d="M36 64 Q46 74 54 70 Q62 74 72 64 Q64 72 54 74 Q44 72 36 64 Z" fill="#f8fafc"/>
|
||||
<path d="M44 66 Q54 74 64 66" fill="none" stroke="#92400e" stroke-width="2.2" stroke-linecap="round"/>
|
||||
|
||||
<!-- BLUE pointed hat -->
|
||||
<path d="M28 44 L54 2 L80 44 Z" fill="#1d4ed8"/>
|
||||
<path d="M36 44 L54 10 L72 44 Z" fill="#3b82f6" opacity="0.5"/>
|
||||
<ellipse cx="54" cy="44" rx="30" ry="8" fill="#1e40af"/>
|
||||
<ellipse cx="54" cy="42.5" rx="26" ry="5" fill="#2563eb"/>
|
||||
<ellipse cx="54" cy="44" rx="30" ry="8" fill="none" stroke="#f8fafc" stroke-width="2.2"/>
|
||||
<polygon points="54,12 55.6,16.8 60.5,18.4 55.6,20 54,24.8 52.4,20 47.5,18.4 52.4,16.8" fill="#f8fafc"/>
|
||||
<polygon points="42,22 43.1,25.2 46.2,26.4 43.1,27.6 42,30.8 40.9,27.6 37.8,26.4 40.9,25.2" fill="#fef08a"/>
|
||||
<circle cx="54" cy="4" r="6" fill="#f8fafc"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 4.9 KiB |
78
configs/decidim/bootstrap.rb
Normal file
78
configs/decidim/bootstrap.rb
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
# frozen_string_literal: true
|
||||
# Create system admin + organization + org admin. Idempotent.
|
||||
# Usage: bundle exec rails runner /code/lib/koopa_bootstrap.rb
|
||||
|
||||
host = ENV.fetch("DECIDIM_HOST", "decidim.hacktivism.ch")
|
||||
sys_email = ENV.fetch("DECIDIM_SYSTEM_EMAIL")
|
||||
sys_password = ENV.fetch("DECIDIM_SYSTEM_PASSWORD")
|
||||
admin_email = ENV.fetch("DECIDIM_ADMIN_EMAIL")
|
||||
admin_password = ENV.fetch("DECIDIM_ADMIN_PASSWORD")
|
||||
admin_name = ENV.fetch("DECIDIM_ADMIN_NAME", "hacktivism")
|
||||
org_name = ENV.fetch("DECIDIM_APPLICATION_NAME", "hacktivism")
|
||||
|
||||
sys = Decidim::System::Admin.find_or_initialize_by(email: sys_email)
|
||||
sys.password = sys_password
|
||||
sys.password_confirmation = sys_password
|
||||
sys.save!
|
||||
puts "system admin: #{sys.email}"
|
||||
|
||||
org = Decidim::Organization.find_by(host: host)
|
||||
if org.nil?
|
||||
attrs = {
|
||||
host: host,
|
||||
default_locale: ENV.fetch("DECIDIM_DEFAULT_LOCALE", "en"),
|
||||
available_locales: ENV.fetch("DECIDIM_AVAILABLE_LOCALES", "en,de,fr").split(","),
|
||||
reference_prefix: "HCK",
|
||||
time_zone: "Europe/Zurich",
|
||||
users_registration_mode: "enabled",
|
||||
force_users_to_authenticate_before_access_organization: false,
|
||||
available_authorizations: [],
|
||||
tos_version: Time.current,
|
||||
colors: {
|
||||
"primary" => "#e8a838",
|
||||
"secondary" => "#3ecfbf",
|
||||
"tertiary" => "#3d3128",
|
||||
"success" => "#16a34a",
|
||||
"warning" => "#f0d090",
|
||||
"alert" => "#e7131a"
|
||||
},
|
||||
header_snippets: %(<link rel="stylesheet" href="/hacktivism.css"><script src="/hacktivism-consent.js"></script><link rel="icon" href="/hacktivism-favicon.svg">)
|
||||
}
|
||||
name_val = { "en" => org_name, "de" => org_name, "fr" => org_name }
|
||||
desc_val = { "en" => "hacktivism participatory platform", "de" => "hacktivism Partizipationsplattform", "fr" => "plateforme participative hacktivism" }
|
||||
begin
|
||||
org = Decidim::Organization.new(attrs.merge(name: name_val, description: desc_val))
|
||||
org.save!
|
||||
rescue StandardError
|
||||
org = Decidim::Organization.new(attrs.merge(name: org_name, description: "hacktivism participatory platform"))
|
||||
org.save!
|
||||
end
|
||||
Decidim::System::CreateDefaultPages.call(org) if defined?(Decidim::System::CreateDefaultPages)
|
||||
Decidim::System::CreateDefaultContentBlocks.call(org) if defined?(Decidim::System::CreateDefaultContentBlocks)
|
||||
puts "organization created host=#{org.host}"
|
||||
else
|
||||
org.colors = {
|
||||
"primary" => "#e8a838",
|
||||
"secondary" => "#3ecfbf",
|
||||
"tertiary" => "#3d3128",
|
||||
"success" => "#16a34a",
|
||||
"warning" => "#f0d090",
|
||||
"alert" => "#e7131a"
|
||||
}
|
||||
org.header_snippets = %(<link rel="stylesheet" href="/hacktivism.css"><script src="/hacktivism-consent.js"></script><link rel="icon" href="/hacktivism-favicon.svg">)
|
||||
org.save!
|
||||
puts "organization updated host=#{org.host}"
|
||||
end
|
||||
|
||||
user = Decidim::User.find_or_initialize_by(email: admin_email, organization: org)
|
||||
user.name = admin_name
|
||||
user.nickname = admin_name.downcase.gsub(/[^a-z0-9_]/, "")[0, 20]
|
||||
user.password = admin_password
|
||||
user.password_confirmation = admin_password
|
||||
user.admin = true
|
||||
user.confirmed_at ||= Time.current
|
||||
user.tos_agreement = true
|
||||
user.accepted_tos_version = org.tos_version
|
||||
user.locale = org.default_locale
|
||||
user.save!
|
||||
puts "org admin: #{user.email}"
|
||||
132
configs/decidim/compose.yml
Normal file
132
configs/decidim/compose.yml
Normal file
|
|
@ -0,0 +1,132 @@
|
|||
# koopa-decidim — Decidim behind host Caddy on :9027
|
||||
# Docs: https://docs.decidim.org/en/develop/install/
|
||||
# Image: official pre-generated app (core modules only). No secrets in this file.
|
||||
|
||||
x-logging: &default-logging
|
||||
driver: "json-file"
|
||||
options:
|
||||
max-size: "50m"
|
||||
max-file: "4"
|
||||
|
||||
x-app-env: &app-env
|
||||
RAILS_ENV: production
|
||||
RAILS_SERVE_STATIC_FILES: "true"
|
||||
RAILS_LOG_TO_STDOUT: "true"
|
||||
DATABASE_URL: postgres://decidim:${POSTGRES_PASSWORD}@postgres:5432/decidim
|
||||
REDIS_URL: redis://redis:6379/0
|
||||
SECRET_KEY_BASE: ${SECRET_KEY_BASE}
|
||||
DECIDIM_APPLICATION_NAME: ${DECIDIM_APPLICATION_NAME:-hacktivism}
|
||||
DECIDIM_MAILER_SENDER: ${DECIDIM_MAILER_SENDER:-noreply@hacktivism.ch}
|
||||
DECIDIM_AVAILABLE_LOCALES: ${DECIDIM_AVAILABLE_LOCALES:-en,de,fr}
|
||||
DECIDIM_DEFAULT_LOCALE: ${DECIDIM_DEFAULT_LOCALE:-en}
|
||||
SMTP_ADDRESS: ${SMTP_ADDRESS:-127.0.0.1}
|
||||
SMTP_DOMAIN: ${SMTP_DOMAIN:-hacktivism.ch}
|
||||
SMTP_USERNAME: ${SMTP_USERNAME:-unused}
|
||||
SMTP_PASSWORD: ${SMTP_PASSWORD:-unused}
|
||||
SMTP_PORT: ${SMTP_PORT:-25}
|
||||
SMTP_AUTHENTICATION: ${SMTP_AUTHENTICATION:-plain}
|
||||
QUEUE_ADAPTER: ${QUEUE_ADAPTER:-sidekiq}
|
||||
|
||||
services:
|
||||
decidim:
|
||||
image: docker.io/decidim/decidim:0.30.8
|
||||
container_name: koopa-decidim
|
||||
hostname: decidim
|
||||
ports:
|
||||
- "9027:3000"
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
<<: *app-env
|
||||
volumes:
|
||||
- ./entrypoint.sh:/usr/local/bin/koopa-decidim-entrypoint.sh:ro
|
||||
- ./theme/hacktivism.rb:/code/config/initializers/hacktivism.rb:ro
|
||||
- ./theme/hacktivism.css:/code/public/hacktivism.css:ro
|
||||
- ./theme/hacktivism-consent.js:/code/public/hacktivism-consent.js:ro
|
||||
- ./bootstrap.rb:/code/lib/koopa_bootstrap.rb:ro
|
||||
- ./assets/img/logo.svg:/code/public/hacktivism-logo.svg:ro
|
||||
- ./assets/img/favicon.svg:/code/public/hacktivism-favicon.svg:ro
|
||||
- decidim-storage:/code/storage
|
||||
- decidim-uploads:/code/public/uploads
|
||||
- decidim-tmp:/code/tmp
|
||||
entrypoint: ["/bin/bash", "/usr/local/bin/koopa-decidim-entrypoint.sh"]
|
||||
command: ["bundle", "exec", "rails", "s", "-b", "0.0.0.0", "-p", "3000"]
|
||||
restart: unless-stopped
|
||||
logging: *default-logging
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_started
|
||||
labels:
|
||||
org.hacktivism.service: decidim
|
||||
org.hacktivism.host_port: "9027"
|
||||
org.hacktivism.site: decidim.hacktivism.ch
|
||||
org.hacktivism.managed_by: koopa-admin
|
||||
|
||||
sidekiq:
|
||||
image: docker.io/decidim/decidim:0.30.8
|
||||
container_name: koopa-decidim-sidekiq
|
||||
hostname: sidekiq
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
<<: *app-env
|
||||
volumes:
|
||||
- ./entrypoint.sh:/usr/local/bin/koopa-decidim-entrypoint.sh:ro
|
||||
- ./theme/hacktivism.rb:/code/config/initializers/hacktivism.rb:ro
|
||||
- decidim-storage:/code/storage
|
||||
- decidim-uploads:/code/public/uploads
|
||||
- decidim-tmp:/code/tmp
|
||||
entrypoint: ["/bin/bash", "/usr/local/bin/koopa-decidim-entrypoint.sh"]
|
||||
command: ["bundle", "exec", "sidekiq", "-C", "config/sidekiq.yml"]
|
||||
restart: unless-stopped
|
||||
logging: *default-logging
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_started
|
||||
labels:
|
||||
org.hacktivism.service: decidim
|
||||
org.hacktivism.managed_by: koopa-admin
|
||||
|
||||
postgres:
|
||||
image: docker.io/library/postgres:16-alpine
|
||||
container_name: koopa-decidim-db
|
||||
hostname: postgres
|
||||
environment:
|
||||
- POSTGRES_USER=decidim
|
||||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
|
||||
- POSTGRES_DB=decidim
|
||||
volumes:
|
||||
- decidim-db:/var/lib/postgresql/data
|
||||
restart: unless-stopped
|
||||
logging: *default-logging
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U decidim -d decidim"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 12
|
||||
labels:
|
||||
org.hacktivism.service: decidim
|
||||
org.hacktivism.managed_by: koopa-admin
|
||||
|
||||
redis:
|
||||
image: docker.io/library/redis:7-alpine
|
||||
container_name: koopa-decidim-redis
|
||||
hostname: redis
|
||||
volumes:
|
||||
- decidim-redis:/data
|
||||
restart: unless-stopped
|
||||
logging: *default-logging
|
||||
labels:
|
||||
org.hacktivism.service: decidim
|
||||
org.hacktivism.managed_by: koopa-admin
|
||||
|
||||
volumes:
|
||||
decidim-db:
|
||||
decidim-redis:
|
||||
decidim-storage:
|
||||
decidim-uploads:
|
||||
decidim-tmp:
|
||||
21
configs/decidim/container-koopa-decidim-db.service
Normal file
21
configs/decidim/container-koopa-decidim-db.service
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
# user systemd — Decidim postgres + redis
|
||||
[Unit]
|
||||
Description=Decidim postgres/redis (koopa-decidim-db)
|
||||
Wants=network-online.target
|
||||
After=network-online.target
|
||||
RequiresMountsFor=%t/containers
|
||||
|
||||
[Service]
|
||||
Environment=PODMAN_SYSTEMD_UNIT=%n
|
||||
Restart=on-failure
|
||||
RestartSec=20
|
||||
TimeoutStartSec=300
|
||||
TimeoutStopSec=120
|
||||
WorkingDirectory=/home/hernani/koopa-decidim
|
||||
ExecStart=/bin/bash -lc 'set -a && source .env && set +a && /usr/bin/podman-compose up -d postgres redis'
|
||||
ExecStop=/usr/bin/podman stop -t 30 koopa-decidim-db koopa-decidim-redis
|
||||
Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
21
configs/decidim/container-koopa-decidim.service
Normal file
21
configs/decidim/container-koopa-decidim.service
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
# user systemd — Decidim stack (app + sidekiq)
|
||||
[Unit]
|
||||
Description=Decidim stack (koopa-decidim)
|
||||
Wants=network-online.target container-koopa-decidim-db.service
|
||||
After=network-online.target container-koopa-decidim-db.service
|
||||
RequiresMountsFor=%t/containers
|
||||
|
||||
[Service]
|
||||
Environment=PODMAN_SYSTEMD_UNIT=%n
|
||||
Restart=on-failure
|
||||
RestartSec=20
|
||||
TimeoutStartSec=600
|
||||
TimeoutStopSec=120
|
||||
WorkingDirectory=/home/hernani/koopa-decidim
|
||||
ExecStart=/bin/bash -lc 'set -a && source .env && set +a && /usr/bin/podman-compose up -d'
|
||||
ExecStop=/usr/bin/podman stop -t 30 koopa-decidim koopa-decidim-sidekiq
|
||||
Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
22
configs/decidim/entrypoint.sh
Executable file
22
configs/decidim/entrypoint.sh
Executable file
|
|
@ -0,0 +1,22 @@
|
|||
#!/bin/bash
|
||||
# Wait for Postgres, migrate, then exec CMD (rails or sidekiq).
|
||||
set -euo pipefail
|
||||
|
||||
export RAILS_ENV="${RAILS_ENV:-production}"
|
||||
|
||||
echo "koopa-decidim: waiting for postgres..."
|
||||
i=0
|
||||
until bundle exec rails runner 'ActiveRecord::Base.connection.execute("SELECT 1")' >/dev/null 2>&1; do
|
||||
i=$((i + 1))
|
||||
if [ "$i" -ge 60 ]; then
|
||||
echo "koopa-decidim: postgres not ready after ${i} tries" >&2
|
||||
exit 1
|
||||
fi
|
||||
sleep 3
|
||||
done
|
||||
|
||||
echo "koopa-decidim: db:prepare"
|
||||
bundle exec rails db:prepare
|
||||
|
||||
echo "koopa-decidim: exec $*"
|
||||
exec "$@"
|
||||
10
configs/decidim/theme/hacktivism-consent.js
Normal file
10
configs/decidim/theme/hacktivism-consent.js
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
/* Essential-only consent; banner hidden via CSS. */
|
||||
(function () {
|
||||
var name = "decidim-consent";
|
||||
if (document.cookie.indexOf(name + "=") !== -1) return;
|
||||
document.cookie =
|
||||
name +
|
||||
"=" +
|
||||
encodeURIComponent(JSON.stringify({ essential: true })) +
|
||||
"; path=/; max-age=31536000; SameSite=Lax";
|
||||
})();
|
||||
98
configs/decidim/theme/hacktivism.css
Normal file
98
configs/decidim/theme/hacktivism.css
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
/* hacktivism — same palette as bonfire/git/lemmy (exchange-dark) */
|
||||
:root,
|
||||
html {
|
||||
--primary: #e8a838;
|
||||
--primary-rgb: 232, 168, 56;
|
||||
--secondary: #3ecfbf;
|
||||
--secondary-rgb: 62, 207, 191;
|
||||
--tertiary: #3d3128;
|
||||
--success: #16a34a;
|
||||
--warning: #f0d090;
|
||||
--alert: #e7131a;
|
||||
--highlight: #e8a838;
|
||||
}
|
||||
|
||||
html,
|
||||
body {
|
||||
background-color: #1a1410 !important;
|
||||
background-image:
|
||||
radial-gradient(ellipse 90% 55% at 50% 108%, rgba(26, 107, 110, 0.35) 0%, transparent 55%),
|
||||
radial-gradient(circle 420px at 12% 18%, rgba(232, 168, 56, 0.22) 0%, transparent 62%),
|
||||
linear-gradient(165deg, #2c1e14 0%, #1a1410 38%, #12181a 72%, #0e1c1e 100%) !important;
|
||||
background-attachment: fixed !important;
|
||||
color: #fff6e8 !important;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #e8a838 !important;
|
||||
}
|
||||
a:hover {
|
||||
color: #f0d090 !important;
|
||||
}
|
||||
|
||||
.title-bar,
|
||||
.main-bar,
|
||||
.navbar,
|
||||
.topbar,
|
||||
header.header,
|
||||
.main-nav,
|
||||
.footer,
|
||||
.mini-footer,
|
||||
.off-canvas,
|
||||
.sidebar {
|
||||
background-color: #14110e !important;
|
||||
color: #fff6e8 !important;
|
||||
border-color: #2a2018 !important;
|
||||
}
|
||||
|
||||
.card,
|
||||
.card__content,
|
||||
.callout,
|
||||
.flash,
|
||||
.dialog,
|
||||
.reveal,
|
||||
.accordion-item,
|
||||
.comment-thread,
|
||||
.process-header,
|
||||
.hero,
|
||||
.home-section {
|
||||
background-color: #221c16 !important;
|
||||
color: #fff6e8 !important;
|
||||
border-color: #2a2018 !important;
|
||||
}
|
||||
|
||||
.button,
|
||||
.button.primary,
|
||||
.button--sc,
|
||||
input[type="submit"].button {
|
||||
background-color: #e8a838 !important;
|
||||
border-color: #e8a838 !important;
|
||||
color: #1a1410 !important;
|
||||
}
|
||||
|
||||
.button.secondary {
|
||||
background-color: #3d3128 !important;
|
||||
border-color: #3d3128 !important;
|
||||
color: #fff6e8 !important;
|
||||
}
|
||||
|
||||
h1, h2, h3, h4, h5, h6,
|
||||
.title-bar__title,
|
||||
.card__title {
|
||||
color: #f0c86a !important;
|
||||
}
|
||||
|
||||
input,
|
||||
textarea,
|
||||
select,
|
||||
.input-group-field {
|
||||
background-color: #221c16 !important;
|
||||
color: #fff6e8 !important;
|
||||
border-color: #3d3128 !important;
|
||||
}
|
||||
|
||||
/* No third-party trackers; hide stock GDPR banner (privacy by default). */
|
||||
#dc-dialog-wrapper,
|
||||
.cookies__container {
|
||||
display: none !important;
|
||||
}
|
||||
14
configs/decidim/theme/hacktivism.rb
Normal file
14
configs/decidim/theme/hacktivism.rb
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
# frozen_string_literal: true
|
||||
# hacktivism theme + host allowlist for decidim.hacktivism.ch
|
||||
|
||||
Rails.application.config.hosts << "decidim.hacktivism.ch"
|
||||
Rails.application.config.hosts << "127.0.0.1"
|
||||
Rails.application.config.hosts << "localhost"
|
||||
|
||||
if Rails.application.config.respond_to?(:assume_ssl=)
|
||||
Rails.application.config.assume_ssl = true
|
||||
end
|
||||
|
||||
Decidim.configure do |config|
|
||||
config.enable_html_header_snippets = true if config.respond_to?(:enable_html_header_snippets=)
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue