feature/homarr #2

Merged
Tobias-Wuest merged 3 commits from feature/homarr into main 2026-05-13 13:31:20 +00:00
Owner

Ansible Playbook for basic installation of the homarr board with a home board
To Dos:

  • finalise OICD
  • Move the secret to the vault
  • Move the basic Admin PW to the Vault
  • Add the rest of the Applications to the default board.
  • Code Cleanup
  • Documentation
Ansible Playbook for basic installation of the homarr board with a home board To Dos: - finalise OICD - Move the secret to the vault - Move the basic Admin PW to the Vault - Add the rest of the Applications to the default board. - Code Cleanup - Documentation
bert-jan was assigned by Tobias-Wuest 2026-04-07 15:28:31 +00:00
Tobias-Wuest added 3 commits 2026-04-07 15:28:32 +00:00
requested review from bert-jan 2026-04-07 15:37:16 +00:00
Tobias-Wuest changed title from feature/homarr to WIP: feature/homarr 2026-04-07 15:41:07 +00:00
Tobias-Wuest changed title from WIP: feature/homarr to feature/homarr 2026-04-07 15:41:34 +00:00
bert-jan requested changes 2026-04-09 12:53:07 +00:00
bert-jan left a comment
Owner

Schon mal ein guter Start! Braucht aber noch ein paar Changes @Tobias-Wuest

Schon mal ein guter Start! Braucht aber noch ein paar Changes @Tobias-Wuest
@ -0,0 +11,4 @@
homarr_service_name: homarr
homarr_docker_compose_dir: "{{ docker_compose_base_dir }}/{{ homarr_service_name }}"
homarr_docker_volume_dir: "{{ docker_volume_base_dir }}/{{ homarr_service_name }}"
homarr_appdata_dir: "{{ homarr_docker_volume_dir }}/{{ homarr_service_name }}/appdata"
Owner

Nit: Der wird nur einmalig verwendet, brauchen wir eigentlich nicht abstrahieren

Nit: Der wird nur einmalig verwendet, brauchen wir eigentlich nicht abstrahieren
Author
Owner

angepasst und ist jetzt fix homarr drinn

angepasst und ist jetzt fix homarr drinn
Tobias-Wuest marked this conversation as resolved
@ -0,0 +12,4 @@
homarr_docker_compose_dir: "{{ docker_compose_base_dir }}/{{ homarr_service_name }}"
homarr_docker_volume_dir: "{{ docker_volume_base_dir }}/{{ homarr_service_name }}"
homarr_appdata_dir: "{{ homarr_docker_volume_dir }}/{{ homarr_service_name }}/appdata"
homarr_db_dir: "{{ homarr_appdata_dir }}/db/db.sqlite"
Owner

Angeschrieben mit dir, aber verweisst auf eine Datei

Angeschrieben mit dir, aber verweisst auf eine Datei
Author
Owner

variable auf homarr_db angepasst

variable auf homarr_db angepasst
Tobias-Wuest marked this conversation as resolved
@ -0,0 +17,4 @@
# Service configuration
homarr_domain: "homarr.local.test"
homarr_image: "ghcr.io/homarr-labs/homarr:latest"
homarr_secret_encryption_key: "4fc2f54f54be3f4439b728da81b743fb0ee6317fd1a24f4096611f68019fa5a7"
Owner

Könnte man hier evt ein value nehmen, bei dem es deutlich ist das es ein placeholder ist? Oder wird hier eine Validation drauf ausgeführt?

Könnte man hier evt ein value nehmen, bei dem es deutlich ist das es ein placeholder ist? Oder wird hier eine Validation drauf ausgeführt?
Author
Owner

entsprechender kommentar ist drinn

entsprechender kommentar ist drinn
Tobias-Wuest marked this conversation as resolved
@ -0,0 +25,4 @@
homarr_base_url: "https://home.local.test"
# OIDC Konfiguration
oidc_issuer: "https://auth.digitalboard.ch/realms/Digitalboard"
Owner

