final commit before setup refactoring

This commit is contained in:
cortex
2026-05-20 15:17:30 +01:00
parent 4763fde62e
commit fe775ca1c2
4 changed files with 100 additions and 33 deletions
+26 -19
View File
@@ -13,7 +13,7 @@ require_file "$TEMPLATE_FILE" "Compose template"
log_info "Configuring optional services..."
read -r -p "Enable LiveKit RTC Stack? (Y/n) [Y]: " LIVEKIT_INPUT
read -r -p "Enable LiveKit RTC Stack? (Used for Element call) (Y/n) [Y]: " LIVEKIT_INPUT
LIVEKIT_INPUT="${LIVEKIT_INPUT:-Y}"
if [[ "$LIVEKIT_INPUT" =~ ^[Yy]$ ]]; then
INCLUDE_LIVEKIT=true
@@ -29,39 +29,46 @@ EOF
else
INCLUDE_LIVEKIT=false
fi
write_state LIVEKIT "$INCLUDE_LIVEKIT"
echo "Select Web Client: 1) Element 2) Cinny 3) FluffyChat 4) None"
read -r -p "Default [1]: " WEB_APP_INPUT
WEB_APP_INPUT="${WEB_APP_INPUT:-1}"
case "$WEB_APP_INPUT" in
1) INCLUDE_ELEMENT=true; INCLUDE_CINNY=false; INCLUDE_FLUFFY=false ;;
2) INCLUDE_ELEMENT=false; INCLUDE_CINNY=true; INCLUDE_FLUFFY=false ;;
3) INCLUDE_ELEMENT=false; INCLUDE_CINNY=false; INCLUDE_FLUFFY=true ;;
*) INCLUDE_ELEMENT=false; INCLUDE_CINNY=false; INCLUDE_FLUFFY=false ;;
1) INCLUDE_ELEMENT=true; INCLUDE_CINNY=false; INCLUDE_FLUFFY=false; write_state "APP" "ELEMENT" ;;
2) INCLUDE_ELEMENT=false; INCLUDE_CINNY=true; INCLUDE_FLUFFY=false; write_state "APP" "CINNY" ;;
3) INCLUDE_ELEMENT=false; INCLUDE_CINNY=false; INCLUDE_FLUFFY=true; write_state "APP" "FLUFFY" ;;
*) INCLUDE_ELEMENT=false; INCLUDE_CINNY=false; INCLUDE_FLUFFY=false; write_state "APP" "NONE" ;;
esac
echo "Select Reverse Proxy: 1) Traefik 2) nginx"
read -r -p "Default [1]: " PROXY_INPUT
PROXY_INPUT="${PROXY_INPUT:-1}"
case "$PROXY_INPUT" in
1) INCLUDE_NGINX=false; INCLUDE_TRAEFIK=true ;;
*) INCLUDE_NGINX=true; INCLUDE_TRAEFIK=false ;;
2)
INCLUDE_NGINX=true
INCLUDE_TRAEFIK=false
write_state "PROXY" "NGINX"
;;
*)
INCLUDE_NGINX=false
INCLUDE_TRAEFIK=true
write_state "PROXY" "TRAEFIK"
;;
esac
cp "$TEMPLATE_FILE" "$OUTPUT_FILE"
toggle_block() {
[[ "$3" == "true" ]] && sed -i "/$1/d; /$2/d" "$OUTPUT_FILE" || sed -i "/$1/,/$2/d" "$OUTPUT_FILE"
}
toggle_block "$OUTPUT_FILE" "# \[LIVEKIT_START\]" "# \[LIVEKIT_END\]" "$INCLUDE_LIVEKIT"
toggle_block "$OUTPUT_FILE" "# \[ELEMENT_START\]" "# \[ELEMENT_END\]" "$INCLUDE_ELEMENT"
toggle_block "$OUTPUT_FILE" "# \[CINNY_START\]" "# \[CINNY_END\]" "$INCLUDE_CINNY"
toggle_block "$OUTPUT_FILE" "# \[FLUFFYCHAT_START\]" "# \[FLUFFYCHAT_END\]" "$INCLUDE_FLUFFY"
toggle_block "$OUTPUT_FILE" "# \[NGINX_START\]" "# \[NGINX_END\]" "$INCLUDE_NGINX"
toggle_block "$OUTPUT_FILE" "# \[TRAEFIK_START\]" "# \[TRAEFIK_END\]" "$INCLUDE_TRAEFIK"
toggle_block "# \[LIVEKIT_START\]" "# \[LIVEKIT_END\]" "$INCLUDE_LIVEKIT"
toggle_block "# \[ELEMENT_START\]" "# \[ELEMENT_END\]" "$INCLUDE_ELEMENT"
toggle_block "# \[CINNY_START\]" "# \[CINNY_END\]" "$INCLUDE_CINNY"
toggle_block "# \[FLUFFYCHAT_START\]" "# \[FLUFFYCHAT_END\]" "$INCLUDE_FLUFFY"
toggle_block "# \[NGINX_START\]" "# \[NGINX_END\]" "$INCLUDE_NGINX"
toggle_block "# \[TRAEFIK_START\]" "# \[TRAEFIK_END\]" "$INCLUDE_TRAEFIK"
[[ "$INCLUDE_TRAEFIK" == "true" ]] && sed -i "/# \[TRAEFIK_LABELS_START\]/d; /# \[TRAEFIK_LABELS_END\]/d" "$OUTPUT_FILE" || \
if [[ "$INCLUDE_TRAEFIK" == "true" ]]; then
sed -i "/# \[TRAEFIK_LABELS_START\]/d; /# \[TRAEFIK_LABELS_END\]/d" "$OUTPUT_FILE"
else
sed -i "/# \[TRAEFIK_LABELS_START\]/,/# \[TRAEFIK_LABELS_END\]/d" "$OUTPUT_FILE"
fi
log_info "Compose file generated: $OUTPUT_FILE"