Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| fc3b5a1e05 | |||
| 13839c9dfd | |||
| 242b719671 | |||
| 224b27abc3 | |||
| a2022fd14c | |||
| be07698dae | |||
| ab7e09d90b | |||
| 8c81827e24 | |||
| 57996f1efd | |||
| 8311fcf53e | |||
| 90277b2d4e |
@@ -74,3 +74,6 @@ version:
|
||||
authelia: "4.39.15"
|
||||
# App
|
||||
vaultwarden: "1.35.4"
|
||||
gitea: "1.25.5"
|
||||
redis: "8.6.1"
|
||||
immich: "v2.6.1"
|
||||
|
||||
@@ -39,3 +39,6 @@ storage:
|
||||
label: "APP_DATA"
|
||||
level: "raid10"
|
||||
mount_point: "/home/app/data"
|
||||
|
||||
redis:
|
||||
immich: "6379"
|
||||
|
||||
@@ -169,6 +169,22 @@
|
||||
tags: ["site", "vaultwarden"]
|
||||
tags: ["site", "vaultwarden"]
|
||||
|
||||
- name: Set gitea
|
||||
ansible.builtin.include_role:
|
||||
name: "app"
|
||||
tasks_from: "services/set_gitea"
|
||||
apply:
|
||||
tags: ["site", "gitea"]
|
||||
tags: ["site", "gitea"]
|
||||
|
||||
- name: Set immich
|
||||
ansible.builtin.include_role:
|
||||
name: "app"
|
||||
tasks_from: "services/set_immich"
|
||||
apply:
|
||||
tags: ["site", "immich"]
|
||||
tags: ["site", "immich"]
|
||||
|
||||
- name: Flush handlers right now
|
||||
ansible.builtin.meta: "flush_handlers"
|
||||
|
||||
|
||||
@@ -9,3 +9,36 @@
|
||||
changed_when: false
|
||||
listen: "notification_restart_vaultwarden"
|
||||
ignore_errors: true # noqa: ignore-errors
|
||||
|
||||
- name: Restart gitea
|
||||
ansible.builtin.systemd:
|
||||
name: "gitea.service"
|
||||
state: "restarted"
|
||||
enabled: true
|
||||
scope: "user"
|
||||
daemon_reload: true
|
||||
changed_when: false
|
||||
listen: "notification_restart_gitea"
|
||||
ignore_errors: true # noqa: ignore-errors
|
||||
|
||||
- name: Restart immich
|
||||
ansible.builtin.systemd:
|
||||
name: "immich.service"
|
||||
state: "restarted"
|
||||
enabled: true
|
||||
scope: "user"
|
||||
daemon_reload: true
|
||||
changed_when: false
|
||||
listen: "notification_restart_immich"
|
||||
ignore_errors: true # noqa: ignore-errors
|
||||
|
||||
- name: Restart immich-ml
|
||||
ansible.builtin.systemd:
|
||||
name: "immich-ml.service"
|
||||
state: "restarted"
|
||||
enabled: true
|
||||
scope: "user"
|
||||
daemon_reload: true
|
||||
changed_when: false
|
||||
listen: "notification_restart_immich-ml"
|
||||
ignore_errors: true # noqa: ignore-errors
|
||||
|
||||
55
ansible/roles/app/tasks/services/set_gitea.yaml
Normal file
55
ansible/roles/app/tasks/services/set_gitea.yaml
Normal file
@@ -0,0 +1,55 @@
|
||||
---
|
||||
- name: Set gitea container subuid
|
||||
ansible.builtin.set_fact:
|
||||
gitea_subuid: "100999"
|
||||
|
||||
- name: Create gitea directory
|
||||
ansible.builtin.file:
|
||||
path: "{{ node['home_path'] }}/{{ item }}"
|
||||
state: "directory"
|
||||
owner: "{{ gitea_subuid }}"
|
||||
group: "svadmins"
|
||||
mode: "0770"
|
||||
loop:
|
||||
- "data/containers/gitea"
|
||||
- "containers/gitea"
|
||||
- "containers/gitea/ssl"
|
||||
become: true
|
||||
|
||||
- name: Deploy root certificate
|
||||
ansible.builtin.copy:
|
||||
content: |
|
||||
{{ hostvars['console']['ca']['root']['crt'] }}
|
||||
dest: "{{ node['home_path'] }}/containers/gitea/ssl/ilnmors_root_ca.crt"
|
||||
owner: "{{ gitea_subuid }}"
|
||||
group: "svadmins"
|
||||
mode: "0440"
|
||||
become: true
|
||||
notify: "notification_restart_gitea"
|
||||
no_log: true
|
||||
|
||||
- name: Register secret value to podman secret
|
||||
containers.podman.podman_secret:
|
||||
name: "GITEA__database__PASSWD"
|
||||
data: "{{ hostvars['console']['postgresql']['password']['gitea'] }}"
|
||||
state: "present"
|
||||
force: true
|
||||
notify: "notification_restart_gitea"
|
||||
no_log: true
|
||||
|
||||
- name: Deploy container file
|
||||
ansible.builtin.template:
|
||||
src: "{{ hostvars['console']['node']['config_path'] }}/services/containers/app/gitea/gitea.container.j2"
|
||||
dest: "{{ node['home_path'] }}/.config/containers/systemd/gitea.container"
|
||||
owner: "{{ ansible_user }}"
|
||||
group: "svadmins"
|
||||
mode: "0644"
|
||||
notify: "notification_restart_gitea"
|
||||
|
||||
- name: Enable gitea.service
|
||||
ansible.builtin.systemd:
|
||||
name: "gitea.service"
|
||||
state: "started"
|
||||
enabled: true
|
||||
daemon_reload: true
|
||||
scope: "user"
|
||||
120
ansible/roles/app/tasks/services/set_immich.yaml
Normal file
120
ansible/roles/app/tasks/services/set_immich.yaml
Normal file
@@ -0,0 +1,120 @@
|
||||
---
|
||||
- name: Set redis service name
|
||||
ansible.builtin.set_fact:
|
||||
redis_service: "immich"
|
||||
redis_subuid: "100998"
|
||||
|
||||
- name: Create redis_immich directory
|
||||
ansible.builtin.file:
|
||||
path: "{{ node['home_path'] }}/{{ item }}"
|
||||
state: "directory"
|
||||
owner: "{{ redis_subuid }}"
|
||||
group: "svadmins"
|
||||
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: "svadmins"
|
||||
mode: "0644"
|
||||
|
||||
- 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: "svadmins"
|
||||
mode: "0644"
|
||||
register: "is_redis_conf"
|
||||
|
||||
- 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 # noqa: no-handler
|
||||
|
||||
- name: Add user in video, render group
|
||||
ansible.builtin.user:
|
||||
name: "{{ ansible_user }}"
|
||||
state: "present"
|
||||
groups: "video, render"
|
||||
append: true
|
||||
become: true
|
||||
|
||||
- name: Create immich directory
|
||||
ansible.builtin.file:
|
||||
path: "{{ node['home_path'] }}/{{ item }}"
|
||||
state: "directory"
|
||||
owner: "{{ ansible_user }}"
|
||||
group: "svadmins"
|
||||
mode: "0770"
|
||||
loop:
|
||||
- "data/containers/immich"
|
||||
- "containers/immich"
|
||||
- "containers/immich/ssl"
|
||||
- "containers/immich/ml"
|
||||
- "containers/immich/ml/cache"
|
||||
|
||||
- name: Deploy root certificate
|
||||
ansible.builtin.copy:
|
||||
content: |
|
||||
{{ hostvars['console']['ca']['root']['crt'] }}
|
||||
dest: "{{ node['home_path'] }}/containers/immich/ssl/ilnmors_root_ca.crt"
|
||||
owner: "{{ ansible_user }}"
|
||||
group: "svadmins"
|
||||
mode: "0440"
|
||||
notify: "notification_restart_immich"
|
||||
no_log: true
|
||||
|
||||
- name: Register secret value to podman secret
|
||||
containers.podman.podman_secret:
|
||||
name: "IMMICH_DB_PASSWORD"
|
||||
data: "{{ hostvars['console']['postgresql']['password']['immich'] }}"
|
||||
state: "present"
|
||||
force: true
|
||||
notify: "notification_restart_immich"
|
||||
no_log: true
|
||||
|
||||
- name: Deploy immich.container file
|
||||
ansible.builtin.template:
|
||||
src: "{{ hostvars['console']['node']['config_path'] }}/services/containers/app/immich/immich.container.j2"
|
||||
dest: "{{ node['home_path'] }}/.config/containers/systemd/immich.container"
|
||||
owner: "{{ ansible_user }}"
|
||||
group: "svadmins"
|
||||
mode: "0644"
|
||||
notify: "notification_restart_immich"
|
||||
|
||||
- name: Deploy immich-ml.container file
|
||||
ansible.builtin.template:
|
||||
src: "{{ hostvars['console']['node']['config_path'] }}/services/containers/app/immich/immich-ml.container.j2"
|
||||
dest: "{{ node['home_path'] }}/.config/containers/systemd/immich-ml.container"
|
||||
owner: "{{ ansible_user }}"
|
||||
group: "svadmins"
|
||||
mode: "0644"
|
||||
notify: "notification_restart_immich-ml"
|
||||
|
||||
- name: Enable immich.service
|
||||
ansible.builtin.systemd:
|
||||
name: "immich.service"
|
||||
state: "started"
|
||||
enabled: true
|
||||
daemon_reload: true
|
||||
scope: "user"
|
||||
|
||||
- name: Enable immich-ml.service
|
||||
ansible.builtin.systemd:
|
||||
name: "immich-ml.service"
|
||||
state: "started"
|
||||
enabled: true
|
||||
daemon_reload: true
|
||||
scope: "user"
|
||||
@@ -27,14 +27,14 @@
|
||||
listen: "notification_reload_networkctl"
|
||||
ignore_errors: true # noqa: ignore-errors
|
||||
|
||||
- name: Reload systemd-resolved.service
|
||||
- name: Restart systemd-resolved.service
|
||||
ansible.builtin.systemd:
|
||||
name: "systemd-resolved.service"
|
||||
state: "reloaded"
|
||||
state: "restarted"
|
||||
enabled: true
|
||||
become: true
|
||||
changed_when: false
|
||||
listen: "notification_reload_resolved"
|
||||
listen: "notification_restart_resolved"
|
||||
ignore_errors: true # noqa: ignore-errors
|
||||
|
||||
- name: Restart systemd-timesyncd
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
group: "systemd-resolve"
|
||||
mode: "0640"
|
||||
become: true
|
||||
notify: "notification_reload_resolved"
|
||||
notify: "notification_restart_resolved"
|
||||
|
||||
- name: Restart systemd-resolved.service when it is initiated
|
||||
ansible.builtin.systemd:
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
dest: "{{ node['data_path'] }}/bin/blocky-{{ version['packages']['blocky'] }}-{{ item }}.tar.gz"
|
||||
owner: "{{ ansible_user }}"
|
||||
group: "svadmins"
|
||||
mode: "0600" # noqa: line-length
|
||||
mode: "0600"
|
||||
loop:
|
||||
- "x86_64"
|
||||
- "arm64"
|
||||
|
||||
@@ -5,12 +5,13 @@
|
||||
|
||||
- name: Set connected services list
|
||||
ansible.builtin.set_fact:
|
||||
# telegraf has no database
|
||||
connected_services:
|
||||
- "ldap"
|
||||
- "authelia"
|
||||
- "grafana"
|
||||
- "vaultwarden"
|
||||
- "gitea"
|
||||
- "immich"
|
||||
|
||||
- name: Create postgresql directory
|
||||
ansible.builtin.file:
|
||||
@@ -108,7 +109,7 @@
|
||||
group: "svadmins"
|
||||
mode: "0600"
|
||||
|
||||
- name: Deploy resoring data sql files
|
||||
- name: Deploy restoring data sql files
|
||||
ansible.builtin.copy:
|
||||
src: "{{ hostvars['console']['node']['config_path'] }}/services/containers/infra/postgresql/init/pg_{{ item }}.sql"
|
||||
dest: "{{ node['home_path'] }}/containers/postgresql/init/{{ index_num + 1 }}_pg_{{ item }}.sql"
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
DNS=1.1.1.2 1.0.0.2
|
||||
DNS=2606:4700:4700::1112 2606:4700:4700::1002
|
||||
{% endif %}
|
||||
cache=false
|
||||
cache=false
|
||||
|
||||
@@ -114,6 +114,8 @@ postgresql:
|
||||
grafana: ENC[AES256_GCM,data:P9okJ7bcsqmeGstkSwbDq/RgnG+lFrgAOvcj8A5lOTpmHaSlXGiKG+ybXa0=,iv:Di1ghnxIbAb/u7uo/mJCC3QYVjdweTHaQDZmXTx8OG4=,tag:DT3a1zgU9sTr0BXpyoZ/SQ==,type:str]
|
||||
authelia: ENC[AES256_GCM,data:OqyloAADO6KKEaBjGLsJc9GTe77wn6IvA1VCD2dfCWxx+zgzUYh87fK1XX8=,iv:QIOHNTdNnzcY/f3Co8dPdNHykhBnYRhm43nt35hbALM=,tag:DLQq58GrZd+Ul7MSn6s9uQ==,type:str]
|
||||
vaultwarden: ENC[AES256_GCM,data:BPj5eFo54DTZ82n3yTIqEbm7kb/jWT0n2kZY//oV5q48eRch3C2RBuxn/Ko=,iv:DGC4ipHMyVs25gc4sNMt8LN1RsHjiR/b303vgiFoxMY=,tag:k1eb4DoRPLKvvMstSI1faQ==,type:str]
|
||||
gitea: ENC[AES256_GCM,data:l+pBCzyQa3000SE9z1R4htD0V0ONsBtKy92dfgsVYsZ3XlEyVJDIBOsugwM=,iv:5t/oHW1vFAmV/s2Ze/cV9Vuqo96Qu6QvZeRbio7VX2s=,tag:4zeQaXiXIzBpy+tXsxmN7Q==,type:str]
|
||||
immich: ENC[AES256_GCM,data:11jvxTKA/RL0DGL6y2/X092hnDohj6yTrYGK4IVojqBd1gCOBnDvUjgmx14=,iv:oBfHxsx9nxhyKY/WOuWfybxEX2bf+lHEtsaifFRS9lg=,tag:tAfkBdgQ8ZEkLIFcDICKDw==,type:str]
|
||||
#ENC[AES256_GCM,data:ODXFUxxxdQ==,iv:s9zJVx6wo6x517tbNvC+FZ0dFzqbjqeLI6rXBq72hQA=,tag:bXoV2I3LbpmQyddJrtS3Qg==,type:comment]
|
||||
#
|
||||
#
|
||||
@@ -183,6 +185,27 @@ vaultwarden:
|
||||
#ENC[AES256_GCM,data:ODXFUxxxdQ==,iv:s9zJVx6wo6x517tbNvC+FZ0dFzqbjqeLI6rXBq72hQA=,tag:bXoV2I3LbpmQyddJrtS3Qg==,type:comment]
|
||||
#
|
||||
#
|
||||
#ENC[AES256_GCM,data:HAN9BBEl1CW11LAf3x8=,iv:hwqCErtmPqGJ+y86D9MoxJwixvbcJONlyT900Y5DOug=,tag:kCxsG353ltbOCKLe85adCg==,type:comment]
|
||||
gitea:
|
||||
il:
|
||||
password: ENC[AES256_GCM,data:Bs5/t5mNbSv5+ek9gNHZp5qqxitM4Kq0Xgh2JV6LiFw9lZJSOVT4JPLRP5M=,iv:z50+naWOTVL8lEgBgm51j6hLjS8ve2UcRRKukvtykM0=,tag:TF9rPxjoLe/vAyvl23PiCg==,type:str]
|
||||
token: ENC[AES256_GCM,data:CiYEXEKLLRDp++iga5YmhyPB2bSvqhhDgSOhmiulp9n9SsBVQ3s5MQ==,iv:+oetgEH/IORz74Xoz5zgDjD3BLyledZTqlYlCWaDrRk=,tag:S9O09YEMuSexuNW3ojEw5Q==,type:str]
|
||||
oidc:
|
||||
secret: ENC[AES256_GCM,data:qjQosi83oaK47wX4VtDktDFlIU3FQgmDpwyiSgJNPDq2Dtc/QEKzdv5/ZpQ=,iv:aUJx5a6Wj7lhaD19aPiZWIE/MWKUgH0muxtTSkwfg8M=,tag:DttjXee7ntxRAbqbFq6qeQ==,type:str]
|
||||
hash: ENC[AES256_GCM,data:iVls8UzdP6JTfRosET6nsk3RcEtFQ8ak6GtPuBjcqAv3lyA9oSLwvvC8MvGaT1aHCB+5y/lspuloHEaAcVGNuzGCIVLg9Adut4a7LYDTHNOZnJIKLj8ldL1ytD5XVdbeBhZGCqoTs088oO0HVCQiDzpJL5NdmM3Ru6egyYBCLLUOlPA=,iv:er63GEC+kxNDscvspvvLiq17VSg0GeZ2w3jmGojF9PM=,tag:F1pDpaQrVdomIlZ8psVpAw==,type:str]
|
||||
#ENC[AES256_GCM,data:ODXFUxxxdQ==,iv:s9zJVx6wo6x517tbNvC+FZ0dFzqbjqeLI6rXBq72hQA=,tag:bXoV2I3LbpmQyddJrtS3Qg==,type:comment]
|
||||
#
|
||||
#
|
||||
#ENC[AES256_GCM,data:HvMeGuC8JwK50pO1E/nm,iv:5NFTyjesMX0ZnBpH+hEv8jQ0G2NvrDtT23CUyLbQcUo=,tag:qWmPvQpADTeD+W8nWXRQvA==,type:comment]
|
||||
immich:
|
||||
il:
|
||||
password: ENC[AES256_GCM,data:PbDFc4m7rNPPN1mCjcvhbKwf/EbiJxdvO/iMspf9jMuCqQyGv7h6VrZqk98=,iv:hlMAp5wXXkFO9+ekq3A2/ioF/EX8Uau0puhb4TAHkRQ=,tag:pfS0W2JNaFNMpBlKgZ3Pjw==,type:str]
|
||||
oidc:
|
||||
secret: ENC[AES256_GCM,data:9ENcp2Ns21OLXDY05zRoSdP+93EiwSH8MGzZZpxK7sToe4QLUXWt9w6xQIE=,iv:Q/VcnArZHs/J2YLRVFXt3Mp+LYfuq4PD/trqO8Simig=,tag:BY/mOyZpYmoAc7NrASlmSA==,type:str]
|
||||
hash: ENC[AES256_GCM,data:mrML2CWFFtGjq8wfWipVpv+pjJRSHe74VGC7Eoa6588R5C/sCnC3W5aI+dsRCZN3LRCjHAkOJJgjeYrwcXYdKRauXsAYR51dNSsHqqSN3WebLxapRDwcYu5e4j5RN1aPHsysr7GaQ4hhe5rKW4ORCGC3Cp3Ob+LChPy4bdCAZG3bN9k=,iv:Q4hmqhq+dvIr7DxCpcqP4E0NKyFZkOeTnDpGctmCxXM=,tag:/gji6AFkHnYwkQf3FSQUxA==,type:str]
|
||||
#ENC[AES256_GCM,data:ODXFUxxxdQ==,iv:s9zJVx6wo6x517tbNvC+FZ0dFzqbjqeLI6rXBq72hQA=,tag:bXoV2I3LbpmQyddJrtS3Qg==,type:comment]
|
||||
#
|
||||
#
|
||||
#ENC[AES256_GCM,data:T4Wtn49AAxPd2QUFTR+q,iv:bH5goGWBDqumAat9dUv2OwfCUJUpuVqncTMqMBZUXhI=,tag:G+W6hHA+yftQ+4RJpXrxHg==,type:comment]
|
||||
switch:
|
||||
password: ENC[AES256_GCM,data:qu0f9L7A0eFq/UCpaRs=,iv:W8LLOp3MSfd/+EfNEZNf91K8GgI5eUfVPoWTRES2C0Y=,tag:Q5FlAOfwqwJwPvd7k6i+0g==,type:str]
|
||||
@@ -212,7 +235,7 @@ sops:
|
||||
UmliaFNxVTBqRkI1QWJpWGpTRWxETW8KEY/8AfU73UOzCGhny1cNnd5dCNv7bHXt
|
||||
k+uyWPPi+enFkVaceSwMFrA66uaWWrwAj11sXEB7yzvGFPrnAGezjQ==
|
||||
-----END AGE ENCRYPTED FILE-----
|
||||
lastmodified: "2026-03-14T19:42:34Z"
|
||||
mac: ENC[AES256_GCM,data:xnsUauduZtPvf7MHkCWkzxpD8tCKDZZ97jskvi8jOeQdRM+L9U0bs3PTfrSeXjRvt1FCEDLyLxh6+NUBmGdI24/9mPU8wVN2sLVLKQ4HkXneCiKErRLoVKdliJGD9YxpkSNuYkwNyiM442akJUG0sVJOGcOGIrxn2msqCZlwSuk=,iv:AUqsg6B6CFVKcnBX+g126Xva7+xeNpTQ3FBKVVWoGFw=,tag:YMMZXfXON0MAahtjKWWWzw==,type:str]
|
||||
lastmodified: "2026-03-21T00:50:58Z"
|
||||
mac: ENC[AES256_GCM,data:xLYH+20TGYk0piWG7OaJqysuEc2xlqpKZcvCIKj9xOIgQIXVS8l5YXXAv6c4uen2cNe/0DIWs04Cb6cdItRWWq46jV3F6+u1BOy7mSmQ40nmbKCy+qls8TaYBeqhlrffpy5yYolDdztYqBjZYQDjY6rNXUIp7UU1VJEZkpY96lI=,iv:EZUezHsy6pghcWa/rq5CObaw3CRW7JJB5zdmCp6mIAA=,tag:JJVI0EDuA90uafbLwdn4ww==,type:str]
|
||||
unencrypted_suffix: _unencrypted
|
||||
version: 3.12.1
|
||||
|
||||
51
config/services/containers/app/gitea/gitea.container.j2
Normal file
51
config/services/containers/app/gitea/gitea.container.j2
Normal file
@@ -0,0 +1,51 @@
|
||||
[Quadlet]
|
||||
DefaultDependencies=false
|
||||
|
||||
[Unit]
|
||||
Description=Gitea
|
||||
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
|
||||
[Container]
|
||||
Image=docker.io/gitea/gitea:{{ version['containers']['gitea'] }}
|
||||
|
||||
ContainerName=gitea
|
||||
HostName=gitea
|
||||
|
||||
PublishPort=3000:3000/tcp
|
||||
|
||||
Volume=%h/data/containers/gitea:/data:rw
|
||||
Volume=%h/containers/gitea/ssl:/etc/ssl/gitea:ro
|
||||
|
||||
# General
|
||||
Environment="TZ=Asia/Seoul"
|
||||
Environment="GITEA__server__DISABLE_SSH=true"
|
||||
# Database
|
||||
Environment="GITEA__database__DB_TYPE=postgres"
|
||||
Environment="GITEA__database__HOST={{ infra_uri['postgresql']['domain'] }}:{{ infra_uri['postgresql']['ports']['tcp'] }}"
|
||||
Environment="GITEA__database__NAME=gitea_db"
|
||||
Environment="GITEA__database__USER=gitea"
|
||||
Secret=GITEA__database__PASSWD,type=env
|
||||
Environment="GITEA__database__SSL_MODE=verify-full"
|
||||
Environment="PGSSLROOTCERT=/etc/ssl/gitea/ilnmors_root_ca.crt"
|
||||
# OAuth2 client
|
||||
Environment="GITEA__oauth2_client__ACCOUNT_LINKING=auto"
|
||||
# OIDC configuration
|
||||
Environment="GITEA__openid__ENABLE_OPENID_SIGNIN=false"
|
||||
Environment="GITEA__openid__ENABLE_OPENID_SIGNUP=true"
|
||||
Environment="GITEA__openid__WHITELISTED_URIS=authelia.ilnmors.com"
|
||||
# automatic create user via authelia
|
||||
Environment="GITEA__service__DISABLE_REGISTRATION=false"
|
||||
Environment="GITEA__service__ALLOW_ONLY_EXTERNAL_REGISTRATION=true"
|
||||
Environment="GITEA__service__SHOW_REGISTRATION_BUTTON=false"
|
||||
|
||||
|
||||
[Service]
|
||||
ExecStartPre=/usr/bin/nc -zv {{ infra_uri['postgresql']['domain'] }} {{ infra_uri['postgresql']['ports']['tcp'] }}
|
||||
Restart=always
|
||||
RestartSec=10s
|
||||
TimeoutStopSec=120
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
32
config/services/containers/app/immich/immich-ml.container.j2
Normal file
32
config/services/containers/app/immich/immich-ml.container.j2
Normal file
@@ -0,0 +1,32 @@
|
||||
[Quadlet]
|
||||
DefaultDependencies=false
|
||||
|
||||
[Unit]
|
||||
Description=Immich Machine Learning
|
||||
|
||||
After=immich.service
|
||||
Wants=immich.service
|
||||
|
||||
[Container]
|
||||
Image=ghcr.io/immich-app/immich-machine-learning:{{ version['containers']['immich'] }}-openvino
|
||||
|
||||
ContainerName=immich-ml
|
||||
HostName=immich-ml
|
||||
|
||||
PublishPort=3003:3003
|
||||
|
||||
# iGPU access for OpenVINO
|
||||
AddDevice=/dev/dri:/dev/dri
|
||||
PodmanArgs=--group-add keep-groups
|
||||
|
||||
Volume=%h/containers/immich/ml/cache:/cache:rw
|
||||
|
||||
Environment="TZ=Asia/Seoul"
|
||||
|
||||
[Service]
|
||||
Restart=always
|
||||
RestartSec=10s
|
||||
TimeoutStopSec=120
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
49
config/services/containers/app/immich/immich.container.j2
Normal file
49
config/services/containers/app/immich/immich.container.j2
Normal file
@@ -0,0 +1,49 @@
|
||||
[Quadlet]
|
||||
DefaultDependencies=false
|
||||
|
||||
[Unit]
|
||||
Description=Immich
|
||||
|
||||
After=redis_immich.service
|
||||
Wants=redis_immich.service
|
||||
|
||||
[Container]
|
||||
Image=ghcr.io/immich-app/immich-server:{{ version['containers']['immich'] }}
|
||||
|
||||
ContainerName=immich
|
||||
HostName=immich
|
||||
|
||||
PublishPort=2283:2283
|
||||
|
||||
# iGPU access
|
||||
AddDevice=/dev/dri:/dev/dri
|
||||
PodmanArgs=--group-add keep-groups
|
||||
|
||||
# Volumes
|
||||
Volume=%h/data/containers/immich:/data:rw
|
||||
Volume=%h/containers/immich/ssl:/etc/ssl/immich:ro
|
||||
|
||||
# Environment
|
||||
Environment="TZ=Asia/Seoul"
|
||||
Environment="REDIS_HOSTNAME=host.containers.internal"
|
||||
Environment="REDIS_PORT={{ hostvars['app']['redis']['immich'] }}"
|
||||
Environment="REDIS_DBINDEX=0"
|
||||
|
||||
# Database
|
||||
Environment="DB_HOSTNAME={{ infra_uri['postgresql']['domain'] }}"
|
||||
Environment="DB_PORT={{ infra_uri['postgresql']['ports']['tcp'] }}"
|
||||
Environment="DB_USERNAME=immich"
|
||||
Environment="DB_DATABASE_NAME=immich_db"
|
||||
Environment="DB_PASSWORD_FILE=/run/secrets/DB_PASSWORD"
|
||||
Environment="DB_SSL_MODE=verify-full"
|
||||
Environment="NODE_EXTRA_CA_CERTS=/etc/ssl/immich/ilnmors_root_ca.crt"
|
||||
Secret=IMMICH_DB_PASSWORD,target=/run/secrets/DB_PASSWORD
|
||||
|
||||
[Service]
|
||||
ExecStartPre=/usr/bin/nc -zv {{ infra_uri['postgresql']['domain'] }} {{ infra_uri['postgresql']['ports']['tcp'] }}
|
||||
Restart=always
|
||||
RestartSec=10s
|
||||
TimeoutStopSec=120
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
4
config/services/containers/app/redis/redis.conf.j2
Normal file
4
config/services/containers/app/redis/redis.conf.j2
Normal file
@@ -0,0 +1,4 @@
|
||||
databases 16
|
||||
bind 0.0.0.0
|
||||
port {{ hostvars['app']['redis'][redis_service] }}
|
||||
protected-mode no
|
||||
31
config/services/containers/app/redis/redis.container.j2
Normal file
31
config/services/containers/app/redis/redis.container.j2
Normal file
@@ -0,0 +1,31 @@
|
||||
[Quadlet]
|
||||
DefaultDependencies=false
|
||||
|
||||
[Unit]
|
||||
Description=Redis - {{ redis_service }}
|
||||
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
|
||||
[Container]
|
||||
Image=docker.io/library/redis:{{ version['containers']['redis'] }}
|
||||
|
||||
ContainerName=redis_{{ redis_service }}
|
||||
HostName=redis_{{ redis_service }}
|
||||
|
||||
PublishPort={{ hostvars['app']['redis'][redis_service] }}:{{ hostvars['app']['redis'][redis_service] }}
|
||||
|
||||
Volume=%h/containers/redis/{{ redis_service }}/data:/data:rw
|
||||
Volume=%h/containers/redis/{{ redis_service }}/redis.conf:/usr/local/etc/redis/redis.conf:ro
|
||||
|
||||
Exec=redis-server /usr/local/etc/redis/redis.conf
|
||||
|
||||
Environment="TZ=Asia/Seoul"
|
||||
|
||||
[Service]
|
||||
Restart=always
|
||||
RestartSec=10s
|
||||
TimeoutStopSec=120
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
@@ -131,3 +131,47 @@ identity_providers:
|
||||
userinfo_signed_response_alg: 'none'
|
||||
# [ client_secret_post | client_secret_basic ]
|
||||
token_endpoint_auth_method: 'client_secret_post'
|
||||
# https://www.authelia.com/integration/openid-connect/clients/gitea/
|
||||
- client_id: 'gitea'
|
||||
client_name: 'gitea'
|
||||
client_secret: '{{ hostvars['console']['gitea']['oidc']['hash'] }}'
|
||||
public: false
|
||||
authorization_policy: 'one_factor'
|
||||
require_pkce: false
|
||||
pkce_challenge_method: ''
|
||||
redirect_uris:
|
||||
- 'https://gitea.ilnmors.com/user/oauth2/authelia/callback'
|
||||
scopes:
|
||||
- 'openid'
|
||||
- 'email'
|
||||
- 'profile'
|
||||
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'
|
||||
# https://www.authelia.com/integration/openid-connect/clients/immich/
|
||||
- client_id: 'immich'
|
||||
client_name: 'immich'
|
||||
client_secret: '{{ hostvars['console']['immich']['oidc']['hash'] }}'
|
||||
public: false
|
||||
authorization_policy: 'one_factor'
|
||||
require_pkce: false
|
||||
pkce_challenge_method: ''
|
||||
redirect_uris:
|
||||
- 'https://immich.ilnmors.com/auth/login'
|
||||
- 'https://immich.ilnmors.com/user-settings'
|
||||
- 'app.immich:///oauth-callback'
|
||||
scopes:
|
||||
- 'openid'
|
||||
- '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_post'
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
key_alg hmac-sha256
|
||||
key "{file./run/secrets/CADDY_ACME_KEY}"
|
||||
}
|
||||
resolvers {{ infra_uri['bind']['domain'] }}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -34,3 +35,15 @@ vault.app.ilnmors.internal {
|
||||
header_up Host {http.request.header.X-Forwarded-Host}
|
||||
}
|
||||
}
|
||||
gitea.app.ilnmors.internal {
|
||||
import private_tls
|
||||
reverse_proxy host.containers.internal:3000 {
|
||||
header_up Host {http.request.header.X-Forwarded-Host}
|
||||
}
|
||||
}
|
||||
immich.app.ilnmors.internal {
|
||||
import private_tls
|
||||
reverse_proxy host.containers.internal:2283 {
|
||||
header_up Host {http.request.header.X-Forwarded-Host}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
key_alg hmac-sha256
|
||||
key "{file./run/secrets/CADDY_ACME_KEY}"
|
||||
}
|
||||
resolvers {{ infra_uri['bind']['domain'] }}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -72,6 +73,24 @@ vault.ilnmors.com {
|
||||
}
|
||||
}
|
||||
}
|
||||
gitea.ilnmors.com {
|
||||
import crowdsec_log
|
||||
route {
|
||||
crowdsec
|
||||
reverse_proxy https://gitea.app.ilnmors.internal {
|
||||
header_up Host {http.reverse_proxy.upstream.host}
|
||||
}
|
||||
}
|
||||
}
|
||||
immich.ilnmors.com {
|
||||
import crowdsec_log
|
||||
route {
|
||||
crowdsec
|
||||
reverse_proxy https://immich.app.ilnmors.internal {
|
||||
header_up Host {http.reverse_proxy.upstream.host}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Internal domain
|
||||
auth.ilnmors.internal {
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
key_alg hmac-sha256
|
||||
key "{file./run/secrets/CADDY_ACME_KEY}"
|
||||
}
|
||||
resolvers {{ infra_uri['bind']['domain'] }}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
0
data/create_all_structure.sh
Normal file → Executable file
0
data/create_all_structure.sh
Normal file → Executable file
@@ -69,3 +69,27 @@ git tag -a 0.0.1-caddy-app -m "caddy-app: Start caddy-app branch"
|
||||
git switch main
|
||||
git merge caddy-app
|
||||
```
|
||||
|
||||
## Connect local git and remote git
|
||||
|
||||
- Set this after gitea is implemented
|
||||
|
||||
```bash
|
||||
# Add git remote repository
|
||||
git config --global credential.helper store
|
||||
git remote add origin https://gitea.ilnmors.com/il/ilnmors-homelab.git
|
||||
# For first time to make connection between local and remote git
|
||||
git push -u origin main
|
||||
# Username for 'https://gitea.ilnmors.com': il
|
||||
# Password for 'https://il@gitea.ilnmors.com': gitea.il.token
|
||||
git push --tags
|
||||
# After first connection, -u origin main option is not needed
|
||||
git add $PATH
|
||||
git commit -m "comment"
|
||||
git tag -a $VERSION -m "comment"
|
||||
git push && git push --tags
|
||||
# -f and --force-with-lease can be used in commit and tags
|
||||
# -f option and --force-with-lease
|
||||
# -f: just overwrite forcefully without any condition. it is dangerous, because it doesn't care the changes (commit) from other local git
|
||||
# --force-with-lease: overwrite forcefully only when there's no changes (commit) from other local git
|
||||
```
|
||||
|
||||
93
docs/services/app/gitea.md
Normal file
93
docs/services/app/gitea.md
Normal file
@@ -0,0 +1,93 @@
|
||||
# gitea
|
||||
|
||||
## Prerequisite
|
||||
|
||||
### Create database
|
||||
|
||||
- Create the password with `openssl rand -base64 32`
|
||||
- Save this value in secrets.yaml in `postgresql.password.gitea`
|
||||
- Access infra server to create gitea_db with `podman exec -it postgresql psql -U postgres`
|
||||
|
||||
```SQL
|
||||
CREATE USER gitea WITH PASSWORD 'postgresql.password.gitea';
|
||||
CREATE DATABASE gitea_db;
|
||||
ALTER DATABASE gitea_db OWNER TO gitea;
|
||||
```
|
||||
|
||||
### Create oidc secret and hash
|
||||
|
||||
- Create the secret with `openssl rand -base64 32`
|
||||
- access to auth vm
|
||||
- `podman exec -it authelia sh`
|
||||
- `authelia crypto hash generate pbkdf2 --password 'gitea.oidc.secret'`
|
||||
- Save this value in secrets.yaml in `gitea.oidc.secret` and `gitea.oidc.hash`
|
||||
|
||||
### Create admin password
|
||||
|
||||
- Create the secret with `openssl rand -base64 32`
|
||||
- Save this value in secrets.yaml in `gitea.admin.password`
|
||||
-
|
||||
### Add postgresql dump backup list
|
||||
|
||||
- [set_postgresql.yaml](../../../ansible/roles/infra/tasks/services/set_postgresql.yaml)
|
||||
|
||||
```yaml
|
||||
- name: Set connected services list
|
||||
ansible.builtin.set_fact:
|
||||
connected_services:
|
||||
- ...
|
||||
- "gitea"
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
### Site installation
|
||||
|
||||
- **!CAUTION!** This is needed Only when first installing. This process isn't needed when the data is restored on `~/data/containers/gitea`
|
||||
- https://gitea.ilnmors.com
|
||||
- General setting
|
||||
- Site Title: Gitea: ilnmors
|
||||
- Administrator Account Setting
|
||||
- Administrator Username: il
|
||||
- Email Address il@ilnmors.internal
|
||||
- Password & confirm password: gitea.il.password
|
||||
- Install Gitea
|
||||
|
||||
### Oauth configuration
|
||||
|
||||
- Site Administration
|
||||
- Identity & Access: Authentication Sources: Add Authentication Source
|
||||
- Configure the following options:
|
||||
- Authentication Type: OAuth2
|
||||
- Authentication Name: authelia
|
||||
- OAuth2 Provider: OpenID Connect
|
||||
- Client ID (Key): gitea
|
||||
- Client Secret: gitea.oidc.secret
|
||||
- OpenID Connect Auto Discovery URL: https://authelia.ilnmors.com/.well-known/openid-configuration
|
||||
|
||||
### Link Account via OAuth2
|
||||
|
||||
- Login with autheila
|
||||
- Register New Account
|
||||
- Link to Existing Account
|
||||
- Link the account of administrational account which set at the inital install page
|
||||
- id and password
|
||||
|
||||
### Set repository access token
|
||||
|
||||
- Settings: Applications: Generate New Token
|
||||
- Token name: ilnmors-homelab
|
||||
- Repository and Organization Access: All
|
||||
- repository - Read and Write
|
||||
- Generate Token
|
||||
- Copy token value and save this in `secrets.yaml`
|
||||
|
||||
## Connect with loacl git repository
|
||||
|
||||
### Create remote git repository
|
||||
|
||||
- Repository: `+`
|
||||
- Name: ilnmors-homelab
|
||||
- etc: default vaules
|
||||
|
||||
- Following [07-git.md](../../runbook/07-git.md)
|
||||
86
docs/services/app/immich.md
Normal file
86
docs/services/app/immich.md
Normal file
@@ -0,0 +1,86 @@
|
||||
# immich
|
||||
|
||||
## Prerequisite
|
||||
|
||||
### Create database
|
||||
|
||||
- Create the password with `openssl rand -base64 32`
|
||||
- Save this value in secrets.yaml in `postgresql.password.immich`
|
||||
- Access infra server to create immich_db with `podman exec -it postgresql psql -U postgres`
|
||||
|
||||
```SQL
|
||||
CREATE USER immich WITH PASSWORD 'postgresql.password.immich';
|
||||
CREATE DATABASE immich_db;
|
||||
ALTER DATABASE immich_db OWNER TO immich;
|
||||
\connect immich_db
|
||||
CREATE EXTENSION IF NOT EXISTS vchord CASCADE;
|
||||
CREATE EXTENSION IF NOT EXISTS cube CASCADE;
|
||||
CREATE EXTENSION IF NOT EXISTS earthdistance CASCADE;
|
||||
\dx
|
||||
-- Check the extension is activated with `\dx`
|
||||
-- postgresql image is built with `pgvector` and `vectorchord` already
|
||||
```
|
||||
|
||||
### Create oidc secret and hash
|
||||
|
||||
- Create the secret with `openssl rand -base64 32`
|
||||
- access to auth vm
|
||||
- `podman exec -it authelia sh`
|
||||
- `authelia crypto hash generate pbkdf2 --password 'immich.oidc.secret'`
|
||||
- Save this value in secrets.yaml in `immich.oidc.secret` and `immich.oidc.hash`
|
||||
|
||||
### Create admin password
|
||||
|
||||
- Create the secret with `openssl rand -base64 32`
|
||||
- Save this value in secrets.yaml in `immich.il.password`
|
||||
-
|
||||
### Add postgresql dump backup list
|
||||
|
||||
- [set_postgresql.yaml](../../../ansible/roles/infra/tasks/services/set_postgresql.yaml)
|
||||
|
||||
```yaml
|
||||
- name: Set connected services list
|
||||
ansible.builtin.set_fact:
|
||||
connected_services:
|
||||
- ...
|
||||
- "immich"
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
### Access to immich
|
||||
|
||||
- https://immich.ilnmors.com
|
||||
- Getting started
|
||||
- admin E-mail
|
||||
- admin password
|
||||
- admin name
|
||||
- Theme
|
||||
- language
|
||||
- Server privacy
|
||||
- map
|
||||
- version check
|
||||
- User privacy
|
||||
- google cast \(disable\)
|
||||
- Storage template
|
||||
- `{{y}}/{{MM}}/{{y}}{{MM}}{{dd}}_{{hh}}{{mm}}{{ss}}`
|
||||
- Backups
|
||||
- Mobile App
|
||||
- Done
|
||||
|
||||
### Oauth configuration
|
||||
|
||||
- Administartion: Authentication Settings: OAuth: Enable
|
||||
- Issuer URL: https://auth.example.com/.well-known/openid-configuration
|
||||
- Client ID: immich
|
||||
- Client Secret: immich.oidc.secret
|
||||
- Scope: openid profile email
|
||||
- Button Text: Login with Authelia
|
||||
- Auto Register: Enable if desired
|
||||
|
||||
### Machine learning configuration
|
||||
|
||||
- Administration: Machine Learning Settings: Enable
|
||||
- URL: http://host.containers.internal:3003
|
||||
- **!CAUTION!**
|
||||
- immich-ml should contain `-openvino` to use GPU for machine learning.
|
||||
@@ -5,11 +5,11 @@
|
||||
### Create database
|
||||
|
||||
- Create the password with `openssl rand -base64 32`
|
||||
- Save this value in secrets.yaml in `postgres.password.vaultwarden`
|
||||
- Save this value in secrets.yaml in `postgresql.password.vaultwarden`
|
||||
- Access infra server to create vaultwarden_db with `podman exec -it postgresql psql -U postgres`
|
||||
|
||||
```SQL
|
||||
CREATE USER vaultwarden WITH PASSWORD 'postgres.password.vaultwarden';
|
||||
CREATE USER vaultwarden WITH PASSWORD 'postgresql.password.vaultwarden';
|
||||
CREATE DATABASE vaultwarden_db;
|
||||
ALTER DATABASE vaultwarden_db OWNER TO vaultwarden;
|
||||
```
|
||||
@@ -33,7 +33,6 @@ ALTER DATABASE vaultwarden_db OWNER TO vaultwarden;
|
||||
```yaml
|
||||
- name: Set connected services list
|
||||
ansible.builtin.set_fact:
|
||||
# telegraf has no database
|
||||
connected_services:
|
||||
- ...
|
||||
- "vaultwarden"
|
||||
|
||||
Reference in New Issue
Block a user