Diese Vars sollten genau wie die anderen auch mit homarr geprefixed werden. Dann ist später bei einer Überschreibung im Projekt deutlich wo es herkommt.

Diese Vars sollten genau wie die anderen auch mit homarr geprefixed werden. Dann ist später bei einer Überschreibung im Projekt deutlich wo es herkommt.
Author
Owner

ist aktuell als lehre env drinn

ist aktuell als lehre env drinn
Tobias-Wuest marked this conversation as resolved
@ -0,0 +10,4 @@
ansible.builtin.package:
name:
- sqlite3
- python3-docker
Owner

python3-docker braucht es eigentlich nicht nur für diese Rolle -> Sollte in die base Rolle

python3-docker braucht es eigentlich nicht nur für diese Rolle -> Sollte in die base Rolle
Tobias-Wuest marked this conversation as resolved
@ -0,0 +62,4 @@
timeout: 60
when: not db_exists.stat.exists
- name: Wait for database schema to be initialized
Owner

da kannst du ansible until verwenden, anstatt ein loop. Macht es etwas lesbarer.
https://docs.ansible.com/projects/ansible/latest/playbook_guide/playbooks_loops.html#retrying-a-task-until-a-condition-is-met

bsp:

- name: Wait for database schema to be initialized
  ansible.builtin.command:
    cmd: sqlite3 "{{ homarr_db_dir }}" "SELECT name FROM sqlite_master WHERE type='table' AND name='board';"
  register: schema_check
  until: schema_check.stdout == "board"
  retries: 30
  delay: 2
  changed_when: false
  when: not db_exists.stat.exists
da kannst du ansible until verwenden, anstatt ein loop. Macht es etwas lesbarer. https://docs.ansible.com/projects/ansible/latest/playbook_guide/playbooks_loops.html#retrying-a-task-until-a-condition-is-met bsp: ``` - name: Wait for database schema to be initialized ansible.builtin.command: cmd: sqlite3 "{{ homarr_db_dir }}" "SELECT name FROM sqlite_master WHERE type='table' AND name='board';" register: schema_check until: schema_check.stdout == "board" retries: 30 delay: 2 changed_when: false when: not db_exists.stat.exists ```
Author
Owner

angepasst

angepasst
Tobias-Wuest marked this conversation as resolved
@ -0,0 +77,4 @@
changed_when: false
when: not db_exists.stat.exists
- name: Ensure python3-bcrypt is installed
Owner

Das installierst du in Zeile 14 auch bereits, sollte aber eigentlich in die base-role

Das installierst du in Zeile 14 auch bereits, sollte aber eigentlich in die base-role
Author
Owner

die task zum check von bcypt ist raus

die task zum check von bcypt ist raus
Tobias-Wuest marked this conversation as resolved
@ -0,0 +83,4 @@
state: present
- name: Generate bcrypt hash for admin password
ansible.builtin.shell: |
Owner

Brauchst hier nicht auf python/shell aus zu weichen, ansible kann das direkt über Filter: https://docs.ansible.com/projects/ansible/latest/collections/ansible/builtin/password_hash_filter.html. bsp:

- name: Generate bcrypt hash for admin password
  ansible.builtin.set_fact:
    homarr_bcrypt_hash: "{{ homarr_admin_password | password_hash('bcrypt', rounds=10) }}"
  no_log: true
Brauchst hier nicht auf python/shell aus zu weichen, ansible kann das direkt über Filter: https://docs.ansible.com/projects/ansible/latest/collections/ansible/builtin/password_hash_filter.html. bsp: ``` - name: Generate bcrypt hash for admin password ansible.builtin.set_fact: homarr_bcrypt_hash: "{{ homarr_admin_password | password_hash('bcrypt', rounds=10) }}" no_log: true ```
Author
Owner

funktioniert aufgrund einer inkompabilität von passlib 1.7.4 und bcript 5.0 nicht. hab die task noch etwas aktualisiert.

