diff --git a/client/src/index.html b/client/src/index.html index 788adb7..7576bfe 100644 --- a/client/src/index.html +++ b/client/src/index.html @@ -3,11 +3,11 @@ - Gitea Apps + Gitea Kan -
+
\ No newline at end of file diff --git a/client/src/index.js b/client/src/index.js index e2853fa..57e1dbe 100644 --- a/client/src/index.js +++ b/client/src/index.js @@ -6,5 +6,6 @@ import { setBase } from '@riotjs/route'; import { component } from 'riot'; import AppLoader from './components/app-loader.riot'; import './sass/_all.scss'; +import './index.html'; -component(AppLoader)(document.getElementById('gitea-apps')); +component(AppLoader)(document.getElementById('gitea-kan')); diff --git a/cmd/server/container.go b/cmd/server/container.go index 775ac8a..00a92c0 100644 --- a/cmd/server/container.go +++ b/cmd/server/container.go @@ -1,7 +1,7 @@ package main import ( - "forge.cadoles.com/wpetit/gitea-kan/cmd/server/config" + "forge.cadoles.com/wpetit/gitea-kan/internal/config" "github.com/gorilla/sessions" "github.com/pkg/errors" "gitlab.com/wpetit/goweb/service" diff --git a/cmd/server/main.go b/cmd/server/main.go index 93870fa..e1cf7a8 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -6,8 +6,8 @@ import ( "net/http" "os" - "forge.cadoles.com/wpetit/gitea-kan/cmd/server/route" - "forge.cadoles.com/wpetit/gitea-kan/config" + "forge.cadoles.com/wpetit/gitea-kan/internal/config" + "forge.cadoles.com/wpetit/gitea-kan/internal/route" "github.com/go-chi/chi" "github.com/go-chi/chi/middleware" "github.com/pkg/errors" diff --git a/go.mod b/go.mod index 694f7f2..c2fd876 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module forge.cadoles.com/wpetit/gitea-kan go 1.13 require ( - github.com/davecgh/go-spew v1.1.1 // indirect + github.com/davecgh/go-spew v1.1.1 github.com/go-chi/chi v4.0.2+incompatible github.com/google/uuid v1.1.1 // indirect github.com/gopherjs/gopherjs v0.0.0-20190430165422-3e4dfb77656c // indirect diff --git a/go.sum b/go.sum index 6d7a8fb..ae75178 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,3 @@ -cloud.google.com/go v0.34.0 h1:eOI3/cP2VTU6uZLDYAoic+eyzzB9YyGmJ7eIjl8rOPg= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -13,18 +12,14 @@ github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gopherjs/gopherjs v0.0.0-20190430165422-3e4dfb77656c h1:7lF+Vz0LqiRidnzC1Oq86fpX1q/iEv2KJdrCtttYjT4= github.com/gopherjs/gopherjs v0.0.0-20190430165422-3e4dfb77656c/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/securecookie v1.1.1 h1:miw7JPhV+b/lAHSXz4qd/nN9jRiAFV5FwjeKyCS8BvQ= github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4= github.com/gorilla/sessions v1.2.0 h1:S7P+1Hm5V/AT9cjEcUD5uDaQSX0OE577aCXgoaKpYbQ= github.com/gorilla/sessions v1.2.0/go.mod h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/zI+bUmuGM= -github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/leodido/go-urn v1.1.0/go.mod h1:+cyI34gQWZcE1eQU7NVgKkkzdXDQHr1dBMtdAPozLkw= github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c h1:rp5dCmg/yLR3mgFuSOe4oEnDDmGLROTvMragMUXpTQw= @@ -33,16 +28,12 @@ github.com/pborman/uuid v1.2.0 h1:J7Q5mO4ysT1dv8hyrUGHb9+ooztCXu1D8MY8DZYsu3g= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/assertions v1.0.1 h1:voD4ITNjPL5jjBfgR/r8fPIIBrliWrWHeiJApdr3r4w= github.com/smartystreets/assertions v1.0.1/go.mod h1:kHHU4qYBaI3q23Pp3VPrmWhuIUrLW/7eUrw0BU5VaoM= -github.com/smartystreets/goconvey v0.0.0-20190731233626-505e41936337 h1:WN9BUFbdyOsSH/XohnWpXOlq9NBD5sGAB2FciQMUEe8= github.com/smartystreets/goconvey v0.0.0-20190731233626-505e41936337/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= gitlab.com/wpetit/goweb v0.0.0-20190728111123-bbcb57177273 h1:YtMGT0pEGTQ5MAglg6rvu8pQVQJEtskoeEw+csUqf2o= gitlab.com/wpetit/goweb v0.0.0-20190728111123-bbcb57177273/go.mod h1:5Y/eVplFvdsd6zMdA3bx8KON6Ab1n90+cQeX5uJ6jIE= @@ -58,19 +49,16 @@ golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4Iltr golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= gopkg.in/go-playground/validator.v9 v9.29.1/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ= gopkg.in/ini.v1 v1.49.0 h1:MW0aLMiezbm/Ray0gJJ+nQFE2uOC9EpK2p5zPN3NqpM= gopkg.in/ini.v1 v1.49.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.5 h1:ymVxjfMaHvXD8RqPRmzHHsB3VvucivSkIAvJFDI5O3c= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/config/config.go b/internal/config/config.go similarity index 100% rename from config/config.go rename to internal/config/config.go diff --git a/config/provider.go b/internal/config/provider.go similarity index 100% rename from config/provider.go rename to internal/config/provider.go diff --git a/config/service.go b/internal/config/service.go similarity index 100% rename from config/service.go rename to internal/config/service.go diff --git a/middleware/auth.go b/internal/middleware/auth.go similarity index 96% rename from middleware/auth.go rename to internal/middleware/auth.go index fdceafb..428483c 100644 --- a/middleware/auth.go +++ b/internal/middleware/auth.go @@ -5,7 +5,7 @@ import ( "github.com/pborman/uuid" - "forge.cadoles.com/wpetit/gitea-kan/config" + "forge.cadoles.com/wpetit/gitea-kan/internal/config" "github.com/pkg/errors" "gitlab.com/wpetit/goweb/middleware/container" "gitlab.com/wpetit/goweb/service" diff --git a/cmd/server/route/helper.go b/internal/route/helper.go similarity index 100% rename from cmd/server/route/helper.go rename to internal/route/helper.go diff --git a/cmd/server/route/logout.go b/internal/route/logout.go similarity index 91% rename from cmd/server/route/logout.go rename to internal/route/logout.go index 8e3fe28..b6039fc 100644 --- a/cmd/server/route/logout.go +++ b/internal/route/logout.go @@ -3,7 +3,7 @@ package route import ( "net/http" - "forge.cadoles.com/wpetit/gitea-kan/config" + "forge.cadoles.com/wpetit/gitea-kan/internal/config" "github.com/pkg/errors" "gitlab.com/wpetit/goweb/middleware/container" "gitlab.com/wpetit/goweb/service/session" diff --git a/cmd/server/route/oauth2.go b/internal/route/oauth2.go similarity index 95% rename from cmd/server/route/oauth2.go rename to internal/route/oauth2.go index dc85371..711f985 100644 --- a/cmd/server/route/oauth2.go +++ b/internal/route/oauth2.go @@ -3,7 +3,7 @@ package route import ( "net/http" - "forge.cadoles.com/wpetit/gitea-kan/middleware" + "forge.cadoles.com/wpetit/gitea-kan/internal/middleware" "github.com/pkg/errors" "gitlab.com/wpetit/goweb/middleware/container" "gitlab.com/wpetit/goweb/service/session" diff --git a/cmd/server/route/proxy.go b/internal/route/proxy.go similarity index 85% rename from cmd/server/route/proxy.go rename to internal/route/proxy.go index 610ebf6..094226f 100644 --- a/cmd/server/route/proxy.go +++ b/internal/route/proxy.go @@ -6,8 +6,10 @@ import ( "net/http/httputil" "net/url" - "forge.cadoles.com/wpetit/gitea-kan/config" - "forge.cadoles.com/wpetit/gitea-kan/middleware" + "github.com/davecgh/go-spew/spew" + + "forge.cadoles.com/wpetit/gitea-kan/internal/config" + "forge.cadoles.com/wpetit/gitea-kan/internal/middleware" "github.com/pkg/errors" "gitlab.com/wpetit/goweb/middleware/container" "gitlab.com/wpetit/goweb/service/session" @@ -35,6 +37,7 @@ func proxyAPIRequest(w http.ResponseWriter, r *http.Request) { r.URL.Scheme = apiBaseURL.Scheme r.URL.Host = apiBaseURL.Host r.Header.Add("Authorization", fmt.Sprintf("token %s", accessToken)) + spew.Dump(r) } proxy.ServeHTTP(w, r) diff --git a/cmd/server/route/route.go b/internal/route/route.go similarity index 87% rename from cmd/server/route/route.go rename to internal/route/route.go index 078e151..55a0eb6 100644 --- a/cmd/server/route/route.go +++ b/internal/route/route.go @@ -4,8 +4,8 @@ import ( "net/http" "path" - "forge.cadoles.com/wpetit/gitea-kan/config" - "forge.cadoles.com/wpetit/gitea-kan/middleware" + "forge.cadoles.com/wpetit/gitea-kan/internal/config" + "forge.cadoles.com/wpetit/gitea-kan/internal/middleware" "github.com/go-chi/chi" "gitlab.com/wpetit/goweb/middleware/container" "gitlab.com/wpetit/goweb/static" diff --git a/modd.conf b/modd.conf index 9e3dcc7..6ab6a30 100644 --- a/modd.conf +++ b/modd.conf @@ -5,7 +5,7 @@ modd.conf !mage_output_file.go { prep: make build prep: [ -e data/server.conf ] || ( mkdir -p data && bin/server -dump-config > data/server.conf ) - daemon: GITEA_APP_PUBDIR=../../client/dist bin/server -workdir "./cmd/server" -config ../../data/server.conf + daemon: GITEA_APP_PUBDIR=./client/dist bin/server -config ./data/server.conf } **/*.go { diff --git a/cmd/server/template/blocks/base.html.tmpl b/template/blocks/base.html.tmpl similarity index 100% rename from cmd/server/template/blocks/base.html.tmpl rename to template/blocks/base.html.tmpl diff --git a/cmd/server/template/layouts/index.html.tmpl b/template/layouts/index.html.tmpl similarity index 51% rename from cmd/server/template/layouts/index.html.tmpl rename to template/layouts/index.html.tmpl index b16a6f7..2fbaa46 100644 --- a/cmd/server/template/layouts/index.html.tmpl +++ b/template/layouts/index.html.tmpl @@ -1,6 +1,6 @@ -{{define "title"}}Gitea Apps{{end}} +{{define "title"}}Gitea Kan{{end}} {{define "body"}} -
+
{{end}} {{define "body_scripts"}}