From c510a1b05c0ec86447dd63c8f10750635fe8f210 Mon Sep 17 00:00:00 2001 From: Sam Therapy Date: Sat, 30 Jul 2022 16:33:02 +0200 Subject: [PATCH] template stuff Signed-off-by: Sam Therapy --- Makefile | 28 +++--- README.md | 10 +- docker.mk | 17 ++++ mkfile | 20 ++++ root/etc/config.json | 2 +- root/lib/topbar.html | 6 +- .../default.cat-v.org/_werc/lib/footer.inc | 5 + .../default.cat-v.org/_werc/lib/top_bar.inc | 23 +++++ root/sites/offblast.org/_werc/config.json | 4 + root/sites/offblast.org/_werc/pub/style.css | 49 +++++++++ root/sites/offblast.org/foo/bar.md | 67 +++++++++++++ root/sites/offblast.org/index.md | 5 + root/sites/offblast.org/test/apage.md | 3 + root/sites/offblast.org/test/coolhtml.html | 2 + root/sites/offblast.org/test/file.txt | 3 + root/sites/offblast.org/test/index.md | 5 + root/sites/tst.cat-v.org/_werc/config | 2 + .../tst.cat-v.org/apps/blagh/_werc/config | 3 + .../tst.cat-v.org/apps/bridge/a/_werc/config | 1 + root/sites/tst.cat-v.org/index.md | 4 + .../tst.cat-v.org/titles/dashed-title.md | 3 + .../sites/tst.cat-v.org/titles/under_title.md | 3 + root/sites/werc.cat-v.org/_werc/config | 7 ++ root/sites/werc.cat-v.org/apps/_footer.md | 11 +++ root/sites/werc.cat-v.org/apps/_header.md | 5 + root/sites/werc.cat-v.org/apps/blagh/index.md | 59 +++++++++++ .../sites/werc.cat-v.org/apps/bridge/index.md | 13 +++ .../sites/werc.cat-v.org/apps/dirdir/index.md | 48 +++++++++ .../werc.cat-v.org/apps/duckduckgo/index.md | 39 ++++++++ root/sites/werc.cat-v.org/apps/wman/index.md | 34 +++++++ .../sites/werc.cat-v.org/development/index.md | 21 ++++ .../werc.cat-v.org/development/roadmap.md | 67 +++++++++++++ root/sites/werc.cat-v.org/development/todo.md | 88 +++++++++++++++++ root/sites/werc.cat-v.org/docs/_werc/config | 1 + .../werc.cat-v.org/docs/config-options.md | 68 +++++++++++++ root/sites/werc.cat-v.org/docs/css-style.md | 15 +++ .../sites/werc.cat-v.org/docs/dir-listings.md | 29 ++++++ .../werc.cat-v.org/docs/rc-template-lang.md | 56 +++++++++++ .../werc.cat-v.org/docs/site-customization.md | 54 ++++++++++ .../werc.cat-v.org/docs/user-management.md | 36 +++++++ .../docs/web-server-setup/_header.md | 16 +++ .../docs/web-server-setup/apache.md | 93 +++++++++++++++++ .../docs/web-server-setup/cgd.md | 14 +++ .../docs/web-server-setup/cherokee.md | 31 ++++++ .../docs/web-server-setup/hiawatha.md | 16 +++ .../docs/web-server-setup/lighttpd.md | 44 +++++++++ .../docs/web-server-setup/nginx.md | 96 ++++++++++++++++++ .../docs/web-server-setup/nhttpd.md | 60 +++++++++++ .../docs/web-server-setup/plan-9-httpd.md | 53 ++++++++++ root/sites/werc.cat-v.org/index.md | 99 +++++++++++++++++++ root/sites/werc.cat-v.org/testimonials.md | 8 ++ root/sites/werc.cat-v.org/wiki/_werc/config | 1 + 52 files changed, 1429 insertions(+), 18 deletions(-) create mode 100644 docker.mk create mode 100644 mkfile create mode 100644 root/sites/default.cat-v.org/_werc/lib/footer.inc create mode 100644 root/sites/default.cat-v.org/_werc/lib/top_bar.inc create mode 100644 root/sites/offblast.org/_werc/config.json create mode 100644 root/sites/offblast.org/_werc/pub/style.css create mode 100644 root/sites/offblast.org/foo/bar.md create mode 100644 root/sites/offblast.org/index.md create mode 100644 root/sites/offblast.org/test/apage.md create mode 100644 root/sites/offblast.org/test/coolhtml.html create mode 100644 root/sites/offblast.org/test/file.txt create mode 100644 root/sites/offblast.org/test/index.md create mode 100644 root/sites/tst.cat-v.org/_werc/config create mode 100644 root/sites/tst.cat-v.org/apps/blagh/_werc/config create mode 100644 root/sites/tst.cat-v.org/apps/bridge/a/_werc/config create mode 100644 root/sites/tst.cat-v.org/index.md create mode 100644 root/sites/tst.cat-v.org/titles/dashed-title.md create mode 100644 root/sites/tst.cat-v.org/titles/under_title.md create mode 100644 root/sites/werc.cat-v.org/_werc/config create mode 100644 root/sites/werc.cat-v.org/apps/_footer.md create mode 100644 root/sites/werc.cat-v.org/apps/_header.md create mode 100644 root/sites/werc.cat-v.org/apps/blagh/index.md create mode 100644 root/sites/werc.cat-v.org/apps/bridge/index.md create mode 100644 root/sites/werc.cat-v.org/apps/dirdir/index.md create mode 100644 root/sites/werc.cat-v.org/apps/duckduckgo/index.md create mode 100644 root/sites/werc.cat-v.org/apps/wman/index.md create mode 100644 root/sites/werc.cat-v.org/development/index.md create mode 100644 root/sites/werc.cat-v.org/development/roadmap.md create mode 100644 root/sites/werc.cat-v.org/development/todo.md create mode 100644 root/sites/werc.cat-v.org/docs/_werc/config create mode 100644 root/sites/werc.cat-v.org/docs/config-options.md create mode 100644 root/sites/werc.cat-v.org/docs/css-style.md create mode 100644 root/sites/werc.cat-v.org/docs/dir-listings.md create mode 100644 root/sites/werc.cat-v.org/docs/rc-template-lang.md create mode 100644 root/sites/werc.cat-v.org/docs/site-customization.md create mode 100644 root/sites/werc.cat-v.org/docs/user-management.md create mode 100644 root/sites/werc.cat-v.org/docs/web-server-setup/_header.md create mode 100644 root/sites/werc.cat-v.org/docs/web-server-setup/apache.md create mode 100644 root/sites/werc.cat-v.org/docs/web-server-setup/cgd.md create mode 100644 root/sites/werc.cat-v.org/docs/web-server-setup/cherokee.md create mode 100644 root/sites/werc.cat-v.org/docs/web-server-setup/hiawatha.md create mode 100644 root/sites/werc.cat-v.org/docs/web-server-setup/lighttpd.md create mode 100644 root/sites/werc.cat-v.org/docs/web-server-setup/nginx.md create mode 100644 root/sites/werc.cat-v.org/docs/web-server-setup/nhttpd.md create mode 100644 root/sites/werc.cat-v.org/docs/web-server-setup/plan-9-httpd.md create mode 100644 root/sites/werc.cat-v.org/index.md create mode 100644 root/sites/werc.cat-v.org/testimonials.md create mode 100644 root/sites/werc.cat-v.org/wiki/_werc/config diff --git a/Makefile b/Makefile index 9c604b9..3018c7a 100644 --- a/Makefile +++ b/Makefile @@ -1,17 +1,23 @@ -P=gowerc -SRC=git.froth.zone -USER?=fishe -GO_VERSION=1.18 +GO ?= go +GOFLAGS ?= -ldflags "-s -w" -docker: $(USER)/$(P) +CGO_ENABLED ?= 0 -$(USER)/$(P): bin/$(P) - docker build -t "$(USER)/$(P):latest" . +all: go2werc -bin/$(P): *.go - docker run --rm -v ${PWD}:/go/src/$(SRC)/$(USER)/$(P) golang:${GO_VERSION} /bin/bash -c "go list -f '{{range .Imports}}{{printf \"%s\n\" .}}{{end}}' $(SRC)/$(USER)/$(P) | xargs go get -d; CGO_ENABLED=0 go build -v -installsuffix cgo -o /go/src/$(SRC)/$(USER)/$(P)/bin/$(P) $(SRC)/$(USER)/$(P)" +go2werc: + $(GO) build $(GOFLAGS) . + +fmt: + gofmt -w -s . + +vet: + $(GO) vet ./... + +lint: fmt vet + -golangci-lint run clean: - docker run --rm -v ${PWD}:/opt busybox rm -f /opt/bin/$(P) - docker rmi -f "$(USER)/$(P):latest" + $(GO) clean +.PHONY: clean lint test fmt vet help \ No newline at end of file diff --git a/README.md b/README.md index 9bd5130..98f934f 100644 --- a/README.md +++ b/README.md @@ -10,11 +10,11 @@ clone of http://werc.cat-v.org/ in go. ## building -### with go +### with go install go install git.froth.zone/sam/go2werc@latest -### in docker + +## License +Werc was originally put into the public domain. Since the public domain isn't a thing +outside of the US, 0BSD is used instead. It's basically the public domain but the EU +actually recognizes it. \ No newline at end of file diff --git a/docker.mk b/docker.mk new file mode 100644 index 0000000..9c604b9 --- /dev/null +++ b/docker.mk @@ -0,0 +1,17 @@ +P=gowerc +SRC=git.froth.zone +USER?=fishe +GO_VERSION=1.18 + +docker: $(USER)/$(P) + +$(USER)/$(P): bin/$(P) + docker build -t "$(USER)/$(P):latest" . + +bin/$(P): *.go + docker run --rm -v ${PWD}:/go/src/$(SRC)/$(USER)/$(P) golang:${GO_VERSION} /bin/bash -c "go list -f '{{range .Imports}}{{printf \"%s\n\" .}}{{end}}' $(SRC)/$(USER)/$(P) | xargs go get -d; CGO_ENABLED=0 go build -v -installsuffix cgo -o /go/src/$(SRC)/$(USER)/$(P)/bin/$(P) $(SRC)/$(USER)/$(P)" + +clean: + docker run --rm -v ${PWD}:/opt busybox rm -f /opt/bin/$(P) + docker rmi -f "$(USER)/$(P):latest" + diff --git a/mkfile b/mkfile new file mode 100644 index 0000000..8c0c272 --- /dev/null +++ b/mkfile @@ -0,0 +1,20 @@ +GO = go + +CGO_ENABLED = 0 + +all: go2werc + +go2werc: + $GO build -ldflags="-s -w" . + +fmt: + gofmt -w -s . + +vet: + $GO vet ./... + +lint: fmt vet + -golangci-lint run + +clean: + $GO clean \ No newline at end of file diff --git a/root/etc/config.json b/root/etc/config.json index d0f0ba0..acc483a 100644 --- a/root/etc/config.json +++ b/root/etc/config.json @@ -1,4 +1,4 @@ { - "mastersite": "example.com" + "mastersite": "dns.froth.zone" } diff --git a/root/lib/topbar.html b/root/lib/topbar.html index 0d35018..7017dce 100644 --- a/root/lib/topbar.html +++ b/root/lib/topbar.html @@ -1,8 +1,8 @@