- name: Generate bcrypt hash for admin password
  ansible.builtin.shell:
    cmd: python3 -c "import bcrypt, sys; print(bcrypt.hashpw(sys.stdin.read().encode(), bcrypt.gensalt(rounds=10)).decode())"
    stdin: "{{ homarr_admin_password }}"
    stdin_add_newline: false
  delegate_to: localhost
  become: false
  register: bcrypt_result
  changed_when: false
  no_log: true

- name: Set bcrypt hash fact
  ansible.builtin.set_fact:
    homarr_bcrypt_hash: "{{ bcrypt_result.stdout }}"
  no_log: true
funktioniert aufgrund einer inkompabilität von passlib 1.7.4 und bcript 5.0 nicht. hab die task noch etwas aktualisiert. ``` - name: Generate bcrypt hash for admin password ansible.builtin.shell: cmd: python3 -c "import bcrypt, sys; print(bcrypt.hashpw(sys.stdin.read().encode(), bcrypt.gensalt(rounds=10)).decode())" stdin: "{{ homarr_admin_password }}" stdin_add_newline: false delegate_to: localhost become: false register: bcrypt_result changed_when: false no_log: true - name: Set bcrypt hash fact ansible.builtin.set_fact: homarr_bcrypt_hash: "{{ bcrypt_result.stdout }}" no_log: true ```
Tobias-Wuest marked this conversation as resolved
@ -0,0 +101,4 @@
# =====================================================================
- name: Check if onboarding is already completed
ansible.builtin.shell: |
Owner

Nit: hier würde ansible.builtin.command eigentlich ausreichen, da 1 binary (spawnt keine shell(/bin/sh) und führt es dann aus, sondern geht direkt aufs binary).

Nit: hier würde ansible.builtin.command eigentlich ausreichen, da 1 binary (spawnt keine shell(/bin/sh) und führt es dann aus, sondern geht direkt aufs binary).
Author
Owner

ersetzt durch:

  • name: Check if local admin user exists
    ansible.builtin.command:
    cmd: sqlite3 "{{ homarr_db }}" "SELECT id FROM user WHERE id='user-local-admin';"
    register: admin_exists
    changed_when: false
    failed_when: false
ersetzt durch: - name: Check if local admin user exists ansible.builtin.command: cmd: sqlite3 "{{ homarr_db }}" "SELECT id FROM user WHERE id='user-local-admin';" register: admin_exists changed_when: false failed_when: false
Tobias-Wuest marked this conversation as resolved
@ -0,0 +111,4 @@
ansible.builtin.shell: |
sqlite3 "{{ homarr_db_dir }}" << 'SEEDSQL'
-- SERVER SETTINGS
INSERT OR REPLACE INTO serverSetting (setting_key, value)
Owner

SQL Skript in eine template Datei auslagern. Macht es massiv lesbarer.
bsp:

- name: Seed Homarr database
  ansible.builtin.command:
    cmd: sqlite3 "{{ homarr_db_dir }}"
    stdin: "{{ lookup('template', 'homarr_seed.sql.j2') }}"
  changed_when: true
SQL Skript in eine template Datei auslagern. Macht es massiv lesbarer. bsp: ``` - name: Seed Homarr database ansible.builtin.command: cmd: sqlite3 "{{ homarr_db_dir }}" stdin: "{{ lookup('template', 'homarr_seed.sql.j2') }}" changed_when: true ```
Tobias-Wuest marked this conversation as resolved
@ -0,0 +235,4 @@
('board-default', 'group-credentials-admin', 'full-access');
-- =====================================================================
-- APPS
Owner

Apps sollten wir konfigurierbar/überschreibbar machen über vars im Projekt

Apps sollten wir konfigurierbar/überschreibbar machen über vars im Projekt
Author
Owner

ist über die defaults konfigurierbar

ist über die defaults konfigurierbar
Tobias-Wuest marked this conversation as resolved
@ -0,0 +245,4 @@
'Nextcloud',
'Cloud Storage & Collaboration',
'https://cdn.jsdelivr.net/gh/walkxcode/dashboard-icons/png/nextcloud.png',
'https://cloud.digitalboard.ch'
Owner

