Build project from this github repository

This commit is contained in:
paul 2019-05-15 18:18:54 +02:00
parent 675cf95991
commit f9f6fb64b9
14 changed files with 29 additions and 29 deletions

View file

@ -1,7 +1,7 @@
image: golang:latest image: golang:latest
variables: variables:
REPO_NAME: git.klink.asia/paul/certman REPO_NAME: github.com/zom-bi/ovpn-certman
# The problem is that to be able to use go get, one needs to put # The problem is that to be able to use go get, one needs to put
# the repository in the $GOPATH. So for example if your gitlab domain # the repository in the $GOPATH. So for example if your gitlab domain
@ -41,7 +41,7 @@ compile:
# generate assets # generate assets
- go get github.com/shurcooL/vfsgen/cmd/vfsgendev - go get github.com/shurcooL/vfsgen/cmd/vfsgendev
- go generate git.klink.asia/paul/certman/assets - go generate github.com/zom-bi/ovpn-certman/assets
# build binaries -- list of supported plattforms is here: # build binaries -- list of supported plattforms is here:
# https://stackoverflow.com/a/20728862 # https://stackoverflow.com/a/20728862

View file

@ -1,11 +1,11 @@
FROM golang:1.12 FROM golang:1.12
WORKDIR /go/src/git.klink.asia/paul/certman WORKDIR /go/src/github.com/zom-bi/ovpn-certman
ADD . . ADD . .
RUN \ RUN \
go get -tags="dev" -v git.klink.asia/paul/certman && \ go get -tags="dev" -v github.com/zom-bi/ovpn-certman && \
go get github.com/shurcooL/vfsgen/cmd/vfsgendev && \ go get github.com/shurcooL/vfsgen/cmd/vfsgendev && \
go generate git.klink.asia/paul/certman/assets && \ go generate github.com/zom-bi/ovpn-certman/assets && \
go build -tags="netgo" go build -tags="netgo"
FROM scratch FROM scratch
@ -22,5 +22,5 @@ ENV \
VPN_PROTO="udp" \ VPN_PROTO="udp" \
APP_KEY="" APP_KEY=""
COPY --from=0 /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ COPY --from=0 /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=0 /go/src/git.klink.asia/paul/certman/certman / COPY --from=0 /go/src/github.com/zom-bi/ovpn-certman/certman /
ENTRYPOINT ["/certman"] ENTRYPOINT ["/certman"]

View file

