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
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 repository in the $GOPATH. So for example if your gitlab domain
@ -41,7 +41,7 @@ compile:
# generate assets
- 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:
# https://stackoverflow.com/a/20728862

View file

@ -1,11 +1,11 @@
FROM golang:1.12
WORKDIR /go/src/git.klink.asia/paul/certman
WORKDIR /go/src/github.com/zom-bi/ovpn-certman
ADD . .
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 generate git.klink.asia/paul/certman/assets && \
go generate github.com/zom-bi/ovpn-certman/assets && \
go build -tags="netgo"
FROM scratch
@ -22,5 +22,5 @@ ENV \
VPN_PROTO="udp" \
APP_KEY=""
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"]

View file

@ -12,8 +12,8 @@ import (
// Assets contains project assets.
var Assets = union.New(map[string]http.FileSystem{
"/static": http.Dir(importPathToDir("git.klink.asia/paul/certman/assets/static")),
"/templates": http.Dir(importPathToDir("git.klink.asia/paul/certman/assets/templates")),
"/static": http.Dir(importPathToDir("github.com/zom-bi/ovpn-certman/assets/static")),
"/templates": http.Dir(importPathToDir("github.com/zom-bi/ovpn-certman/assets/templates")),
})
// 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
// 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

View file

@ -6,10 +6,10 @@ import (
"net/http"
"os"
"git.klink.asia/paul/certman/views"
"github.com/zom-bi/ovpn-certman/views"
"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 {

View file

@ -17,11 +17,11 @@ import (
"strings"
"time"
"git.klink.asia/paul/certman/models"
"git.klink.asia/paul/certman/services"
"github.com/zom-bi/ovpn-certman/models"
"github.com/zom-bi/ovpn-certman/services"
"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 {

View file

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

View file

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

View file

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

View file

@ -3,7 +3,7 @@ package middleware
import (
"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

View file

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

View file

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

View file

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

View file

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