Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
115 commits
Select commit Hold shift + click to select a range
2f7a103
add vagrant to test script
davidbeig Oct 16, 2025
f0d9789
add compose files
davidbeig Oct 16, 2025
8940ca0
add initial scripts
davidbeig Oct 16, 2025
fc2ca20
generate SECRET_KEY_BASE
davidbeig Oct 16, 2025
51f9238
add memory to Vagrant
davidbeig Oct 21, 2025
38fc814
add traefik domain and fix default decidim_image
davidbeig Oct 21, 2025
32e3f9b
add pull_policy always to worker
davidbeig Oct 21, 2025
e9d262e
add storage to handle volume in app if not bucket
davidbeig Oct 21, 2025
5181c5f
change how to handle repository path
davidbeig Oct 21, 2025
fe067ac
add migration execution on app entrypoint
davidbeig Oct 21, 2025
1e9a000
fix up script to handle local database and local storage
davidbeig Oct 21, 2025
e0b7bd5
change local database to generate user, password and database name
davidbeig Oct 21, 2025
ca858ad
add script to generate gemfiles
davidbeig Oct 23, 2025
f2955bd
add alpine versions for cache and db
davidbeig Oct 23, 2025
32009ec
generate vapid keys
davidbeig Oct 29, 2025
97c3ffb
make docker script exit after installing
davidbeig Oct 29, 2025
acc8327
pull decidim image when deciding version
davidbeig Oct 29, 2025
4035540
git clone repository to repository path
davidbeig Oct 29, 2025
e550ea6
fix on decidim version script
davidbeig Oct 29, 2025
be2ca79
change docker installation process
davidbeig Oct 29, 2025
174af9e
fix on variable assignment
davidbeig Oct 29, 2025
434d6ba
fix use of variable
davidbeig Oct 29, 2025
4917f61
add volumes for Gemfile.wrapper and Gemfile.local
davidbeig Oct 30, 2025
a47284b
read from /dev/tty
davidbeig Nov 13, 2025
c0168d1
check before deleting .env file
davidbeig Nov 24, 2025
1773cf8
ask before openning ports
davidbeig Nov 24, 2025
03553cd
fix parameters passed to docker compose
davidbeig Nov 24, 2025
dc42a99
don't exit on open_ports script
davidbeig Nov 24, 2025
5c15d5d
fix volumes on app.yml
davidbeig Nov 24, 2025
fa87b32
change bash errors
davidbeig Nov 24, 2025
4cad4c7
update traefik version
davidbeig Nov 24, 2025
4c2ca22
fix use of sidekiq_entrypoint
davidbeig Nov 24, 2025
7921196
fix on entrypoints paths
davidbeig Nov 24, 2025
6cc99b8
make scripts executable
davidbeig Nov 24, 2025
add55e3
make entrypoints execute bundle install
davidbeig Nov 24, 2025
2feb6f7
remove sudo from entrypoints
davidbeig Nov 24, 2025
a30dcb5
change database env variables
davidbeig Nov 24, 2025
9ddd38f
change password generated base
davidbeig Nov 24, 2025
0adb8ed
update composes
davidbeig Nov 24, 2025
a144c41
fix commands
davidbeig Nov 24, 2025
1408e79
fix reference passed to exec
davidbeig Nov 24, 2025
87796f2
remove network mode
davidbeig Nov 24, 2025
59c7f59
move scripts and add action to build release zip
davidbeig Nov 26, 2025
74c7c9c
move scripts to install folder
davidbeig Nov 26, 2025
907f171
add log debug to traefik
davidbeig Nov 27, 2025
fb9d9fa
exit if not a correct distribution
davidbeig Nov 27, 2025
b1e12ff
add container name
davidbeig Nov 27, 2025
94a9f10
add keys for s3-compatible buckets
davidbeig Nov 27, 2025
5c206ee
script to create system admin
davidbeig Nov 27, 2025
4fdfe3e
add redis_url env
davidbeig Nov 27, 2025
661dacb
remove env for system admin
davidbeig Nov 27, 2025
783c6fd
unify composes
davidbeig Nov 27, 2025
cc10b73
some fixes
davidbeig Nov 27, 2025
c480654
add certificates and make worker wait for app first
davidbeig Nov 28, 2025
fd55517
fixes on aws variables
davidbeig Nov 28, 2025
6cd940b
remove wait for healthy
davidbeig Dec 3, 2025
df615ea
add interactivity to some missing commands
davidbeig Dec 3, 2025
5d3a4f7
update README
davidbeig Dec 9, 2025
a7d459c
clean up a bit
davidbeig Dec 9, 2025
2100eb9
add sidekiq config
davidbeig Dec 11, 2025
f828cdb
add some readme documentation
davidbeig Dec 11, 2025
9a4fc1d
shell linting
davidbeig Dec 11, 2025
553c013
remove vagrantfile
davidbeig Dec 16, 2025
a65ab0b
improve messages to choose decidim version
davidbeig Dec 16, 2025
5ec5764
add more context to vapid and export vars
davidbeig Dec 16, 2025
712467f
change check of decidim running to create system admin
davidbeig Dec 16, 2025
6750e1c
Improve messages and flow of docker installation
davidbeig Dec 16, 2025
dccb70b
change messages of up.sh
davidbeig Dec 16, 2025
26ebc1f
add new messages and bash fixes
davidbeig Dec 16, 2025
e581b92
refactor and add maps envs
davidbeig Dec 16, 2025
b23a5ad
remove env var
davidbeig Dec 16, 2025
5344a7b
shellcheck fixes
davidbeig Dec 16, 2025
d83e3c9
shellcheck 1091
davidbeig Dec 16, 2025
3931590
disable sc1091
davidbeig Dec 16, 2025
96ac72f
fixes on certs and health_check
davidbeig Dec 18, 2025
7aa5159
update release zip url
davidbeig Dec 18, 2025
5fa1536
improve and fix zip download
davidbeig Dec 18, 2025
75b462c
force overrite of extracted files
davidbeig Dec 22, 2025
94513a0
add minor improvements
davidbeig Dec 22, 2025
4a665e0
remove pull_policy
davidbeig Dec 22, 2025
9e7b7b8
open ports by default
davidbeig Dec 22, 2025
4e8a722
remove option to change decidim version, only install latest
davidbeig Dec 22, 2025
fc3ed3a
automatically create system password
davidbeig Dec 22, 2025
02ac09f
fix generate system
davidbeig Jan 7, 2026
b951095
fix typos
davidbeig Jan 22, 2026
3a84f5b
Update install/scripts/entrypoint.sh
davidbeig Jan 22, 2026
2bce55a
Update install/install.sh
davidbeig Jan 22, 2026
fc9dd76
Update install/up.sh
davidbeig Jan 22, 2026
8cf9f5a
Update install/install.sh
davidbeig Jan 22, 2026
b9e5941
Update install/up.sh
davidbeig Jan 22, 2026
f698509
Update install/install.sh
davidbeig Jan 22, 2026
c18e59e
Update install/dependencies/build_env.sh
davidbeig Jan 22, 2026
47b2a83
Update install/dependencies/os_version.sh
davidbeig Jan 22, 2026
36720e7
Update install/dependencies/generate_vapid_keys.sh
davidbeig Jan 22, 2026
1107d92
Update install/dependencies/build_env.sh
davidbeig Jan 22, 2026
1d81403
apply fixes by coderabbit
davidbeig Jan 22, 2026
66e0d91
more fixes
davidbeig Jan 22, 2026
468432b
add install readme
davidbeig Jan 22, 2026
4da520b
fix typos in readme
davidbeig Jan 23, 2026
163681e
apply some coderabbit suggestions
davidbeig Feb 4, 2026
e362604
change references
davidbeig Feb 4, 2026
bddeaba
Update install/README.md
davidbeig Feb 5, 2026
6c5faaf
Apply suggestions from code review
davidbeig Feb 26, 2026
1e621f0
Apply suggestions from code review
davidbeig Feb 26, 2026
0319ea1
apply more coderabbit fixes
davidbeig Feb 26, 2026
a654986
fixes on sidekiq
davidbeig Feb 26, 2026
0b3d38b
make sidekiq default queu for decidim
davidbeig Feb 26, 2026
e545a1e
add decidim mailer sender env
davidbeig Feb 26, 2026
cde0cce
changes in bundle of deploy.zip
davidbeig Feb 26, 2026
7fcc8ec
remove zip file
davidbeig Mar 2, 2026
d68fa40
add schedule.yml and invoke_rake_task_job
davidbeig Mar 3, 2026
c899e0b
add readme info about schedule.yml
davidbeig Mar 3, 2026
71d0296
change scheduled job
davidbeig Mar 3, 2026
a07e2bc
remove duplicated sidekiq gem
davidbeig Mar 3, 2026
e72e3b8
remove reference to hello-world.sh
davidbeig Mar 3, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 77 additions & 0 deletions Vagrantfile
Comment thread
davidbeig marked this conversation as resolved.
Outdated
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
# https://docs.vagrantup.com.

