tests now pass

This commit is contained in:
2025-10-14 21:26:58 +03:00
parent 5471f3b138
commit 7c4c4fd620
3 changed files with 14 additions and 11 deletions

View File

@@ -1,8 +1,7 @@
# Required: Admin bearer token for API access
ADMIN_TOKEN=devadmintoken ADMIN_TOKEN=devadmintoken
# Docker host binding (used by docker-compose for port mapping) # Docker host binding (used by docker compose for port mapping)
HOST=0.0.0.0 HOST=127.0.0.1
PORT=8080 PORT=8080
# Optional: Service configuration (defaults shown) # Optional: Service configuration (defaults shown)

View File

@@ -1,14 +1,14 @@
# Required: Admin bearer token for API access # Docker Compose Variables (used for port mapping)
ADMIN_TOKEN=your-secure-admin-token-here # Copy this file to .env for docker-compose to use
# Docker host binding (used by docker-compose for port mapping)
# The Go service always binds to 0.0.0.0:8080 inside the container # The Go service always binds to 0.0.0.0:8080 inside the container
HOST=0.0.0.0 HOST=0.0.0.0
PORT=8080 PORT=8080
# Required: Admin bearer token for API access
ADMIN_TOKEN=your-secure-admin-token-here # TODO: generate a secure token
# Optional: Service configuration (defaults shown) # Optional: Service configuration (defaults shown)
DEPLOY_ROOT=/var/www/docs DEPLOY_ROOT=/var/www/tingz-docs
RELEASE_ROOT=/var/www/deploys RELEASE_ROOT=/var/www/tingz-deploys
DB_PATH=/data/deployer.db DB_PATH=/data/deployer.db
# Optional: Upload and retention settings # Optional: Upload and retention settings
@@ -24,4 +24,3 @@ DISABLE_FILE_DELETE_ON_USER_REMOVE=false
# Optional: TLS configuration (if terminating TLS in the service) # Optional: TLS configuration (if terminating TLS in the service)
# TLS_CERT=/path/to/cert.pem # TLS_CERT=/path/to/cert.pem
# TLS_KEY=/path/to/key.pem # TLS_KEY=/path/to/key.pem

View File

@@ -74,8 +74,13 @@ func (m *Manager) Deploy(ctx context.Context, username, project string, r io.Rea
return "", fmt.Errorf("failed to create deploy parent directory: %w", err) return "", fmt.Errorf("failed to create deploy parent directory: %w", err)
} }
relPath, err := filepath.Rel(deployParentDir, releasePath)
if err != nil {
return "", fmt.Errorf("failed to calculate relative path: %w", err)
}
tmpLink := deployPath + ".tmp." + releaseID tmpLink := deployPath + ".tmp." + releaseID
if err := os.Symlink(releasePath, tmpLink); err != nil { if err := os.Symlink(relPath, tmpLink); err != nil {
return "", fmt.Errorf("failed to create temporary symlink: %w", err) return "", fmt.Errorf("failed to create temporary symlink: %w", err)
} }