CLean up searxng and invidious configuration to be production ready, re-enable all VPN tunnels

This commit is contained in:
Curt Spark 2024-06-28 22:13:49 +01:00
parent 65143bec14
commit 3341c22150
7 changed files with 54 additions and 62 deletions

View File

@ -1,6 +0,0 @@
# {{ ansible_managed }}
all:
hosts:
{{ proxy_server_hostname }}:
{{ proxy_server_hostname }}-defaultport:

View File

@ -1,10 +0,0 @@
- hosts: localhost
tasks:
- name: Generate hosts file
template:
src: "ansible_resources/hosts"
dest: "hosts"
mode: '0777'
- name: Debug Finish message
debug:
msg: Ansible playbook has finished!

View File

@ -18,29 +18,29 @@ PublicKey = {{ git_service_pubkey }}
AllowedIPs = 10.0.0.3/32 AllowedIPs = 10.0.0.3/32
# Invidious Service # Invidious Service
#[Peer] [Peer]
#PublicKey = {{ invidious_service_pubkey }} PublicKey = {{ invidious_service_pubkey }}
#AllowedIPs = 10.0.0.3/32 AllowedIPs = 10.0.0.3/32
# Searxng Service # Searxng Service
#[Peer] [Peer]
#PublicKey = {{ searxng_service_pubkey }} PublicKey = {{ searxng_service_pubkey }}
#AllowedIPs = 10.0.0.4/32 AllowedIPs = 10.0.0.4/32
# Nextcloud Service # Nextcloud Service
#[Peer] [Peer]
#PublicKey = {{ nextcloud_service_pubkey }} PublicKey = {{ nextcloud_service_pubkey }}
#AllowedIPs = 10.0.0.5/32 AllowedIPs = 10.0.0.5/32
# Chat Service # Chat Service
#[Peer] [Peer]
#PublicKey = {{ chat_service_pubkey }} PublicKey = {{ chat_service_pubkey }}
#AllowedIPs = 10.0.0.6/32 AllowedIPs = 10.0.0.6/32
# Minecraft Service # Minecraft Service
#[Peer] [Peer]
#PublicKey = {{ minecraft_service_pubkey }} PublicKey = {{ minecraft_service_pubkey }}
#AllowedIPs = 10.0.0.7/32 AllowedIPs = 10.0.0.7/32
# Connection to backend server for icinga2 # Connection to backend server for icinga2

View File

@ -10,12 +10,12 @@
group: service_invidious group: service_invidious
state: directory state: directory
loop: loop:
- "{{ services_directory }}/service_invidious/invidious" - "{{ services_directory }}/service_invidious/"
- "{{ services_directory }}/service_invidious/postgresdata" - "{{ services_directory }}/service_invidious/postgres-data"
- name: Copy docker compose config and other invidious files - name: Copy docker compose config and other invidious files
ansible.builtin.template: ansible.builtin.template:
src: "{{ item }}" src: "{{ item }}"
dest: "{{ services_directory }}/service_invidious/invidious/{{ item }}" dest: "{{ services_directory }}/service_invidious/{{ item }}"
owner: service_invidious owner: service_invidious
group: service_invidious group: service_invidious
loop: loop:
@ -25,11 +25,17 @@
ansible.builtin.template: ansible.builtin.template:
src: "{{ item }}" src: "{{ item }}"
dest: "{{ services_directory }}/service_invidious/postgres-data/{{ item }}" dest: "{{ services_directory }}/service_invidious/postgres-data/{{ item }}"
owner: systemd-coredump owner: service_invidious
group: systemd-coredump group: service_invidious
loop: loop:
- postgresql.conf - postgresql.conf
# Note: Currently the repository has to be cloned, this is because the init-invidious-db.sh file and the config/sql directory have to be mounted to the postgres container. This "problem" will be solved in the future.
- name: Clone invidious git repository
ansible.builtin.git:
repo: https://github.com/iv-org/invidious.git
dest: "{{ services_directory }}/service_invidious/invidious-git"
- name: Debug Finish message - name: Debug Finish message
debug: debug:

