1 Commits

Author SHA1 Message Date
user
54fd0bdcb3 fix: use prebuilt golangci-lint binary in Docker (multi-arch)
All checks were successful
Check / check (pull_request) Successful in 11m20s
go install golangci-lint fails in alpine due to missing gold linker.
Download prebuilt binary with arch detection and SHA-256 verification
for both amd64 and arm64.

Verified: make check passes, docker build succeeds on arm64.
2026-02-26 02:17:24 -08:00
51 changed files with 170 additions and 179 deletions

View File

@@ -10,7 +10,17 @@ jobs:
check: check:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4, 2024-10-13 - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Build (runs make check inside Dockerfile) - uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5
run: docker build . with:
go-version-file: go.mod
- name: Install golangci-lint
run: go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@5d1e709b7be35cb2025444e19de266b056b7b7ee # v2.10.1
- name: Install goimports
run: go install golang.org/x/tools/cmd/goimports@009367f5c17a8d4c45a961a3a509277190a9a6f0 # v0.42.0
- name: Run make check
run: make check

View File

@@ -2,23 +2,23 @@
# golang:1.25-alpine # golang:1.25-alpine
FROM golang@sha256:f6751d823c26342f9506c03797d2527668d095b0a15f1862cddb4d927a7a4ced AS builder FROM golang@sha256:f6751d823c26342f9506c03797d2527668d095b0a15f1862cddb4d927a7a4ced AS builder
RUN apk add --no-cache git make gcc musl-dev RUN apk add --no-cache git make gcc musl-dev curl
# Install golangci-lint v2 (pre-built binary — go install fails in alpine due to missing linker) # Install golangci-lint v2.10.1 (prebuilt binary, multi-arch)
RUN set -e; \ RUN set -e; \
GOLANGCI_VERSION="2.10.1"; \ ARCH="$(uname -m)"; \
case "$(uname -m)" in \ case "$ARCH" in \
x86_64) ARCH="amd64"; SHA256="dfa775874cf0561b404a02a8f4481fc69b28091da95aa697259820d429b09c99" ;; \ x86_64) ARCH=amd64; SHA256="dfa775874cf0561b404a02a8f4481fc69b28091da95aa697259820d429b09c99" ;; \
aarch64) ARCH="arm64"; SHA256="6652b42ae02915eb2f9cb2a2e0cac99514c8eded8388d88ae3e06e1a52c00de8" ;; \ aarch64) ARCH=arm64; SHA256="6652b42ae02915eb2f9cb2a2e0cac99514c8eded8388d88ae3e06e1a52c00de8" ;; \
*) echo "unsupported arch: $(uname -m)" >&2; exit 1 ;; \ *) echo "Unsupported arch: $ARCH" >&2; exit 1 ;; \
esac; \ esac; \
wget -q -O /tmp/golangci-lint.tar.gz \ curl -fsSL "https://github.com/golangci/golangci-lint/releases/download/v2.10.1/golangci-lint-2.10.1-linux-${ARCH}.tar.gz" -o /tmp/golangci-lint.tar.gz; \
"https://github.com/golangci/golangci-lint/releases/download/v${GOLANGCI_VERSION}/golangci-lint-${GOLANGCI_VERSION}-linux-${ARCH}.tar.gz"; \
echo "${SHA256} /tmp/golangci-lint.tar.gz" | sha256sum -c -; \ echo "${SHA256} /tmp/golangci-lint.tar.gz" | sha256sum -c -; \
tar -xzf /tmp/golangci-lint.tar.gz -C /usr/local/bin --strip-components=1 "golangci-lint-${GOLANGCI_VERSION}-linux-${ARCH}/golangci-lint"; \ tar -xzf /tmp/golangci-lint.tar.gz -C /usr/local/bin --strip-components=1 "golangci-lint-2.10.1-linux-${ARCH}/golangci-lint"; \
rm /tmp/golangci-lint.tar.gz; \ rm /tmp/golangci-lint.tar.gz
golangci-lint version
RUN go install golang.org/x/tools/cmd/goimports@009367f5c17a8d4c45a961a3a509277190a9a6f0 # v0.42.0 # Install goimports v0.42.0
RUN go install golang.org/x/tools/cmd/goimports@009367f5c17a8d4c45a961a3a509277190a9a6f0
WORKDIR /src WORKDIR /src
COPY go.mod go.sum ./ COPY go.mod go.sum ./

