Deprecating old stuff that isnt used anymore

This commit is contained in:
2024-08-17 16:19:28 -07:00
parent cbdfe05111
commit 2ec74d8b85
63 changed files with 151 additions and 0 deletions

View 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"

View 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"

View 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 }}" }

View 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 }}" }

View 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"

View 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

View 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'

View 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 }}"

View 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