From 84f7d34840d7fbc853417958d39205f3f06f5fa8 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Sun, 24 Jul 2022 11:52:11 -0300 Subject: [PATCH] rename closed to whitelisted and build it and basic with musl. --- .gitignore | 1 - basic/.gitignore | 1 + basic/Makefile | 4 ++-- basic/README | 8 ++++---- closedrelay/.gitignore | 1 - closedrelay/Makefile | 2 -- whitelisted/.gitignore | 1 + whitelisted/Makefile | 2 ++ {closedrelay => whitelisted}/README | 8 ++++---- {closedrelay => whitelisted}/delete.go | 0 {closedrelay => whitelisted}/main.go | 0 {closedrelay => whitelisted}/postgresql.go | 0 {closedrelay => whitelisted}/query.go | 0 {closedrelay => whitelisted}/save.go | 0 14 files changed, 14 insertions(+), 14 deletions(-) create mode 100644 basic/.gitignore delete mode 100644 closedrelay/.gitignore delete mode 100644 closedrelay/Makefile create mode 100644 whitelisted/.gitignore create mode 100644 whitelisted/Makefile rename {closedrelay => whitelisted}/README (84%) rename {closedrelay => whitelisted}/delete.go (100%) rename {closedrelay => whitelisted}/main.go (100%) rename {closedrelay => whitelisted}/postgresql.go (100%) rename {closedrelay => whitelisted}/query.go (100%) rename {closedrelay => whitelisted}/save.go (100%) diff --git a/.gitignore b/.gitignore index b16b131..03bd412 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ -relayer *.env diff --git a/basic/.gitignore b/basic/.gitignore new file mode 100644 index 0000000..6e8794c --- /dev/null +++ b/basic/.gitignore @@ -0,0 +1 @@ +relayer-basic diff --git a/basic/Makefile b/basic/Makefile index eca219b..32291a5 100644 --- a/basic/Makefile +++ b/basic/Makefile @@ -1,2 +1,2 @@ -relayer: $(shell find .. -name "*.go") - go build -ldflags="-s -w" -o ./relayer +relayer-basic: $(shell find .. -name "*.go") + CC=$$(which musl-gcc) go build -ldflags='-s -w -linkmode external -extldflags "-static"' -o ./relayer-basic diff --git a/basic/README b/basic/README index 8b50236..6161ba6 100644 --- a/basic/README +++ b/basic/README @@ -1,16 +1,16 @@ -basic relayer +relayer basic ============= - a basic relay implementation based on relayer. - uses postgres, which I think must be over version 12 since it uses generated columns. - - it has some antispam limits, tries to delete old stuff so things don't get out of control, and some other small optimizations, but it's something we can call "hardened". + - it has some antispam limits, tries to delete old stuff so things don't get out of control, and some other small optimizations. running ------- grab a binary from the releases page and run it with the environment variable POSTGRESQL_DATABASE set to some postgres url: - POSTGRESQL_DATABASE=postgres://name:pass@localhost:5432/dbname ./relayer + POSTGRESQL_DATABASE=postgres://name:pass@localhost:5432/dbname ./relayer-basic it also accepts a HOST and a PORT environment variables. @@ -19,6 +19,6 @@ compiling if you know Go you already know this: - go get github.com/fiatjaf/relayer/basic + go install github.com/fiatjaf/relayer/basic or something like that. diff --git a/closedrelay/.gitignore b/closedrelay/.gitignore deleted file mode 100644 index 4f201ab..0000000 --- a/closedrelay/.gitignore +++ /dev/null @@ -1 +0,0 @@ -closedrelay diff --git a/closedrelay/Makefile b/closedrelay/Makefile deleted file mode 100644 index 28cd63e..0000000 --- a/closedrelay/Makefile +++ /dev/null @@ -1,2 +0,0 @@ -closedrelay: $(shell find .. -name "*.go") - go build -ldflags="-s -w" -o ./closedrelay diff --git a/whitelisted/.gitignore b/whitelisted/.gitignore new file mode 100644 index 0000000..c15287a --- /dev/null +++ b/whitelisted/.gitignore @@ -0,0 +1 @@ +relayer-whitelisted diff --git a/whitelisted/Makefile b/whitelisted/Makefile new file mode 100644 index 0000000..9d4e006 --- /dev/null +++ b/whitelisted/Makefile @@ -0,0 +1,2 @@ +relayer-whitelisted: $(shell find .. -name "*.go") + CC=$$(which musl-gcc) go build -ldflags='-s -w -linkmode external -extldflags "-static"' -o ./relayer-whitelisted diff --git a/closedrelay/README b/whitelisted/README similarity index 84% rename from closedrelay/README rename to whitelisted/README index 57988e5..7b0c5a3 100644 --- a/closedrelay/README +++ b/whitelisted/README @@ -1,5 +1,5 @@ -closed relay -============ +whitelisted relay +================= - a basic relay implementation based on relayer. - uses postgres, which I think must be over version 12 since it uses generated columns. @@ -10,7 +10,7 @@ running grab a binary from the releases page and run it with the environment variable POSTGRESQL_DATABASE set to some postgres url: - POSTGRESQL_DATABASE=postgres://name:pass@localhost:5432/dbname ./closedrelay + POSTGRESQL_DATABASE=postgres://name:pass@localhost:5432/dbname ./relayer-whitelisted it also accepts a HOST and a PORT environment variables. @@ -19,6 +19,6 @@ compiling if you know Go you already know this: - go install github.com/fiatjaf/relayer/closedrelay + go install github.com/fiatjaf/relayer/whitelisted or something like that. diff --git a/closedrelay/delete.go b/whitelisted/delete.go similarity index 100% rename from closedrelay/delete.go rename to whitelisted/delete.go diff --git a/closedrelay/main.go b/whitelisted/main.go similarity index 100% rename from closedrelay/main.go rename to whitelisted/main.go diff --git a/closedrelay/postgresql.go b/whitelisted/postgresql.go similarity index 100% rename from closedrelay/postgresql.go rename to whitelisted/postgresql.go diff --git a/closedrelay/query.go b/whitelisted/query.go similarity index 100% rename from closedrelay/query.go rename to whitelisted/query.go diff --git a/closedrelay/save.go b/whitelisted/save.go similarity index 100% rename from closedrelay/save.go rename to whitelisted/save.go