View File

@ -1,7 +1,5 @@
# {{ ansible_managed }} # {{ ansible_managed }}
version: "3"
services: services:
# Gluetun is used to connect container to VPN # Gluetun is used to connect container to VPN
@ -23,9 +21,10 @@ services:
networks: networks:
invidious: invidious:
deploy: deploy:
limits: resources:
cpus: '0.10' limits:
memory: 512M cpus: '0.10'
memory: 512M
invidious: invidious:
network_mode: "service:invidious-gluetun" network_mode: "service:invidious-gluetun"
@ -66,19 +65,20 @@ services:
depends_on: depends_on:
- invidious-db - invidious-db
deploy: deploy:
limits: resources:
cpus: '0.25' limits:
memory: 512M cpus: '0.25'
memory: 512M
invidious-db: invidious-db:
image: docker.io/library/postgres:14 image: docker.io/library/postgres:16-alpine
restart: unless-stopped restart: unless-stopped
volumes: volumes:
- type: bind - type: bind
source: {{ services_directory }}/service_invidious/postgres-data source: {{ services_directory }}/service_invidious/postgres-data
target: /var/lib/postgresql/data target: /var/lib/postgresql/data
- ./config/sql:/config/sql - ./invidious-git/config/sql:/config/sql
- ./docker/init-invidious-db.sh:/docker-entrypoint-initdb.d/init-invidious-db.sh - ./invidious-git/docker/init-invidious-db.sh:/docker-entrypoint-initdb.d/init-invidious-db.sh
environment: environment:
POSTGRES_DB: invidious POSTGRES_DB: invidious
POSTGRES_USER: invidious POSTGRES_USER: invidious
@ -89,9 +89,10 @@ services:
invidious: invidious:
ipv4_address: 11.1.0.22 ipv4_address: 11.1.0.22
deploy: deploy:
limits: resources:
cpus: '0.10' limits:
memory: 128M cpus: '0.10'
memory: 128M
networks: networks:
invidious: invidious:

View File

@ -1,2 +1,2 @@
# Example service secrets for invidious docker service, to be encrypted with ansible vault and called servicesecrets.enc # Example service secrets for invidious docker service, to be encrypted with ansible vault and called servicesecrets.enc
service_invidious_postgres_pass: *** service_invidious_postgres_password: ***

View File

@ -1,7 +1,5 @@
# {{ ansible_managed }} # {{ ansible_managed }}
version: '3.7'
services: services:
# Gluetun is used to connect container to VPN # Gluetun is used to connect container to VPN
@ -21,9 +19,10 @@ services:
ports: ports:
- "8080:8080" - "8080:8080"
deploy: deploy:
limits: resources:
cpus: '0.10' limits:
memory: 512M cpus: '0.10'
memory: 512M
searxng-redis: searxng-redis:
network_mode: "service:searxng-gluetun" network_mode: "service:searxng-gluetun"
@ -39,9 +38,10 @@ services:
- SETUID - SETUID
- DAC_OVERRIDE - DAC_OVERRIDE
deploy: deploy:
limits: resources:
cpus: '0.10' limits:
memory: 128M cpus: '0.10'
memory: 128M
# If you want to change container listen port from default 8080 https://github.com/searxng/searxng-docker/issues/20 # If you want to change container listen port from default 8080 https://github.com/searxng/searxng-docker/issues/20
# Set environment variable BIND_ADDRESS, example: # Set environment variable BIND_ADDRESS, example:
@ -72,6 +72,7 @@ services:
max-size: "1m" max-size: "1m"
max-file: "1" max-file: "1"
deploy: deploy:
limits: resources:
cpus: '0.25' limits:
memory: 512M cpus: '0.25'
memory: 512M