Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .github/ci-role-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ ignored_roles:
- "n8n_runner"
- "plex_auto_languages"
- "sanity_check"
- "silo_migrate"
- "sure_worker"
14 changes: 14 additions & 0 deletions announcements.yml
Comment thread
keldian marked this conversation as resolved.
Resolved
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,17 @@ announcements:
`docker logs recyclarr` now shows JSON unless you set `server.logging.format` to `text` in `/opt/recyclarr/settings.yml`. Log files have moved from `/opt/recyclarr/logs/cli` to `/opt/recyclarr/logs/server`.

See https://recyclarr.dev/guide/upgrade-guide/v9.0/ for the full list of changes, including removed commands.

- date: "2026-12-04"
title: "Breaking Changes: Silo"
required_folder: "/opt/silo"
message: |
## Silo role update

The Silo role is available again and now deploys the single-container image, which bundles PostgreSQL and Redis. Its data is stored in `/opt/silo/config` (by default).

Existing installations must be migrated with `sb install sandbox-silo-migrate`. The regular `sb install sandbox-silo` refuses to run until this is done, so Silo never starts on an empty database. The migration copies the database and links the application folders, so the existing `postgres`, `redis`, `plugins`, `artwork` and `compat` folders in `/opt/silo` are left untouched. Once Silo works, you can delete them.

If Silo used an external PostgreSQL database through `silo_role_database_url`, keep that setting. The migration then moves only the application folders, and Silo keeps using that database. If `silo_role_database_url` points at the old `silo-postgres` container, remove it before migrating.

For further assistance, join us in Discord.
78 changes: 19 additions & 59 deletions roles/silo/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,51 +21,16 @@ silo_name: silo
silo_role_jf_enabled: false
# Toggle Audiobookshelf-compatible endpoint
silo_role_abs_enabled: false
# Key Silo uses to sign sessions and tokens
silo_role_secret_key: "{{ silo_saltbox_facts.facts.secret_key }}"

################################
# Postgres
################################

silo_role_postgres_deploy: true
silo_role_postgres_name: "{{ silo_name }}-postgres"
# If empty it will fall back to the postgres role default.
silo_role_postgres_user: ""
# If empty it will fall back to the postgres role default.
silo_role_postgres_password: ""
silo_role_postgres_docker_env_db: "silo"
silo_role_postgres_docker_image_repo: "pgvector/pgvector"
silo_role_postgres_docker_image_tag: "pg18"
silo_role_postgres_docker_shm_size: "8G"
# Skip docs
silo_role_postgres_user_lookup: "{{ lookup('role_var', '_postgres_user', role='silo', default=lookup('role_var', '_docker_env_user', role='postgres'), default_if_empty=true) }}"
# Skip docs
silo_role_postgres_password_lookup: "{{ lookup('role_var', '_postgres_password', role='silo', default=lookup('role_var', '_docker_env_password', role='postgres'), default_if_empty=true) }}"
# Skip docs
silo_role_postgres_credentials_lookup: "{{ lookup('role_var', '_postgres_user_lookup', role='silo') }}:{{ lookup('role_var', '_postgres_password_lookup', role='silo') }}"
silo_role_database_url: "postgres://{{ lookup('role_var', '_postgres_credentials_lookup', role='silo') }}@{{ lookup('role_var', '_postgres_name', role='silo') }}:5432/{{ lookup('role_var', '_postgres_docker_env_db', role='silo') }}?sslmode=disable"
silo_role_postgres_docker_healthcheck:
test:
- "CMD"
- "pg_isready"
- "-d"
- "{{ lookup('role_var', '_postgres_docker_env_db', role='silo') }}"
- "-U"
- "{{ lookup('role_var', '_postgres_user_lookup', role='silo') }}"
start_period: 20s
interval: 30s
retries: 5
timeout: 5s
silo_role_postgres_paths_folder: "{{ silo_name }}"
silo_role_postgres_paths_location: "{{ server_appdata_path }}/{{ silo_role_postgres_paths_folder }}/postgres"

################################
# Redis
################################

silo_role_redis_name: "{{ silo_name }}-redis"
silo_role_redis_docker_image_tag: "alpine"
silo_role_redis_paths_folder: "{{ silo_name }}"
silo_role_redis_paths_location: "{{ server_appdata_path }}/{{ silo_role_redis_paths_folder }}/redis"
# Connection string of an external PostgreSQL database
# Leave empty to use the database bundled in the image
silo_role_database_url: ""

