mirror of
https://gitlab.com/Snogard/kaido.git
synced 2025-08-20 10:50:06 +02:00
implemented kaido_config_folder
This commit is contained in:
parent
998cb07390
commit
7a8fe7907b
19
readme.md
19
readme.md
@ -14,22 +14,29 @@ every configuration must be under /etc/kaido.
|
|||||||
(to implement): if "/etc/kaido/" is a git repository, the update function will also take that into account when deciding what container to recreate
|
(to implement): if "/etc/kaido/" is a git repository, the update function will also take that into account when deciding what container to recreate
|
||||||
### Folder structure
|
### Folder structure
|
||||||
- /etc/kaido
|
- /etc/kaido
|
||||||
- commands
|
- build (holds container build data)
|
||||||
|
- containerName
|
||||||
|
- Dockerfile
|
||||||
|
- data.txt
|
||||||
|
- ecc...
|
||||||
|
- commands (holds additional or substitute commands)
|
||||||
- install
|
- install
|
||||||
- install-transmission.sh
|
- install-transmission.sh
|
||||||
- install-pihole.sh
|
- install-pihole.sh
|
||||||
- ecc...
|
- ecc...
|
||||||
- config
|
- config
|
||||||
- ecc...
|
- ecc...
|
||||||
- containers
|
- containers (holds container configuration)
|
||||||
- container1
|
- container1
|
||||||
- config
|
- config
|
||||||
- secrets
|
- secrets
|
||||||
- envs.sh
|
- envs.sh
|
||||||
- container2
|
- container2
|
||||||
- ecc...
|
- ecc...
|
||||||
- system (not implemented)
|
- system (holds system configuration)
|
||||||
- user (not implemented)
|
- samba
|
||||||
|
- ecc...
|
||||||
|
- user (holds user configuration, not implemented)
|
||||||
- update.conf
|
- update.conf
|
||||||
- envs.sh
|
- envs.sh
|
||||||
### /etc/kaido/update.conf
|
### /etc/kaido/update.conf
|
||||||
@ -54,9 +61,9 @@ warning: No parameters are supported yet
|
|||||||
### /etc/kaido/envs.sh
|
### /etc/kaido/envs.sh
|
||||||
This file will be sourced to overrwrite default envs
|
This file will be sourced to overrwrite default envs
|
||||||
|
|
||||||
CONTAINERS_FOLDER: where container folders are created by default
|
CONTAINERS_FOLDER: where container folders are created by default (not fully implemented)
|
||||||
BUILDS_FOLDER: where files are downloaded for build purposes
|
BUILDS_FOLDER: where files are downloaded for build purposes
|
||||||
KAIDO_CONFIG_FOLDER: where kaido will look for a kaido-config repository (not fully implemented)
|
KAIDO_CONFIG_FOLDER: where kaido will look for a kaido-config repository
|
||||||
|
|
||||||
# Container Installation:
|
# Container Installation:
|
||||||
|
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
source /opt/kaido/src/libs/bash/lib.sh
|
||||||
# docs https://gist.github.com/rudylacrete/dcd9779175fe18731852
|
# docs https://gist.github.com/rudylacrete/dcd9779175fe18731852
|
||||||
|
|
||||||
containerName=aria-rpc
|
containerName=aria-rpc
|
||||||
|
|
||||||
srcConfigPath=/etc/kaido/containers/$containerName/config
|
srcConfigPath="$KAIDO_CONFIG_FOLDER/containers/$containerName/config"
|
||||||
dstConfigPath=/mnt/storage/containers/$containerName/config
|
dstConfigPath=/mnt/storage/containers/$containerName/config
|
||||||
|
|
||||||
systemctl stop --user $containerName
|
systemctl stop --user $containerName
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
source /opt/kaido/src/libs/bash/lib.sh
|
||||||
|
|
||||||
containerName=reverse-proxy
|
containerName=reverse-proxy
|
||||||
srcConfigPath=/etc/kaido/containers/$containerName/config
|
srcConfigPath="$KAIDO_CONFIG_FOLDER/containers/$containerName/config"
|
||||||
dstConfigPath=/mnt/storage/containers/$containerName/config
|
dstConfigPath=/mnt/storage/containers/$containerName/config
|
||||||
|
|
||||||
if [ ! -d $srcConfigPath ]; then
|
if [ ! -d $srcConfigPath ]; then
|
||||||
|
@ -11,8 +11,8 @@ containerName=aria-ng
|
|||||||
max_log_size=1m
|
max_log_size=1m
|
||||||
external_port=10103
|
external_port=10103
|
||||||
|
|
||||||
if [ -f "/etc/kaido/containers/$containerName/envs.sh" ]; then
|
if [ -f "$KAIDO_CONFIG_FOLDER/containers/$containerName/envs.sh" ]; then
|
||||||
source /etc/kaido/containers/$containerName/envs.sh
|
source "$KAIDO_CONFIG_FOLDER/containers/$containerName/envs.sh"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
@ -18,8 +18,8 @@ external_port=10102
|
|||||||
internal_port=6800
|
internal_port=6800
|
||||||
secret_rpc_secret="$containerName-rpc_secret"
|
secret_rpc_secret="$containerName-rpc_secret"
|
||||||
|
|
||||||
if [ -f "/etc/kaido/containers/$containerName/envs.sh" ]; then
|
if [ -f "$KAIDO_CONFIG_FOLDER/containers/$containerName/envs.sh" ]; then
|
||||||
source /etc/kaido/containers/$containerName/envs.sh
|
source "$KAIDO_CONFIG_FOLDER/containers/$containerName/envs.sh"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
@ -16,16 +16,16 @@ dstDataPath=/mnt/storage/containers/$containerName/data
|
|||||||
# envs
|
# envs
|
||||||
hostname="example.com"
|
hostname="example.com"
|
||||||
|
|
||||||
if [ -f "/etc/kaido/containers/$baseContainerName/envs.sh" ]; then
|
if [ -f "$KAIDO_CONFIG_FOLDER/containers/$baseContainerName/envs.sh" ]; then
|
||||||
source /etc/kaido/containers/$baseContainerName/envs.sh
|
source "$KAIDO_CONFIG_FOLDER/containers/$baseContainerName/envs.sh"
|
||||||
fi
|
fi
|
||||||
if [ -f "/etc/kaido/containers/$containerName/envs.sh" ]; then
|
if [ -f "$KAIDO_CONFIG_FOLDER/containers/$containerName/envs.sh" ]; then
|
||||||
source /etc/kaido/containers/$containerName/envs.sh
|
source "$KAIDO_CONFIG_FOLDER/containers/$containerName/envs.sh"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$hostname" == "example.com" ]]; then
|
if [[ "$hostname" == "example.com" ]]; then
|
||||||
echo "ERROR: you must set the domain foundry will run on."
|
echo "ERROR: you must set the domain foundry will run on."
|
||||||
echo "Please set the 'hostname' variable in '/etc/kaido/containers/$containerName/envs.sh'"
|
echo "Please set the 'hostname' variable in '$KAIDO_CONFIG_FOLDER/containers/$containerName/envs.sh'"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
source /opt/kaido/src/libs/bash/lib.sh
|
source /opt/kaido/src/libs/bash/lib.sh
|
||||||
|
|
||||||
# setup
|
# setup
|
||||||
imageName=docker.io/gotson/komga:1.8.4
|
imageName=docker.io/gotson/komga:1.10.4
|
||||||
containerName=komga
|
containerName=komga
|
||||||
|
|
||||||
|
|
||||||
@ -15,8 +15,8 @@ dstDataPath=/mnt/storage/containers/$containerName/data
|
|||||||
externalPort=10111
|
externalPort=10111
|
||||||
internalPort=25600
|
internalPort=25600
|
||||||
|
|
||||||
if [ -f "/etc/kaido/containers/$containerName/envs.sh" ]; then
|
if [ -f "$KAIDO_CONFIG_FOLDER/containers/$containerName/envs.sh" ]; then
|
||||||
source /etc/kaido/containers/$containerName/envs.sh
|
source "$KAIDO_CONFIG_FOLDER/containers/$containerName/envs.sh"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
@ -32,8 +32,8 @@ dstDBDataPath=$dstBasePath/db/data
|
|||||||
# envs
|
# envs
|
||||||
trusted_domains="localhost example.com"
|
trusted_domains="localhost example.com"
|
||||||
|
|
||||||
if [ -f "/etc/kaido/containers/$podName/envs.sh" ]; then
|
if [ -f "$KAIDO_CONFIG_FOLDER/containers/$podName/envs.sh" ]; then
|
||||||
source /etc/kaido/containers/$podName/envs.sh
|
source "$KAIDO_CONFIG_FOLDER/containers/$podName/envs.sh"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# pre install
|
# pre install
|
||||||
|
@ -3,7 +3,7 @@ source /opt/kaido/src/libs/bash/lib.sh
|
|||||||
# docs https://hub.docker.com/r/pihole/pihole
|
# docs https://hub.docker.com/r/pihole/pihole
|
||||||
|
|
||||||
# setup
|
# setup
|
||||||
imageName=docker.io/pihole/pihole:2023.11.0
|
imageName=docker.io/pihole/pihole:2024.02.2
|
||||||
containerName=pihole
|
containerName=pihole
|
||||||
|
|
||||||
srcConfigPath=/home-server/configuration/$containerName
|
srcConfigPath=/home-server/configuration/$containerName
|
||||||
@ -18,8 +18,8 @@ webport=10105
|
|||||||
virtual_host=pihole_host
|
virtual_host=pihole_host
|
||||||
timezone=Europe/Rome
|
timezone=Europe/Rome
|
||||||
|
|
||||||
if [ -f "/etc/kaido/containers/$containerName/envs.sh" ]; then
|
if [ -f "$KAIDO_CONFIG_FOLDER/containers/$containerName/envs.sh" ]; then
|
||||||
source /etc/kaido/containers/$containerName/envs.sh
|
source "$KAIDO_CONFIG_FOLDER/containers/$containerName/envs.sh"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# pre install
|
# pre install
|
||||||
|
@ -14,10 +14,10 @@ domain="example.com"
|
|||||||
subdomains=""
|
subdomains=""
|
||||||
email="example@example.com"
|
email="example@example.com"
|
||||||
|
|
||||||
if [ -f "/etc/kaido/containers/$containerName/envs.sh" ]; then
|
if [ -f "$KAIDO_CONFIG_FOLDER/containers/$containerName/envs.sh" ]; then
|
||||||
source /etc/kaido/containers/$containerName/envs.sh
|
source "$KAIDO_CONFIG_FOLDER/containers/$containerName/envs.sh"
|
||||||
else
|
else
|
||||||
echo "You must configure this container with this file: /etc/kaido/containers/$containerName/envs.sh"
|
echo "You must configure this container with this file: "$KAIDO_CONFIG_FOLDER/containers/$containerName/envs.sh"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ source /opt/kaido/src/libs/bash/lib.sh
|
|||||||
|
|
||||||
|
|
||||||
# setup
|
# setup
|
||||||
imageName=docker.io/linuxserver/transmission:4.0.5-r0-ls211
|
imageName=docker.io/linuxserver/transmission:4.0.5-r0-ls226
|
||||||
containerName=transmission
|
containerName=transmission
|
||||||
|
|
||||||
dstBasePath="$CONTAINERS_FOLDER/$containerName"
|
dstBasePath="$CONTAINERS_FOLDER/$containerName"
|
||||||
@ -26,8 +26,8 @@ themeDownloadUrl="https://github.com/johman10/flood-for-transmission/releases/do
|
|||||||
secret_user=$containerName-user
|
secret_user=$containerName-user
|
||||||
secret_pass=$containerName-pass
|
secret_pass=$containerName-pass
|
||||||
|
|
||||||
if [ -f "/etc/kaido/containers/$containerName/envs.sh" ]; then
|
if [ -f "$KAIDO_CONFIG_FOLDER/containers/$containerName/envs.sh" ]; then
|
||||||
source /etc/kaido/containers/$containerName/envs.sh
|
source "$KAIDO_CONFIG_FOLDER/containers/$containerName/envs.sh"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
@ -25,8 +25,8 @@ if [ $(uname -m) == "aarch64" ]; then
|
|||||||
max_old_space_size=2048
|
max_old_space_size=2048
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f "/etc/kaido/containers/$podName/envs.sh" ]; then
|
if [ -f "$KAIDO_CONFIG_FOLDER/containers/$podName/envs.sh" ]; then
|
||||||
source /etc/kaido/containers/$podName/envs.sh
|
source "$KAIDO_CONFIG_FOLDER/containers/$podName/envs.sh"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
srcCondigFile=/etc/kaido/system/samba/smb.conf
|
srcCondigFile="$KAIDO_CONFIG_FOLDER/system/samba/smb.conf"
|
||||||
dstConfigFile=/etc/samba/smb.conf
|
dstConfigFile=/etc/samba/smb.conf
|
||||||
|
|
||||||
if [ ! -f "$srcCondigFile" ]; then
|
if [ ! -f "$srcCondigFile" ]; then
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
srcSysctlConf=/etc/kaido/system/sysctl/sysctl.conf
|
srcSysctlConf="$KAIDO_CONFIG_FOLDER/system/sysctl/sysctl.conf"
|
||||||
dstSysctlConf=/etc/sysctl.conf
|
dstSysctlConf=/etc/sysctl.conf
|
||||||
|
|
||||||
if [ ! -f "$srcSysctlConf" ]; then
|
if [ ! -f "$srcSysctlConf" ]; then
|
||||||
|
@ -1,13 +1,14 @@
|
|||||||
CONTAINERS_FOLDER="$HOME/.local/share/kaido/containers"
|
CONTAINERS_FOLDER="$HOME/.local/share/kaido/containers"
|
||||||
BUILDS_FOLDER="$HOME/.cache/kaido/build"
|
BUILDS_FOLDER="$HOME/.cache/kaido/build"
|
||||||
|
|
||||||
#TODO check if this is used
|
HOME_KAIDO_CONFIG_FOLDER="$HOME/.config/kaido"
|
||||||
MASTER_CONFIG_FOLDER="$HOME/.config/kaido"
|
SYSTEM_KAIDO_CONFIG_FOLDER="/etc/kaido"
|
||||||
|
|
||||||
|
KAIDO_CONFIG_FOLDER=$SYSTEM_KAIDO_CONFIG_FOLDER
|
||||||
if [ -f "/etc/kaido/envs.sh" ]; then
|
if [ -d "$HOME_KAIDO_CONFIG_FOLDER" ]; then
|
||||||
source /etc/kaido/envs.sh
|
KAIDO_CONFIG_FOLDER=$HOME_KAIDO_CONFIG_FOLDER
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# keep here until fully implemented, maybe read it from kaido.conf?
|
if [ -f "$KAIDO_CONFIG_FOLDER/envs.sh" ]; then
|
||||||
KAIDO_CONFIG_FOLDER="/etc/kaido"
|
source "$KAIDO_CONFIG_FOLDER/envs.sh"
|
||||||
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user