# Every Vagrant development environment requires a box. You can search for
# boxes at https://vagrantcloud.com/search.
config.vm.box = "debian/bookworm64"

# Disable automatic box update checking. If you disable this, then
# boxes will only be checked for updates when the user runs
# `vagrant box outdated`. This is not recommended.
# config.vm.box_check_update = false

# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.
# NOTE: This will enable public access to the opened port
config.vm.network "forwarded_port", guest: 80, host: 8080

# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine and only allow access
# via 127.0.0.1 to disable public access
# config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1"

# Create a private network, which allows host-only access to the machine
# using a specific IP.
# config.vm.network "private_network", ip: "192.168.33.10"

# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on
# your network.
# config.vm.network "public_network"

# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
# config.vm.synced_folder "../data", "/vagrant_data"

# Disable the default share of the current code directory. Doing this
# provides improved isolation between the vagrant box and your host
# by making sure your Vagrantfile isn't accessible to the vagrant box.
# If you use this you may want to enable additional shared subfolders as
# shown above.
# config.vm.synced_folder ".", "/vagrant", disabled: true

# Provider-specific configuration so you can fine-tune various
# backing providers for Vagrant. These expose provider-specific options.
# Example for VirtualBox:
#
# config.vm.provider "virtualbox" do |vb|
# # Display the VirtualBox GUI when booting the machine
# vb.gui = true
#
# # Customize the amount of memory on the VM:
# vb.memory = "1024"
# end
#
# View the documentation for the provider you are using for more
# information on available options.