@ -12,8 +12,8 @@ import (
// Assets contains project assets. // Assets contains project assets.
var Assets = union.New(map[string]http.FileSystem{ var Assets = union.New(map[string]http.FileSystem{
"/static": http.Dir(importPathToDir("git.klink.asia/paul/certman/assets/static")), "/static": http.Dir(importPathToDir("github.com/zom-bi/ovpn-certman/assets/static")),
"/templates": http.Dir(importPathToDir("git.klink.asia/paul/certman/assets/templates")), "/templates": http.Dir(importPathToDir("github.com/zom-bi/ovpn-certman/assets/templates")),
}) })
// importPathToDir is a helper function that resolves the absolute path of // importPathToDir is a helper function that resolves the absolute path of

View file

@ -1,6 +1,6 @@
//go:generate vfsgendev -source="git.klink.asia/paul/certman/assets".Assets //go:generate vfsgendev -source="github.com/zom-bi/ovpn-certman/assets".Assets
// Package assets contains assets the service, that will be embedded into // Package assets contains assets the service, that will be embedded into
// the binary. // the binary.
// Regenerate by running `go generate git.klink.asia/paul/certman/assets`. // Regenerate by running `go generate github.com/zom-bi/ovpn-certman/assets`.
package assets package assets

View file

@ -6,10 +6,10 @@ import (
"net/http" "net/http"
"os" "os"
"git.klink.asia/paul/certman/views" "github.com/zom-bi/ovpn-certman/views"
"golang.org/x/oauth2" "golang.org/x/oauth2"
"git.klink.asia/paul/certman/services" "github.com/zom-bi/ovpn-certman/services"
) )
func OAuth2Endpoint(p *services.Provider, config *oauth2.Config) http.HandlerFunc { func OAuth2Endpoint(p *services.Provider, config *oauth2.Config) http.HandlerFunc {

View file

@ -17,11 +17,11 @@ import (
"strings" "strings"
"time" "time"
"git.klink.asia/paul/certman/models" "github.com/zom-bi/ovpn-certman/models"
"git.klink.asia/paul/certman/services" "github.com/zom-bi/ovpn-certman/services"
"github.com/go-chi/chi" "github.com/go-chi/chi"
"git.klink.asia/paul/certman/views" "github.com/zom-bi/ovpn-certman/views"
) )
func ListClientsHandler(p *services.Provider) http.HandlerFunc { func ListClientsHandler(p *services.Provider) http.HandlerFunc {

View file

@ -3,7 +3,7 @@ package handlers
import ( import (
"net/http" "net/http"
"git.klink.asia/paul/certman/views" "github.com/zom-bi/ovpn-certman/views"
) )
func NotFoundHandler(w http.ResponseWriter, req *http.Request) { func NotFoundHandler(w http.ResponseWriter, req *http.Request) {

View file

@ -7,10 +7,10 @@ import (
"os" "os"
"time" "time"
"git.klink.asia/paul/certman/services" "github.com/zom-bi/ovpn-certman/services"
"git.klink.asia/paul/certman/router" "github.com/zom-bi/ovpn-certman/router"
"git.klink.asia/paul/certman/views" "github.com/zom-bi/ovpn-certman/views"
) )
func main() { func main() {

View file

@ -5,7 +5,7 @@ import (
"net/http" "net/http"
"runtime/debug" "runtime/debug"
"git.klink.asia/paul/certman/handlers" "github.com/zom-bi/ovpn-certman/handlers"
) )
// Recoverer Listens for panic() calls and logs the stacktrace. // Recoverer Listens for panic() calls and logs the stacktrace.

View file

@ -3,7 +3,7 @@ package middleware
import ( import (
"net/http" "net/http"
"git.klink.asia/paul/certman/services" "github.com/zom-bi/ovpn-certman/services"
) )
// RequireLogin is a middleware that checks for a username in the active // RequireLogin is a middleware that checks for a username in the active

View file

@ -5,17 +5,17 @@ import (
"os" "os"
"strings" "strings"
"git.klink.asia/paul/certman/services" "github.com/zom-bi/ovpn-certman/services"
"golang.org/x/oauth2" "golang.org/x/oauth2"
"git.klink.asia/paul/certman/assets" "github.com/zom-bi/ovpn-certman/assets"
"git.klink.asia/paul/certman/handlers" "github.com/zom-bi/ovpn-certman/handlers"
"git.klink.asia/paul/certman/views" "github.com/zom-bi/ovpn-certman/views"
"github.com/go-chi/chi" "github.com/go-chi/chi"
"github.com/go-chi/chi/middleware" "github.com/go-chi/chi/middleware"
"github.com/gorilla/csrf" "github.com/gorilla/csrf"
mw "git.klink.asia/paul/certman/middleware" mw "github.com/zom-bi/ovpn-certman/middleware"
) )
var ( var (

View file

@ -8,7 +8,7 @@ import (
"os" "os"
"sync" "sync"
"git.klink.asia/paul/certman/models" "github.com/zom-bi/ovpn-certman/models"
) )
var ( var (

View file

@ -8,7 +8,7 @@ import (
"net/http" "net/http"
"path/filepath" "path/filepath"
"git.klink.asia/paul/certman/assets" "github.com/zom-bi/ovpn-certman/assets"
) )
// map of all parsed templates, by template name // map of all parsed templates, by template name

View file

@ -7,7 +7,7 @@ import (
"log" "log"
"net/http" "net/http"
"git.klink.asia/paul/certman/services" "github.com/zom-bi/ovpn-certman/services"
"github.com/gorilla/csrf" "github.com/gorilla/csrf"
) )