added some wip installations

This commit is contained in:
Snogard 2025-03-05 12:51:35 +01:00
parent 2806a8b2ed
commit 6c3c8fd3eb
5 changed files with 299 additions and 0 deletions

37
src/wip/install-kopia.sh Normal file
View File

@ -0,0 +1,37 @@
#!/bin/bash
source /opt/kaido/src/libs/bash/lib.sh
# setup
imageName=docker.io/
containerName=kopia
dstBasePath="$KAIDO_CONTAINER_FOLDER/$containerName"
# envs
nextauth_url=http://$containerName_db:3000/api/v1/auth
secret_nextauth_secret=$containerName_db-nextauth_secret
secret_postgress_password=$containerName_web-postgress_password
if [ -f "$KAIDO_CONFIG_FOLDER/containers/$containerName/envs.sh" ]; then
source "$KAIDO_CONFIG_FOLDER/containers/$containerName/envs.sh"
fi
# pre install
create_folder "$dstBasePath"
stop_and_remove_container $containerName
# install
echo "Creating new container"
podman create \
--name $containerName \
-v $dstBasePath:/path/to/folder \
$imageName
# systemd
create_systemd_services $containerName
systemctl --user enable --now $containerName

View File

@ -0,0 +1,50 @@
#!/bin/bash
source /opt/kaido/src/libs/bash/lib.sh
# setup
imageName_web=ghcr.io/linkwarden/linkwarden:v2.6.2
imageName_db=docker.io/library/postgres:16.3-alpine3.20
podName=linkwarden
containerName_web=${podName}_web
containerName_db=${podName}_db
dstBasePath="$KAIDO_CONTAINER_FOLDER/$podName"
# envs
if [ -f "$KAIDO_CONFIG_FOLDER/containers/$podName/envs.sh" ]; then
source "$KAIDO_CONFIG_FOLDER/containers/$podName/envs.sh"
fi
# pre install
create_folder "$dstBasePath"
stop_and_remove_pod $podName
#install
echo "Creating new $podName pod"
podman pod create \
--name $podName \
-p 80:80/tcp \
echo "Creating new $containerName_db container"
podman create \
--pod $podName \
--name $containerName_db \
-v $dstBasePath:/path/to/folder \
$imageName_db
echo "Creating new $containerName_web container"
podman create \
--pod $podName \
--name $containerName_web \
--requires $containerName_db \
-v $dstBasePath:/path/to/folder \
$imageName_web
# systemd
create_systemd_services $containerName
systemctl --user enable --now $containerName

View File

@ -0,0 +1,34 @@
#!/bin/bash
source /opt/kaido/src/libs/bash/lib.sh
# setup
imageName=docker.io/vaultwarden/server:1.31.0-alpine
containerName=vaultwarden
dstBasePath="$KAIDO_CONTAINER_FOLDER/$containerName"
dstDataPath="$dstBasePath/data"
# envs
if [ -f "$KAIDO_CONFIG_FOLDER/containers/$containerName/envs.sh" ]; then
source "$KAIDO_CONFIG_FOLDER/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 10114:80 \
-v $dstDataPath:/data \
$imageName
# systemd
create_systemd_services $containerName
systemctl --user enable --now $containerName

View File

