From 2a093fe701e0706830c340b7b2fbd03c26be60d4 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 3 Feb 2021 14:38:00 +1300 Subject: Switch listen to systemd socket activation --- .build.yml | 31 ------------------------------- Makefile | 3 +++ README.md | 5 +++++ go.mod | 4 ++-- go.sum | 9 +++++---- handler.go | 2 +- logger.go | 2 +- main.go | 2 +- recover.go | 2 +- 9 files changed, 19 insertions(+), 41 deletions(-) delete mode 100644 .build.yml create mode 100644 Makefile diff --git a/.build.yml b/.build.yml deleted file mode 100644 index 79ccb7b..0000000 --- a/.build.yml +++ /dev/null @@ -1,31 +0,0 @@ -image: fedora/latest -packages: - - go - - tar -sources: - - https://git.sr.ht/~yotam/shavit - - https://git.sr.ht/~sircmpwn/annotatego -secrets: - - f43da1db-697d-4101-8607-e96f574b035a -tasks: -- lint: | - curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(go env GOPATH)/bin v1.21.0 - go get honnef.co/go/tools/cmd/staticcheck - cd shavit - go vet - ~/go/bin/staticcheck - ~/go/bin/golangci-lint run -- test: | - cd shavit - go test -- build: | - cd shavit - go build -- annotatego: | - cd annotatego - go build - sudo cp annotatego /usr/bin/ -- annotate: | - cd shavit - annotatego -v git.sr.ht/~yotam/shavit... >annotations.json - ~/upload-annotations annotations.json yotam shavit diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..b04db74 --- /dev/null +++ b/Makefile @@ -0,0 +1,3 @@ +all: shavit +shavit: + CGO_ENABLED=0 go build -a -ldflags '-extldflags "-static"' -o $@ . diff --git a/README.md b/README.md index 44cf1a1..293b82b 100644 --- a/README.md +++ b/README.md @@ -26,3 +26,8 @@ configuration file might look like this: With this configuration file the server will look for a certificate and key in `/var/gemini` and for documents in `/var/gemini/docs`. + +## Fork + +This is a fork by Tom Ryder that replaces the default +listening socket with systemd activation. diff --git a/go.mod b/go.mod index ad90b67..81d1630 100644 --- a/go.mod +++ b/go.mod @@ -1,9 +1,9 @@ -module git.sr.ht/~yotam/shavit +module sanctum.geek.nz/code/shavit.git.git go 1.12 require ( - git.sr.ht/~yotam/go-gemini v0.0.0-20191109201753-fe15cf054c37 github.com/BurntSushi/toml v0.3.1 github.com/pelletier/go-toml v1.6.0 // indirect + sanctum.geek.nz/code/go-gemini.git.git v0.0.0-tejr1 ) diff --git a/go.sum b/go.sum index cb4d0b9..42fb8d4 100644 --- a/go.sum +++ b/go.sum @@ -1,12 +1,13 @@ -git.sr.ht/~yotam/go-gemini v0.0.0-20191101110121-e84e0b63cd37 h1:NWDz215k8nz6PGmbCb1YsUWrp9ocqnyKLnUoDCzzgU8= -git.sr.ht/~yotam/go-gemini v0.0.0-20191101110121-e84e0b63cd37/go.mod h1:KxQlipD0Ti7MfV3itYJfuvgcvd+SOlRTtbOK+A0DCCE= -git.sr.ht/~yotam/go-gemini v0.0.0-20191109201753-fe15cf054c37 h1:ga6iPmFGpSgIHAc3cxxqOksOyP14FcP2mQz86AF5q8k= -git.sr.ht/~yotam/go-gemini v0.0.0-20191109201753-fe15cf054c37/go.mod h1:KxQlipD0Ti7MfV3itYJfuvgcvd+SOlRTtbOK+A0DCCE= github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/coreos/go-systemd/v22 v22.1.0 h1:kq/SbG2BCKLkDKkjQf5OWwKWUKj1lgs3lFI4PxnR5lg= +github.com/coreos/go-systemd/v22 v22.1.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/google/go-cmp v0.3.1 h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/pelletier/go-toml v1.6.0/go.mod h1:5N711Q9dKgbdkxHL+MEfF31hpT7l0S0s/t2kKREewys= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +sanctum.geek.nz/code/go-gemini.git.git v0.0.0-tejr1 h1:TFL6Ht6quaVkxv1+JdpTsg5SpqtCQHTyPc0mXAJucn0= +sanctum.geek.nz/code/go-gemini.git.git v0.0.0-tejr1/go.mod h1:Sr0lsNdlueaHKDHYN1jCEsCKLpGnhA0RaiuRAdaat8s= diff --git a/handler.go b/handler.go index 03fcdb4..999b291 100644 --- a/handler.go +++ b/handler.go @@ -8,7 +8,7 @@ import ( "path/filepath" "strings" - gemini "git.sr.ht/~yotam/go-gemini" + gemini "sanctum.geek.nz/code/go-gemini.git.git" ) // Handler is the main handler of the server diff --git a/logger.go b/logger.go index 14891d2..94f0d0a 100644 --- a/logger.go +++ b/logger.go @@ -3,7 +3,7 @@ package main import ( "log" - gemini "git.sr.ht/~yotam/go-gemini" + gemini "sanctum.geek.nz/code/go-gemini.git.git" ) // LoggingHandler wrap a Gemini handler and log all the requsts and responses diff --git a/main.go b/main.go index ecf1eb0..53db3a5 100644 --- a/main.go +++ b/main.go @@ -4,7 +4,7 @@ import ( "log" "mime" - gemini "git.sr.ht/~yotam/go-gemini" + gemini "sanctum.geek.nz/code/go-gemini.git.git" ) func main() { diff --git a/recover.go b/recover.go index b4a82e7..00288e5 100644 --- a/recover.go +++ b/recover.go @@ -1,7 +1,7 @@ package main import ( - gemini "git.sr.ht/~yotam/go-gemini" + gemini "sanctum.geek.nz/code/go-gemini.git.git" ) // RecovererHandler wrap a Gemini handler and recover from panics -- cgit v1.2.3