various fixed
This commit is contained in:
@@ -8,6 +8,11 @@
|
|||||||
name: fail2ban
|
name: fail2ban
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
|
- name: Install sudo
|
||||||
|
ansible.builtin.apt:
|
||||||
|
name: sudo
|
||||||
|
state: present
|
||||||
|
|
||||||
- name: Create user
|
- name: Create user
|
||||||
ansible.builtin.user:
|
ansible.builtin.user:
|
||||||
name: fail2forward
|
name: fail2forward
|
||||||
@@ -38,6 +43,16 @@
|
|||||||
group: root
|
group: root
|
||||||
mode: '0755'
|
mode: '0755'
|
||||||
|
|
||||||
|
- name: Allow fail2forward to run fail2ban-client
|
||||||
|
ansible.builtin.copy:
|
||||||
|
content: |
|
||||||
|
fail2forward ALL=(root) NOPASSWD: /usr/bin/fail2ban-client set sshd banip *, /usr/bin/fail2ban-client set sshd unbanip *
|
||||||
|
dest: /etc/sudoers.d/fail2forward
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: '0440'
|
||||||
|
validate: /usr/sbin/visudo -cf %s
|
||||||
|
|
||||||
- name: Copy jail.local
|
- name: Copy jail.local
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: jail.local.j2
|
src: jail.local.j2
|
||||||
|
|||||||
@@ -4,12 +4,12 @@ case "$SSH_ORIGINAL_COMMAND" in
|
|||||||
"ban "*)
|
"ban "*)
|
||||||
ip="${SSH_ORIGINAL_COMMAND#ban }"
|
ip="${SSH_ORIGINAL_COMMAND#ban }"
|
||||||
[[ "$ip" =~ ^[0-9.]+$|^[0-9a-fA-F:]+$ ]] || { echo "bad ip"; exit 1; }
|
[[ "$ip" =~ ^[0-9.]+$|^[0-9a-fA-F:]+$ ]] || { echo "bad ip"; exit 1; }
|
||||||
exec fail2ban-client set sshd banip "$ip"
|
exec sudo /usr/bin/fail2ban-client set sshd banip "$ip"
|
||||||
;;
|
;;
|
||||||
"unban "*)
|
"unban "*)
|
||||||
ip="${SSH_ORIGINAL_COMMAND#unban }"
|
ip="${SSH_ORIGINAL_COMMAND#unban }"
|
||||||
[[ "$ip" =~ ^[0-9.]+$|^[0-9a-fA-F:]+$ ]] || { echo "bad ip"; exit 1; }
|
[[ "$ip" =~ ^[0-9.]+$|^[0-9a-fA-F:]+$ ]] || { echo "bad ip"; exit 1; }
|
||||||
exec fail2ban-client set sshd unbanip "$ip"
|
exec sudo /usr/bin/fail2ban-client set sshd unbanip "$ip"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "denied" >&2; exit 1
|
echo "denied" >&2; exit 1
|
||||||
|
|||||||
@@ -3,9 +3,9 @@ actionstart =
|
|||||||
actionstop =
|
actionstop =
|
||||||
actioncheck =
|
actioncheck =
|
||||||
|
|
||||||
actionban = sudo -u fail2forward ssh -i ~fail2forward/.ssh/id_rsa -o BatchMode=yes -o ConnectTimeout=5 -o ServerAliveInterval=5 <forward_user>@<forward_host> ban <ip>
|
actionban = sudo -u fail2forward ssh -i ~fail2forward/.ssh/id_rsa -o BatchMode=yes -o StrictHostKeyChecking=accept-new -o ConnectTimeout=5 -o ServerAliveInterval=5 <forward_user>@<forward_host> ban <ip>
|
||||||
|
|
||||||
actionunban = sudo -u fail2forward ssh -i ~fail2forward/.ssh/id_rsa -o BatchMode=yes -o ConnectTimeout=5 -o ServerAliveInterval=5 <forward_user>@<forward_host> unban <ip>
|
actionunban = sudo -u fail2forward ssh -i ~fail2forward/.ssh/id_rsa -o BatchMode=yes -o StrictHostKeyChecking=accept-new -o ConnectTimeout=5 -o ServerAliveInterval=5 <forward_user>@<forward_host> unban <ip>
|
||||||
|
|
||||||
[Init]
|
[Init]
|
||||||
forward_host = animeistrash.org
|
forward_host = animeistrash.org
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
services:
|
services:
|
||||||
homeserver:
|
homeserver:
|
||||||
image: "forgejo.ellis.link/continuwuation/continuwuity:latest"
|
image: "forgejo.ellis.link/continuwuation/continuwuity:v0.5.10"
|
||||||
|
pull_policy: always
|
||||||
restart: always
|
restart: always
|
||||||
command: /sbin/conduwuit
|
command: /sbin/conduwuit
|
||||||
ports:
|
ports:
|
||||||
|
|||||||
@@ -47,7 +47,8 @@ services:
|
|||||||
- monitoring
|
- monitoring
|
||||||
|
|
||||||
alloy:
|
alloy:
|
||||||
image: docker.io/grafana/alloy
|
image: docker.io/grafana/alloy:v1.17.1
|
||||||
|
pull_policy: always
|
||||||
container_name: alloy
|
container_name: alloy
|
||||||
ports:
|
ports:
|
||||||
- '127.0.0.1:12345:12345'
|
- '127.0.0.1:12345:12345'
|
||||||
@@ -70,10 +71,10 @@ services:
|
|||||||
restart: always
|
restart: always
|
||||||
|
|
||||||
podman-exporter:
|
podman-exporter:
|
||||||
image: quay.io/navidys/prometheus-podman-exporter
|
image: quay.io/navidys/prometheus-podman-exporter:1.21.2
|
||||||
container_name: podman-exporter
|
container_name: podman-exporter
|
||||||
|
pull_policy: always
|
||||||
restart: always
|
restart: always
|
||||||
privileged: true
|
|
||||||
user: root
|
user: root
|
||||||
ports:
|
ports:
|
||||||
- '127.0.0.1:9882:9882'
|
- '127.0.0.1:9882:9882'
|
||||||
|
|||||||
@@ -57,7 +57,7 @@
|
|||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: docker-compose.yml.j2
|
src: docker-compose.yml.j2
|
||||||
dest: /opt/beeserver/monitoring/docker-compose.yml
|
dest: /opt/beeserver/monitoring/docker-compose.yml
|
||||||
mode: '0644'
|
mode: '0600'
|
||||||
|
|
||||||
- name: Copy prometheus config
|
- name: Copy prometheus config
|
||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ hostname="localhost:8080"
|
|||||||
log = { level="info" }
|
log = { level="info" }
|
||||||
|
|
||||||
api_key="{{ ott_api_key }}"
|
api_key="{{ ott_api_key }}"
|
||||||
session_secret="{{ ott_api_key }}"
|
session_secret="{{ ott_session_secret }}"
|
||||||
|
|
||||||
[info_extractor.youtube]
|
[info_extractor.youtube]
|
||||||
api_key="{{ google_api_key }}"
|
api_key="{{ google_api_key }}"
|
||||||
|
|||||||
Reference in New Issue
Block a user