Add sqlite to teamspeak webhook and add "Backup" to servername
This commit is contained in:
parent
4dbec53d30
commit
1ddf34690c
5 changed files with 40 additions and 7 deletions
|
@ -34,15 +34,16 @@ teamspeak_fallback_yml:
|
||||||
name: X-Webhook-Token
|
name: X-Webhook-Token
|
||||||
|
|
||||||
teamspeak_fallback_compose:
|
teamspeak_fallback_compose:
|
||||||
watchtower: update
|
watchtower: false
|
||||||
image: ghcr.io/thecatlady/webhook
|
image: "{{ (container_registry.public, 'services/webhook') | path_join }}"
|
||||||
volumes:
|
volumes:
|
||||||
- ./config:/config:ro
|
- ./config:/config:ro
|
||||||
- data:/mnt/teamspeak_fallback_data
|
- data:/mnt/teamspeak_fallback_data
|
||||||
file:
|
file:
|
||||||
services:
|
services:
|
||||||
app:
|
app:
|
||||||
command: ["-verbose", "-hooks=/config/hooks.yml"]
|
build:
|
||||||
|
context: .
|
||||||
teamspeak:
|
teamspeak:
|
||||||
image: teamspeak
|
image: teamspeak
|
||||||
restart: always
|
restart: always
|
||||||
|
|
22
playbooks/roles/teamspeak_fallback/files/Dockerfile
Normal file
22
playbooks/roles/teamspeak_fallback/files/Dockerfile
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
FROM golang:alpine AS builder
|
||||||
|
|
||||||
|
ENV WEBHOOK_VERSION 2.8.1
|
||||||
|
WORKDIR /go/src/github.com/adnanh/webhook
|
||||||
|
|
||||||
|
RUN apk add --update --no-cache -t build-deps curl gcc libc-dev libgcc
|
||||||
|
RUN curl -L -o webhook.tar.gz "https://github.com/adnanh/webhook/archive/${WEBHOOK_VERSION}.tar.gz" && \
|
||||||
|
tar -xzf webhook.tar.gz --strip 1 && \
|
||||||
|
go get -d && \
|
||||||
|
go build -ldflags="-s -w" -o /usr/local/bin/webhook
|
||||||
|
|
||||||
|
|
||||||
|
FROM alpine:3.20.1
|
||||||
|
|
||||||
|
RUN apk add --update --no-cache curl jq sqlite
|
||||||
|
COPY --from=builder /usr/local/bin/webhook /usr/local/bin/webhook
|
||||||
|
|
||||||
|
WORKDIR /config
|
||||||
|
EXPOSE 9000
|
||||||
|
|
||||||
|
ENTRYPOINT ["/usr/local/bin/webhook"]
|
||||||
|
CMD ["-verbose", "-hooks=/config/hooks.yml"]
|
|
@ -1,4 +1,5 @@
|
||||||
#!/usr/bin/env sh
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
chown -R "${TEAMSPEAK_USER}:${TEAMSPEAK_GROUP}" /mnt/teamspeak_fallback_data
|
chown -R "${TEAMSPEAK_USER}:${TEAMSPEAK_GROUP}" /mnt/teamspeak_fallback_data
|
||||||
|
sqlite3 "$WEBHOOK_DATA" "UPDATE server_properties SET value='Vollidioten (Backup)' WHERE ident='virtualserver_name';"
|
||||||
install -o "${TEAMSPEAK_USER}" -g "${TEAMSPEAK_GROUP}" -m 644 "$WEBHOOK_DATA" "/mnt/teamspeak_fallback_data/ts3server.sqlitedb"
|
install -o "${TEAMSPEAK_USER}" -g "${TEAMSPEAK_GROUP}" -m 644 "$WEBHOOK_DATA" "/mnt/teamspeak_fallback_data/ts3server.sqlitedb"
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
---
|
---
|
||||||
- name: Restart service {{ role_name }}
|
- name: Restart service {{ role_name }}
|
||||||
ansible.builtin.include_tasks: tasks/restart-service.yml
|
ansible.builtin.include_tasks: tasks/restart-service.yml
|
||||||
|
- name: Rebuild service {{ role_name }}
|
||||||
|
ansible.builtin.include_tasks: tasks/rebuild-service.yml
|
||||||
|
|
|
@ -11,6 +11,13 @@
|
||||||
- name: Import prepare tasks for common service
|
- name: Import prepare tasks for common service
|
||||||
ansible.builtin.import_tasks: tasks/prepare-common-service.yml
|
ansible.builtin.import_tasks: tasks/prepare-common-service.yml
|
||||||
|
|
||||||
|
- name: Copy the Dockerfile
|
||||||
|
ansible.builtin.copy:
|
||||||
|
src: Dockerfile
|
||||||
|
dest: "{{ (service_path, 'Dockerfile') | path_join }}"
|
||||||
|
mode: "0644"
|
||||||
|
notify: Rebuild service {{ role_name }}
|
||||||
|
|
||||||
- name: Template the conditional-start script
|
- name: Template the conditional-start script
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: conditional-start.sh.j2
|
src: conditional-start.sh.j2
|
||||||
|
@ -19,17 +26,17 @@
|
||||||
|
|
||||||
- name: Set webhook config path
|
- name: Set webhook config path
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
config_path: "{{ (service_path, 'config') | path_join }}"
|
teamspeak_fallback_config_path: "{{ (service_path, 'config') | path_join }}"
|
||||||
|
|
||||||
- name: Create config directory
|
- name: Create config directory
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "{{ config_path }}"
|
path: "{{ teamspeak_fallback_config_path }}"
|
||||||
state: directory
|
state: directory
|
||||||
mode: "0755"
|
mode: "0755"
|
||||||
|
|
||||||
- name: Create main config
|
- name: Create main config
|
||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
dest: "{{ (config_path, 'hooks.yml') | path_join }}"
|
dest: "{{ (teamspeak_fallback_config_path, 'hooks.yml') | path_join }}"
|
||||||
content: '{{ teamspeak_fallback_yml | to_nice_yaml }}'
|
content: '{{ teamspeak_fallback_yml | to_nice_yaml }}'
|
||||||
mode: "0644"
|
mode: "0644"
|
||||||
notify: Restart service {{ role_name }}
|
notify: Restart service {{ role_name }}
|
||||||
|
@ -37,7 +44,7 @@
|
||||||
- name: Copy the teamspeak-fallback-db script
|
- name: Copy the teamspeak-fallback-db script
|
||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
src: teamspeak-fallback-db
|
src: teamspeak-fallback-db
|
||||||
dest: "{{ (config_path, 'teamspeak-fallback-db') | path_join }}"
|
dest: "{{ (teamspeak_fallback_config_path, 'teamspeak-fallback-db') | path_join }}"
|
||||||
mode: "0755"
|
mode: "0755"
|
||||||
|
|
||||||
- name: Import start tasks for common service
|
- name: Import start tasks for common service
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue