updated various containers, added foundry install

This commit is contained in:
Snogard 2023-12-08 18:31:23 +01:00
parent b967b5c226
commit 5895bf2ee9
5 changed files with 63 additions and 12 deletions

View File

@ -0,0 +1,49 @@
#!/bin/bash
source /opt/kaido/src/libs/bash/lib.sh
# setup
instanceName=$1
instancePort=$2
instanceVersion=$3
imageName=localhost/foundry:version-$instanceVersion
containerName=foundry-$instanceName
dstDataPath=/mnt/storage/containers/$containerName/data
# envs
hostname="example.com"
if [ -f "/etc/kaido/containers/$containerName/envs.sh" ]; then
source /etc/kaido/containers/$containerName/envs.sh
fi
if [[ "$hostname" == "example.com" ]]; then
echo "ERROR: you must set the domain foundry will run on."
echo "Please set the 'hostname' variable in '/etc/kaido/containers/$containerName/envs.sh'"
fi
# pre install
create_folder "$dstDataPath"
stop_and_remove_container $containerName
# install
echo "Creating new container"
podman create \
--name $containerName \
-p $instancePort:30000/tcp \
-e ROUTE_PREFIX=$instanceName \
-e HOSTNAME=$hostname \
-v $dstDataPath:/home/foundry/data \
$imageName
# systemd
create_systemd_services $containerName
systemctl --user enable --now $containerName
sleep 30s # wait for the container to create options.json
systemctl --user restart $containerName

View File

@ -31,11 +31,11 @@ stop_and_remove_container $containerName
echo "Checking firewall rules"
echo "Allowing dns"
sudo ufw allow 53/tcp
sudo ufw allow 53/udp
open_port 53/tcp
open_port 53/udp
echo "Allowing dhcp"
sudo ufw allow 67/udp
open_port 67/udp
# install

View File

@ -3,7 +3,7 @@ source /opt/kaido/src/libs/bash/lib.sh
# docs = https://github.com/linuxserver/docker-swag
# setup
imageName=docker.io/linuxserver/swag:2.7.4-ls258
imageName=docker.io/linuxserver/swag:2.8.0-ls263
containerName=reverse-proxy
dstConfigPath=/mnt/storage/containers/$containerName/config
@ -29,10 +29,10 @@ stop_and_remove_container $containerName
echo "Checking firewall rules"
echo "Allowing https"
sudo ufw allow 443/tcp
open_port "443/tcp"
echo "Allowing http"
sudo ufw allow 80/tcp
open_port "80/tcp"
# install

View File

@ -4,7 +4,7 @@ source /opt/kaido/src/libs/bash/lib.sh
# setup
imageName=docker.io/linuxserver/transmission:4.0.4-r0-ls209
imageName=docker.io/linuxserver/transmission:4.0.4-r0-ls210
containerName=transmission
dstBasePath="$CONTAINERS_FOLDER/$containerName"
@ -46,9 +46,8 @@ if [[ $res -gt 0 ]]; then
exit 1
fi
sudo ufw allow $torrentPort/tcp
sudo ufw allow $torrentPort/udp
open_port $torrentPort/tcp
open_port $torrentPort/udp
# download theme
if [ ! -d "${dstBasePath}${themePath}" ]; then

View File

@ -7,7 +7,8 @@ function stop_and_remove_container()
systemctl --user disable $name
systemctl --user stop $name
echo "Removing old container"
podman rm $name
podman stop $name
podman rm -f $name
fi
}
@ -20,10 +21,12 @@ function stop_and_remove_pod()
systemctl --user disable $name
systemctl --user stop $name
echo "Removing old container"
podman pod rm $name
podman pod stop $name
podman pod rm -f $name
fi
}
#TODO: this method is deprecated, make a python script to replace it
function create_systemd_services()
{
local name=$1