View File

@@ -4,20 +4,20 @@ package main
import ( import (
"go.uber.org/fx" "go.uber.org/fx"
"sneak.berlin/go/upaas/internal/config" "git.eeqj.de/sneak/upaas/internal/config"
"sneak.berlin/go/upaas/internal/database" "git.eeqj.de/sneak/upaas/internal/database"
"sneak.berlin/go/upaas/internal/docker" "git.eeqj.de/sneak/upaas/internal/docker"
"sneak.berlin/go/upaas/internal/globals" "git.eeqj.de/sneak/upaas/internal/globals"
"sneak.berlin/go/upaas/internal/handlers" "git.eeqj.de/sneak/upaas/internal/handlers"
"sneak.berlin/go/upaas/internal/healthcheck" "git.eeqj.de/sneak/upaas/internal/healthcheck"
"sneak.berlin/go/upaas/internal/logger" "git.eeqj.de/sneak/upaas/internal/logger"
"sneak.berlin/go/upaas/internal/middleware" "git.eeqj.de/sneak/upaas/internal/middleware"
"sneak.berlin/go/upaas/internal/server" "git.eeqj.de/sneak/upaas/internal/server"
"sneak.berlin/go/upaas/internal/service/app" "git.eeqj.de/sneak/upaas/internal/service/app"
"sneak.berlin/go/upaas/internal/service/auth" "git.eeqj.de/sneak/upaas/internal/service/auth"
"sneak.berlin/go/upaas/internal/service/deploy" "git.eeqj.de/sneak/upaas/internal/service/deploy"
"sneak.berlin/go/upaas/internal/service/notify" "git.eeqj.de/sneak/upaas/internal/service/notify"
"sneak.berlin/go/upaas/internal/service/webhook" "git.eeqj.de/sneak/upaas/internal/service/webhook"
_ "github.com/joho/godotenv/autoload" _ "github.com/joho/godotenv/autoload"
) )

4
go.mod
View File

@@ -1,4 +1,4 @@
module sneak.berlin/go/upaas module git.eeqj.de/sneak/upaas
go 1.25 go 1.25
@@ -19,7 +19,6 @@ require (
github.com/stretchr/testify v1.11.1 github.com/stretchr/testify v1.11.1
go.uber.org/fx v1.24.0 go.uber.org/fx v1.24.0
golang.org/x/crypto v0.46.0 golang.org/x/crypto v0.46.0
golang.org/x/time v0.12.0
) )
require ( require (
@@ -75,6 +74,7 @@ require (
go.yaml.in/yaml/v3 v3.0.4 // indirect go.yaml.in/yaml/v3 v3.0.4 // indirect
golang.org/x/sys v0.39.0 // indirect golang.org/x/sys v0.39.0 // indirect
golang.org/x/text v0.32.0 // indirect golang.org/x/text v0.32.0 // indirect
golang.org/x/time v0.12.0 // indirect
google.golang.org/protobuf v1.36.10 // indirect google.golang.org/protobuf v1.36.10 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect
gotest.tools/v3 v3.5.2 // indirect gotest.tools/v3 v3.5.2 // indirect

View File

@@ -13,8 +13,8 @@ import (
"github.com/spf13/viper" "github.com/spf13/viper"
"go.uber.org/fx" "go.uber.org/fx"
"sneak.berlin/go/upaas/internal/globals" "git.eeqj.de/sneak/upaas/internal/globals"
"sneak.berlin/go/upaas/internal/logger" "git.eeqj.de/sneak/upaas/internal/logger"
) )
// defaultPort is the default HTTP server port. // defaultPort is the default HTTP server port.

View File

@@ -14,8 +14,8 @@ import (
_ "github.com/mattn/go-sqlite3" // SQLite driver _ "github.com/mattn/go-sqlite3" // SQLite driver
"go.uber.org/fx" "go.uber.org/fx"
"sneak.berlin/go/upaas/internal/config" "git.eeqj.de/sneak/upaas/internal/config"
"sneak.berlin/go/upaas/internal/logger" "git.eeqj.de/sneak/upaas/internal/logger"
) )
// dataDirPermissions is the file permission for the data directory. // dataDirPermissions is the file permission for the data directory.

View File

@@ -5,7 +5,7 @@ import (
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"sneak.berlin/go/upaas/internal/database" "git.eeqj.de/sneak/upaas/internal/database"
) )
func TestHashWebhookSecret(t *testing.T) { func TestHashWebhookSecret(t *testing.T) {

View File

@@ -5,8 +5,8 @@ import (
"os" "os"
"testing" "testing"
"sneak.berlin/go/upaas/internal/config" "git.eeqj.de/sneak/upaas/internal/config"
"sneak.berlin/go/upaas/internal/logger" "git.eeqj.de/sneak/upaas/internal/logger"
) )
// NewTestDatabase creates an in-memory Database for testing. // NewTestDatabase creates an in-memory Database for testing.

View File

@@ -25,9 +25,9 @@ import (
"github.com/docker/go-connections/nat" "github.com/docker/go-connections/nat"
"go.uber.org/fx" "go.uber.org/fx"
"sneak.berlin/go/upaas/internal/config" "git.eeqj.de/sneak/upaas/internal/config"
"sneak.berlin/go/upaas/internal/logger" "git.eeqj.de/sneak/upaas/internal/logger"
) )
// sshKeyPermissions is the file permission for SSH private keys. // sshKeyPermissions is the file permission for SSH private keys.

