Compare commits

...

4 Commits

Author SHA1 Message Date
allanice001
325e162d39 fix: add DockerIgnore to exclude terraform & sdk Directories, build process should reduce the container image size 2025-11-06 08:18:55 +00:00
allanice001
30e91bfd88 fix: add DockerIgnore to exclude terraform Directories 2025-11-06 08:17:05 +00:00
allanice001
12f2c5e1c5 feat: dynamically set swagger host, and some ui improvements on ssh page 2025-11-06 05:52:06 +00:00
public-glueops-renovatebot[bot]
7dc7d1a1f1 chore(pindigest): update golang to d2ede9f #patch (#239)
Co-authored-by: public-glueops-renovatebot[bot] <186083205+public-glueops-renovatebot[bot]@users.noreply.github.com>
2025-11-06 05:16:38 +00:00
6 changed files with 45 additions and 31 deletions

3
.dockerignore Normal file
View File

@@ -0,0 +1,3 @@
terraform
terraform-provider-autoglue
sdk

View File

@@ -1,7 +1,7 @@
#################################
# Builder: Go + Node in one
#################################
FROM golang:1.25.4-alpine AS builder
FROM golang:1.25.4-alpine@sha256:d2ede9f3341a67413127cf5366bb25bbad9b0a66e8173cae3a900ab00e84861f AS builder
RUN apk add --no-cache \
bash git ca-certificates tzdata \
@@ -15,7 +15,7 @@ RUN npm i -g yarn pnpm
WORKDIR /src
COPY . .
RUN make clean && make swagger && make -j3 sdk-all && make ui && make build
RUN make clean && make swagger && make sdk-ts-ui && make ui && make build
#################################
# Runtime

View File

@@ -24,10 +24,11 @@ type Config struct {
GithubClientID string
GithubClientSecret string
UIDev bool
Env string
Debug bool
Swagger bool
UIDev bool
Env string
Debug bool
Swagger bool
SwaggerHost string
}
var (
@@ -52,6 +53,7 @@ func Load() (Config, error) {
v.SetDefault("env", "development")
v.SetDefault("debug", false)
v.SetDefault("swagger", false)
v.SetDefault("swagger.host", "localhost:8080")
// Env setup and binding
v.SetEnvKeyReplacer(strings.NewReplacer(".", "_"))
@@ -73,6 +75,7 @@ func Load() (Config, error) {
"env",
"debug",
"swagger",
"swagger.host",
}
for _, k := range keys {
_ = v.BindEnv(k)
@@ -92,10 +95,11 @@ func Load() (Config, error) {
GithubClientID: v.GetString("github.client.id"),
GithubClientSecret: v.GetString("github.client.secret"),
UIDev: v.GetBool("ui.dev"),
Env: v.GetString("env"),
Debug: v.GetBool("debug"),
Swagger: v.GetBool("swagger"),
UIDev: v.GetBool("ui.dev"),
Env: v.GetString("env"),
Debug: v.GetBool("debug"),
Swagger: v.GetBool("swagger"),
SwaggerHost: v.GetString("swagger.host"),
}
// Validate

View File

@@ -62,6 +62,9 @@ func ListPublicSshKeys(db *gorm.DB) http.HandlerFunc {
return
}
if out == nil {
out = []dto.SshResponse{}
}
utils.WriteJSON(w, http.StatusOK, out)
}
}

11
main.go
View File

@@ -1,6 +1,12 @@
package main
import "github.com/glueops/autoglue/cmd"
import (
"os"
"github.com/glueops/autoglue/cmd"
"github.com/glueops/autoglue/docs"
"github.com/joho/godotenv"
)
// @title AutoGlue API
// @version 1.0
@@ -10,7 +16,6 @@ import "github.com/glueops/autoglue/cmd"
// @BasePath /api/v1
// @schemes http https
// @host localhost:8080
// @securityDefinitions.apikey BearerAuth
// @in header
@@ -33,5 +38,7 @@ import "github.com/glueops/autoglue/cmd"
// @description Org-level secret
func main() {
_ = godotenv.Load()
docs.SwaggerInfo.Host = os.Getenv("SWAGGER_HOST")
cmd.Execute()
}

View File

@@ -307,7 +307,7 @@ export const SshPage = () => {
<TableHeader>
<TableRow>
<TableHead>Name</TableHead>
<TableHead className="min-w-[360px]">Public Key</TableHead>
<TableHead>Public Key</TableHead>
<TableHead>Fingerprint</TableHead>
<TableHead>Created</TableHead>
<TableHead className="w-[160px] text-right">Actions</TableHead>
@@ -320,22 +320,19 @@ export const SshPage = () => {
return (
<TableRow key={k.id}>
<TableCell className="font-medium">{k.name || "—"}</TableCell>
<TableCell className="max-w-[560px] truncate">
<div className="flex items-start gap-2">
<Badge variant="secondary" className="whitespace-nowrap">
{keyType}
</Badge>
<Tooltip>
<TooltipTrigger asChild>
<span className="font-mono text-xs">{truncated}</span>
</TooltipTrigger>
<TooltipContent className="max-w-[70vw]">
<div className="max-w-full">
<p className="font-mono text-xs break-all">{k.public_key}</p>
</div>
</TooltipContent>
</Tooltip>
</div>
<TableCell>
<Tooltip>
<TooltipTrigger asChild>
<Badge variant="secondary" className="whitespace-nowrap">
{keyType}
</Badge>
</TooltipTrigger>
<TooltipContent className="max-w-[70vw]">
<div className="max-w-full">
<p className="font-mono text-xs break-all">{k.public_key}</p>
</div>
</TooltipContent>
</Tooltip>
</TableCell>
<TableCell className="font-mono text-xs">{k.fingerprint}</TableCell>
<TableCell>
@@ -352,14 +349,14 @@ export const SshPage = () => {
<TableCell className="space-x-2 text-right">
<Button
size="sm"
variant="ghost"
variant="outline"
onClick={() => copy(k.public_key ?? "", "Public key copied")}
>
Copy Pub
</Button>
<Button
size="sm"
variant="ghost"
variant="outline"
onClick={() => copy(k.fingerprint ?? "", "Fingerprint copied")}
>
Copy FP