diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 52769f0..fa0ca80 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -90,7 +90,7 @@ dockers: - onsonr/hway:latest - ghcr.io/onsonr/hway:{{ .Tag }} - ghcr.io/onsonr/hway:latest - dockerfile: ./docker/Dockerfile + dockerfile: ./docker/release.Dockerfile announce: telegram: diff --git a/app/app.go b/app/app.go index 0571c3d..3de82bc 100644 --- a/app/app.go +++ b/app/app.go @@ -5,9 +5,9 @@ import ( "github.com/labstack/echo-contrib/echoprometheus" "github.com/labstack/echo/v4" echomiddleware "github.com/labstack/echo/v4/middleware" - "github.com/onsonr/hway/app/common" - config "github.com/onsonr/hway/config" - hwayorm "github.com/onsonr/hway/models" + "github.com/onsonr/hway/pkg/common" + config "github.com/onsonr/hway/pkg/config" + hwayorm "github.com/onsonr/hway/pkg/models" // "github.com/onsonr/hway/pkg/context" ) diff --git a/cmd/hway/main.go b/cmd/hway/main.go index 2388e2e..cb3ca6a 100644 --- a/cmd/hway/main.go +++ b/cmd/hway/main.go @@ -9,9 +9,9 @@ import ( "os" "github.com/onsonr/hway/app" - "github.com/onsonr/hway/app/common" - "github.com/onsonr/hway/config" - hwayorm "github.com/onsonr/hway/models" + "github.com/onsonr/hway/pkg/common" + "github.com/onsonr/hway/pkg/config" + hwayorm "github.com/onsonr/hway/pkg/models" "github.com/spf13/cobra" ) diff --git a/docker/Dockerfile b/docker/release.Dockerfile similarity index 100% rename from docker/Dockerfile rename to docker/release.Dockerfile diff --git a/go.mod b/go.mod index 1ad715b..c6ebd7c 100644 --- a/go.mod +++ b/go.mod @@ -189,6 +189,7 @@ require ( github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect github.com/onsi/ginkgo/v2 v2.22.0 // indirect + github.com/onsonr/nebula v0.1.1 // indirect github.com/opentracing/opentracing-go v1.2.0 // indirect github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect github.com/pelletier/go-toml/v2 v2.2.2 // indirect diff --git a/go.sum b/go.sum index 012a82a..ec73265 100644 --- a/go.sum +++ b/go.sum @@ -750,6 +750,8 @@ github.com/onsi/gomega v1.34.2 h1:pNCwDkzrsv7MS9kpaQvVb1aVLahQXyJ/Tv5oAZMI3i8= github.com/onsi/gomega v1.34.2/go.mod h1:v1xfxRgk0KIsG+QOdm7p8UosrOzPYRo60fd3B/1Dukc= github.com/onsonr/crypto v1.50.0 h1:U1oEFPG3v/fPywAUE8VW5w1FSMjpckPS6PLH2bVDI2I= github.com/onsonr/crypto v1.50.0/go.mod h1:bBNLhUlfIaBiVRpKprYtPV8h/9nXB32TXMujkKGwg8w= +github.com/onsonr/nebula v0.1.1 h1:YBIbf4JSt8jVz6DI04fa7gKY9fBZ47YBIzwe3Nom+YQ= +github.com/onsonr/nebula v0.1.1/go.mod h1:1Dcmw5lB4dvKRKSp55B/iLmN4ejZ4vp1/EB/RzXetAQ= github.com/onsonr/sonr v0.6.1 h1:pNP2BbOfe/3UN/bZSYNyf9F+nlIpZaqi2LJ6Ol0496w= github.com/onsonr/sonr v0.6.1/go.mod h1:L4ywLeJemlGD2pmlIX/j3eEKEgu5o/yzgFjkHNr7dAk= github.com/opencontainers/runtime-spec v1.2.0 h1:z97+pHb3uELt/yiAWD691HNHQIF07bE7dzrbT927iTk= diff --git a/handlers/errors.go b/handlers/errors.go index fac491e..55a3b39 100644 --- a/handlers/errors.go +++ b/handlers/errors.go @@ -2,7 +2,7 @@ package handlers import ( "github.com/labstack/echo/v4" - "github.com/onsonr/hway/app/context" + "github.com/onsonr/hway/pkg/context" ) func ErrorHandler(err error, c echo.Context) { diff --git a/handlers/index.go b/handlers/index.go index d154513..0958e16 100644 --- a/handlers/index.go +++ b/handlers/index.go @@ -2,7 +2,7 @@ package handlers import ( "github.com/labstack/echo/v4" - "github.com/onsonr/hway/app/context" + "github.com/onsonr/hway/pkg/context" ) func IndexHandler(c echo.Context) error { diff --git a/handlers/register.go b/handlers/register.go index 986fb55..296ed50 100644 --- a/handlers/register.go +++ b/handlers/register.go @@ -4,11 +4,11 @@ import ( "encoding/json" "github.com/labstack/echo/v4" - "github.com/onsonr/hway/app/common" - "github.com/onsonr/hway/app/context" "github.com/onsonr/hway/app/islands" "github.com/onsonr/hway/app/views" - hwayorm "github.com/onsonr/hway/models" + "github.com/onsonr/hway/pkg/common" + "github.com/onsonr/hway/pkg/context" + hwayorm "github.com/onsonr/hway/pkg/models" ) func RegisterHandler(g *echo.Group) { diff --git a/internal/pkl/App.pkl b/internal/pkl/App.pkl index 31426db..cca91fe 100644 --- a/internal/pkl/App.pkl +++ b/internal/pkl/App.pkl @@ -1,4 +1,4 @@ -@go.Package { name = "github.com/onsonr/hway/config" } +@go.Package { name = "github.com/onsonr/hway/pkg/config" } open module sonr.net.Hway diff --git a/internal/sqlc.yaml b/internal/sqlc.yaml index 1703fbd..29ad5d3 100644 --- a/internal/sqlc.yaml +++ b/internal/sqlc.yaml @@ -8,4 +8,4 @@ sql: emit_interface: true emit_json_tags: true package: "models" - out: "../models" + out: "../pkg/models" diff --git a/app/common/chain_query.go b/pkg/common/chain_query.go similarity index 100% rename from app/common/chain_query.go rename to pkg/common/chain_query.go diff --git a/app/common/http_cookies.go b/pkg/common/http_cookies.go similarity index 100% rename from app/common/http_cookies.go rename to pkg/common/http_cookies.go diff --git a/app/common/http_headers.go b/pkg/common/http_headers.go similarity index 100% rename from app/common/http_headers.go rename to pkg/common/http_headers.go diff --git a/app/common/ipfs_api.go b/pkg/common/ipfs_api.go similarity index 100% rename from app/common/ipfs_api.go rename to pkg/common/ipfs_api.go diff --git a/app/common/ipfs_file.go b/pkg/common/ipfs_file.go similarity index 100% rename from app/common/ipfs_file.go rename to pkg/common/ipfs_file.go diff --git a/app/common/ipfs_folder.go b/pkg/common/ipfs_folder.go similarity index 100% rename from app/common/ipfs_folder.go rename to pkg/common/ipfs_folder.go diff --git a/app/common/ucan_store.go b/pkg/common/ucan_store.go similarity index 100% rename from app/common/ucan_store.go rename to pkg/common/ucan_store.go diff --git a/config/Hway.pkl.go b/pkg/config/Hway.pkl.go similarity index 100% rename from config/Hway.pkl.go rename to pkg/config/Hway.pkl.go diff --git a/config/init.pkl.go b/pkg/config/init.pkl.go similarity index 100% rename from config/init.pkl.go rename to pkg/config/init.pkl.go diff --git a/app/context/credentials.go b/pkg/context/credentials.go similarity index 100% rename from app/context/credentials.go rename to pkg/context/credentials.go diff --git a/app/context/middleware.go b/pkg/context/middleware.go similarity index 92% rename from app/context/middleware.go rename to pkg/context/middleware.go index 2651c83..bd80ef1 100644 --- a/app/context/middleware.go +++ b/pkg/context/middleware.go @@ -7,9 +7,9 @@ import ( "github.com/labstack/echo/v4" "github.com/medama-io/go-useragent" "github.com/onsonr/crypto/mpc" - "github.com/onsonr/hway/app/common" - hway "github.com/onsonr/hway/config" - hwayorm "github.com/onsonr/hway/internal/models" + "github.com/onsonr/hway/pkg/common" + hway "github.com/onsonr/hway/pkg/config" + hwayorm "github.com/onsonr/hway/pkg/models" ) type GatewayContext struct { diff --git a/app/context/profiles.go b/pkg/context/profiles.go similarity index 96% rename from app/context/profiles.go rename to pkg/context/profiles.go index 9082da1..6847a27 100644 --- a/app/context/profiles.go +++ b/pkg/context/profiles.go @@ -4,7 +4,7 @@ import ( "net/http" "github.com/labstack/echo/v4" - hwayorm "github.com/onsonr/hway/internal/models" + hwayorm "github.com/onsonr/hway/pkg/models" ) func UpdateProfile(c echo.Context) (*hwayorm.Profile, error) { diff --git a/app/context/renderer.go b/pkg/context/renderer.go similarity index 100% rename from app/context/renderer.go rename to pkg/context/renderer.go diff --git a/app/context/resolver.go b/pkg/context/resolver.go similarity index 98% rename from app/context/resolver.go rename to pkg/context/resolver.go index 32a6081..25b8cd3 100644 --- a/app/context/resolver.go +++ b/pkg/context/resolver.go @@ -3,7 +3,7 @@ package context import ( "fmt" - "github.com/onsonr/hway/app/common" + "github.com/onsonr/hway/pkg/common" ) // ParamsBank returns the bank params diff --git a/app/context/sessions.go b/pkg/context/sessions.go similarity index 98% rename from app/context/sessions.go rename to pkg/context/sessions.go index b8822e6..aea101b 100644 --- a/app/context/sessions.go +++ b/pkg/context/sessions.go @@ -4,7 +4,7 @@ import ( gocontext "context" "github.com/labstack/echo/v4" - "github.com/onsonr/hway/app/common" + "github.com/onsonr/hway/pkg/common" "github.com/segmentio/ksuid" "lukechampine.com/blake3" ) diff --git a/app/context/types.go b/pkg/context/types.go similarity index 98% rename from app/context/types.go rename to pkg/context/types.go index eacc1ac..6238633 100644 --- a/app/context/types.go +++ b/pkg/context/types.go @@ -4,7 +4,7 @@ import ( "github.com/go-webauthn/webauthn/protocol" "github.com/labstack/echo/v4" "github.com/medama-io/go-useragent" - hwayorm "github.com/onsonr/hway/internal/models" + hwayorm "github.com/onsonr/hway/pkg/models" ) // Define the credential structure matching our frontend data diff --git a/app/context/vaults.go b/pkg/context/vaults.go similarity index 96% rename from app/context/vaults.go rename to pkg/context/vaults.go index d650d76..d26b787 100644 --- a/app/context/vaults.go +++ b/pkg/context/vaults.go @@ -2,7 +2,7 @@ package context import ( "github.com/onsonr/crypto/mpc" - "github.com/onsonr/hway/app/common" + "github.com/onsonr/hway/pkg/common" "lukechampine.com/blake3" ) diff --git a/models/db.go b/pkg/models/db.go similarity index 100% rename from models/db.go rename to pkg/models/db.go diff --git a/models/models.go b/pkg/models/models.go similarity index 100% rename from models/models.go rename to pkg/models/models.go diff --git a/models/querier.go b/pkg/models/querier.go similarity index 100% rename from models/querier.go rename to pkg/models/querier.go diff --git a/models/query.sql.go b/pkg/models/query.sql.go similarity index 100% rename from models/query.sql.go rename to pkg/models/query.sql.go diff --git a/x/errors/handler.go b/x/errors/handler.go index 60a0228..04b3218 100644 --- a/x/errors/handler.go +++ b/x/errors/handler.go @@ -1 +1 @@ -package index +package errors diff --git a/x/errors/route.go b/x/errors/route.go index 60a0228..04b3218 100644 --- a/x/errors/route.go +++ b/x/errors/route.go @@ -1 +1 @@ -package index +package errors diff --git a/x/errors/view.templ b/x/errors/view.templ new file mode 100644 index 0000000..078f883 --- /dev/null +++ b/x/errors/view.templ @@ -0,0 +1,24 @@ +package errors + +templ ErrorView(error string) { + @LayoutView("Error | Sonr.ID") { + @LayoutContainer() { + @HeroTitle("Error", "Something went wrong.") + @Form("/error", "error-form") { + @FormBody() { + @FormHeader() { +