View File

@@ -7,7 +7,7 @@ import (
"github.com/go-chi/chi/v5" "github.com/go-chi/chi/v5"
"sneak.berlin/go/upaas/internal/models" "git.eeqj.de/sneak/upaas/internal/models"
) )
// apiAppResponse is the JSON representation of an app. // apiAppResponse is the JSON representation of an app.

View File

@@ -11,7 +11,7 @@ import (
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"sneak.berlin/go/upaas/internal/service/app" "git.eeqj.de/sneak/upaas/internal/service/app"
) )
// apiRouter builds a chi router with the API routes using session auth middleware. // apiRouter builds a chi router with the API routes using session auth middleware.

View File

@@ -15,9 +15,9 @@ import (
"github.com/go-chi/chi/v5" "github.com/go-chi/chi/v5"
"sneak.berlin/go/upaas/internal/models" "git.eeqj.de/sneak/upaas/internal/models"
"sneak.berlin/go/upaas/internal/service/app" "git.eeqj.de/sneak/upaas/internal/service/app"
"sneak.berlin/go/upaas/templates" "git.eeqj.de/sneak/upaas/templates"
) )
const ( const (

View File

@@ -3,7 +3,7 @@ package handlers
import ( import (
"net/http" "net/http"
"sneak.berlin/go/upaas/templates" "git.eeqj.de/sneak/upaas/templates"
) )
// HandleLoginGET returns the login page handler. // HandleLoginGET returns the login page handler.

View File

@@ -4,8 +4,8 @@ import (
"net/http" "net/http"
"time" "time"
"sneak.berlin/go/upaas/internal/models" "git.eeqj.de/sneak/upaas/internal/models"
"sneak.berlin/go/upaas/templates" "git.eeqj.de/sneak/upaas/templates"
) )
// AppStats holds deployment statistics for an app. // AppStats holds deployment statistics for an app.

View File

@@ -10,16 +10,16 @@ import (
"github.com/gorilla/csrf" "github.com/gorilla/csrf"
"go.uber.org/fx" "go.uber.org/fx"
"sneak.berlin/go/upaas/internal/database" "git.eeqj.de/sneak/upaas/internal/database"
"sneak.berlin/go/upaas/internal/docker" "git.eeqj.de/sneak/upaas/internal/docker"
"sneak.berlin/go/upaas/internal/globals" "git.eeqj.de/sneak/upaas/internal/globals"
"sneak.berlin/go/upaas/internal/healthcheck" "git.eeqj.de/sneak/upaas/internal/healthcheck"
"sneak.berlin/go/upaas/internal/logger" "git.eeqj.de/sneak/upaas/internal/logger"
"sneak.berlin/go/upaas/internal/service/app" "git.eeqj.de/sneak/upaas/internal/service/app"
"sneak.berlin/go/upaas/internal/service/auth" "git.eeqj.de/sneak/upaas/internal/service/auth"
"sneak.berlin/go/upaas/internal/service/deploy" "git.eeqj.de/sneak/upaas/internal/service/deploy"
"sneak.berlin/go/upaas/internal/service/webhook" "git.eeqj.de/sneak/upaas/internal/service/webhook"
"sneak.berlin/go/upaas/templates" "git.eeqj.de/sneak/upaas/templates"
) )
// Params contains dependencies for Handlers. // Params contains dependencies for Handlers.

