From c4c5ab0e2a4463d13f9ccd333f1f1e9c96b61cac Mon Sep 17 00:00:00 2001 From: Jef Roosens Date: Sat, 17 Jan 2026 16:06:46 +0100 Subject: [PATCH] add recipya setup --- plays/emma.yml | 15 ++++++++ .../files/config.json | 22 +++++++++++ .../files/recipya.Caddyfile | 5 +++ .../handlers/main.yml | 8 ++++ .../any.software.recipya-podman/meta/main.yml | 4 ++ .../tasks/main.yml | 37 +++++++++++++++++++ .../templates/recipya.container.j2 | 18 +++++++++ 7 files changed, 109 insertions(+) create mode 100644 roles/any.software.recipya-podman/files/config.json create mode 100644 roles/any.software.recipya-podman/files/recipya.Caddyfile create mode 100644 roles/any.software.recipya-podman/handlers/main.yml create mode 100644 roles/any.software.recipya-podman/meta/main.yml create mode 100644 roles/any.software.recipya-podman/tasks/main.yml create mode 100644 roles/any.software.recipya-podman/templates/recipya.container.j2 diff --git a/plays/emma.yml b/plays/emma.yml index 81e9be4..66f5393 100644 --- a/plays/emma.yml +++ b/plays/emma.yml @@ -214,3 +214,18 @@ # syncthing_data_dir: '/mnt/data1/syncthing/data' # syncthing_home_dir: '/mnt/data1/syncthing/home' # syncthing_config_dir: '/mnt/data1/syncthing/config' + # +- name: Set up Recipya + hosts: emma + tags: recipya + roles: + - role: any.common.btrfs-subvolumes + vars: + subvolumes: + - filesystem_uuid: "{{ btrfs_nvme.uuid }}" + filesystem_path: "{{ btrfs_nvme.path }}" + name: "/@rootfs/data/recipya/data" + become: true + - role: any.software.recipya-podman + vars: + data_dir: '/data/recipya/data' diff --git a/roles/any.software.recipya-podman/files/config.json b/roles/any.software.recipya-podman/files/config.json new file mode 100644 index 0000000..d1961f4 --- /dev/null +++ b/roles/any.software.recipya-podman/files/config.json @@ -0,0 +1,22 @@ +{ + "email": { + "from": "", + "host": "", + "username": "", + "password": "" + }, + "integrations": { + "azureDocumentIntelligence": { + "endpoint": "", + "key": "" + } + }, + "server": { + "autologin": false, + "isDemo": false, + "noSignups": true, + "isProduction": true, + "port": 8078, + "url": "http://0.0.0.0" + } +} diff --git a/roles/any.software.recipya-podman/files/recipya.Caddyfile b/roles/any.software.recipya-podman/files/recipya.Caddyfile new file mode 100644 index 0000000..de49a96 --- /dev/null +++ b/roles/any.software.recipya-podman/files/recipya.Caddyfile @@ -0,0 +1,5 @@ +cook.roosens.me { + reverse_proxy localhost:8023 { + header_down +X-Robots-Tag "none" + } +} diff --git a/roles/any.software.recipya-podman/handlers/main.yml b/roles/any.software.recipya-podman/handlers/main.yml new file mode 100644 index 0000000..0192481 --- /dev/null +++ b/roles/any.software.recipya-podman/handlers/main.yml @@ -0,0 +1,8 @@ +--- +- name: 'restart recipya' + ansible.builtin.systemd_service: + name: 'recipya' + state: 'restarted' + + scope: 'user' + daemon_reload: true diff --git a/roles/any.software.recipya-podman/meta/main.yml b/roles/any.software.recipya-podman/meta/main.yml new file mode 100644 index 0000000..32c83bc --- /dev/null +++ b/roles/any.software.recipya-podman/meta/main.yml @@ -0,0 +1,4 @@ +--- +dependencies: + - role: any.tools.caddy + become: true diff --git a/roles/any.software.recipya-podman/tasks/main.yml b/roles/any.software.recipya-podman/tasks/main.yml new file mode 100644 index 0000000..14b3f2d --- /dev/null +++ b/roles/any.software.recipya-podman/tasks/main.yml @@ -0,0 +1,37 @@ +--- +- name: Ensure configuration directory is present + ansible.builtin.file: + path: '/etc/recipya' + state: directory + mode: '0755' + owner: 'debian' + group: 'debian' + become: true + +- name: Ensure config file is present + ansible.builtin.copy: + src: 'config.json' + dest: '/etc/recipya/config.json' + mode: '0644' + owner: 'debian' + group: 'debian' + notify: 'restart recipya' + +- name: Ensure Quadlet files are present + ansible.builtin.template: + src: "recipya.container.j2" + dest: "/home/debian/.config/containers/systemd/recipya.container" + mode: '0755' + owner: 'debian' + group: 'debian' + notify: 'restart recipya' + +- name: Ensure Caddyfile is present + ansible.builtin.copy: + src: 'recipya.Caddyfile' + dest: '/etc/caddy/recipya.Caddyfile' + owner: root + group: root + mode: '0644' + become: true + notify: reload caddy diff --git a/roles/any.software.recipya-podman/templates/recipya.container.j2 b/roles/any.software.recipya-podman/templates/recipya.container.j2 new file mode 100644 index 0000000..98663e9 --- /dev/null +++ b/roles/any.software.recipya-podman/templates/recipya.container.j2 @@ -0,0 +1,18 @@ +# vim: ft=systemd +[Container] +Image=docker.io/reaper99/recipya:nightly + +PublishPort=127.0.0.1:8023:8078 +Volume={{ data_dir }}:/root/.config/Recipya +Volume=/etc/recipya/config.json:/root/.config/Recipya/config.json:ro + +Environment=RECIPYA_SERVER_AUTOLOGIN=false RECIPYA_SERVER_IS_DEMO=false RECIPYA_SERVER_IS_PROD=true RECIPYA_SERVER_NO_SIGNUPS=false RECIPYA_SERVER_PORT=8078 RECIPYA_SERVER_URL=http://0.0.0.0 + +User=0 +AutoUpdate=registry + +[Service] +Restart=always + +[Install] +WantedBy=default.target