diff --git a/docker/edge/entrypoint-edge.sh b/docker/edge/entrypoint-edge.sh index 2f77de4..6517511 100755 --- a/docker/edge/entrypoint-edge.sh +++ b/docker/edge/entrypoint-edge.sh @@ -8,14 +8,9 @@ FORGE_URL="${FORGE_URL:-http://forgejo:3000}" # Derive FORGE_REPO from PROJECT_TOML if available, otherwise require explicit env var if [ -z "${FORGE_REPO:-}" ]; then - # Try to find and parse PROJECT_TOML + # Try to find a project TOML to derive FORGE_REPO from _project_toml="${PROJECT_TOML:-}" - if [ -z "$_project_toml" ]; then - # Default path for project TOML in container - _project_toml="${FACTORY_ROOT:-/opt/disinto}/projects/disinto.toml" - fi - # Also check the generic projects directory - if [ ! -f "$_project_toml" ] && [ -d "${FACTORY_ROOT:-/opt/disinto}/projects" ]; then + if [ -z "$_project_toml" ] && [ -d "${FACTORY_ROOT:-/opt/disinto}/projects" ]; then for toml in "${FACTORY_ROOT:-/opt/disinto}"/projects/*.toml; do if [ -f "$toml" ]; then _project_toml="$toml" @@ -26,7 +21,7 @@ if [ -z "${FORGE_REPO:-}" ]; then if [ -n "$_project_toml" ] && [ -f "$_project_toml" ]; then # Parse FORGE_REPO from project TOML using load-project.sh - if source "${SCRIPT_ROOT:-$(dirname "${BASH_SOURCE[0]}")}/../lib/load-project.sh" "$_project_toml" 2>/dev/null; then + if source "${FACTORY_ROOT:-/opt/disinto}/lib/load-project.sh" "$_project_toml" 2>/dev/null; then if [ -n "${FORGE_REPO:-}" ]; then echo "Derived FORGE_REPO from PROJECT_TOML: $_project_toml" >&2 fi