# Enable provisioning with a shell script. Additional provisioners such as
# Ansible, Chef, Docker, Puppet and Salt are also available. Please see the
# documentation for more information about their specific syntax and use.
# config.vm.provision "shell", inline: <<-SHELL
# apt-get update
# apt-get install -y apache2
# SHELL
end
44 changes: 44 additions & 0 deletions app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
services:
app:
container_name: decidim
image: ${DECIDIM_IMAGE}
command: "bin/rails server -b 0.0.0.0"
volumes:
- ./storage:/app/storage
restart: always
labels:
- "traefik.enable=true"
- "traefik.http.routers.app.rule=PathPrefix(`/`)"
- "traefik.http.routers.app.entrypoints=web"
- "traefik.http.services.app.loadbalancer.server.port=3000"
env_file:
- .env
environment:
- DATABASE_URL
- SECRET_KEY_BASE
- DECIDIM_FORCE_SSL=${DECIDIM_FORCE_SSL:-false}
- QUEUE_ADAPTER=${QUEUE_ADAPTER:-sidekiq}
- REDIS_URL=${REDIS_URL:-redis://redis:6379/0}
- WEB_CONCURRENCY=${WEB_CONCURRENCY:-2}
- LOG_LEVEL=${LOG_LEVEL:-info}
- DECIDIM_ENABLE_HTML_HEADER_SNIPPETS
- DECIDIM_ADMIN_PASSWORD_EXPIRATION_DAYS=${DECIDIM_ADMIN_PASSWORD_EXPIRATION_DAYS:-360}
- CHANGE_ACTIVE_STEP=${CHANGE_ACTIVE_STEP:-enabled}
- SEND_REMINDERS=${SEND_REMINDERS:-enabled}
- WEEKLY_NOTIFICATIONS_DIGEST=${WEEKLY_NOTIFICATIONS_DIGEST:-enabled}
- DAILY_NOTIFICATIONS_DIGEST=${DAILY_NOTIFICATIONS_DIGEST:-enabled}
- HEALTHCHECK_EXCLUDE_CHECKS=${HEALTHCHECK_EXCLUDE_CHECKS:-emailconf}
- SMTP_STARTTLS_AUTO=${SMTP_STARTTLS_AUTO:-true}
- SMTP_USERNAME
- SMTP_PASSWORD
- SMTP_ADDRESS
- SMTP_DOMAIN
- SMTP_PORT
- DECIDIM_MAILER_SENDER
- MAPS_API_KEY
- MAPS_PROVIDER=${MAPS_PROVIDER:-here}
- RACK_ATTACK_SECRET
depends_on:
- db
- cache

11 changes: 11 additions & 0 deletions cache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
services:
app:
depends_on:
- cache
cache:
image: redis
volumes:
- redis_data:/data
restart: always
volumes:
redis_data: {}
12 changes: 12 additions & 0 deletions db.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
services:
app:
depends_on:
- db
db:
image: postgres:17
env_file:
- .env
environment:
POSTGRES_USER: ${POSTGRES_USER:-decidim}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-decidim}
POSTGRES_DB: ${POSTGRES_DB:-decidim}
102 changes: 102 additions & 0 deletions scripts/dependencies/build_env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
#!/bin/bash
set -e # exit on error