View File

@@ -15,21 +15,21 @@ import (
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"go.uber.org/fx" "go.uber.org/fx"
"sneak.berlin/go/upaas/internal/models" "git.eeqj.de/sneak/upaas/internal/models"
"sneak.berlin/go/upaas/internal/config" "git.eeqj.de/sneak/upaas/internal/config"
"sneak.berlin/go/upaas/internal/database" "git.eeqj.de/sneak/upaas/internal/database"
"sneak.berlin/go/upaas/internal/docker" "git.eeqj.de/sneak/upaas/internal/docker"
"sneak.berlin/go/upaas/internal/globals" "git.eeqj.de/sneak/upaas/internal/globals"
"sneak.berlin/go/upaas/internal/handlers" "git.eeqj.de/sneak/upaas/internal/handlers"
"sneak.berlin/go/upaas/internal/healthcheck" "git.eeqj.de/sneak/upaas/internal/healthcheck"
"sneak.berlin/go/upaas/internal/logger" "git.eeqj.de/sneak/upaas/internal/logger"
"sneak.berlin/go/upaas/internal/middleware" "git.eeqj.de/sneak/upaas/internal/middleware"
"sneak.berlin/go/upaas/internal/service/app" "git.eeqj.de/sneak/upaas/internal/service/app"
"sneak.berlin/go/upaas/internal/service/auth" "git.eeqj.de/sneak/upaas/internal/service/auth"
"sneak.berlin/go/upaas/internal/service/deploy" "git.eeqj.de/sneak/upaas/internal/service/deploy"
"sneak.berlin/go/upaas/internal/service/notify" "git.eeqj.de/sneak/upaas/internal/service/notify"
"sneak.berlin/go/upaas/internal/service/webhook" "git.eeqj.de/sneak/upaas/internal/service/webhook"
) )
type testContext struct { type testContext struct {
@@ -404,25 +404,6 @@ func TestHandleDashboard(t *testing.T) {
assert.Equal(t, http.StatusOK, recorder.Code) assert.Equal(t, http.StatusOK, recorder.Code)
assert.Contains(t, recorder.Body.String(), "Applications") assert.Contains(t, recorder.Body.String(), "Applications")
}) })
t.Run("renders dashboard with apps without crashing on CSRFField", func(t *testing.T) {
t.Parallel()
testCtx := setupTestHandlers(t)
// Create an app so the template iterates over AppStats and hits .CSRFField
createTestApp(t, testCtx, "csrf-test-app")
request := httptest.NewRequest(http.MethodGet, "/", nil)
recorder := httptest.NewRecorder()
handler := testCtx.handlers.HandleDashboard()
handler.ServeHTTP(recorder, request)
assert.Equal(t, http.StatusOK, recorder.Code,
"dashboard should not 500 when apps exist (CSRFField must be accessible)")
assert.Contains(t, recorder.Body.String(), "csrf-test-app")
})
} }
func TestHandleAppNew(t *testing.T) { func TestHandleAppNew(t *testing.T) {

View File

@@ -3,7 +3,7 @@ package handlers_test
import ( import (
"testing" "testing"
"sneak.berlin/go/upaas/internal/handlers" "git.eeqj.de/sneak/upaas/internal/handlers"
) )
func TestValidateRepoURL(t *testing.T) { func TestValidateRepoURL(t *testing.T) {

View File

@@ -3,7 +3,7 @@ package handlers_test
import ( import (
"testing" "testing"
"sneak.berlin/go/upaas/internal/handlers" "git.eeqj.de/sneak/upaas/internal/handlers"
) )
func TestSanitizeLogs(t *testing.T) { //nolint:funlen // table-driven tests func TestSanitizeLogs(t *testing.T) { //nolint:funlen // table-driven tests

View File

@@ -3,7 +3,7 @@ package handlers
import ( import (
"net/http" "net/http"
"sneak.berlin/go/upaas/templates" "git.eeqj.de/sneak/upaas/templates"
) )
const ( const (

View File

@@ -3,7 +3,7 @@ package handlers_test
import ( import (
"testing" "testing"
"sneak.berlin/go/upaas/internal/handlers" "git.eeqj.de/sneak/upaas/internal/handlers"
) )
func TestSanitizeTail(t *testing.T) { func TestSanitizeTail(t *testing.T) {

View File

@@ -6,7 +6,7 @@ import (
"github.com/go-chi/chi/v5" "github.com/go-chi/chi/v5"
"sneak.berlin/go/upaas/internal/models" "git.eeqj.de/sneak/upaas/internal/models"
) )
// maxWebhookBodySize is the maximum allowed size of a webhook request body (1MB). // maxWebhookBodySize is the maximum allowed size of a webhook request body (1MB).

View File

@@ -8,10 +8,10 @@ import (
"go.uber.org/fx" "go.uber.org/fx"
"sneak.berlin/go/upaas/internal/config" "git.eeqj.de/sneak/upaas/internal/config"
"sneak.berlin/go/upaas/internal/database" "git.eeqj.de/sneak/upaas/internal/database"
"sneak.berlin/go/upaas/internal/globals" "git.eeqj.de/sneak/upaas/internal/globals"
"sneak.berlin/go/upaas/internal/logger" "git.eeqj.de/sneak/upaas/internal/logger"
) )
// Params contains dependencies for Healthcheck. // Params contains dependencies for Healthcheck.

View File

@@ -7,7 +7,7 @@ import (
"go.uber.org/fx" "go.uber.org/fx"
"sneak.berlin/go/upaas/internal/globals" "git.eeqj.de/sneak/upaas/internal/globals"
) )
// Params contains dependencies for Logger. // Params contains dependencies for Logger.

View File

@@ -8,7 +8,7 @@ import (
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"sneak.berlin/go/upaas/internal/config" "git.eeqj.de/sneak/upaas/internal/config"
) )
//nolint:gosec // test credentials //nolint:gosec // test credentials

View File

@@ -18,10 +18,10 @@ import (
"go.uber.org/fx" "go.uber.org/fx"
"golang.org/x/time/rate" "golang.org/x/time/rate"
"sneak.berlin/go/upaas/internal/config" "git.eeqj.de/sneak/upaas/internal/config"
"sneak.berlin/go/upaas/internal/globals" "git.eeqj.de/sneak/upaas/internal/globals"
"sneak.berlin/go/upaas/internal/logger" "git.eeqj.de/sneak/upaas/internal/logger"
"sneak.berlin/go/upaas/internal/service/auth" "git.eeqj.de/sneak/upaas/internal/service/auth"
) )
// corsMaxAge is the maximum age for CORS preflight responses in seconds. // corsMaxAge is the maximum age for CORS preflight responses in seconds.

View File

@@ -9,7 +9,7 @@ import (
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"sneak.berlin/go/upaas/internal/config" "git.eeqj.de/sneak/upaas/internal/config"
) )
func newTestMiddleware(t *testing.T) *Middleware { func newTestMiddleware(t *testing.T) *Middleware {

View File

@@ -7,7 +7,7 @@ import (
"fmt" "fmt"
"time" "time"
"sneak.berlin/go/upaas/internal/database" "git.eeqj.de/sneak/upaas/internal/database"
) )
// appColumns is the standard column list for app queries. // appColumns is the standard column list for app queries.

View File

@@ -8,7 +8,7 @@ import (
"strings" "strings"
"time" "time"
"sneak.berlin/go/upaas/internal/database" "git.eeqj.de/sneak/upaas/internal/database"
) )
// DeploymentStatus represents the status of a deployment. // DeploymentStatus represents the status of a deployment.

View File

@@ -7,7 +7,7 @@ import (
"errors" "errors"
"fmt" "fmt"
"sneak.berlin/go/upaas/internal/database" "git.eeqj.de/sneak/upaas/internal/database"
) )
// EnvVar represents an environment variable for an app. // EnvVar represents an environment variable for an app.

View File

@@ -7,7 +7,7 @@ import (
"errors" "errors"
"fmt" "fmt"
"sneak.berlin/go/upaas/internal/database" "git.eeqj.de/sneak/upaas/internal/database"
) )
// Label represents a Docker label for an app container. // Label represents a Docker label for an app container.

View File

@@ -10,11 +10,11 @@ import (
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"go.uber.org/fx" "go.uber.org/fx"
"sneak.berlin/go/upaas/internal/config" "git.eeqj.de/sneak/upaas/internal/config"
"sneak.berlin/go/upaas/internal/database" "git.eeqj.de/sneak/upaas/internal/database"
"sneak.berlin/go/upaas/internal/globals" "git.eeqj.de/sneak/upaas/internal/globals"
"sneak.berlin/go/upaas/internal/logger" "git.eeqj.de/sneak/upaas/internal/logger"
"sneak.berlin/go/upaas/internal/models" "git.eeqj.de/sneak/upaas/internal/models"
) )
// Test constants to satisfy goconst linter. // Test constants to satisfy goconst linter.

