2026-AUG-29
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
identity_providers:
|
||||
oidc:
|
||||
claims_policies:
|
||||
romm:
|
||||
id_token:
|
||||
- 'email'
|
||||
- 'email_verified'
|
||||
- 'alt_emails'
|
||||
- 'preferred_username'
|
||||
- 'name'
|
||||
- 'groups'
|
||||
clients:
|
||||
# https://www.authelia.com/integration/openid-connect/clients/romm/
|
||||
- client_id: 'romm'
|
||||
claims_policy: 'romm'
|
||||
client_name: 'romm'
|
||||
consent_mode: 'implicit'
|
||||
client_secret: ''
|
||||
public: false
|
||||
authorization_policy: 'one_factor'
|
||||
require_pkce: false
|
||||
pkce_challenge_method: ''
|
||||
redirect_uris:
|
||||
- 'https://romm.example.com/api/oauth/openid'
|
||||
scopes:
|
||||
- 'openid'
|
||||
- 'groups'
|
||||
- 'profile'
|
||||
- 'email'
|
||||
response_types:
|
||||
- 'code'
|
||||
grant_types:
|
||||
- 'authorization_code'
|
||||
access_token_signed_response_alg: 'none'
|
||||
userinfo_signed_response_alg: 'none'
|
||||
token_endpoint_auth_method: 'client_secret_basic'
|
||||
@@ -0,0 +1,15 @@
|
||||
services:
|
||||
romm:
|
||||
domain:
|
||||
public: "romm"
|
||||
internal: "romm.app"
|
||||
ports:
|
||||
http: "8002"
|
||||
redis: "6384"
|
||||
subuid: "100999"
|
||||
dependency:
|
||||
web: "app-public"
|
||||
db: "postgresql"
|
||||
version:
|
||||
containers:
|
||||
romm: "5.1.0"
|
||||
@@ -0,0 +1,80 @@
|
||||
[Quadlet]
|
||||
DefaultDependencies=false
|
||||
|
||||
[Unit]
|
||||
Description=RomM
|
||||
|
||||
After=redis_romm.service
|
||||
Wants=redis_romm.service
|
||||
|
||||
[Container]
|
||||
Image=docker.io/rommapp/romm:{{ version['containers']['romm'] }}
|
||||
ContainerName=romm
|
||||
HostName=romm
|
||||
|
||||
PublishPort={{ services['romm']['ports']['http'] }}:8080/tcp
|
||||
|
||||
# Volumes
|
||||
Volume=%h/data/containers/romm/library:/romm/library:rw
|
||||
Volume=%h/data/containers/romm/resources:/romm/resources:rw
|
||||
Volume=%h/data/containers/romm/assets:/romm/assets:rw
|
||||
Volume=%h/containers/romm/ssl:/etc/ssl/romm:ro
|
||||
|
||||
# General
|
||||
Environment="TZ={{ timezone }}"
|
||||
Environment="ROMM_BASE_URL=https://{{ services['romm']['domain']['public'] }}.{{ domain['public'] }}"
|
||||
Environment="DISABLE_SETUP_WIZARD=true"
|
||||
Environment="DISABLE_USERPASS_LOGIN=true"
|
||||
|
||||
# Secrets
|
||||
Secret=ROMM_AUTH_SECRET_KEY,type=env,target=ROMM_AUTH_SECRET_KEY
|
||||
|
||||
# Database
|
||||
Environment="ROMM_DB_DRIVER=postgresql"
|
||||
Environment="DB_HOST={{ services['postgresql']['domain']['internal'] }}.{{ domain['internal'] }}"
|
||||
Environment="DB_PORT={{ services['postgresql']['ports']['tcp'] }}"
|
||||
Environment="DB_NAME=romm_db"
|
||||
Environment="DB_USER=romm"
|
||||
Environment="PGSSLMODE=verify-full"
|
||||
Environment="PGSSLROOTCERT=/etc/ssl/romm/{{ root_cert_filename }}"
|
||||
Secret=ROMM_DATABASE_PASSWORD,type=env,target=DB_PASSWD
|
||||
|
||||
# Redis
|
||||
Environment="REDIS_HOST=host.containers.internal"
|
||||
Environment="REDIS_PORT={{ services['romm']['ports']['redis'] }}"
|
||||
|
||||
# OIDC
|
||||
Environment="OIDC_ENABLED=true"
|
||||
Environment="OIDC_PROVIDER=authelia"
|
||||
Environment="OIDC_CLIENT_ID=romm"
|
||||
Environment="OIDC_REDIRECT_URI=https://{{ services['romm']['domain']['public'] }}.{{ domain['public'] }}/api/oauth/openid"
|
||||
Environment="OIDC_SERVER_APPLICATION_URL=https://{{ services['authelia']['domain']['public'] }}.{{ domain['public'] }}"
|
||||
Environment="OIDC_USERNAME_ATTRIBUTE=preferred_username"
|
||||
Environment="OIDC_ALLOW_REGISTRATION=true"
|
||||
Environment="OIDC_CLAIM_ROLES=groups"
|
||||
Environment="OIDC_ROLE_ADMIN=admins"
|
||||
Environment="OIDC_ROLE_VIEWER=users"
|
||||
Environment="OIDC_AUTOLOGIN=false"
|
||||
Secret=ROMM_OIDC_CLIENT_SECRET,type=env,target=OIDC_CLIENT_SECRET
|
||||
|
||||
# Players
|
||||
Environment="DISABLE_EMULATOR_JS=false"
|
||||
Environment="DISABLE_RUFFLE_RS=false"
|
||||
|
||||
# Metadata
|
||||
Environment="HASHEOUS_API_ENABLED=true"
|
||||
#Environment="PLAYMATCH_API_ENABLED=true"
|
||||
|
||||
# Optional
|
||||
Environment="LOGLEVEL=INFO"
|
||||
Environment="DISABLE_LOGS_VIEWER=true"
|
||||
|
||||
[Service]
|
||||
ExecStartPre=/usr/bin/nc -zv {{ services['postgresql']['domain']['internal'] }}.{{ domain['internal'] }} {{ services['postgresql']['ports']['tcp'] }}
|
||||
|
||||
Restart=always
|
||||
RestartSec=10s
|
||||
TimeoutStopSec=120
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
@@ -0,0 +1,8 @@
|
||||
postgresql:
|
||||
password:
|
||||
romm: ""
|
||||
romm:
|
||||
secret_key: ""
|
||||
oidc:
|
||||
secret: ""
|
||||
hash: ""
|
||||
@@ -0,0 +1,146 @@
|
||||
---
|
||||
- name: Set redis service name
|
||||
ansible.builtin.set_fact:
|
||||
redis_service: "romm"
|
||||
|
||||
- name: Create redis_romm directory
|
||||
ansible.builtin.file:
|
||||
path: "{{ node['home_path'] }}/{{ item }}"
|
||||
state: "directory"
|
||||
owner: "{{ services['redis']['subuid'] }}"
|
||||
group: "{{ node['group'] }}"
|
||||
mode: "0770"
|
||||
loop:
|
||||
- "containers/redis"
|
||||
- "containers/redis/{{ redis_service }}"
|
||||
- "containers/redis/{{ redis_service }}/data"
|
||||
become: true
|
||||
|
||||
- name: Deploy redis config file
|
||||
ansible.builtin.template:
|
||||
src: "{{ hostvars['console']['node']['config_path'] }}/services/containers/app/redis/redis.conf.j2"
|
||||
dest: "{{ node['home_path'] }}/containers/redis/{{ redis_service }}/redis.conf"
|
||||
owner: "{{ ansible_user }}"
|
||||
group: "{{ node['group'] }}"
|
||||
mode: "0644"
|
||||
register: "is_redis_conf"
|
||||
|
||||
- name: Deploy redis container file
|
||||
ansible.builtin.template:
|
||||
src: "{{ hostvars['console']['node']['config_path'] }}/services/containers/app/redis/redis.container.j2"
|
||||
dest: "{{ node['home_path'] }}/.config/containers/systemd/redis_{{ redis_service }}.container"
|
||||
owner: "{{ ansible_user }}"
|
||||
group: "{{ node['group'] }}"
|
||||
mode: "0644"
|
||||
register: "is_redis_containerfile"
|
||||
|
||||
- name: Enable (Restart) redis service
|
||||
ansible.builtin.systemd:
|
||||
name: "redis_{{ redis_service }}.service"
|
||||
state: "restarted"
|
||||
enabled: true
|
||||
daemon_reload: true
|
||||
scope: "user"
|
||||
when: is_redis_conf.changed or is_redis_containerfile.changed # noqa: no-handler
|
||||
|
||||
- name: Create romm directory
|
||||
ansible.builtin.file:
|
||||
path: "{{ node['home_path'] }}/{{ item }}"
|
||||
state: "directory"
|
||||
owner: "{{ services['romm']['subuid'] }}"
|
||||
group: "{{ node['group'] }}"
|
||||
mode: "0770"
|
||||
loop:
|
||||
- "data/containers/romm"
|
||||
- "data/containers/romm/library"
|
||||
- "data/containers/romm/resources"
|
||||
- "data/containers/romm/assets"
|
||||
- "containers/romm"
|
||||
- "containers/romm/ssl"
|
||||
become: true
|
||||
|
||||
- name: Deploy root certificate
|
||||
ansible.builtin.copy:
|
||||
content: |
|
||||
{{ hostvars['console']['ca']['root']['crt'] }}
|
||||
dest: "{{ node['home_path'] }}/containers/romm/ssl/{{ root_cert_filename }}"
|
||||
owner: "{{ ansible_user }}"
|
||||
group: "{{ node['group'] }}"
|
||||
mode: "0440"
|
||||
notify: "notification_restart_romm"
|
||||
no_log: true
|
||||
|
||||
- name: Register secret value to podman secret
|
||||
containers.podman.podman_secret:
|
||||
name: "{{ item.name }}"
|
||||
data: "{{ item.value }}"
|
||||
state: "present"
|
||||
force: true
|
||||
loop:
|
||||
- name: "ROMM_AUTH_SECRET_KEY"
|
||||
value: "{{ hostvars['console']['romm']['secret_key'] }}"
|
||||
- name: "ROMM_DATABASE_PASSWORD"
|
||||
value: "{{ hostvars['console']['postgresql']['password']['romm'] }}"
|
||||
- name: "ROMM_OIDC_CLIENT_SECRET"
|
||||
value: "{{ hostvars['console']['romm']['oidc']['secret'] }}"
|
||||
notify: "notification_restart_romm"
|
||||
no_log: true
|
||||
|
||||
- name: Pull image
|
||||
containers.podman.podman_image:
|
||||
name: "docker.io/rommapp/romm"
|
||||
tag: "{{ version['containers']['romm'] }}"
|
||||
state: "present"
|
||||
pull: true
|
||||
|
||||
- name: Deploy romm.container file
|
||||
ansible.builtin.template:
|
||||
src: "{{ hostvars['console']['node']['config_path'] }}/services/containers/app/romm/romm.container.j2"
|
||||
dest: "{{ node['home_path'] }}/.config/containers/systemd/romm.container"
|
||||
owner: "{{ ansible_user }}"
|
||||
group: "{{ node['group'] }}"
|
||||
mode: "0644"
|
||||
notify: "notification_restart_romm"
|
||||
|
||||
- name: Enable romm.service
|
||||
ansible.builtin.systemd:
|
||||
name: "romm.service"
|
||||
state: "started"
|
||||
enabled: true
|
||||
daemon_reload: true
|
||||
scope: "user"
|
||||
|
||||
- name: Check container archive images
|
||||
ansible.builtin.stat:
|
||||
path: "{{ node['home_path'] }}/archives/containers/{{ item.file }}.tar"
|
||||
loop:
|
||||
- name: "redis"
|
||||
image: "docker.io/library/redis:{{ version['containers']['redis'] }}"
|
||||
file: "docker.io_library_redis_{{ version['containers']['redis'] }}"
|
||||
- name: "romm"
|
||||
image: "docker.io/rommapp/romm:{{ version['containers']['romm'] }}"
|
||||
file: "docker.io_rommapp_romm_{{ version['containers']['romm'] }}"
|
||||
loop_control:
|
||||
label: "{{ item.name }}"
|
||||
register: container_archive_images
|
||||
|
||||
- name: Save container archive images
|
||||
containers.podman.podman_save:
|
||||
image:
|
||||
- "{{ item.item.image }}"
|
||||
dest: "{{ node['home_path'] }}/archives/containers/{{ item.item.file }}.tar"
|
||||
format: "oci-archive"
|
||||
force: false
|
||||
loop: "{{ container_archive_images.results }}"
|
||||
loop_control:
|
||||
label: "{{ item.item.file }}"
|
||||
when: not item.stat.exists
|
||||
|
||||
- name: Fetch container archive images
|
||||
ansible.builtin.fetch:
|
||||
src: "{{ node['home_path'] }}/archives/containers/{{ item.item.file }}.tar"
|
||||
dest: "{{ hostvars['console']['node']['data_path'] }}/images/containers/"
|
||||
flat: true
|
||||
loop: "{{ container_archive_images.results }}"
|
||||
loop_control:
|
||||
label: "{{ item.item.file }}"
|
||||
Reference in New Issue
Block a user