add simplytranslate; make the PF playbook mostly tagged; make caddy reload not restart

This commit is contained in:
Arya 2023-06-05 17:02:24 +08:00
parent fac9e01a1e
commit 99955a9b27
Signed by: arya
GPG Key ID: 842D12BDA50DF120
4 changed files with 56 additions and 2 deletions

View File

@ -0,0 +1,9 @@
version: "3"
services:
simplytranslate:
image: quay.io/pussthecatorg/simplytranslate:latest
ports:
- "127.0.0.1:5046:5000" # Replace with "5000:5000" if you don't use a reverse proxy
volumes:
- "./extras.conf:/etc/simplytranslate/web.conf"

View File

@ -0,0 +1,23 @@
[libre]
Enabled = False
Instance = https://libretranslate.com
[google]
Enabled = True
[deepl]
# Deepl Translate does not support async as of right now, it will block all other requests
# while it's processing a Deepl Requests, please enable this with caution!
Enabled = True
[iciba]
# ICIBA Translate (a.k.a. PowerWord) is disabled by default.
Enabled = True
[reverso]
Enabled = True
[network]
port = 5000
host = 0.0.0.0

View File

@ -3,37 +3,46 @@
file:
path: /opt/docker/{{item}}
state: directory
tags: docker
- name: Copy docker-compose templates for the service
template:
src: ./compose/{{item}}/compose.yml.j2
dest: /opt/docker/{{item}}/compose.yml
backup: yes
register: check_status
tags: docker
- name: check if extras file exists for the service
local_action: stat path=./compose/{{item}}/extras.conf.j2
register: file
tags: docker
- name: Copy extras file
template:
src: ./compose/{{item}}/extras.conf.j2
dest: /opt/docker/{{item}}/extras.conf
backup: yes
when: file.stat.exists
tags: docker
- name: "Update docker service image"
command:
chdir: "/opt/docker/{{ item }}"
cmd: docker compose pull
when: check_status.changed
tags: docker
- name: "Stop docker service"
command:
chdir: "/opt/docker/{{ item }}"
cmd: docker compose down
when: check_status.changed
tags: docker
- name: "Start docker service"
command:
chdir: "/opt/docker/{{ item }}"
cmd: docker compose up -d --build --remove-orphans
when: check_status.changed
tags: docker

View File

@ -11,16 +11,24 @@
# Static weekly builds of caddy with rfc2136 dns plugin
caddy_url_base: "https://cb.projectsegfau.lt/api/download"
tasks:
# This is run again so config still updates even if i dont run the role which isnt needed most of the time
- name: Copy Caddyfile
template:
src: ./templates/Caddyfile.j2
dest: /etc/caddy/Caddyfile
tags: caddy-non-update
- name: Copy per-server caddy extras
copy:
src: "./templates/{{ inventory_hostname }}/"
dest: /etc/caddy/
directory_mode: true
- name: Restart
tags: caddy-non-update
- name: Reload Caddy
service:
name: caddy
enabled: yes
state: restarted
state: reloaded
tags: caddy-non-update
- name: Setup docker compose for privacy frontends
hosts: privfrontends
vars:
@ -37,6 +45,7 @@
- rimgo
- scribe
- teddit
- simplytranslate
- watchtower
non_pizza_docker_services:
#- piped
@ -49,9 +58,11 @@
- name: Update docker compose files and restart those with changes
include_tasks: docker-tasks.yaml
with_items: "{{ docker_services }}"
tags: docker
- name: Update docker compose files and restart those with changes (Privacy Frontends but without Pizza1)
include_tasks: docker-tasks.yaml
with_items: "{{ non_pizza_docker_services }}"
tags: docker
- name: Setup cron jobs
hosts: privfrontends
@ -61,8 +72,10 @@
name: "hourly invidious restart"
special_time: hourly
job: "docker restart invidious-invidious-1 && curl https://healthchecks.projectsegfau.lt/ping/{{invidious_hc_uuid}}"
tags: cron
- name: Restart teddit every hour
cron:
name: "hourly teddit restart"
special_time: hourly
job: "docker restart teddit && curl https://healthchecks.projectsegfau.lt/ping/{{teddit_hc_uuid}}"
tags: cron