Added mastodon, tautulli
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
---
|
||||
# Unable to use ansible.builtin.lineinfile, because we need to run this through the proxmox host (because SSH is not enabled duh)
|
||||
|
||||
- name: Allow SSH into LXC
|
||||
ansible.builtin.command: lxc-attach -n 611 -- sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
|
||||
|
||||
- name: Restart SSH Service
|
||||
ansible.builtin.command: lxc-attach -n 611 service ssh restart
|
||||
@@ -0,0 +1,28 @@
|
||||
---
|
||||
- name: Create directory for docker-compose
|
||||
ansible.builtin.file:
|
||||
path: /root/docker/
|
||||
state: directory
|
||||
mode: "0755"
|
||||
|
||||
- name: Copy .env file
|
||||
template:
|
||||
src: ".env"
|
||||
dest: /root/docker/.env
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0755
|
||||
|
||||
- name: Copy docker-compose file
|
||||
template:
|
||||
src: "docker-compose.yml"
|
||||
dest: /root/docker/docker-compose.yml
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0755
|
||||
|
||||
- name: Run docker-compose
|
||||
ansible.builtin.shell:
|
||||
args:
|
||||
cmd: docker compose up -d
|
||||
chdir: /root/docker/
|
||||
@@ -0,0 +1,39 @@
|
||||
PUID=1000
|
||||
PGID=1000
|
||||
TZ=Europe/Lisbon
|
||||
LOCAL_DOMAIN=social.lino.cooking
|
||||
REDIS_HOST=redis
|
||||
REDIS_PORT=6379
|
||||
DB_HOST=database
|
||||
DB_USER={{ mastodon_db_user }}
|
||||
DB_NAME={{ mastodon_db_name }}
|
||||
DB_PASS={{ mastodon_db_pass }}
|
||||
DB_PORT=5432
|
||||
POSTGRES_PASSWORD={{ mastodon_db_pass }}
|
||||
POSTGRES_USER={{ mastodon_db_user }}
|
||||
POSTGRES_DB={{ mastodon_db_name }}
|
||||
ES_ENABLED=false
|
||||
SECRET_KEY_BASE={{ mastodon_key_base }}
|
||||
OTP_SECRET={{ mastodon_otp_secret }}
|
||||
VAPID_PRIVATE_KEY={{ mastodon_vapid_private_key }}
|
||||
VAPID_PUBLIC_KEY={{ mastodon_vapid_public_key }}
|
||||
SMTP_SERVER=smtp.gmail.com
|
||||
SMTP_PORT=587
|
||||
SMTP_LOGIN=okulto@gmail.com
|
||||
SMTP_PASSWORD={{ gmail_smtp_pass }}
|
||||
SMTP_FROM_ADDRESS=mastodon@lino.cooking
|
||||
S3_ENABLED=false
|
||||
WEB_DOMAIN=social.lino.cooking
|
||||
#ES_HOST=es #optional
|
||||
#ES_PORT=9200 #optional
|
||||
#ES_USER=elastic #optional
|
||||
#ES_PASS=elastic #optional
|
||||
#S3_BUCKET= #optional
|
||||
#AWS_ACCESS_KEY_ID= #optional
|
||||
#AWS_SECRET_ACCESS_KEY= #optional
|
||||
#S3_ALIAS_HOST= #optional
|
||||
#SIDEKIQ_ONLY=false #optional
|
||||
#SIDEKIQ_QUEUE= #optional
|
||||
#SIDEKIQ_DEFAULT=false #optional
|
||||
#SIDEKIQ_THREADS=5 #optional
|
||||
#DB_POOL=5 #optional
|
||||
@@ -0,0 +1,30 @@
|
||||
version: "2.1"
|
||||
services:
|
||||
mastodon:
|
||||
image: lscr.io/linuxserver/mastodon:latest
|
||||
container_name: mastodon
|
||||
env_file:
|
||||
- .env
|
||||
volumes:
|
||||
- /config:/config
|
||||
ports:
|
||||
- 80:80
|
||||
restart: unless-stopped
|
||||
|
||||
redis:
|
||||
container_name: redis
|
||||
image: redis:latest
|
||||
restart: always
|
||||
env_file:
|
||||
- .env
|
||||
|
||||
database:
|
||||
container_name: database
|
||||
image: postgres:14
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
PG_DATA: /var/lib/postgresql/data
|
||||
volumes:
|
||||
- /psql/data:/var/lib/postgresql/data
|
||||
restart: always
|
||||
@@ -0,0 +1,27 @@
|
||||
---
|
||||
- name: Get convenience script
|
||||
uri:
|
||||
url: "https://get.docker.com"
|
||||
method: GET
|
||||
dest: /tmp/get-docker.sh
|
||||
mode: a+x
|
||||
creates: /tmp/get-docker.sh
|
||||
|
||||
- name: Execute script
|
||||
ansible.builtin.shell: /tmp/get-docker.sh
|
||||
|
||||
- name: Ensure group "docker" exists
|
||||
ansible.builtin.group:
|
||||
name: docker
|
||||
state: present
|
||||
|
||||
- name: Add root user to docker group
|
||||
ansible.builtin.user:
|
||||
name: root
|
||||
groups: docker
|
||||
append: yes
|
||||
|
||||
- name: Enable docker on startup
|
||||
ansible.builtin.shell: |
|
||||
systemctl enable docker.service
|
||||
systemctl enable containerd.service
|
||||
@@ -0,0 +1,28 @@
|
||||
---
|
||||
- name: Create container
|
||||
community.general.proxmox:
|
||||
vmid: 611
|
||||
node: epona
|
||||
api_user: root@pam
|
||||
api_password: "{{ proxmox_api_password }}"
|
||||
api_host: 10.0.2.2
|
||||
password: "{{ lxc_password }}"
|
||||
hostname: mastodon
|
||||
ostemplate: "hyrule-8tb-nfs:vztmpl/debian-11-standard_11.3-1_amd64.tar.zst"
|
||||
netif: "{'net0':'name=eth0,\
|
||||
gw=10.0.0.1,\
|
||||
ip=10.0.2.20/21,\
|
||||
hwaddr=cc:c6:cf:de:17:80,\
|
||||
bridge=vmbr0'}"
|
||||
cores: 4
|
||||
memory: 8192
|
||||
unprivileged: no
|
||||
swap: 0
|
||||
searchdomain: "home"
|
||||
onboot: 1
|
||||
features:
|
||||
- nesting=1
|
||||
- keyctl=1
|
||||
disk: local-lvm:50
|
||||
mounts: '{"mp0":"local-lvm:5,mp=/psql,backup=1", "mp1":"local-lvm:5,mp=/redis,backup=1", "mp2":"local-lvm:1,mp=/config,backup=1"}'
|
||||
force: yes
|
||||
@@ -0,0 +1,26 @@
|
||||
---
|
||||
- name: Stop container
|
||||
community.general.proxmox:
|
||||
vmid: "{{ vmid }}"
|
||||
api_user: root@pam
|
||||
api_password: "{{ proxmox_api_password }}"
|
||||
api_host: 10.0.2.2
|
||||
state: stopped
|
||||
ignore_errors: true
|
||||
timeout: 90
|
||||
|
||||
- name: Remove containers
|
||||
community.general.proxmox:
|
||||
vmid: "{{ vmid }}"
|
||||
api_user: root@pam
|
||||
api_password: "{{ proxmox_api_password }}"
|
||||
api_host: 10.0.2.2
|
||||
state: absent
|
||||
ignore_errors: true
|
||||
timeout: 90
|
||||
|
||||
- name: Remove .ssh/known_hosts lines
|
||||
ansible.builtin.lineinfile:
|
||||
path: /Users/lino.silva/.ssh/known_hosts
|
||||
state: absent
|
||||
regexp: "^10.0.2.20"
|
||||
@@ -0,0 +1,8 @@
|
||||
---
|
||||
- name: Start deployments
|
||||
community.general.proxmox:
|
||||
vmid: "{{ vmid }}"
|
||||
api_user: root@pam
|
||||
api_password: "{{ proxmox_api_password }}"
|
||||
api_host: 10.0.2.2
|
||||
state: started
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
- name: Update all packages to their latest version
|
||||
become: true
|
||||
ansible.builtin.apt:
|
||||
update_cache: yes
|
||||
upgrade: full
|
||||
@@ -51,7 +51,7 @@ notifier:
|
||||
disable_startup_check: false
|
||||
smtp:
|
||||
username: okulto@gmail.com
|
||||
password: tcqmoqyeoknwqcqj
|
||||
password: {{ gmail_smtp_pass }}
|
||||
host: smtp.gmail.com
|
||||
port: 587
|
||||
sender: okulto@gmail.com
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
## Version 2023/02/05
|
||||
# make sure that your mastodon container is named mastodon
|
||||
# make sure that your dns has a cname set for mastodon
|
||||
# make sure you set `WEB_DOMAIN=mastodon.example.com` env var for the mastodon container
|
||||
# if you set `LOCAL_DOMAIN=example.com` (without the mastodon subdomain), then don't forget to add
|
||||
# the location block for redirecting `/.well-known/webfinger` into your main server block for the WEB_DOMAIN
|
||||
# See the upstream docs for more info: https://docs.joinmastodon.org/admin/config/#basic
|
||||
|
||||
server {
|
||||
listen 443 ssl;
|
||||
listen [::]:443 ssl;
|
||||
|
||||
server_name social.*;
|
||||
|
||||
include /config/nginx/ssl.conf;
|
||||
|
||||
client_max_body_size 0;
|
||||
|
||||
# enable for ldap auth (requires ldap-location.conf in the location block)
|
||||
#include /config/nginx/ldap-server.conf;
|
||||
|
||||
# enable for Authelia (requires authelia-location.conf in the location block)
|
||||
#include /config/nginx/authelia-server.conf;
|
||||
|
||||
# enable for Authentik (requires authentik-location.conf in the location block)
|
||||
#include /config/nginx/authentik-server.conf;
|
||||
|
||||
location / {
|
||||
# enable the next two lines for http auth
|
||||
#auth_basic "Restricted";
|
||||
#auth_basic_user_file /config/nginx/.htpasswd;
|
||||
|
||||
# enable for ldap auth (requires ldap-server.conf in the server block)
|
||||
#include /config/nginx/ldap-location.conf;
|
||||
|
||||
# enable for Authelia (requires authelia-server.conf in the server block)
|
||||
#include /config/nginx/authelia-location.conf;
|
||||
|
||||
# enable for Authentik (requires authentik-server.conf in the server block)
|
||||
#include /config/nginx/authentik-location.conf;
|
||||
|
||||
include /config/nginx/proxy.conf;
|
||||
include /config/nginx/resolver.conf;
|
||||
set $upstream_app 10.0.2.20;
|
||||
set $upstream_port 80;
|
||||
set $upstream_proto http;
|
||||
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
---
|
||||
# Unable to use ansible.builtin.lineinfile, because we need to run this through the proxmox host (because SSH is not enabled duh)
|
||||
|
||||
- name: Allow SSH into LXC
|
||||
ansible.builtin.command: lxc-attach -n 612 -- sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
|
||||
|
||||
- name: Restart SSH Service
|
||||
ansible.builtin.command: lxc-attach -n 612 service ssh restart
|
||||
@@ -0,0 +1,20 @@
|
||||
---
|
||||
- name: Create directory for docker-compose
|
||||
ansible.builtin.file:
|
||||
path: /root/docker/
|
||||
state: directory
|
||||
mode: "0755"
|
||||
|
||||
- name: Copy docker-compose file
|
||||
template:
|
||||
src: "docker-compose.yml"
|
||||
dest: /root/docker/docker-compose.yml
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0755
|
||||
|
||||
- name: Run docker-compose
|
||||
ansible.builtin.shell:
|
||||
args:
|
||||
cmd: docker compose up -d
|
||||
chdir: /root/docker/
|
||||
@@ -0,0 +1,12 @@
|
||||
version: '3'
|
||||
services:
|
||||
tautulli:
|
||||
image: ghcr.io/tautulli/tautulli
|
||||
container_name: tautulli
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- /root/config:/config
|
||||
environment:
|
||||
- TZ=Europe/Lisbon
|
||||
ports:
|
||||
- 8181:8181
|
||||
@@ -0,0 +1,27 @@
|
||||
---
|
||||
- name: Get convenience script
|
||||
uri:
|
||||
url: "https://get.docker.com"
|
||||
method: GET
|
||||
dest: /tmp/get-docker.sh
|
||||
mode: a+x
|
||||
creates: /tmp/get-docker.sh
|
||||
|
||||
- name: Execute script
|
||||
ansible.builtin.shell: /tmp/get-docker.sh
|
||||
|
||||
- name: Ensure group "docker" exists
|
||||
ansible.builtin.group:
|
||||
name: docker
|
||||
state: present
|
||||
|
||||
- name: Add root user to docker group
|
||||
ansible.builtin.user:
|
||||
name: root
|
||||
groups: docker
|
||||
append: yes
|
||||
|
||||
- name: Enable docker on startup
|
||||
ansible.builtin.shell: |
|
||||
systemctl enable docker.service
|
||||
systemctl enable containerd.service
|
||||
@@ -0,0 +1,27 @@
|
||||
---
|
||||
- name: Create container
|
||||
community.general.proxmox:
|
||||
vmid: 612
|
||||
node: epona
|
||||
api_user: root@pam
|
||||
api_password: "{{ proxmox_api_password }}"
|
||||
api_host: 10.0.2.2
|
||||
password: "{{ lxc_password }}"
|
||||
hostname: tautulli
|
||||
ostemplate: "hyrule-8tb-nfs:vztmpl/debian-11-standard_11.3-1_amd64.tar.zst"
|
||||
netif: "{'net0':'name=eth0,\
|
||||
gw=10.0.0.1,\
|
||||
ip=10.0.2.21/21,\
|
||||
hwaddr=cc:c6:cf:de:17:81,\
|
||||
bridge=vmbr0'}"
|
||||
cores: 4
|
||||
memory: 8192
|
||||
unprivileged: no
|
||||
swap: 0
|
||||
searchdomain: "home"
|
||||
onboot: 1
|
||||
features:
|
||||
- nesting=1
|
||||
- keyctl=1
|
||||
disk: local-lvm:15
|
||||
force: yes
|
||||
@@ -0,0 +1,26 @@
|
||||
---
|
||||
- name: Stop container
|
||||
community.general.proxmox:
|
||||
vmid: "{{ vmid }}"
|
||||
api_user: root@pam
|
||||
api_password: "{{ proxmox_api_password }}"
|
||||
api_host: 10.0.2.2
|
||||
state: stopped
|
||||
ignore_errors: true
|
||||
timeout: 90
|
||||
|
||||
- name: Remove containers
|
||||
community.general.proxmox:
|
||||
vmid: "{{ vmid }}"
|
||||
api_user: root@pam
|
||||
api_password: "{{ proxmox_api_password }}"
|
||||
api_host: 10.0.2.2
|
||||
state: absent
|
||||
ignore_errors: true
|
||||
timeout: 90
|
||||
|
||||
- name: Remove .ssh/known_hosts lines
|
||||
ansible.builtin.lineinfile:
|
||||
path: /Users/lino.silva/.ssh/known_hosts
|
||||
state: absent
|
||||
regexp: "^10.0.2.21"
|
||||
@@ -0,0 +1,8 @@
|
||||
---
|
||||
- name: Start deployments
|
||||
community.general.proxmox:
|
||||
vmid: "{{ vmid }}"
|
||||
api_user: root@pam
|
||||
api_password: "{{ proxmox_api_password }}"
|
||||
api_host: 10.0.2.2
|
||||
state: started
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
- name: Update all packages to their latest version
|
||||
become: true
|
||||
ansible.builtin.apt:
|
||||
update_cache: yes
|
||||
upgrade: full
|
||||
Reference in New Issue
Block a user