################################
# Paths
Expand All @@ -76,10 +41,8 @@ silo_role_paths_location: "{{ server_appdata_path }}/{{ silo_role_paths_folder }
silo_role_paths_transcodes_location: "{{ transcodes_path }}/{{ silo_role_paths_folder }}"
silo_role_paths_folders_list:
- "{{ silo_role_paths_location }}"
- "{{ silo_role_paths_location }}/plugins"
- "{{ silo_role_paths_location }}/compat"
- "{{ silo_role_paths_transcodes_location }}"
- "{{ silo_role_paths_location }}/artwork"
- "{{ silo_role_paths_location }}/download-artifacts"
- "{{ silo_role_paths_location }}/catalog-seeds"

################################
Expand Down Expand Up @@ -152,24 +115,23 @@ silo_role_docker_image: "{{ lookup('role_var', '_docker_image_repo', role='silo'

# Envs
silo_role_docker_envs_default:
HOME: "/tmp"
MODE: "integrated"
SECRET_KEY: "{{ silo_saltbox_facts.facts.secret_key }}"
DATABASE_URL: "{{ lookup('role_var', '_database_url', role='silo') }}"
REDIS_URL: "redis://{{ lookup('role_var', '_redis_name', role='silo') }}:6379"
SILO_PLUGIN_CACHE_DIR: "/var/lib/silo/plugins"
POSTGRES_TUNE: "auto"
PUID: "{{ uid }}"
PGID: "{{ gid }}"
TZ: "{{ tz }}"
SECRET_KEY: "{{ lookup('role_var', '_secret_key', role='silo') }}"
ENABLE_REDIS: "true"
DATABASE_URL: "{{ lookup('role_var', '_database_url', role='silo')
if (lookup('role_var', '_database_url', role='silo') | trim | length > 0)
else omit }}"
silo_role_docker_envs_custom: {}
silo_role_docker_envs: "{{ lookup('role_var', '_docker_envs_default', role='silo')
| combine(lookup('role_var', '_docker_envs_custom', role='silo')) }}"

# Volumes
silo_role_docker_volumes_default:
- "{{ lookup('role_var', '_paths_location', role='silo') }}/plugins:/var/lib/silo/plugins"
- "{{ lookup('role_var', '_paths_location', role='silo') }}/compat:/var/lib/silo/compat"
- "{{ lookup('role_var', '_paths_location', role='silo') }}/config:/config"
- "{{ lookup('role_var', '_paths_transcodes_location', role='silo') }}:/tmp/silo-transcode"
- "{{ lookup('role_var', '_paths_location', role='silo') }}/artwork:/var/lib/silo/artwork"
- "{{ lookup('role_var', '_paths_location', role='silo') }}/download-artifacts:/tmp/silo-download-artifacts"
- "{{ lookup('role_var', '_paths_location', role='silo') }}/catalog-seeds:/catalog-seeds:ro"
- "/proc/meminfo:/host/proc/meminfo:ro"
- "/proc/stat:/host/proc/stat:ro"
Expand Down Expand Up @@ -256,10 +218,8 @@ silo_role_docker_networks: "{{ docker_networks_common
# Restart Policy
silo_role_docker_restart_policy: unless-stopped

# User
silo_role_docker_user: "{{ uid }}:{{ gid }}"
# Shared Memory
silo_role_docker_shm_size: "8G"

# Dependencies
silo_role_depends_on: "{{ lookup('role_var', '_postgres_name', role='silo') }},{{ lookup('role_var', '_redis_name', role='silo') }}"
silo_role_depends_on_delay: "0"
silo_role_depends_on_healthchecks: "false"
# Stop Timeout
silo_role_docker_stop_timeout: 120
114 changes: 86 additions & 28 deletions roles/silo/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,41 @@
# GNU General Public License v3.0 #
##########################################################################
---
- name: "Fail with discontinuation notice"
- name: Check for legacy Silo PostgreSQL data
ansible.builtin.stat:
path: "{{ lookup('role_var', '_paths_location', role='silo') }}/postgres/PG_VERSION"
register: silo_legacy_postgres

- name: Check for legacy Silo plugins folder
ansible.builtin.stat:
path: "{{ lookup('role_var', '_paths_location', role='silo') }}/plugins"
register: silo_legacy_plugins

- name: Check for migrated Silo PostgreSQL data
ansible.builtin.stat:
path: "{{ lookup('role_var', '_paths_location', role='silo') }}/config/postgres/data/PG_VERSION"
register: silo_migrated_postgres

- name: Check for migrated Silo plugins folder
ansible.builtin.stat:
path: "{{ lookup('role_var', '_paths_location', role='silo') }}/config/silo/plugins"
register: silo_migrated_plugins

- name: Validate Silo database URL
ansible.builtin.fail:
msg: "silo_role_database_url points at the legacy {{ lookup('role_var', '_postgres_name', role='silo', default=silo_name + '-postgres') }} container, which the single-container image replaces. Remove it from the inventory to use the bundled database."
when:
- (lookup('role_var', '_database_url', role='silo') | trim | length > 0)
- ((lookup('role_var', '_database_url', role='silo') | urlsplit('hostname')) in [(lookup('role_var', '_postgres_name', role='silo', default=silo_name + '-postgres') | lower), 'localhost', '127.0.0.1', '::1'])

- name: Validate Silo migration state
ansible.builtin.fail:
msg:
- "We are dropping Silo due to continued breaking changes upstream that we cannot keep up with."
- "See https://docs.saltbox.dev/advanced/your-own-containers for how to run it self-managed."
when: (not (continuous_integration | bool))
msg: "A legacy multi-container Silo installation was found, but it has not been migrated. Run 'sb install sandbox-silo-migrate' before installing Silo."
when:
- (silo_legacy_postgres.stat.exists or silo_legacy_plugins.stat.exists)
- (not (silo_migrated_plugins.stat.exists
if (lookup('role_var', '_database_url', role='silo') | trim | length > 0)
else silo_migrated_postgres.stat.exists))

- name: "Save Silo Saltbox facts"
saltbox_facts:
Expand All @@ -25,33 +54,62 @@
base_path: "{{ server_appdata_path }}"
register: silo_saltbox_facts

- name: Validate Silo secret key
ansible.builtin.assert:
that:
- lookup('role_var', '_secret_key', role='silo') | trim | length > 0
fail_msg: "silo_role_secret_key must not be empty."

- name: Remove existing Docker container
ansible.builtin.include_tasks: "{{ resources_tasks_path }}/docker/remove_docker_container.yml"

- name: Redis Role
ansible.builtin.include_role:
name: redis
vars:
redis_instances: ["{{ lookup('role_var', '_redis_name', role='silo') }}"]
redis_role_docker_image_tag: "{{ lookup('role_var', '_redis_docker_image_tag', role='silo') }}"
redis_role_paths_folder: "{{ lookup('role_var', '_redis_paths_folder', role='silo') }}"
redis_role_paths_location: "{{ lookup('role_var', '_redis_paths_location', role='silo') }}"
- name: Check migrated Silo database
community.docker.docker_container:
name: "{{ silo_name }}-check"
image: "{{ lookup('role_var', '_docker_image', role='silo') }}"
pull: "{{ 'always' if (lookup('role_var', '_docker_image_pull', role='silo') | bool) else 'missing' }}"
entrypoint:
- bash
- -c
- |
set -euo pipefail
pgdata=/config/postgres/data
usermod -o -u "$(stat -c %u "$pgdata")" postgres 2>/dev/null
groupmod -o -g "$(stat -c %g "$pgdata")" postgres 2>/dev/null
work="$(mktemp -d)"
chmod 0755 "$work"
install -d -o postgres -g postgres -m 0700 "$work/socket"
printf 'local all all trust\n' > "$work/hba.conf"
chown postgres:postgres "$work/hba.conf"
trap '/command/s6-setuidgid postgres pg_ctl -D "$pgdata" -s -m fast stop >/dev/null 2>&1 || true' EXIT
/command/s6-setuidgid postgres pg_ctl -D "$pgdata" -s -w -t 600 -l "$work/socket/server.log" \
-o "-c listen_addresses='' -c unix_socket_directories='$work/socket' -c hba_file='$work/hba.conf' -c archive_mode=off" start
/command/s6-setuidgid postgres psql -h "$work/socket" -U silo -d silo -XAtq -v ON_ERROR_STOP=1 \
-c "SELECT (SELECT rolname FROM pg_roles WHERE oid = 10), (SELECT count(*) FROM users)"
mounts:
- type: bind
source: "{{ lookup('role_var', '_paths_location', role='silo') }}/config"
target: /config
network_mode: none
detach: false
cleanup: true
keep_volumes: false
container_default_behavior: compatibility
tls_hostname: localhost
register: silo_migrated_database
changed_when: false
failed_when: false
when:
- (silo_legacy_postgres.stat.exists or silo_legacy_plugins.stat.exists)
- (lookup('role_var', '_database_url', role='silo') | trim | length == 0)