BUILD_ENV_PATH="$REPOSITORY_PATH/.env"

echo "───────────────────────────────────────────────"
echo "📦 Now we need to get some information about the instance you are building."
echo
read -p "What are you going to name your instance? " DECIDIM_APPLICATION_NAME
echo "The name of the instance is: $DECIDIM_APPLICATION_NAME"
echo
echo "Who's going to administer this instance?"
read -p "email: " DECIDIM_SYSTEM_ADMIN_EMAIL
read -p "name: " DECIDIM_SYSTEM_ADMIN_NAME
echo "The administrator will be $DECIDIM_SYSTEM_ADMIN_NAME, $DECIDIM_SYSTEM_ADMIN_EMAIL"
echo
echo "Now we need to know how people will access this instance (e.g., decidim.example.org)"
read -p "domain: " DECIDIM_DOMAIN

echo "───────────────────────────────────────────────"
echo "To set up the Database we also need some information"
read -p "Do you have an external database already set up? [y/N] " yn

case $yn in
[Yy]*)
EXTERNAL_DATABASE=true
;;
[Nn]*)
EXTERNAL_DATABASE=false
;;
*)
echo "Please answer yes or no."
exit 1
;;
esac

read -p "Name of the database: " DATABASE_NAME
read -p "Database user: " DATABASE_USER

if [ "$EXTERNAL_DATABASE" = true ]; then
read -p "Database host (ip or domain): " DATABASE_HOST
else
DATABASE_HOST="db"
fi

read -p "Database password: " DATABASE_PASSWORD

DATABASE_URL="postgres://$DATABASE_USER:$DATABASE_PASSWORD@$DATABASE_HOST/$DATABASE_NAME"

echo "───────────────────────────────────────────────"
echo "Now we have to set your SMTP server."
echo "You can check the documentation to know what to do here."
read -p "SMTP_USERNAME: " SMTP_USERNAME
read -p "SMTP_PASSWORD: " SMTP_PASSWORD
read -p "SMTP_ADDRESS: " SMTP_ADDRESS
read -p "SMTP_DOMAIN: " SMTP_DOMAIN

echo "───────────────────────────────────────────────"
echo "To start, we are going to store assets locally"
read -p "Do you have an external bucket [y/N] " yn
STORAGE="local"

echo "───────────────────────────────────────────────"
echo "To be able to have the maps working inside the Decidim application,"
echo "is necessary to configure a maps provider."
read -p "Maps provider: " MAPS_PROVIDER
read -p "Maps API KEY: " MAPS_API_KEY

if [ -f .env ]; then
echo "❌ Failing: .env file already exists."
exit 1
else
echo "✅ Writing the environment variables to .env file..."

SECRET_KEY_BASE=$(openssl rand -hex 64)

