From 707ea2936c03d5903d1922b5fe425e7d1a951b18 Mon Sep 17 00:00:00 2001 From: Christine Dodrill Date: Mon, 14 Jan 2019 13:56:04 +0000 Subject: [PATCH] update vgo lol --- Dockerfile | 17 ++- cmd/sserver/main.go | 2 +- go.mod | 6 +- go.modverify | 4 - go.sum | 2 + vendor/github.com/rakyll/statik/fs/fs.go | 146 ----------------------- vendor/vgo.list | 4 - 7 files changed, 13 insertions(+), 168 deletions(-) delete mode 100644 go.modverify create mode 100644 go.sum delete mode 100644 vendor/github.com/rakyll/statik/fs/fs.go delete mode 100644 vendor/vgo.list diff --git a/Dockerfile b/Dockerfile index 1d40f2a..aef7cc7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,6 @@ -FROM xena/go:1.10 AS build +FROM xena/go:1.11.2 AS build +ENV GOPROXY https://cache.greedo.xeserv.us +ENV GO111MODULE on RUN apk --no-cache add make git RUN mkdir -p /usr/local/src \ && git clone https://github.com/jroimartin/sw /usr/local/src/sw \ @@ -9,17 +11,14 @@ COPY . /site RUN set -x \ && cd /site \ && sw site - -COPY ./vendor/ /root/go/src -COPY ./cmd /root/go/src/git.xeserv.us/xena/tulpaforce.tk/cmd ENV CGO_ENABLED 0 -RUN cd /root/go/src/git.xeserv.us/xena/tulpaforce.tk/cmd/sserver \ +WORKDIR /site +RUN cd ./cmd/sserver \ && /root/go/bin/statik -src /site/site.static \ - && go build \ - && GOBIN=/usr/local/bin go install - -FROM alpine:3.7 + && go build -o sserver . \ + && cp sserver /usr/local/bin/sserver +FROM alpine:3.8 COPY CHECKS /app/CHECKS COPY --from=build /usr/local/bin/sserver /tftk EXPOSE 80 diff --git a/cmd/sserver/main.go b/cmd/sserver/main.go index 6f8de53..69d2448 100644 --- a/cmd/sserver/main.go +++ b/cmd/sserver/main.go @@ -6,7 +6,7 @@ import ( "os" "github.com/rakyll/statik/fs" - _ "git.xeserv.us/xena/tulpaforce.tk/cmd/sserver/statik" + _ "tulpaforce.xyz/cmd/sserver/statik" ) func main() { diff --git a/go.mod b/go.mod index c8f3371..c0e084f 100644 --- a/go.mod +++ b/go.mod @@ -1,5 +1,3 @@ -module "tulpaforce.xyz" +module tulpaforce.xyz -require ( - "github.com/rakyll/statik" v0.1.1 -) +require github.com/rakyll/statik v0.1.1 diff --git a/go.modverify b/go.modverify deleted file mode 100644 index 3e4c849..0000000 --- a/go.modverify +++ /dev/null @@ -1,4 +0,0 @@ -github.com/Xe/ln v0.0.0-20170921000907-466e05b2ef3e h1:uMC/C/zBov+PItx2c6Vax4lt37X+2V5X7NWRcXsxuzE= -github.com/pkg/errors v0.8.0 h1:WdK/asTD0HN+q6hsWO3/vpuAkAr+tw6aNJNDFFf0+qw= -github.com/rakyll/statik v0.1.1 h1:fCLHsIMajHqD5RKigbFXpvX3dN7c80Pm12+NCrI3kvg= -golang.org/x/net v0.0.0-20180202180947-2fb46b16b8dd h1:sFXnfxrhbeCXDiKa6Ra98LxiHoUWSHs9AKOxFURy5pY= diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..7724707 --- /dev/null +++ b/go.sum @@ -0,0 +1,2 @@ +github.com/rakyll/statik v0.1.1 h1:fCLHsIMajHqD5RKigbFXpvX3dN7c80Pm12+NCrI3kvg= +github.com/rakyll/statik v0.1.1/go.mod h1:OEi9wJV/fMUAGx1eNjq75DKDsJVuEv1U0oYdX6GX8Zs= diff --git a/vendor/github.com/rakyll/statik/fs/fs.go b/vendor/github.com/rakyll/statik/fs/fs.go deleted file mode 100644 index 82cda3a..0000000 --- a/vendor/github.com/rakyll/statik/fs/fs.go +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright 2014 Google Inc. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package fs contains an HTTP file system that works with zip contents. -package fs - -import ( - "archive/zip" - "bytes" - "errors" - "fmt" - "io/ioutil" - "net/http" - "os" - "strings" -) - -var zipData string - -// file holds unzipped read-only file contents and file metadata. -type file struct { - os.FileInfo - data []byte -} - -type statikFS struct { - files map[string]file -} - -// Register registers zip contents data, later used to initialize -// the statik file system. -func Register(data string) { - zipData = data -} - -// New creates a new file system with the registered zip contents data. -// It unzips all files and stores them in an in-memory map. -func New() (http.FileSystem, error) { - if zipData == "" { - return nil, errors.New("statik/fs: no zip data registered") - } - zipReader, err := zip.NewReader(strings.NewReader(zipData), int64(len(zipData))) - if err != nil { - return nil, err - } - files := make(map[string]file) - for _, zipFile := range zipReader.File { - unzipped, err := unzip(zipFile) - if err != nil { - return nil, fmt.Errorf("statik/fs: error unzipping file %q: %s", zipFile.Name, err) - } - files["/"+zipFile.Name] = file{ - FileInfo: zipFile.FileInfo(), - data: unzipped, - } - } - return &statikFS{files: files}, nil -} - -func unzip(zf *zip.File) ([]byte, error) { - rc, err := zf.Open() - if err != nil { - return nil, err - } - defer rc.Close() - return ioutil.ReadAll(rc) -} - -// Open returns a file matching the given file name, or os.ErrNotExists if -// no file matching the given file name is found in the archive. -// If a directory is requested, Open returns the file named "index.html" -// in the requested directory, if that file exists. -func (fs *statikFS) Open(name string) (http.File, error) { - name = strings.Replace(name, "//", "/", -1) - f, ok := fs.files[name] - if ok { - return newHTTPFile(f, false), nil - } - // The file doesn't match, but maybe it's a directory, - // thus we should look for index.html - indexName := strings.Replace(name+"/index.html", "//", "/", -1) - f, ok = fs.files[indexName] - if !ok { - return nil, os.ErrNotExist - } - return newHTTPFile(f, true), nil -} - -func newHTTPFile(file file, isDir bool) *httpFile { - return &httpFile{ - file: file, - reader: bytes.NewReader(file.data), - isDir: isDir, - } -} - -// httpFile represents an HTTP file and acts as a bridge -// between file and http.File. -type httpFile struct { - file - - reader *bytes.Reader - isDir bool -} - -// Read reads bytes into p, returns the number of read bytes. -func (f *httpFile) Read(p []byte) (n int, err error) { - return f.reader.Read(p) -} - -// Seek seeks to the offset. -func (f *httpFile) Seek(offset int64, whence int) (ret int64, err error) { - return f.reader.Seek(offset, whence) -} - -// Stat stats the file. -func (f *httpFile) Stat() (os.FileInfo, error) { - return f, nil -} - -// IsDir returns true if the file location represents a directory. -func (f *httpFile) IsDir() bool { - return f.isDir -} - -// Readdir returns an empty slice of files, directory -// listing is disabled. -func (f *httpFile) Readdir(count int) ([]os.FileInfo, error) { - // directory listing is disabled. - return make([]os.FileInfo, 0), nil -} - -func (f *httpFile) Close() error { - return nil -} diff --git a/vendor/vgo.list b/vendor/vgo.list deleted file mode 100644 index a898a56..0000000 --- a/vendor/vgo.list +++ /dev/null @@ -1,4 +0,0 @@ -MODULE VERSION -git.xeserv.us/xena/tulpaforce.tk - -github.com/rakyll/statik v0.1.1 -golang.org/x/net v0.0.0-20180202180947-2fb46b16b8dd