#!/bin/bash # Fix source file locations for all apps # Move source files to correct directories for Docker builds WORKSPACE="/home/localuser/TSYSDevStack/Cloudron/CloudronPackages-Workspace" echo "🔧 Fixing source file locations..." # Fix Go apps GO_APPS=( "chirpstack" "database-gateway" "easy-gate" "fleet" "gophish" "signoz" "tirreno" ) for app in "${GO_APPS[@]}"; do app_dir="$WORKSPACE/$app" echo " 📝 Fixing $app..." # Move go.mod to app directory if it exists in parent if [ -f "$app_dir/go.mod" ] && [ -d "$app_dir/app" ]; then mv "$app_dir/go.mod" "$app_dir/app/" echo " Moved go.mod to app directory" fi # Move cmd directory to app directory if it exists in parent if [ -d "$app_dir/cmd" ] && [ -d "$app_dir/app" ]; then mv "$app_dir/cmd" "$app_dir/app/" echo " Moved cmd to app directory" fi done # Fix Node.js apps NODE_APPS=( "runme" "autobom" "comply" "docker-drawio" "fonoster" "fx" "grist-core" "jamovi" "langfuse" "midday" "no-code-architects-toolkit" "openblocks" "PLMore" "policies" "puter" "security-awareness-training" "windmill" "wireviz-web" ) for app in "${NODE_APPS[@]}"; do app_dir="$WORKSPACE/$app" echo " 📝 Fixing $app..." # Move package.json to app directory if it exists in parent if [ -f "$app_dir/package.json" ] && [ -d "$app_dir/app" ]; then mv "$app_dir/package.json" "$app_dir/app/" echo " Moved package.json to app directory" fi # Move index.js to app directory if it exists in parent if [ -f "$app_dir/index.js" ] && [ -d "$app_dir/app" ]; then mv "$app_dir/index.js" "$app_dir/app/" echo " Moved index.js to app directory" fi done # Fix Python apps PYTHON_APPS=( "netbox" "boinc" "datahub" "docassemble" "healthchecks" "InvenTree" "mender" "nautilus_trader" "reviewboard" "satnogs" "sdrangel" "slurm" "SniperPhish" "WireViz" "sentry" ) for app in "${PYTHON_APPS[@]}"; do app_dir="$WORKSPACE/$app" echo " 📝 Fixing $app..." # Move requirements.txt to app directory if it exists in parent if [ -f "$app_dir/requirements.txt" ] && [ -d "$app_dir/app" ]; then mv "$app_dir/requirements.txt" "$app_dir/app/" echo " Moved requirements.txt to app directory" fi # Move app.py to app directory if it exists in parent if [ -f "$app_dir/app.py" ] && [ -d "$app_dir/app" ]; then mv "$app_dir/app.py" "$app_dir/app/" echo " Moved app.py to app directory" fi done # Fix Java apps JAVA_APPS=( "rundeck" "openboxes" "PayrollEngine" "seatunnel" ) for app in "${JAVA_APPS[@]}"; do app_dir="$WORKSPACE/$app" echo " 📝 Fixing $app..." # Move pom.xml to app directory if it exists in parent if [ -f "$app_dir/pom.xml" ] && [ -d "$app_dir/app" ]; then mv "$app_dir/pom.xml" "$app_dir/app/" echo " Moved pom.xml to app directory" fi # Move src directory to app directory if it exists in parent if [ -d "$app_dir/src" ] && [ -d "$app_dir/app" ]; then mv "$app_dir/src" "$app_dir/app/" echo " Moved src to app directory" fi done # Fix Rust apps RUST_APPS=( "hyperswitch" "rathole" "warp" ) for app in "${RUST_APPS[@]}"; do app_dir="$WORKSPACE/$app" echo " 📝 Fixing $app..." # Move Cargo.toml to app directory if it exists in parent if [ -f "$app_dir/Cargo.toml" ] && [ -d "$app_dir/app" ]; then mv "$app_dir/Cargo.toml" "$app_dir/app/" echo " Moved Cargo.toml to app directory" fi # Move src directory to app directory if it exists in parent if [ -d "$app_dir/src" ] && [ -d "$app_dir/app" ]; then mv "$app_dir/src" "$app_dir/app/" echo " Moved src to app directory" fi done # Fix PHP apps PHP_APPS=( "corteza" "elabftw" "oat-sa" "pimcore" ) for app in "${PHP_APPS[@]}"; do app_dir="$WORKSPACE/$app" echo " 📝 Fixing $app..." # Move composer.json to app directory if it exists in parent if [ -f "$app_dir/composer.json" ] && [ -d "$app_dir/app" ]; then mv "$app_dir/composer.json" "$app_dir/app/" echo " Moved composer.json to app directory" fi # Move index.php to app directory if it exists in parent if [ -f "$app_dir/index.php" ] && [ -d "$app_dir/app" ]; then mv "$app_dir/index.php" "$app_dir/app/" echo " Moved index.php to app directory" fi done # Fix Ruby apps RUBY_APPS=( "huginn" "consuldemocracy" ) for app in "${RUBY_APPS[@]}"; do app_dir="$WORKSPACE/$app" echo " 📝 Fixing $app..." # Move Gemfile to app directory if it exists in parent if [ -f "$app_dir/Gemfile" ] && [ -d "$app_dir/app" ]; then mv "$app_dir/Gemfile" "$app_dir/app/" echo " Moved Gemfile to app directory" fi # Move app.rb to app directory if it exists in parent if [ -f "$app_dir/app.rb" ] && [ -d "$app_dir/app" ]; then mv "$app_dir/app.rb" "$app_dir/app/" echo " Moved app.rb to app directory" fi # Move config.ru to app directory if it exists in parent if [ -f "$app_dir/config.ru" ] && [ -d "$app_dir/app" ]; then mv "$app_dir/config.ru" "$app_dir/app/" echo " Moved config.ru to app directory" fi done echo "✅ Source file locations fixed!"