moved nextcloud to wip folder

This commit is contained in:
Snogard 2025-03-05 12:52:43 +01:00
parent 6c3c8fd3eb
commit 2e248de8cb

95
src/wip/install-nextcloud.sh Executable file
View File

@ -0,0 +1,95 @@
#!/bin/bash
source /opt/kaido/src/libs/bash/lib.sh
# docs https://github.com/nextcloud/docker
# setup
podName=nextcloud
containerName_nextcloud=${podName}_web
containerName_db=${podName}_db
containerName_redis=${podName}_redis
containerName_smtp=${podName}_smtp
imageName_nextcloud=docker.io/library/nextcloud:27.0.0-apache
imageName_db=docker.io/library/mariadb:11.0.2
imageName_redis=docker.io
imageName_smtp=docker.io
dstBasePath="$KAIDO_CONTAINER_FOLDER/$podName"
dstNextcloudPath=$dstBasePath/nextcloud
dstAppsPath=$dstBasePath/apps
dstConfigPath=$dstBasePath/config
dstDataPath=$dstBasePath/data
dstThemePath=$dstBasePath/theme
dstDBConfigPath=$dstBasePath/db/config
dstDBDataPath=$dstBasePath/db/data
# envs
trusted_domains="localhost example.com"
if [ -f "$KAIDO_CONFIG_FOLDER/containers/$podName/envs.sh" ]; then
source "$KAIDO_CONFIG_FOLDER/containers/$podName/envs.sh"
fi
# pre install
create_folder "$dstNextcloudPath"
create_folder "$dstAppsPath"
create_folder "$dstConfigPath"
create_folder "$dstDataPath"
create_folder "$dstThemePath"
create_folder "$dstDBDataPath"
create_folder "$dstDBConfigPath"
stop_and_remove_pod $podName
# install
echo "Creating new $podName pod"
podman pod create \
--name $podName \
-p 10117:80/tcp
echo "Creating new $containerName_db container"
podman create \
--pod $podName \
--name $containerName_db \
-v $dstDBConfigPath:/etc/mysql/conf.d \
-v $dstDBDataPath:/var/lib/mysql \
-e MARIADB_DATABASE=nextcloud \
-e MARIADB_USER=nextcloud \
-e MARIADB_PASSWORD=mariadb_password \
-e MARIADB_ROOT_PASSWORD=mariadb_root_password \
$imageName_db
echo "Creating new $containerName_nextcloud container"
podman create \
--pod $podName \
--name $containerName_nextcloud \
--requires $containerName_db \
-v $dstNextcloudPath:/var/www/html \
-v $dstAppsPath:/var/www/html/custom_apps \
-v $dstConfigPath:/var/www/html/config \
-v $dstDataPath:/var/www/html/data \
-v $dstThemePath:/var/www/html/themes/custom \
-e NEXTCLOUD_TRUSTED_DOMAINS="$trusted_domains" \
-e MYSQL_DATABASE=nextcloud \
-e MYSQL_USER=nextcloud \
-e MYSQL_PASSWORD=mariadb_password \
-e MYSQL_HOST=$containerName_db \
$imageName_nextcloud
# --requires $containerName_smtp \
# --requires $containerName_redis \
# -e SMTP_SECURE=ssl \
# -e SMTP_HOST=$containerName_smtp \
# -e SMTP_NAME=nexcloud \
# -e SMTP_PASSWORDS=smtp_password \
# -e MAIL_DOMAIN=example.com \
# -e REDIS_HOST=$containerName_redis \
# -e REDIS_PASSWORD=redis_password \
# systemd
create_systemd_services $podName
systemctl --user enable --now $podName