cat >.env <<EOF
DECIDIM_IMAGE=$DECIDIM_IMAGE
DECIDIM_APPLICATION_NAME="$DECIDIM_APPLICATION_NAME"
DECIDIM_SYSTEM_ADMIN_EMAIL="$DECIDIM_SYSTEM_ADMIN_EMAIL"
DECIDIM_SYSTEM_ADMIN_NAME="$DECIDIM_SYSTEM_ADMIN_NAME"
DECIDIM_DOMAIN="$DECIDIM_DOMAIN"

SECRET_KEY_BASE=$SECRET_KEY_BASE

POSTGRES_DB="$DATABASE_NAME"
POSTGRES_NAME="$DATABASE_USER"
DATABASE_HOST="$DATABASE_HOST"
POSTGRES_PASSWORD="$DATABASE_PASSWORD"
DATABASE_URL="$DATABASE_URL"

SMTP_USERNAME="$SMTP_USERNAME"
SMTP_PASSWORD="$SMTP_PASSWORD"
SMTP_ADDRESS="$SMTP_ADDRESS"
SMTP_DOMAIN="$SMTP_DOMAIN"

MAPS_PROVIDER="$MAPS_PROVIDER"
MAPS_API_KEY="$MAPS_API_KEY"
EOF
fi

echo "✅ All environment variables saved to .env successfully!"
24 changes: 24 additions & 0 deletions scripts/dependencies/check_docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash

if ! command -v docker; then
echo "Installing docker..."

# Add Docker's official GPG key:
sudo apt update && sudo apt upgrade -y
sudo apt-get install -y ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

# Add the repository to Apt sources:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" |
sudo tee /etc/apt/sources.list.d/docker.list >/dev/null
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
else
echo "Docker is installed $(docker --version)"
fi

sudo usermod -aG docker ${USER}
17 changes: 17 additions & 0 deletions scripts/dependencies/decidim_version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
echo "───────────────────────────────────────────────"
echo "📦 What version of Decidim do you want to use?"
echo
echo "The default image is: decidim/decidim:latest"
echo
echo "You can also specify a custom image, for example:"
echo " • decidim/decidim:0.30"
echo " • ghcr.io/decidim/decidim:0.28"
echo " • ghcr.io/my-org/custom-decidim:1.0.0"
echo
read -p "👉 Enter the Decidim image (or press Enter to use the default): " DECIDIM_IMAGE

# Use default if none entered
DECIDIM_IMAGE=${DECIDIM_IMAGE:-decidim/decidim:latest}

echo "✅ Using Decidim image: $DECIDIM_IMAGE"
echo "───────────────────────────────────────────────"
17 changes: 17 additions & 0 deletions scripts/dependencies/open_ports.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
echo "───────────────────────────────────────────────"
echo "Now we are going to open the necessary ports for Decidim to work."
echo
echo "To handle the SSL certificate we will have to open the port 80 and the port 443"
echo

if ! command -v ufw; then
echo "UFW nos intalled. We are going to install it to allow openning ports 80 and 443 on this machine."
sudo apt install ufw
fi

sudo ufw allow 22
sudo ufw allow 80
sudo ufw allow 443
sudo ufw enable

echo "───────────────────────────────────────────────"
9 changes: 9 additions & 0 deletions scripts/dependencies/os_version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

if [ ! -f /etc/os-release ]; then
echo "Error: Unable to determine OS. /etc/os-release file not found."
echo "Installation stopped."
exit 1
fi

cat /etc/os-release
6 changes: 3 additions & 3 deletions scripts/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ USER_GID=$(stat -c %g /code/Gemfile)
export USER_UID
export USER_GID

usermod -u "$USER_UID" decidim 2> /dev/null
groupmod -g "$USER_GID" decidim 2> /dev/null
usermod -g "$USER_GID" decidim 2> /dev/null
usermod -u "$USER_UID" decidim 2>/dev/null
groupmod -g "$USER_GID" decidim 2>/dev/null
usermod -g "$USER_GID" decidim 2>/dev/null

chown -R -h "$USER_UID" "$BUNDLE_PATH"
chgrp -R -h "$USER_GID" "$BUNDLE_PATH"
Expand Down
Loading