Skip to content

Commit 8ad3b64

Browse files
authored
hotfix: fix caddy docker proxy issue (#416)
1 parent ad621d9 commit 8ad3b64

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

api/api/versions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{
44
"version": "v1",
55
"status": "active",
6-
"release_date": "2025-09-16T08:20:28.255146+05:30",
6+
"release_date": "2025-09-18T09:02:53.080017+05:30",
77
"end_of_life": "0001-01-01T00:00:00Z",
88
"changes": [
99
"Initial API version"

api/internal/features/deploy/tasks/create.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77

88
"github.com/google/uuid"
99
"github.com/raghavyuva/caddygo"
10+
"github.com/raghavyuva/nixopus-api/internal/config"
1011
"github.com/raghavyuva/nixopus-api/internal/features/deploy/types"
1112
shared_types "github.com/raghavyuva/nixopus-api/internal/types"
1213
)
@@ -81,7 +82,9 @@ func (t *TaskService) HandleCreateDockerfileDeployment(ctx context.Context, Task
8182
taskCtx.LogAndUpdateStatus("Failed to convert port to int: "+err.Error(), shared_types.Failed)
8283
return err
8384
}
84-
err = client.AddDomainWithAutoTLS(TaskPayload.Application.Domain, TaskPayload.Application.Domain, port, caddygo.DomainOptions{})
85+
upstreamHost := config.AppConfig.SSH.Host
86+
87+
err = client.AddDomainWithAutoTLS(TaskPayload.Application.Domain, upstreamHost, port, caddygo.DomainOptions{})
8588
if err != nil {
8689
fmt.Println("Failed to add domain: ", err)
8790
taskCtx.LogAndUpdateStatus("Failed to add domain: "+err.Error(), shared_types.Failed)

helpers/config.dev.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ services:
1717
SSH_PASSWORD: ${SSH_PASSWORD:-}
1818
DOCKER_HOST: ${DOCKER_HOST:-unix:///var/run/docker.sock}
1919
REDIS_URL: ${REDIS_URL:-redis://localhost:6379}
20+
CADDY_ENDPOINT: ${CADDY_ENDPOINT:-http://127.0.0.1:2019}
2021
ALLOWED_ORIGIN: ${ALLOWED_ORIGIN:-http://localhost:7443}
2122
ENV: ${ENV:-development}
2223
LOGS_PATH: ${LOGS_PATH:-./logs}

0 commit comments

Comments
 (0)