Vow, uncensorable PDS written in Go

build: simplify Makefile and use runtime version

+67 -61
+13 -31
Makefile
··· 1 1 SHELL = /bin/bash 2 2 .SHELLFLAGS = -o pipefail -c 3 - GIT_TAG := $(shell git describe --tags --exact-match 2>/dev/null) 4 - GIT_COMMIT := $(shell git rev-parse --short=9 HEAD) 5 - VERSION := $(if $(GIT_TAG),$(GIT_TAG),dev-$(GIT_COMMIT)) 6 3 7 4 # Build output directory 8 5 BUILD_DIR := dist ··· 11 8 PLATFORMS := \ 12 9 linux/amd64 \ 13 10 linux/arm64 \ 14 - linux/arm \ 15 - darwin/amd64 \ 16 - darwin/arm64 \ 17 - windows/amd64 \ 18 - windows/arm64 \ 19 - freebsd/amd64 \ 20 - freebsd/arm64 \ 21 - openbsd/amd64 \ 22 - openbsd/arm64 11 + linux/arm 23 12 24 13 .PHONY: help 25 14 help: ## Print info about all commands ··· 28 17 @grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[01;32m%-20s\033[0m %s\n", $$1, $$2}' 29 18 30 19 .PHONY: build 31 - build: ## Build all executables 32 - go build -ldflags "-X main.Version=$(VERSION)" -o vow ./cmd/vow 20 + build: ## Build the vow binary 21 + go build -o vow ./cmd/vow 33 22 34 - .PHONY: build-release 23 + .PHONY: build-all 35 24 build-all: ## Build binaries for all architectures 36 25 @echo "Building for all architectures..." 37 26 @mkdir -p $(BUILD_DIR) 38 27 @$(foreach platform,$(PLATFORMS), \ 39 28 $(eval OS := $(word 1,$(subst /, ,$(platform)))) \ 40 29 $(eval ARCH := $(word 2,$(subst /, ,$(platform)))) \ 41 - $(eval EXT := $(if $(filter windows,$(OS)),.exe,)) \ 42 - $(eval OUTPUT := $(BUILD_DIR)/vow-$(VERSION)-$(OS)-$(ARCH)$(EXT)) \ 30 + $(eval OUTPUT := $(BUILD_DIR)/vow-$(OS)-$(ARCH)) \ 43 31 echo "Building $(OS)/$(ARCH)..."; \ 44 - GOOS=$(OS) GOARCH=$(ARCH) go build -ldflags "-X main.Version=$(VERSION)" -o $(OUTPUT) ./cmd/vow && \ 32 + GOOS=$(OS) GOARCH=$(ARCH) go build -o $(OUTPUT) ./cmd/vow && \ 45 33 echo " ✓ $(OUTPUT)" || echo " ✗ Failed: $(OS)/$(ARCH)"; \ 46 34 ) 47 35 @echo "Done! Binaries are in $(BUILD_DIR)/" 48 36 49 - .PHONY: clean-dist 50 - clean-dist: ## Remove all built binaries 51 - rm -rf $(BUILD_DIR) 37 + .PHONY: clean 38 + clean: ## Remove built binaries 39 + rm -rf $(BUILD_DIR) vow 52 40 53 41 .PHONY: run 54 - run: 55 - go build -ldflags "-X main.Version=dev-local" -o vow ./cmd/vow && ./vow run 56 - 57 - .PHONY: all 58 - all: build 42 + run: ## Build and run the PDS 43 + go run ./cmd/vow run 59 44 60 45 .PHONY: test 61 46 test: ## Run tests ··· 73 58 go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest 74 59 75 60 .PHONY: fmt 76 - fmt: ## Run syntax re-formatting (modify in place) 61 + fmt: ## Format code 77 62 go fmt ./... 78 63 79 64 .PHONY: check 80 65 check: ## Compile everything, checking syntax (does not output binaries) 81 66 go build ./... 82 67 83 - .env: 84 - if [ ! -f ".env" ]; then cp example.dev.env .env; fi 85 - 86 68 .PHONY: docker-build 87 - docker-build: 69 + docker-build: ## Build the Docker image 88 70 docker build -t vow .
+18 -3
cmd/vow/main.go
··· 11 11 "net/http" 12 12 _ "net/http/pprof" 13 13 "os" 14 + "runtime/debug" 14 15 "strings" 15 16 "time" 16 17 ··· 28 29 "pkg.rbrt.fr/vow/server" 29 30 ) 30 31 31 - var Version = "dev" 32 + var version = func() string { 33 + info, ok := debug.ReadBuildInfo() 34 + if !ok { 35 + return "dev" 36 + } 37 + if info.Main.Version != "" && info.Main.Version != "(devel)" { 38 + return info.Main.Version 39 + } 40 + for _, s := range info.Settings { 41 + if s.Key == "vcs.revision" && len(s.Value) >= 7 { 42 + return s.Value[:7] 43 + } 44 + } 45 + return "dev" 46 + }() 32 47 33 48 func main() { 34 49 if err := rootCmd.Execute(); err != nil { ··· 39 54 var rootCmd = &cobra.Command{ 40 55 Use: "vow", 41 56 Short: "An atproto PDS", 42 - Version: Version, 57 + Version: version, 43 58 SilenceErrors: true, 44 59 SilenceUsage: true, 45 60 } ··· 162 177 RotationKeyPath: v.GetString(flagRotationKeyPath), 163 178 JwkPath: v.GetString(flagJwkPath), 164 179 ContactEmail: v.GetString(flagContactEmail), 165 - Version: Version, 180 + Version: version, 166 181 Relays: v.GetStringSlice(flagRelays), 167 182 AdminPassword: v.GetString(flagAdminPassword), 168 183 RequireInvite: v.GetBool(flagRequireInvite),
+29 -1
readme.md
··· 5 5 6 6 Vow is a PDS (Personal Data Server) implementation in Go for the AT Protocol. 7 7 8 + ## Incoming Features 9 + 10 + - [ ] **BYOK (Bring Your Own Key) for PDS** — users supply their own signing key for their PDS, keeping full custody of their identity. 11 + - [ ] **IPFS for account storage** — repository data is stored on IPFS, giving users a decentralised and portable data layer. 12 + - [ ] **x402 payments for IPFS storage** — IPFS pinning costs are settled via [x402](https://x402.org), paid directly by the user. The payment key is derived from the user's EVM wallet, so no separate key management is required. 13 + - [ ] **Extension for action signing** — a browser extension intercepts each write operation sent to the user's PDS and prompts the user to sign it locally, so private keys never leave the client. 14 + 8 15 ## Quick Start with Docker Compose 9 16 10 17 ### Prerequisites ··· 214 221 215 222 ## License 216 223 217 - MIT. `server/static/pico.css` is also MIT licensed, available at [https://github.com/picocss/pico/](https://github.com/picocss/pico/). 224 + [MIT](license). `server/static/pico.css` is also MIT licensed, available at [https://github.com/picocss/pico/](https://github.com/picocss/pico/). 225 + 226 + ## Thanks 227 + 228 + Vow is based on [Cocoon](https://tangled.org/hailey.at/cocoon). Many thanks for the solid foundation. 229 + 230 + ### Vow vs Cocoon 231 + 232 + | Feature | Vow | Cocoon | 233 + | ---------------------------- | ----------- | ------ | 234 + | Language | Go | Go | 235 + | SQLite blockstore | ✅ | ✅ | 236 + | PostgreSQL support | ❌ removed | ✅ | 237 + | S3 blob storage | ❌ removed | ✅ | 238 + | S3 database backups | ❌ removed | ✅ | 239 + | IPFS blob storage | ✅ (Kubo) | ❌ | 240 + | IPFS account storage | 🔜 incoming | ❌ | 241 + | BYOK (Bring Your Own Key) | 🔜 incoming | ❌ | 242 + | x402 payments for IPFS | 🔜 incoming | ❌ | 243 + | Extension for action signing | 🔜 incoming | ❌ | 244 + 245 + Vow trades Cocoon's operational storage flexibility (PostgreSQL, S3) for a leaner SQLite-only core, with a roadmap focused on decentralised storage and user-controlled keys.
+7 -26
server/handle_root.go
··· 9 9 w.Header().Set("Content-Type", "text/plain") 10 10 _, _ = fmt.Fprint(w, ` 11 11 12 - ....-*%%%##### 13 - .%#+++****#%%%%%%%%%#+:.... 14 - .%+++**++++*%%%%..... 15 - .%+++*****#%%%%#.. %#%... 16 - ***+*****%%%%%... =.. 17 - *****%%%%.. +=++.. 18 - %%%%%... .+----==++. 19 - .-::----===++ 20 - .=-:.------==+++ 21 - +-:::-:----===++.. 22 - =-::-----:-==+++-. 23 - .==*=------==++++. 24 - +-:--=++===*=--++. 25 - +:::--:=++=----=+.. 26 - *::::---=+#----=+. 27 - =::::----=+#---=+.. 28 - .::::----==+=--=+.. 29 - .-::-----==++=-=+.. 30 - -::-----==++===+.. 31 - =::-----==++==++ 32 - +::----:==++=+++ 33 - :-:----:==+++++. 34 - .=:=----=+++++. 35 - +=-=====+++.. 36 - =====++. 37 - =++... 12 + ___ ___ ________ ___ __ 13 + |\ \ / /||\ __ \|\ \ |\ \ 14 + \ \ \ / / /\ \ \|\ \ \ \ \ \ \ 15 + \ \ \/ / / \ \ \\\ \ \ \ __\ \ \ 16 + \ \ / / \ \ \\\ \ \ \|\__\_\ \ 17 + \ \__/ / \ \_______\ \____________\ 18 + \|__|/ \|_______|\|____________| 38 19 39 20 40 21 This is an AT Protocol Personal Data Server (aka, an atproto PDS)