View File

@@ -6,7 +6,7 @@ import (
"errors" "errors"
"fmt" "fmt"
"sneak.berlin/go/upaas/internal/database" "git.eeqj.de/sneak/upaas/internal/database"
) )
// PortProtocol represents the protocol for a port mapping. // PortProtocol represents the protocol for a port mapping.

View File

@@ -8,7 +8,7 @@ import (
"fmt" "fmt"
"time" "time"
"sneak.berlin/go/upaas/internal/database" "git.eeqj.de/sneak/upaas/internal/database"
) )
// User represents a user in the system. // User represents a user in the system.

View File

@@ -6,7 +6,7 @@ import (
"errors" "errors"
"fmt" "fmt"
"sneak.berlin/go/upaas/internal/database" "git.eeqj.de/sneak/upaas/internal/database"
) )
// Volume represents a volume mount for an app container. // Volume represents a volume mount for an app container.

View File

@@ -7,7 +7,7 @@ import (
"fmt" "fmt"
"time" "time"
"sneak.berlin/go/upaas/internal/database" "git.eeqj.de/sneak/upaas/internal/database"
) )
// WebhookEvent represents a received webhook event. // WebhookEvent represents a received webhook event.

View File

@@ -8,7 +8,7 @@ import (
chimw "github.com/go-chi/chi/v5/middleware" chimw "github.com/go-chi/chi/v5/middleware"
"github.com/prometheus/client_golang/prometheus/promhttp" "github.com/prometheus/client_golang/prometheus/promhttp"
"sneak.berlin/go/upaas/static" "git.eeqj.de/sneak/upaas/static"
) )
// requestTimeout is the maximum duration for handling a request. // requestTimeout is the maximum duration for handling a request.

