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 # 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 \ RUN apk add --no-cache \
bash git ca-certificates tzdata \ bash git ca-certificates tzdata \
@@ -15,7 +15,7 @@ RUN npm i -g yarn pnpm
WORKDIR /src WORKDIR /src
COPY . . 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 # Runtime

View File

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

View File

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

11
main.go
View File

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

View File

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