Deprecating old stuff that isnt used anymore
This commit is contained in:
34
deprecated/playbooks/atlas/init/clippable/main.yml
Normal file
34
deprecated/playbooks/atlas/init/clippable/main.yml
Normal file
@@ -0,0 +1,34 @@
|
||||
---
|
||||
- hosts: atlas
|
||||
become: yes
|
||||
vars:
|
||||
CLIPPABLE_ROOT: "{{ CLIPPABLE_MOUNT_POINT }}/clips"
|
||||
tasks:
|
||||
- name: Fetch vars for getting mount points
|
||||
include_vars:
|
||||
file: ../../vars/drives.yml
|
||||
- name: Create mountpoints for volumes
|
||||
file:
|
||||
state: directory
|
||||
path: "{{ CLIPPABLE_ROOT }}/{{ item }}"
|
||||
loop:
|
||||
- clips
|
||||
- thumbnails
|
||||
|
||||
- name: Pull latest Clippable Image
|
||||
community.docker.docker_container:
|
||||
name: clippable
|
||||
image: registry.gitlab.com/shockrah/clippable:latest
|
||||
pull: yes
|
||||
restart_policy: always
|
||||
recreate: yes
|
||||
env:
|
||||
SITE_NAME: "Shockrah's Clips"
|
||||
SITE_DESC: "Short clips of random stuff I do"
|
||||
SITE_URL: "https://clips.shockrah.xyz"
|
||||
ports:
|
||||
- "8482:8482"
|
||||
volumes:
|
||||
- "{{CLIPPABLE_ROOT}}/clips:/media/clips"
|
||||
- "{{CLIPPABLE_ROOT}}/thumbnails:/media/thumbnails"
|
||||
|
||||
23
deprecated/playbooks/atlas/init/filebrowser/main.yml
Normal file
23
deprecated/playbooks/atlas/init/filebrowser/main.yml
Normal file
@@ -0,0 +1,23 @@
|
||||
# This playbook goes through the process of setting up a simple FTP server on
|
||||
# the target host.
|
||||
---
|
||||
- hosts: atlas
|
||||
become: yes
|
||||
tasks:
|
||||
- name: Fetch vars for getting mount points
|
||||
include_vars:
|
||||
file: ../../vars/drives.yml
|
||||
- name: Setup Filebrowser Container
|
||||
community.docker.docker_container:
|
||||
name: filebrowser
|
||||
image: filebrowser/filebrowser
|
||||
restart_policy: always
|
||||
volumes:
|
||||
- "{{ FILEBROWSER_MOUNT_POINT }}/files:/srv"
|
||||
ports:
|
||||
- "8000:80"
|
||||
user: "0:0"
|
||||
|
||||
|
||||
|
||||
|
||||
14
deprecated/playbooks/atlas/init/migrate-clips-files.yml
Normal file
14
deprecated/playbooks/atlas/init/migrate-clips-files.yml
Normal file
@@ -0,0 +1,14 @@
|
||||
---
|
||||
- hosts: atlas
|
||||
tasks:
|
||||
- name: Fetch vars for getting mount points
|
||||
include_vars:
|
||||
file: ../vars/drives.yml
|
||||
- name: Copy over Filebrowser & Clippable data from local
|
||||
become: yes
|
||||
copy:
|
||||
src: "{{ item.src }}"
|
||||
dest: "{{ item.dst }}"
|
||||
loop:
|
||||
- { src: "{{ filebrowser }}", dst: "{{ FILEBROWSER_MOUNT_POINT }}" }
|
||||
- { src: "{{ clippable }}" , dst: "{{ CLIPPABLE_MOUNT_POINT }}" }
|
||||
50
deprecated/playbooks/atlas/init/perma-mount-drives.yml
Normal file
50
deprecated/playbooks/atlas/init/perma-mount-drives.yml
Normal file
@@ -0,0 +1,50 @@
|
||||
# This ensures that the mount points for our docker volumes are present and
|
||||
# populated correctly
|
||||
---
|
||||
- hosts: atlas
|
||||
become: yes
|
||||
vars:
|
||||
filesystem: ext4
|
||||
tasks:
|
||||
- name: Fetch vars for getting mount points
|
||||
include_vars:
|
||||
file: ../vars/drives.yml
|
||||
|
||||
- name: Creat mountpoints for mounted volumes
|
||||
file:
|
||||
path: "{{ item }}"
|
||||
state: directory
|
||||
owner: ubuntu
|
||||
loop:
|
||||
- "{{ CLIPPABLE_MOUNT_POINT }}"
|
||||
- "{{ FILEBROWSER_MOUNT_POINT }}"
|
||||
|
||||
- name: Partition Devices
|
||||
community.general.parted:
|
||||
device: "{{ item }}"
|
||||
number: 1
|
||||
label: gpt
|
||||
part_start: 0%
|
||||
part_end: 100%
|
||||
name: data
|
||||
loop:
|
||||
- "{{ FILEBROWSER_DRIVE }}"
|
||||
- "{{ CLIPPABLE_DRIVE }}"
|
||||
|
||||
- name: Format the drive for use
|
||||
community.general.filesystem:
|
||||
dev: "{{ item }}"
|
||||
fstype: "{{ filesystem }}"
|
||||
loop:
|
||||
- "{{ FILEBROWSER_DRIVE }}"
|
||||
- "{{ CLIPPABLE_DRIVE }}"
|
||||
|
||||
- name: Permanently Mount Drives
|
||||
mount:
|
||||
state: mounted
|
||||
path: "{{ item.dst }}"
|
||||
src: "{{ item.src }}"
|
||||
fstype: "{{ filesystem }}"
|
||||
loop:
|
||||
- { src: "{{ FILEBROWSER_DRIVE }}", dst: "{{ FILEBROWSER_MOUNT_POINT }}" }
|
||||
- { src: "{{ CLIPPABLE_DRIVE }}", dst: "{{ CLIPPABLE_MOUNT_POINT }}" }
|
||||
30
deprecated/playbooks/atlas/init/searx/main.yml
Normal file
30
deprecated/playbooks/atlas/init/searx/main.yml
Normal file
@@ -0,0 +1,30 @@
|
||||
---
|
||||
- hosts: atlas
|
||||
become: yes
|
||||
tasks:
|
||||
- name: Create /var/www/ Configuration Directory
|
||||
file:
|
||||
path: /var/www/
|
||||
state: directory
|
||||
|
||||
- name: Create /var/www/searx/ Searx configuration Directory
|
||||
file:
|
||||
path: /var/www/searx
|
||||
state: directory
|
||||
|
||||
- name: Copy Searx Configuration to /var/www/searx
|
||||
copy:
|
||||
src: settings.yml
|
||||
dest: /var/www/searx/settings.yml
|
||||
|
||||
- name: Pull latest Searx Repo patches
|
||||
community.docker.docker_container:
|
||||
name: searx
|
||||
image: searx/searx
|
||||
pull: yes
|
||||
restart_policy: always
|
||||
recreate: yes
|
||||
volumes:
|
||||
- "/var/www/searx/settings.yml:/etc/searx/settings.yml"
|
||||
ports:
|
||||
- "8080:8080"
|
||||
20
deprecated/playbooks/atlas/init/searx/settings.yml
Normal file
20
deprecated/playbooks/atlas/init/searx/settings.yml
Normal file
@@ -0,0 +1,20 @@
|
||||
use_default_settings: True
|
||||
|
||||
general:
|
||||
debug : False # Debug mode, only for development
|
||||
instance_name : "Project Athens SearX" # displayed name
|
||||
|
||||
search:
|
||||
safe_search : 0 # Filter results. 0: None, 1: Moderate, 2: Strict
|
||||
autocomplete : "" # Existing autocomplete backends: "dbpedia", "duckduckgo", "google", "startpage", "swisscows", "qwant", "wikipedia" - leave blank to turn it off by default
|
||||
default_lang : "" # Default search language - leave blank to detect from browser information or use codes from 'languages.py'
|
||||
|
||||
server:
|
||||
port : 8080
|
||||
bind_address : "127.0.0.1" # explicitly only listen on localhost
|
||||
# This key only matters for API users which I don't care about
|
||||
# Hence this is fine because meh.jpg
|
||||
secret_key : "VnnTHjYycpMerevPKQ5DAngpcZ3in5R8wgshvz2kW1LBDw6Z/ytWGdkZfXZTdY7zMb0oe6UXoZ9a"
|
||||
base_url : "https://search.project-athens.xyz"
|
||||
image_proxy : False # Proxying image results through searx
|
||||
|
||||
8
deprecated/playbooks/atlas/init/setup-containers.yml
Normal file
8
deprecated/playbooks/atlas/init/setup-containers.yml
Normal file
@@ -0,0 +1,8 @@
|
||||
# Here we just call other playbooks to setup the services in the same way
|
||||
# that the alpha host would set them up.
|
||||
# NOTE: lewdlad is not included here because it is deployed via pipeline
|
||||
# in it's own repository
|
||||
---
|
||||
- import_playbook: './searx/main.yml'
|
||||
- import_playbook: './filebrowser/main.yml'
|
||||
- import_playbook: './clippable/main.yml'
|
||||
48
deprecated/playbooks/atlas/init/setup-reverse-proxy.yml
Normal file
48
deprecated/playbooks/atlas/init/setup-reverse-proxy.yml
Normal file
@@ -0,0 +1,48 @@
|
||||
|
||||
# This playbook just installs nginx so that it is ready to configure
|
||||
# we don't bother with extra user accounts like with Beta because we
|
||||
# are only concerned with using nginx to serve fully containerized
|
||||
# applications. Not static files
|
||||
---
|
||||
- hosts: atlas
|
||||
become: yes
|
||||
vars:
|
||||
CERT_EMAIL: "dev@shockrah.xyz"
|
||||
SITES:
|
||||
- search.project-athens.xyz
|
||||
- files.leftcoast.space
|
||||
- clips.shockrah.xyz
|
||||
tasks:
|
||||
- name: Install nginx
|
||||
apt:
|
||||
name: nginx
|
||||
state: latest
|
||||
|
||||
- name: Install Certbot
|
||||
community.general.snap:
|
||||
name: certbot
|
||||
classic: yes
|
||||
|
||||
- name: Push Configs
|
||||
copy:
|
||||
src: "{{ '../nginx-plain-conf/' ~ item }}"
|
||||
dest: "{{ '/etc/nginx/sites-available/' ~ item }}"
|
||||
loop: "{{ SITES }}"
|
||||
|
||||
- name: Enable Sites in Nginx
|
||||
file:
|
||||
src: "/etc/nginx/sites-available/{{item}}"
|
||||
dest: "/etc/nginx/sites-enabled/{{item}}"
|
||||
state: link
|
||||
loop: "{{ SITES }}"
|
||||
|
||||
- name: Restart Nginx
|
||||
service:
|
||||
name: nginx
|
||||
state: restarted
|
||||
|
||||
- name: Install Certificates for all sites on this host
|
||||
command: >
|
||||
certbot -n --nginx -m "{{ CERT_EMAIL }}" --agree-tos
|
||||
--domains "{{item}}"
|
||||
loop: "{{ SITES }}"
|
||||
46
deprecated/playbooks/atlas/init/system-deps.yml
Normal file
46
deprecated/playbooks/atlas/init/system-deps.yml
Normal file
@@ -0,0 +1,46 @@
|
||||
# This playbook downloads all the basic requirements to give containers
|
||||
# an environment where they can be brought up safely. We focus primarily
|
||||
# on the host with this playbook
|
||||
---
|
||||
- hosts: atlas
|
||||
become: yes
|
||||
become_method: sudo
|
||||
tasks:
|
||||
- name: Install docker dependencies
|
||||
apt:
|
||||
name: "{{item}}"
|
||||
update_cache: yes
|
||||
loop:
|
||||
- apt-transport-https
|
||||
- ca-certificates
|
||||
- curl
|
||||
- gnupg
|
||||
- software-properties-common
|
||||
- lsb-release
|
||||
- python3
|
||||
- python3-pip
|
||||
|
||||
- name: Install docker-py
|
||||
pip:
|
||||
name: docker-py
|
||||
state: present
|
||||
|
||||
- name: Install docker GPG key
|
||||
apt_key:
|
||||
url: https://download.docker.com/linux/ubuntu/gpg
|
||||
state: present
|
||||
|
||||
- name: Add Docker Apt Repo
|
||||
apt_repository:
|
||||
repo: deb https://download.docker.com/linux/ubuntu impish stable
|
||||
state: present
|
||||
|
||||
- name: Install Docker components
|
||||
apt:
|
||||
name: "{{item}}"
|
||||
update_cache: yes
|
||||
loop:
|
||||
- docker-ce
|
||||
- docker-ce-cli
|
||||
- containerd.io
|
||||
|
||||
30
deprecated/playbooks/atlas/nginx-plain-conf/clippable.yml
Normal file
30
deprecated/playbooks/atlas/nginx-plain-conf/clippable.yml
Normal file
@@ -0,0 +1,30 @@
|
||||
# It is important to keep in mind that these websites are to be served under
|
||||
# either port 80 or port 443. The reasoning for allowing port 80 connections
|
||||
# is because the content here is not sensitive and I'm 100% sure I'm going
|
||||
# to get traffic from glow-friends so there
|
||||
|
||||
---
|
||||
- hosts: beta
|
||||
become: yes
|
||||
tasks:
|
||||
- name: Push clips.shockrah.xyz config(nginx)
|
||||
copy:
|
||||
src: "clips.shockrah.xyz"
|
||||
dest: "/etc/nginx/sites-available/clips.shockrah.xyz"
|
||||
|
||||
- name: Enable clips nginx config
|
||||
file:
|
||||
src: /etc/nginx/sites-available/clips.shockrah.xyz
|
||||
dest: /etc/nginx/sites-enabled/clips.shockrah.xyz
|
||||
state: link
|
||||
|
||||
- name: Restart Nginx
|
||||
service:
|
||||
name: nginx
|
||||
state: restarted
|
||||
|
||||
- name: Install New Certificate for all sites
|
||||
command: >
|
||||
certbot -n --nginx -m "dev@shockrah.xyz" --agree-tos
|
||||
--domains clips.shockrah.xyz
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
# This file contains a base configuration file for the projectathens
|
||||
# It is to be overwritten by certbot later on so adjusting this config
|
||||
# should not happen on the target server
|
||||
|
||||
server {
|
||||
server_name clips.shockrah.xyz;
|
||||
location / {
|
||||
proxy_pass http://127.0.0.1:8482;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
---
|
||||
- hosts: alpha
|
||||
tasks:
|
||||
- name: Disable Default Nginx Site
|
||||
become: yes
|
||||
file:
|
||||
path: /etc/nginx/sites-enabled/default
|
||||
state: absent
|
||||
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
# This file contains a base configuration file for the projectathens
|
||||
# It is to be overwritten by certbot later on so adjusting this config
|
||||
# should not happen on the target server
|
||||
|
||||
server {
|
||||
server_name files.leftcoast.space;
|
||||
location / {
|
||||
proxy_pass http://127.0.0.1:8000;
|
||||
}
|
||||
# Because we take large video/image file uploads
|
||||
client_max_body_size 0;
|
||||
}
|
||||
|
||||
|
||||
42
deprecated/playbooks/atlas/nginx-plain-conf/main.yml
Normal file
42
deprecated/playbooks/atlas/nginx-plain-conf/main.yml
Normal file
@@ -0,0 +1,42 @@
|
||||
# This playbook just installs nginx so that it is ready to configure
|
||||
# we don't bother with extra user accounts like with Beta because we
|
||||
# are only concerned with using nginx to serve fully containerized
|
||||
# applications. Not static files
|
||||
---
|
||||
- hosts: alpha
|
||||
become: yes
|
||||
tasks:
|
||||
- name: Install Certbot
|
||||
community.general.snap:
|
||||
name: certbot
|
||||
classic: yes
|
||||
|
||||
- name: Push Configs
|
||||
copy:
|
||||
src: "{{item}}"
|
||||
dest: "/etc/nginx/sites-available/{{item}}"
|
||||
loop:
|
||||
- search.project-athens.xyz
|
||||
- files.leftcoast.space
|
||||
|
||||
- name: Enable Sites in Nginx
|
||||
file:
|
||||
src: "/etc/nginx/sites-available/{{item}}"
|
||||
dest: "/etc/nginx/sites-enabled/{{item}}"
|
||||
state: link
|
||||
loop:
|
||||
- search.project-athens.xyz
|
||||
- files.leftcoast.space
|
||||
|
||||
- name: Restart Nginx
|
||||
service:
|
||||
name: nginx
|
||||
state: restarted
|
||||
|
||||
- name: Install Certificates for all sites on this host
|
||||
command: >
|
||||
certbot -n --nginx -m "{{CERT_EMAIL}}" --agree-tos
|
||||
--domains "{{item}}"
|
||||
loop:
|
||||
- search.project-athens.xyz
|
||||
- files.leftcoast.space
|
||||
@@ -0,0 +1,11 @@
|
||||
# This file contains a base configuration file for the projectathens
|
||||
# It is to be overwritten by certbot later on so adjusting this config
|
||||
# should not happen on the target server
|
||||
|
||||
server {
|
||||
server_name search.project-athens.xyz;
|
||||
location / {
|
||||
proxy_pass http://127.0.0.1:8080;
|
||||
}
|
||||
}
|
||||
|
||||
5
deprecated/playbooks/atlas/vars/drives.yml
Normal file
5
deprecated/playbooks/atlas/vars/drives.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
# These vars are really only used to configure the host for the first time
|
||||
CLIPPABLE_MOUNT_POINT: /mnt/clippable
|
||||
CLIPPABLE_DRIVE: /dev/nvme1n1
|
||||
FILEBROWSER_DRIVE: /dev/nvme2n1
|
||||
FILEBROWSER_MOUNT_POINT: /mnt/filebrowser
|
||||
Reference in New Issue
Block a user