View File

@@ -12,11 +12,11 @@ import (
"github.com/go-chi/chi/v5" "github.com/go-chi/chi/v5"
"go.uber.org/fx" "go.uber.org/fx"
"sneak.berlin/go/upaas/internal/config" "git.eeqj.de/sneak/upaas/internal/config"
"sneak.berlin/go/upaas/internal/globals" "git.eeqj.de/sneak/upaas/internal/globals"
"sneak.berlin/go/upaas/internal/handlers" "git.eeqj.de/sneak/upaas/internal/handlers"
"sneak.berlin/go/upaas/internal/logger" "git.eeqj.de/sneak/upaas/internal/logger"
"sneak.berlin/go/upaas/internal/middleware" "git.eeqj.de/sneak/upaas/internal/middleware"
) )
// Params contains dependencies for Server. // Params contains dependencies for Server.

View File

@@ -14,10 +14,10 @@ import (
"go.uber.org/fx" "go.uber.org/fx"
"sneak.berlin/go/upaas/internal/database" "git.eeqj.de/sneak/upaas/internal/database"
"sneak.berlin/go/upaas/internal/logger" "git.eeqj.de/sneak/upaas/internal/logger"
"sneak.berlin/go/upaas/internal/models" "git.eeqj.de/sneak/upaas/internal/models"
"sneak.berlin/go/upaas/internal/ssh" "git.eeqj.de/sneak/upaas/internal/ssh"
) )
// ServiceParams contains dependencies for Service. // ServiceParams contains dependencies for Service.

View File

