diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 6876572..99aed45 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -4,40 +4,14 @@ - @@ -199,7 +172,8 @@ - true diff --git a/Dockerfile b/Dockerfile index 7200191..af19f58 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,6 @@ # Building Backend FROM golang:alpine as passport-server -RUN apk add nodejs npm - WORKDIR /source COPY . . RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -buildvcs -o /dist ./pkg/main.go diff --git a/go.mod b/go.mod index 54bb7dc..6a499cc 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ toolchain go1.22.1 require ( firebase.google.com/go v3.13.0+incompatible - git.solsynth.dev/hydrogen/paperclip v0.0.0-20240518085442-715238074040 + git.solsynth.dev/hydrogen/paperclip v0.0.0-20240622051057-0f56dba45745 github.com/go-playground/validator/v10 v10.17.0 github.com/gofiber/contrib/websocket v1.3.0 github.com/gofiber/fiber/v2 v2.52.4 diff --git a/go.sum b/go.sum index 251c1d7..4522a2e 100644 --- a/go.sum +++ b/go.sum @@ -17,8 +17,8 @@ cloud.google.com/go/storage v1.41.0 h1:RusiwatSu6lHeEXe3kglxakAmAbfV+rhtPqA6i8RB cloud.google.com/go/storage v1.41.0/go.mod h1:J1WCa/Z2FcgdEDuPUY8DxT5I+d9mFKsCepp5vR6Sq80= firebase.google.com/go v3.13.0+incompatible h1:3TdYC3DDi6aHn20qoRkxwGqNgdjtblwVAyRLQwGn/+4= firebase.google.com/go v3.13.0+incompatible/go.mod h1:xlah6XbEyW6tbfSklcfe5FHJIwjt8toICdV5Wh9ptHs= -git.solsynth.dev/hydrogen/paperclip v0.0.0-20240518085442-715238074040 h1:B/3gXFaxoLdD7icLu33OXrx166raEHtHdfhCFrPYgTE= -git.solsynth.dev/hydrogen/paperclip v0.0.0-20240518085442-715238074040/go.mod h1:uTNEtJcNdgt7DhOgsewPaLQQ5kTN9H+tGNRT2CshHGs= +git.solsynth.dev/hydrogen/paperclip v0.0.0-20240622051057-0f56dba45745 h1:40BUsQMNXjqHyytkyF9py1HjTAWlRgO6R57YXUrHNy4= +git.solsynth.dev/hydrogen/paperclip v0.0.0-20240622051057-0f56dba45745/go.mod h1:FsQGSLTl0gvo+9Jmbot02S72suyF9tFTrzDj70Xhifo= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8= github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= diff --git a/pkg/internal/server/api/avatar_api.go b/pkg/internal/server/api/avatar_api.go index a650ad9..2b6bfc3 100644 --- a/pkg/internal/server/api/avatar_api.go +++ b/pkg/internal/server/api/avatar_api.go @@ -3,7 +3,7 @@ package api import ( "context" "fmt" - pcpb "git.solsynth.dev/hydrogen/paperclip/pkg/grpc/proto" + "git.solsynth.dev/hydrogen/paperclip/pkg/proto" "git.solsynth.dev/hydrogen/passport/pkg/internal/database" "git.solsynth.dev/hydrogen/passport/pkg/internal/gap" "git.solsynth.dev/hydrogen/passport/pkg/internal/models" @@ -35,7 +35,7 @@ func setAvatar(c *fiber.Ctx) error { if err != nil { return fiber.NewError(fiber.StatusInternalServerError, "attachments services was not available") } - if _, err := pcpb.NewAttachmentsClient(pc).CheckAttachmentExists(context.Background(), &pcpb.AttachmentLookupRequest{ + if _, err := proto.NewAttachmentsClient(pc).CheckAttachmentExists(context.Background(), &proto.AttachmentLookupRequest{ Id: lo.ToPtr(uint64(data.AttachmentID)), Usage: lo.ToPtr("p.avatar"), }); err != nil { @@ -71,7 +71,7 @@ func setBanner(c *fiber.Ctx) error { if err != nil { return fiber.NewError(fiber.StatusInternalServerError, "attachments services was not available") } - if _, err := pcpb.NewAttachmentsClient(pc).CheckAttachmentExists(context.Background(), &pcpb.AttachmentLookupRequest{ + if _, err := proto.NewAttachmentsClient(pc).CheckAttachmentExists(context.Background(), &proto.AttachmentLookupRequest{ Id: lo.ToPtr(uint64(data.AttachmentID)), Usage: lo.ToPtr("p.banner"), }); err != nil { diff --git a/pkg/internal/server/api/index.go b/pkg/internal/server/api/index.go index 64760a3..9bcb2e7 100644 --- a/pkg/internal/server/api/index.go +++ b/pkg/internal/server/api/index.go @@ -7,7 +7,6 @@ import ( ) func MapAPIs(app *fiber.App) { - app.Get("/.well-known", getMetadata) app.Get("/.well-known/openid-configuration", getOidcConfiguration) api := app.Group("/api").Name("API") diff --git a/pkg/internal/server/api/well_known_api.go b/pkg/internal/server/api/well_known_api.go index 4384450..df62e03 100644 --- a/pkg/internal/server/api/well_known_api.go +++ b/pkg/internal/server/api/well_known_api.go @@ -7,14 +7,6 @@ import ( "github.com/spf13/viper" ) -func getMetadata(c *fiber.Ctx) error { - return c.JSON(fiber.Map{ - "name": viper.GetString("name"), - "domain": viper.GetString("domain"), - "open_registration": !viper.GetBool("use_registration_magic_token"), - }) -} - func getOidcConfiguration(c *fiber.Ctx) error { domain := viper.GetString("domain") basepath := fmt.Sprintf("https://%s", domain) diff --git a/settings.toml b/settings.toml index ca7c6cd..d8b319f 100644 --- a/settings.toml +++ b/settings.toml @@ -1,6 +1,4 @@ id = "passport01" -name = "Goatpass" -maintainer = "Solsynth LLC" bind = "0.0.0.0:8444" grpc_bind = "0.0.0.0:7444"