- name: "Import Postgres Role"
ansible.builtin.include_role:
name: postgres
vars:
postgres_instances: ["{{ lookup('role_var', '_postgres_name', role='silo') }}"]
postgres_role_docker_image_repo: "{{ lookup('role_var', '_postgres_docker_image_repo', role='silo') }}"
postgres_role_docker_image_tag: "{{ lookup('role_var', '_postgres_docker_image_tag', role='silo') }}"
postgres_role_docker_shm_size: "{{ lookup('role_var', '_postgres_docker_shm_size', role='silo') }}"
postgres_role_paths_folder: "{{ lookup('role_var', '_postgres_paths_folder', role='silo') }}"
postgres_role_paths_location: "{{ lookup('role_var', '_postgres_paths_location', role='silo') }}"
postgres_role_docker_env_db: "{{ lookup('role_var', '_postgres_docker_env_db', role='silo') }}"
postgres_role_docker_env_user_include: "{{ lookup('role_var', '_postgres_user', role='silo') }}"
postgres_role_docker_env_password_include: "{{ lookup('role_var', '_postgres_password', role='silo') }}"
postgres_role_docker_healthcheck: "{{ lookup('role_var', '_postgres_docker_healthcheck', role='silo') }}"
when: lookup('role_var', '_postgres_deploy', role='silo')
- name: Validate migrated Silo database
ansible.builtin.fail:
msg: "The migrated Silo database in {{ lookup('role_var', '_paths_location', role='silo') }}/config/postgres is incomplete or has no users. Run 'sb install sandbox-silo-migrate' to complete the migration."
when:
- (silo_legacy_postgres.stat.exists or silo_legacy_plugins.stat.exists)
- (lookup('role_var', '_database_url', role='silo') | trim | length == 0)
- (((silo_migrated_database.status | default(1)) != 0) or (not ((silo_migrated_database.container.Output | default('') | trim | split('\n') | last) is match('silo[|][1-9][0-9]*$'))))

- name: Add DNS record
ansible.builtin.include_tasks: "{{ resources_tasks_path }}/dns/tasker.yml"
Expand Down
61 changes: 61 additions & 0 deletions roles/silo_migrate/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
##########################################################################
# Title: Sandbox: Silo Migrate | Default Variables #
# Author(s): After-Shock #
# URL: https://github.com/saltyorg/Sandbox #
# -- #
##########################################################################
# GNU General Public License v3.0 #
##########################################################################
---
################################
# Basics
################################

silo_migrate_name: silo-migrate

################################
# Settings
################################

# Whether the legacy Silo installation deployed its own PostgreSQL container
silo_migrate_role_postgres_deploy: "{{ lookup('role_var', '_postgres_deploy', role='silo', default=true) }}"
# Skip docs
silo_migrate_role_validation_query: "SELECT (SELECT count(*) FROM users), (SELECT count(*) FROM media_items), (SELECT count(*) FROM user_watch_history), (SELECT count(*) FROM user_watch_progress)"

################################
# Postgres
################################

silo_migrate_role_postgres_name: "{{ lookup('role_var', '_postgres_name', role='silo', default=silo_name + '-postgres') }}"
silo_migrate_role_postgres_user: "{{ lookup('role_var', '_postgres_user', role='silo', default='') }}"
silo_migrate_role_postgres_password: "{{ lookup('role_var', '_postgres_password', role='silo', default='') }}"
# Skip docs
silo_migrate_role_postgres_user_lookup: "{{ lookup('role_var', '_postgres_user', role='silo_migrate', default=lookup('role_var', '_docker_env_user', role='postgres'), default_if_empty=true) }}"
silo_migrate_role_postgres_docker_env_db: "{{ lookup('role_var', '_postgres_docker_env_db', role='silo', default='silo') }}"
silo_migrate_role_postgres_docker_image_repo: "{{ lookup('role_var', '_postgres_docker_image_repo', role='silo', default='pgvector/pgvector') }}"
silo_migrate_role_postgres_docker_image_tag: "{{ lookup('role_var', '_postgres_docker_image_tag', role='silo', default='pg18') }}"
silo_migrate_role_postgres_docker_shm_size: "{{ lookup('role_var', '_postgres_docker_shm_size', role='silo', default='8G') }}"
silo_migrate_role_postgres_docker_healthcheck:
test:
- "CMD"
- "pg_isready"
- "-d"
- "{{ lookup('role_var', '_postgres_docker_env_db', role='silo_migrate') }}"
- "-U"
- "{{ lookup('role_var', '_postgres_user_lookup', role='silo_migrate') }}"
start_period: 20s
interval: 30s
retries: 5
timeout: 5s
silo_migrate_role_postgres_paths_folder: "{{ lookup('role_var', '_postgres_paths_folder', role='silo', default=silo_name) }}"
silo_migrate_role_postgres_paths_location: "{{ lookup('role_var', '_postgres_paths_location', role='silo', default=server_appdata_path + '/' + lookup('role_var', '_postgres_paths_folder', role='silo_migrate') + '/postgres') }}"
# Connection string of an external PostgreSQL database used by the legacy Silo installation
silo_migrate_role_database_url: "{{ lookup('role_var', '_database_url', role='silo', default='') }}"
# Skip docs
silo_migrate_role_database_external_lookup: "{{ lookup('role_var', '_database_url', role='silo_migrate') | trim | length > 0 }}"

################################
# Redis
################################

silo_migrate_role_redis_name: "{{ lookup('role_var', '_redis_name', role='silo', default=silo_name + '-redis') }}"
Loading