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,13 @@
# This file basically contains the base configuration for freechat.shockrah.xyz
# This is to be installed before running certbot against it as this only sets us
# up for correct HTTP(not TLS) based connections
server {
root /var/www/freechat;
index index.html;
server_name freechat.shockrah.xyz;
location / {
try_files $uri $uri/ =404;
}
}

View File

@@ -0,0 +1,13 @@
# This file basically contains the base configuration for qrcodes.leftcoast.space
# This is to be installed before running certbot against it as this only sets us
# up for correct HTTP(not TLS) based connections
server {
root /var/www/qrcodes.leftcoast.space;
index index.html;
server_name qrcodes.leftcoast.space;
location / {
try_files $uri $uri/ =404;
}
}

View File

@@ -0,0 +1,14 @@
# This file basically contains the base configuration for freechat.shockrah.xyz
# This is to be installed before running certbot against it as this only sets us
# up for correct HTTP(not TLS) based connections
server {
root /var/www/resume.shockrah.xyz;
index index.html;
server_name resume.shockrah.xyz;
location / {
try_files $uri $uri/ =404;
}
}

View File

@@ -0,0 +1,14 @@
# This file basically contains the base configuration for freechat.shockrah.xyz
# This is to be installed before running certbot against it as this only sets us
# up for correct HTTP(not TLS) based connections
server {
root /var/www/shockrah.xyz;
index index.html;
server_name shockrah.xyz;
location / {
try_files $uri $uri/ =404;
}
}

View File

@@ -0,0 +1,19 @@
# 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
remote_user: ubuntu
become: yes
tasks:
- name: Install New Certificate for all sites
command: >
certbot -n --nginx -m "{{CERT_EMAIL}}" --agree-tos
--domains "{{item}}"
loop:
- freechat.shockrah.xyz
- shockrah.xyz
- resume.shockrah.xyz
- qrcodes.leftcoast.space

View File

View File

@@ -0,0 +1 @@
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC9n/H/AMcDcz90L5q0zxGxZWU5ShveyLOUFZBlcJ6SBco3Vb2ZD/qwmgDpVrgaB8bRdmioSgBIEvjX1uv6oEPvhCNu9JoXgy9uqOkbV7vqALxxEbleFYT2KQl5aq/OK0f+3Do9yiyNH8xaJ/FgwLHDC3GIKijdLa++e0Ydk1xnmzxD1C+Ciu8s6RHeGjG89txWqE0iEgfc+VNbPYdve9TR3WApbokUkux2KwYYDi3naqNB+pYn4cScx/fHoibiZeTBCnqGrgk+ZDowOtsvrSUVzKqBqQzphKO1YlttoNlcktkRjoUoQUP3g/B3NJqGMZi1NAovy3uD/QG5p1DaFVgZll6WDY4NsfhmT3K1xjNqBf0SSsXwe/CUIQ4oTcLPKwaW8hKygO//727l2n8GtwVAU2v3aYYHPbZrPmz/+3iALq0cjhpFz97WX1ifPijiSFPJ9vvE9H4p24bmVn64mBVaYq8E088t8ycWgPj04makbc5sPu7K5CecUUaGD4MWDws= Beta SSH Key

View File

@@ -0,0 +1,66 @@
# This playbook goes through the process of setting up all the lower level
# infrastructure we need to start deploying website files to the server
# itself.
---
- hosts: beta
remote_user: ubuntu
become: yes
become_method: sudo
tasks:
- name: Install snapd package manager
apt:
name: snapd
update_cache: yes
state: present
- name: Install Nginx
apt:
name: nginx
update_cache: yes
state: present
- name: Update Snap
community.general.snap:
name: core
state: present
- name: Install Certbot Snap Package
community.general.snap:
name: certbot
classic: yes
- name: Create website admin group
group:
name: web
state: present
- name: Create website user account
user:
name: web
comment: Website maintainer account
state: present
- name: Create /home/web/.ssh directory
file:
path: /home/web/.ssh
state: directory
owner: web
group: web
mode: 0700
- name: Copy public web key to beta
authorized_key:
user: web
key: "{{ lookup('file', 'files/'+'web.pub') }}"
- name: Create Web root directory under new web account
file:
path: /var/www
state: directory
recurse: yes
owner: web
group: web

View File

@@ -0,0 +1,34 @@
---
- hosts: beta
remote_user: ubuntu
become: yes
become_method: sudo
tasks:
- name: Push Nginx Site Configs into available site listings
copy:
src: "base-site-conf/{{item}}"
dest: /etc/nginx/sites-available/
loop:
- freechat.shockrah.xyz
- resume.shockrah.xyz
- shockrah.xyz
- qrcodes.leftcoast.space
- name: Enable Static Sites in Nginx
file:
src: "/etc/nginx/sites-available/{{item}}"
dest: "/etc/nginx/sites-enabled/{{item}}"
state: link
loop:
- freechat.shockrah.xyz
- resume.shockrah.xyz
- shockrah.xyz
- qrcodes.leftcoast.space
- name: Restart Nginx Service
service:
name: nginx
state: restarted

View File

@@ -0,0 +1,18 @@
# This playbooks basically just ensures that the web user account is behaving
# correctly and is installed in the correct places
---
- hosts: web
user: web
tasks:
- name: Echo something
shell: echo Hello
register: hi
- debug: var=hi.stdout
- name: Who am I
shell: whoami
register: whoami
- debug: var=whoami.stdout_lines

View File

View File

@@ -0,0 +1,4 @@
FC_LOCAL_DOCS: "/home/shockrah/GitRepos/freechat/docs/"
RESUME_LOCAL_PUBLIC: "/home/shockrah/GitRepos/resume/"
BLOG_LOCAL_PUBLIC: "/home/shockrah/GitRepos/shockrah-city/"
CERT_EMAIL: "alejandros714@protonmail.com"

View File

@@ -0,0 +1,8 @@
---
- hosts: beta
become: yes
tasks:
- name: Push blog content
copy:
src: "{{BLOG_LOCAL_PUBLIC}}/public/"
dest: /var/www/shockrah.xyz

View File

@@ -0,0 +1,8 @@
---
- hosts: beta
become: yes
tasks:
- name: Push docs content
copy:
src: "{{FC_LOCAL_DOCS}}/public"
dest: /var/www/freechat

View File

@@ -0,0 +1,12 @@
---
- hosts: beta
become: yes
tasks:
- name: Fetch variables from role specific vars file
include_vars:
file: ../vars/main.yml
- name: Push out qrcodes public content
copy:
src: "{{QRCODES_LOCAL_PUBLIC}}/public/"
dest: /var/www/qrcodes.leftcoast.space

View File

@@ -0,0 +1,11 @@
---
- hosts: beta
become: yes
tasks:
- name: Fetch variables from role specific vars file
include_vars:
file: ../vars/main.yml
- name: Push out resume public content
copy:
src: "{{RESUME_LOCAL_PUBLIC}}/public/"
dest: /var/www/resume.shockrah.xyz