bsp wieso es konfigurierbar sein sollte. Das stimmt bereits bei den Demo-Envs nicht mehr

bsp wieso es konfigurierbar sein sollte. Das stimmt bereits bei den Demo-Envs nicht mehr
Author
Owner

ist über die defaults konfigurierbar in der app sektion

ist über die defaults konfigurierbar in der app sektion
Tobias-Wuest marked this conversation as resolved
@ -0,0 +324,4 @@
# =====================================================================
- name: Restart Homarr to apply database changes
ansible.builtin.shell:
Owner
Das kann direkt über das docker modul gemacht werden. Noch schöner wäre ein hook https://docs.ansible.com/projects/ansible/latest/playbook_guide/playbooks_handlers.html. Bsp https://git.digitalboard.ch/Digitalboard/digitalboard.core/src/branch/main/roles/collabora/handlers/main.yml + https://git.digitalboard.ch/Digitalboard/digitalboard.core/src/commit/77484f194460e041e5b69f2dfbfe6c512ae4ad7d/roles/collabora/tasks/main.yml#L29 Akte
Author
Owner

angepasst wie vorgeschalgen

angepasst wie vorgeschalgen
Tobias-Wuest marked this conversation as resolved
@ -0,0 +330,4 @@
when: seed_result is changed
- name: Wait for Homarr to be ready
ansible.builtin.shell:
Owner

direkt aufs docker compose module gehen, anstatt shell

direkt aufs docker compose module gehen, anstatt shell
Author
Owner

entsprechend angepasst.

entsprechend angepasst.
Tobias-Wuest marked this conversation as resolved
@ -0,0 +339,4 @@
until: homarr_ready.rc == 0
changed_when: false
- name: Display completion message
Owner

Die Debugs und msgs würde ich entfernen. PW-s ausgeben ist nicht so cool, da sie hier auch ausgegeben werden, wenn sie über bspw vault übergeben werden. Sollten auch, wenn möglich, alles auf EN umsetzen

Die Debugs und msgs würde ich entfernen. PW-s ausgeben ist nicht so cool, da sie hier auch ausgegeben werden, wenn sie über bspw vault übergeben werden. Sollten auch, wenn möglich, alles auf EN umsetzen
Tobias-Wuest marked this conversation as resolved
@ -0,0 +383,4 @@
Nächste Schritte:
1. Stelle sicher, dass in Keycloak die Gruppe "{{ oidc_admin_group }}" existiert
2. Füge deinen User zur Gruppe "{{ oidc_admin_group }}" hinzu
Owner

Funktioniert das so bei Homarr 🤔?

Funktioniert das so bei Homarr 🤔?
Author
Owner

lol, da hab ich wohl noch comments drinn gehabt die so nicht rein sollten... ist raus

lol, da hab ich wohl noch comments drinn gehabt die so nicht rein sollten... ist raus
Tobias-Wuest marked this conversation as resolved
@ -0,0 +17,4 @@
NEXTAUTH_URL: "{{ homarr_base_url }}"
SECRET_ENCRYPTION_KEY: "{{ homarr_secret_encryption_key }}"
# Auth: Credentials + OIDC
AUTH_PROVIDERS: "credentials,oidc"
Owner

Sollten wir konfigurierbar machen, evt wollen nicht alle Anwender OIDC

Sollten wir konfigurierbar machen, evt wollen nicht alle Anwender OIDC
Author
Owner

entfernt

entfernt
Tobias-Wuest marked this conversation as resolved
bert-jan removed their assignment 2026-04-09 13:04:05 +00:00
Tobias-Wuest was assigned by bert-jan 2026-04-09 13:04:06 +00:00
Tobias-Wuest force-pushed feature/homarr from 422b196831 to 23ea8dafc9 2026-05-13 13:30:37 +00:00 Compare
Tobias-Wuest merged commit 23ea8dafc9 into main 2026-05-13 13:31:20 +00:00
Tobias-Wuest deleted branch feature/homarr 2026-05-13 13:32:35 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Digitalboard/digitalboard.core#2
No description provided.