@ -0,0 +1,74 @@
#!/bin/bash
source /opt/kaido/src/libs/bash/lib.sh
# setup
imageName_web=docker.io/vaultwarden/server:1.31.0-alpine
imageName_db=docker.io/library/mariadb:11.4.2
podName=vaultwarden
containerName_web=${podName}_web
containerName_db=${podName}_db
dstBasePath="$KAIDO_CONTAINER_FOLDER/$podName"
dstDBPath="$dstBasePath/db"
dstDataPath="$dstBasePath/data"
# envs
if [ -f "$KAIDO_CONFIG_FOLDER/containers/$podName/envs.sh" ]; then
source "$KAIDO_CONFIG_FOLDER/containers/$podName/envs.sh"
fi
if [ ! -f "$KAIDO_CONFIG_FOLDER/containers/$podName/$containerName_db.env" ]; then
echo "Error: missing $containerName_db.env file in the container configuration folder;
Add the following variables to the file:
MARIADB_ROOT_PASSWORD=<your root password>
MARIADB_PASSWORD=<your db_password>
MARIADB_USER=<your db_user>"
exit 1
fi
if [ ! -f "$KAIDO_CONFIG_FOLDER/containers/$podName/$containerName_web.env" ]; then
echo "Error: missing $containerName_web.env file in the container configuration folder;
Add the following variables to the file:
DATABASE_URL=mysql://<db_user>:<db_pw>@$containerName_db/vaultwarden
ADMIN_TOKEN=<your token>"
exit 1
fi
# pre install
create_folder "$dstBasePath"
stop_and_remove_pod $podName
#install
echo "Creating new $podName pod"
podman pod create \
--name $podName \
-p 10114:80/tcp \
echo "Creating new $containerName_db container"
podman create \
--pod $podName \
--name $containerName_db \
-v $dstDBPath:/var/lib/mysql \
-v /etc/localtime:/etc/localtime:ro \
-e "MARIADB_DATABASE=vaultwarden" \
--env-file="$KAIDO_CONFIG_FOLDER/containers/$podName/$containerName_db.env" \
$imageName_db
echo "Creating new $containerName_web container"
podman create \
--pod $podName \
--name $containerName_web \
--requires $containerName_db \
-v $dstDataPath:/data \
-e "RUST_BACKTRACE=1" \
--env-file="$KAIDO_CONFIG_FOLDER/containers/$podName/$containerName_web.env" \
$imageName_web
# systemd
create_systemd_services $containerName
systemctl --user enable --now $containerName

View File

@ -0,0 +1,104 @@
#!/bin/bash
source /opt/kaido/src/libs/bash/lib.sh
# setup
imageName_web=docker.io/vaultwarden/server:1.31.0-alpine
imageName_db=docker.io/library/mariadb:11.4.2
podName=vaultwarden
containerName_web=${podName}_web
containerName_db=${podName}_db
envFile_db="$KAIDO_CONFIG_FOLDER/containers/$podName/$containerName_db.env"
envFile_web="$KAIDO_CONFIG_FOLDER/containers/$podName/$containerName_web.env"
dstBasePath="$KAIDO_CONTAINER_FOLDER/$podName"
dstDBPath="$dstBasePath/db"
dstDataPath="$dstBasePath/data"
# envs
external_port=10114
rust_backtrace=1
db_name=vaultwarden
secret_db_root_password=$containerName_db-mariadb_root_password
secret_db_user=$containerName_db-mariadb_user
secret_db_password=$containerName_db-mariadb_password
secret_db_url=$containerName_web-database_url
secret_token=$containerName_web-admin_token
if [ -f "$KAIDO_CONFIG_FOLDER/containers/$podName/envs.sh" ]; then
source "$KAIDO_CONFIG_FOLDER/containers/$podName/envs.sh"
fi
if [ ! -f "$envFile_db" ]; then
envFile_db=$KAIDO_EMPTY_ENV_FILE
fi
if [ ! -f "$envFile_web" ]; then
envFile_web=$KAIDO_EMPTY_ENV_FILE
fi
# pre install
create_folder "$dstDBPath"
create_folder "$dstDataPath"
stop_and_remove_pod $podName
res=0
secret_check $secret_db_root_password
res=$(($?+$res))
secret_check $secret_db_password
res=$(($?+$res))
secret_check $secret_db_user
res=$(($?+$res))
secret_check $secret_db_url
res=$(($?+$res))
# secret_check $secret_token
# res=$(($?+$res))
if [[ $res -gt 0 ]]; then
exit 1
fi
#install
echo "Creating new $podName pod"
podman pod create \
--name $podName \
-p $external_port:80/tcp
echo "Creating new $containerName_db container"
podman create \
--pod $podName \
--name $containerName_db \
-v $dstDBPath:/var/lib/mysql \
-v /etc/localtime:/etc/localtime:ro \
--secret $secret_db_root_password,type=env,target=MARIADB_ROOT_PASSWORD \
--secret $secret_db_password,type=env,target=MARIADB_PASSWORD \
--secret $secret_db_user,type=env,target=MARIADB_USER \
-e MARIADB_DATABASE=$db_name \
--env-file="$envFile_db" \
$imageName_db
echo "Creating new $containerName_web container"
podman create \
--pod $podName \
--name $containerName_web \
--requires $containerName_db \
-v $dstDataPath:/data \
--secret $secret_db_url,type=env,target=DATABASE_URL \
-e RUST_BACKTRACE=$rust_backtrace \
--env-file="$envFile_web" \
$imageName_web
# --secret $secret_token,type=env,target=ADMIN_TOKEN \
# systemd
create_systemd_services $podName
systemctl --user enable --now $podName
#TODO add smtp server/relay