Use go embed for web files and remove httptreemux (#382)

- replace togo with go embed
- replace httptreemux with gin

closes #308
This commit is contained in:
Anbraten
2021-09-29 17:34:56 +02:00
committed by GitHub
parent a82d569bd1
commit ed6d3f3cea
26 changed files with 62 additions and 12984 deletions

View File

@@ -18,6 +18,7 @@ import (
"fmt"
"time"
"github.com/gin-gonic/gin"
"github.com/woodpecker-ci/woodpecker/server"
"github.com/woodpecker-ci/woodpecker/server/model"
"github.com/woodpecker-ci/woodpecker/server/plugins/environments"
@@ -37,7 +38,6 @@ import (
"github.com/woodpecker-ci/woodpecker/server/store/datastore"
"github.com/woodpecker-ci/woodpecker/server/web"
"github.com/dimfeld/httptreemux"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
"github.com/sirupsen/logrus"
@@ -201,8 +201,8 @@ func setupCoding(c *cli.Context) (remote.Remote, error) {
})
}
func setupTree(c *cli.Context) *httptreemux.ContextMux {
tree := httptreemux.NewContextMux()
func setupTree(c *cli.Context) *gin.Engine {
tree := gin.New()
web.New(
web.WithSync(time.Hour*72),
web.WithDocs(c.String("docs")),