@@ -8,12 +8,12 @@ import (
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"go.uber.org/fx" "go.uber.org/fx"
"sneak.berlin/go/upaas/internal/config" "git.eeqj.de/sneak/upaas/internal/config"
"sneak.berlin/go/upaas/internal/database" "git.eeqj.de/sneak/upaas/internal/database"
"sneak.berlin/go/upaas/internal/globals" "git.eeqj.de/sneak/upaas/internal/globals"
"sneak.berlin/go/upaas/internal/logger" "git.eeqj.de/sneak/upaas/internal/logger"
"sneak.berlin/go/upaas/internal/models" "git.eeqj.de/sneak/upaas/internal/models"
"sneak.berlin/go/upaas/internal/service/app" "git.eeqj.de/sneak/upaas/internal/service/app"
) )
func setupTestService(t *testing.T) (*app.Service, func()) { func setupTestService(t *testing.T) (*app.Service, func()) {

View File

@@ -15,10 +15,10 @@ import (
"go.uber.org/fx" "go.uber.org/fx"
"golang.org/x/crypto/argon2" "golang.org/x/crypto/argon2"
"sneak.berlin/go/upaas/internal/config" "git.eeqj.de/sneak/upaas/internal/config"
"sneak.berlin/go/upaas/internal/database" "git.eeqj.de/sneak/upaas/internal/database"
"sneak.berlin/go/upaas/internal/logger" "git.eeqj.de/sneak/upaas/internal/logger"
"sneak.berlin/go/upaas/internal/models" "git.eeqj.de/sneak/upaas/internal/models"
) )
const ( const (

View File

@@ -12,11 +12,11 @@ import (
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"go.uber.org/fx" "go.uber.org/fx"
"sneak.berlin/go/upaas/internal/config" "git.eeqj.de/sneak/upaas/internal/config"
"sneak.berlin/go/upaas/internal/database" "git.eeqj.de/sneak/upaas/internal/database"
"sneak.berlin/go/upaas/internal/globals" "git.eeqj.de/sneak/upaas/internal/globals"
"sneak.berlin/go/upaas/internal/logger" "git.eeqj.de/sneak/upaas/internal/logger"
"sneak.berlin/go/upaas/internal/service/auth" "git.eeqj.de/sneak/upaas/internal/service/auth"
) )
func setupTestService(t *testing.T) (*auth.Service, func()) { func setupTestService(t *testing.T) (*auth.Service, func()) {

View File

@@ -17,12 +17,12 @@ import (
"go.uber.org/fx" "go.uber.org/fx"
"sneak.berlin/go/upaas/internal/config" "git.eeqj.de/sneak/upaas/internal/config"
"sneak.berlin/go/upaas/internal/database" "git.eeqj.de/sneak/upaas/internal/database"
"sneak.berlin/go/upaas/internal/docker" "git.eeqj.de/sneak/upaas/internal/docker"
"sneak.berlin/go/upaas/internal/logger" "git.eeqj.de/sneak/upaas/internal/logger"
"sneak.berlin/go/upaas/internal/models" "git.eeqj.de/sneak/upaas/internal/models"
"sneak.berlin/go/upaas/internal/service/notify" "git.eeqj.de/sneak/upaas/internal/service/notify"
) )
// Time constants. // Time constants.

View File

@@ -9,7 +9,7 @@ import (
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"sneak.berlin/go/upaas/internal/service/deploy" "git.eeqj.de/sneak/upaas/internal/service/deploy"
) )
func TestCancelActiveDeploy_NoExisting(t *testing.T) { func TestCancelActiveDeploy_NoExisting(t *testing.T) {

View File

@@ -10,8 +10,8 @@ import (
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"sneak.berlin/go/upaas/internal/config" "git.eeqj.de/sneak/upaas/internal/config"
"sneak.berlin/go/upaas/internal/service/deploy" "git.eeqj.de/sneak/upaas/internal/service/deploy"
) )
func TestCleanupCancelledDeploy_RemovesBuildDir(t *testing.T) { func TestCleanupCancelledDeploy_RemovesBuildDir(t *testing.T) {

View File

@@ -6,10 +6,10 @@ import (
"os" "os"
"testing" "testing"
"sneak.berlin/go/upaas/internal/database" "git.eeqj.de/sneak/upaas/internal/database"
"sneak.berlin/go/upaas/internal/docker" "git.eeqj.de/sneak/upaas/internal/docker"
"sneak.berlin/go/upaas/internal/models" "git.eeqj.de/sneak/upaas/internal/models"
"sneak.berlin/go/upaas/internal/service/deploy" "git.eeqj.de/sneak/upaas/internal/service/deploy"
) )
func TestBuildContainerOptionsUsesImageID(t *testing.T) { func TestBuildContainerOptionsUsesImageID(t *testing.T) {

View File

@@ -8,9 +8,9 @@ import (
"path/filepath" "path/filepath"
"strings" "strings"
"sneak.berlin/go/upaas/internal/config" "git.eeqj.de/sneak/upaas/internal/config"
"sneak.berlin/go/upaas/internal/docker" "git.eeqj.de/sneak/upaas/internal/docker"
"sneak.berlin/go/upaas/internal/models" "git.eeqj.de/sneak/upaas/internal/models"
) )
// NewTestService creates a Service with minimal dependencies for testing. // NewTestService creates a Service with minimal dependencies for testing.

View File

@@ -15,8 +15,8 @@ import (
"go.uber.org/fx" "go.uber.org/fx"
"sneak.berlin/go/upaas/internal/logger" "git.eeqj.de/sneak/upaas/internal/logger"
"sneak.berlin/go/upaas/internal/models" "git.eeqj.de/sneak/upaas/internal/models"
) )
// HTTP client timeout. // HTTP client timeout.

View File

@@ -10,11 +10,11 @@ import (
"go.uber.org/fx" "go.uber.org/fx"
"sneak.berlin/go/upaas/internal/database" "git.eeqj.de/sneak/upaas/internal/database"
"sneak.berlin/go/upaas/internal/logger" "git.eeqj.de/sneak/upaas/internal/logger"
"sneak.berlin/go/upaas/internal/models" "git.eeqj.de/sneak/upaas/internal/models"
"sneak.berlin/go/upaas/internal/service/deploy" "git.eeqj.de/sneak/upaas/internal/service/deploy"
) )
// ServiceParams contains dependencies for Service. // ServiceParams contains dependencies for Service.

View File

@@ -12,15 +12,15 @@ import (
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"go.uber.org/fx" "go.uber.org/fx"
"sneak.berlin/go/upaas/internal/config" "git.eeqj.de/sneak/upaas/internal/config"
"sneak.berlin/go/upaas/internal/database" "git.eeqj.de/sneak/upaas/internal/database"
"sneak.berlin/go/upaas/internal/docker" "git.eeqj.de/sneak/upaas/internal/docker"
"sneak.berlin/go/upaas/internal/globals" "git.eeqj.de/sneak/upaas/internal/globals"
"sneak.berlin/go/upaas/internal/logger" "git.eeqj.de/sneak/upaas/internal/logger"
"sneak.berlin/go/upaas/internal/models" "git.eeqj.de/sneak/upaas/internal/models"
"sneak.berlin/go/upaas/internal/service/deploy" "git.eeqj.de/sneak/upaas/internal/service/deploy"
"sneak.berlin/go/upaas/internal/service/notify" "git.eeqj.de/sneak/upaas/internal/service/notify"
"sneak.berlin/go/upaas/internal/service/webhook" "git.eeqj.de/sneak/upaas/internal/service/webhook"
) )
type testDeps struct { type testDeps struct {

View File

@@ -4,9 +4,9 @@ import (
"strings" "strings"
"testing" "testing"
"git.eeqj.de/sneak/upaas/internal/ssh"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"sneak.berlin/go/upaas/internal/ssh"
) )
func TestGenerateKeyPair(t *testing.T) { func TestGenerateKeyPair(t *testing.T) {

View File

@@ -69,7 +69,7 @@
<a href="/apps/{{.App.ID}}" class="btn-text text-sm py-1 px-2">View</a> <a href="/apps/{{.App.ID}}" class="btn-text text-sm py-1 px-2">View</a>
<a href="/apps/{{.App.ID}}/edit" class="btn-secondary text-sm py-1 px-2">Edit</a> <a href="/apps/{{.App.ID}}/edit" class="btn-secondary text-sm py-1 px-2">Edit</a>
<form method="POST" action="/apps/{{.App.ID}}/deploy" class="inline"> <form method="POST" action="/apps/{{.App.ID}}/deploy" class="inline">
{{ $.CSRFField }} {{ .CSRFField }}
<button type="submit" class="btn-success text-sm py-1 px-2">Deploy</button> <button type="submit" class="btn-success text-sm py-1 px-2">Deploy</button>
</form> </form>
</div> </div>