Finished all services

This commit is contained in:
crt 2024-07-11 04:30:42 +02:00
parent f943c3ff98
commit 06db8148ed
6 changed files with 205 additions and 6 deletions

View File

@ -37,3 +37,6 @@
## 2024-06-29
- Regarding sleep as overrated and continued working through the night and day to finish this
- First Container Built using selfmade image-builder script
## 2024-07-11
- It is 4 AM, I am finishing the basics just so I can potentially not fail this semester im begging.

View File

@ -2,16 +2,13 @@
## Nginx Proxy manager
Requirements :
- Nginx WebUI : https://github.com/0xJacky/nginx-ui/tree/dev
- Nginx WebUI : https://github.com/0xJacky/nginx-ui
- Configs and Websites Stored Webserver for easy redeployment and changes
Distro of Choice : Debian
- Why ? : Eases installation of Nginx Plugins if needed and more up to date Nginx versions available compared to alpine
### Making Installation script :
The easiest way to do this is to manually install and configure things how you want them. Then figure out how to automate that after which you can provide set in place updatable images.
1. Making our Temporary Debian VM, adding the data directory and starting it : `pct create 201 adastor:vztmpl/debian-12-standard_12.2-1_amd64.tar.zst --rootfs local-btrfs:8 --cores 2 --memory 1024 --swap 512 --net0 name=eth0,bridge=vmbr0,ip=dhcp --hostname debian-nginx-temp && pct set 201 -mp0 local-btrfs:8,mp=/data,size=8G && pct start 201`
1. Making our Temporary Debian CT, adding the data directory and starting it : `pct create 201 adastor:vztmpl/debian-12-standard_12.2-1_amd64.tar.zst --rootfs local-btrfs:8 --cores 2 --memory 1024 --swap 512 --net0 name=eth0,bridge=vmbr0,ip=dhcp --hostname debian-nginx-temp && pct set 201 -mp0 local-btrfs:8,mp=/data,size=8G && pct start 201`
2. Entering our container : `pct enter 201`
3. Completing a Manual Installation of the basics :
```
@ -28,3 +25,36 @@ See debian-nginx.conf
6. Move to your CT Template dir of choice :`mv ./vzdump-lxc-202-2024_06_29-10_52_05.tar.gz /mnt/pve/adastor/template/cache/debian-nginx-2024-06-29.tar.gz`
7. Enjoy our success and Deploy where needed
## Vaultwarden Password manager
Requirements :
- Vaultwarden + Web : https://github.com/dani-garcia/vaultwarden
### Making Installation script :
1. Making our Temporary Alpine CT, adding the data directory and starting it : `pct create 201 adastor:vztmpl/alpine-3.19-default_plus_bash_20240207_amd64.tar.xz --rootfs local-btrfs:8 --cores 2 --memory 1024 --swap 512 --net0 name=eth0,bridge=vmbr0,ip=dhcp --hostname alpine-vaultwarden-temp && pct set 202,size=8G && pct start 202`
2. Entering our container : `pct enter 201`
3. Completing a Manual Installation of the basics :
```
apk update
apk add bash openssh vaultwarden
apk add vaultwarden-web-vault
rc-service --list
rc-update add vaultwarden
rc-update add sshd
rc-service sshd start
nano /etc/conf.d/vaultwarden
rc-update add vaultwarden
rc-service vaultwarden start
```
4. Making it a bash script and implementing our config files aswell as website files :
See debian-nginx.conf
5. Building the Container Image : `./image_builder.sh --param-file debian-nginx.conf`
6. Move to your CT Template dir of choice :`mv ./vzdump-lxc-202-2024_06_29-10_52_05.tar.gz /mnt/pve/adastor/template/cache/debian-nginx-2024-06-29.tar.gz`
7. Enjoy our success and Deploy where needed
# Why I dont list every service here ?
As seen it is pretty easy to make Container Templates using basic Bash scripting and usage of the image_builder.
For the rest of the Services simply have a look at the remaining config files in here
# Where is Mailcow ?
Mailcow has been excluded as it uses docker, I've however made a container template that installs the docker engine so use that (configuring email is a pain and I would recommnd you make manual images)

View File

@ -0,0 +1,65 @@
TEMPLATE=adastor:vztmpl/debian-12-standard_12.2-1_amd64.tar.zst
# Set your Baseimage here
RAM=1024
# Define RAM during setup
SWAP=512
# Define SWAP during setup
CORES=2
# Define Cores during setup
BRIDGE=vmbr0
# Define Network interface during Installation
IP=dhcp
# Define IP During installation (use DHCP, proper static V4 not implemented)
CTID=
# Manually Override CTID, not needed usually
HOSTNAME=docker-512mb
# Set Temporary Hostname
EXPORT_NAME=MB-DOCKER
# Doesnt work properly, ignore for now
EXPORT_PATH=
# Leave this empty to use the current directory
MIN_ID=200
# Define minimum ID for CT to avoid conflicts with other nodes if in a cluster
STORAGE=local-btrfs
# Set what storage pool to use
DISK_SIZE=8
# Set the default disk size for the container
MOUNT_POINT=
# Specify your mount point here
PRIVILEGED=0
# Set to 1 for privileged container, 0 for unprivileged
SCRIPT_CONTENT=$(cat <<'EOF'
#!/bin/bash
# Installing Nginx and Enabling it
apt-get update
apt-get upgrade -y
apt-get install -y nginx-full unzip curl wget
systemctl start nginx
systemctl enable nginx
# Nginx Install end
# Setting Nginx Config Files
cat << 'EOT' > /etc/nginx/conf.d/512mb.ch.conf
#!/bin/bash
apt-get -y wget
wget get.docker.com && mv index.html docker.sh
chmod a+x ./docker.sh
./docker.sh
apt install docker-compose-plugin
rm /etc/docker/daemon.json
touch /etc/docker/daemon.json
cat << 'EOT' > /etc/nginx/conf.d/512mb.ch.conf
{
"selinux-enabled": true
}
EOT
systemctl enable docker
systemctl start docker
echo "Docker has been installed and configured."
EOF
)

View File

@ -0,0 +1,44 @@
TEMPLATE=adastor:vztmpl/alpine-3.19-default_plus_bash_20240207_amd64.tar.xz
# Set your Baseimage here
RAM=1024
# Define RAM during setup
SWAP=512
# Define SWAP during setup
CORES=2
# Define Cores during setup
BRIDGE=vmbr0
# Define Network interface during Installation
IP=dhcp
# Define IP During installation (use DHCP, proper static V4 not implemented)
CTID=
# Manually Override CTID, not needed usually
HOSTNAME=jelly-512mb
# Set Temporary Hostname
EXPORT_NAME=MB-JELLY
# Doesnt work properly, ignore for now
EXPORT_PATH=
# Leave this empty to use the current directory
MIN_ID=200
# Define minimum ID for CT to avoid conflicts with other nodes if in a cluster
STORAGE=local-btrfs
# Set what storage pool to use
DISK_SIZE=8
# Set the default disk size for the container
MOUNT_POINT=
# Specify your mount point here
PRIVILEGED=0
# Set to 1 for privileged container, 0 for unprivileged
SCRIPT_CONTENT=$(cat <<'EOF'
#!/bin/bash
# Installing Vaultwarden and Enabling it
apk update
apk add bash openssh jellyfin
rc-update add jellyfin
rc-update add sshd
rc-service jellyfin start
rc-service sshd start
echo "Jellyfin has been installed and configured."
EOF
)

View File

@ -24,7 +24,7 @@ STORAGE=local-btrfs
# Set what storage pool to use
DISK_SIZE=8
# Set the default disk size for the container
MOUNT_POINT=local-lvm:8,mp=/data,size=8G
MOUNT_POINT=
# Specify your mount point here
PRIVILEGED=0
# Set to 1 for privileged container, 0 for unprivileged

View File

@ -0,0 +1,57 @@
TEMPLATE=adastor:vztmpl/alpine-3.19-default_plus_bash_20240207_amd64.tar.xz
# Set your Baseimage here
RAM=1024
# Define RAM during setup
SWAP=512
# Define SWAP during setup
CORES=2
# Define Cores during setup
BRIDGE=vmbr0
# Define Network interface during Installation
IP=dhcp
# Define IP During installation (use DHCP, proper static V4 not implemented)
CTID=
# Manually Override CTID, not needed usually
HOSTNAME=vault-512mb
# Set Temporary Hostname
EXPORT_NAME=MB-VAULT
# Doesnt work properly, ignore for now
EXPORT_PATH=
# Leave this empty to use the current directory
MIN_ID=200
# Define minimum ID for CT to avoid conflicts with other nodes if in a cluster
STORAGE=local-btrfs
# Set what storage pool to use
DISK_SIZE=8
# Set the default disk size for the container
MOUNT_POINT=
# Specify your mount point here
PRIVILEGED=0
# Set to 1 for privileged container, 0 for unprivileged
SCRIPT_CONTENT=$(cat <<'EOF'
#!/bin/bash
# Installing Vaultwarden and Enabling it
apk update
apk add bash openssh vaultwarden
apk add vaultwarden-web-vault
rc-update add vaultwarden
rc-update add sshd
rc-service sshd start
rm /etc/conf.d/vaultwarden
cat << 'EOT' > /var/www/ssl/fullchain.pem
export DATA_FOLDER=/var/lib/vaultwarden
export WEB_VAULT_FOLDER=/usr/share/webapps/vaultwarden-web/
export WEB_VAULT_ENABLED=true
export ROCKET_ADDRESS=0.0.0.0
export ROCKET_PORT=80 # Defaults to 80 in the Docker images, or 8000 otherwise.
export ROCKET_WORKERS=10
EOT
rc-update add vaultwarden
rc-service vaultwarden start
echo "Vaultwarden has been installed and configured."
EOF
)