From 4b5a13a0de9e4d9fadb6720b73b6a91c4aecf5a2 Mon Sep 17 00:00:00 2001 From: Opnxng Date: Sat, 16 Nov 2024 23:52:19 +0800 Subject: [PATCH] Added Standardnotes --- config-tasks/caddy.yaml | 1 + templates/compose/standardnotes.yaml.j2 | 22 ++++++++++++++++++++++ templates/conf/Caddyfile.j2 | 9 +++++++++ vars/services.yaml | 7 ++++--- 4 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 templates/compose/standardnotes.yaml.j2 diff --git a/config-tasks/caddy.yaml b/config-tasks/caddy.yaml index e47594a..4e1a33f 100644 --- a/config-tasks/caddy.yaml +++ b/config-tasks/caddy.yaml @@ -19,6 +19,7 @@ state: latest install_recommends: false delegate_to: "{{ control_host }}" + become: true - name: Curl IP block range file by ProjectSegfault command: curl --output /tmp/blocked-ranges.yaml https://raw.githubusercontent.com/ProjectSegfault/ansible/master/privfrontends/blocked-ranges.yaml diff --git a/templates/compose/standardnotes.yaml.j2 b/templates/compose/standardnotes.yaml.j2 new file mode 100644 index 0000000..b7f027e --- /dev/null +++ b/templates/compose/standardnotes.yaml.j2 @@ -0,0 +1,22 @@ +# {{ ansible_managed }} +services: + standardnotes: + image: standardnotes/web:latest + container_name: standardnotes + security_opt: + - no-new-privileges +# cap_drop: +# - ALL + environment: + - PUID=1000 + - PGID=1000 + - TZ=Asia/Singapore + restart: unless-stopped + ports: + - 8911:80 + networks: + - standardnotes + +networks: + standardnotes: + name: standardnotes diff --git a/templates/conf/Caddyfile.j2 b/templates/conf/Caddyfile.j2 index 45bed91..93dfa31 100755 --- a/templates/conf/Caddyfile.j2 +++ b/templates/conf/Caddyfile.j2 @@ -599,6 +599,15 @@ } } + @sn host sn.{$HOSTNAME} + handle @sn { + encode zstd gzip + reverse_proxy {{ vultr_private_ip }}:8911 + header { + X-Robots-Tag "noindex, noimageindex, nosnippet, notranslate, noarchive, nofollow" + } + } + } # ---------------------------------------------------------------------------------------------------- diff --git a/vars/services.yaml b/vars/services.yaml index 9efcf47..38161a0 100644 --- a/vars/services.yaml +++ b/vars/services.yaml @@ -1,11 +1,12 @@ -config: - oracle3: - - gitea-netrc +compose: + vultr: + - standardnotes # ---------------------------------------------------------------------------------------------------- deployed_compose: vultr: + - standardnotes - imgin - rat-aint-tieba - watchtower