summaryrefslogtreecommitdiff
path: root/srv
diff options
context:
space:
mode:
authorBrian Picciano <mediocregopher@gmail.com>2022-05-05 21:20:22 -0600
committerBrian Picciano <mediocregopher@gmail.com>2022-05-05 21:20:22 -0600
commiteed10ce514f28e4acf772f76c92ca05eebec105f (patch)
treed76820d7a3cd23f09f7dd0e6065bb0cef7ba16dc /srv
parentcc8b6289ac3f7d1abb648217949beb89827d7374 (diff)
Fix various problems with the srv build
Diffstat (limited to 'srv')
-rw-r--r--srv/default.nix40
-rw-r--r--srv/src/api/api.go (renamed from srv/api/api.go)0
-rw-r--r--srv/src/api/apiutils/apiutils.go (renamed from srv/api/apiutils/apiutils.go)0
-rw-r--r--srv/src/api/chat.go (renamed from srv/api/chat.go)0
-rw-r--r--srv/src/api/csrf.go (renamed from srv/api/csrf.go)0
-rw-r--r--srv/src/api/mailinglist.go (renamed from srv/api/mailinglist.go)0
-rw-r--r--srv/src/api/middleware.go (renamed from srv/api/middleware.go)0
-rw-r--r--srv/src/api/pow.go (renamed from srv/api/pow.go)0
-rw-r--r--srv/src/cfg/cfg.go (renamed from srv/cfg/cfg.go)0
-rw-r--r--srv/src/cfg/cfg_test.go (renamed from srv/cfg/cfg_test.go)0
-rw-r--r--srv/src/chat/chat.go (renamed from srv/chat/chat.go)0
-rw-r--r--srv/src/chat/chat_test.go (renamed from srv/chat/chat_test.go)0
-rw-r--r--srv/src/chat/user.go (renamed from srv/chat/user.go)0
-rw-r--r--srv/src/chat/user_test.go (renamed from srv/chat/user_test.go)0
-rw-r--r--srv/src/chat/util.go (renamed from srv/chat/util.go)0
-rw-r--r--srv/src/cmd/mailinglist-cli/main.go (renamed from srv/cmd/mailinglist-cli/main.go)0
-rw-r--r--srv/src/cmd/mediocre-blog/main.go (renamed from srv/cmd/mediocre-blog/main.go)0
-rw-r--r--srv/src/cmd/userid-calc-cli/main.go (renamed from srv/cmd/userid-calc-cli/main.go)0
-rw-r--r--srv/src/go.mod (renamed from srv/go.mod)0
-rw-r--r--srv/src/go.sum (renamed from srv/go.sum)0
-rw-r--r--srv/src/mailinglist/mailer.go (renamed from srv/mailinglist/mailer.go)0
-rw-r--r--srv/src/mailinglist/mailinglist.go (renamed from srv/mailinglist/mailinglist.go)0
-rw-r--r--srv/src/mailinglist/store.go (renamed from srv/mailinglist/store.go)0
-rw-r--r--srv/src/mailinglist/store_test.go (renamed from srv/mailinglist/store_test.go)0
-rw-r--r--srv/src/pow/pow.go (renamed from srv/pow/pow.go)0
-rw-r--r--srv/src/pow/pow_test.go (renamed from srv/pow/pow_test.go)0
-rw-r--r--srv/src/pow/store.go (renamed from srv/pow/store.go)0
-rw-r--r--srv/src/pow/store_test.go (renamed from srv/pow/store_test.go)0
28 files changed, 22 insertions, 18 deletions
diff --git a/srv/default.nix b/srv/default.nix
index 3037fd7..5510744 100644
--- a/srv/default.nix
+++ b/srv/default.nix
@@ -1,62 +1,66 @@
{
+ bash,
+ go,
buildGoModule,
writeScript,
- writeScriptBin,
+ writeText,
stdenv,
config,
staticBuild,
}: rec {
- env = ''
+ init = writeText "mediocre-blog-srv-init" ''
- export MEDIOCRE_BLOG_DATA_DIR=${config.dataDir}
+ export MEDIOCRE_BLOG_DATA_DIR="${config.dataDir}"
+ mkdir -p "${config.dataDir}"
# mailing list
- export MEDIOCRE_BLOG_ML_SMTP_ADDR=${config.mlSMTPAddr}
- export MEDIOCRE_BLOG_ML_SMTP_AUTH='${config.mlSMTPAuth}'
- export MEDIOCRE_BLOG_ML_PUBLIC_URL=${config.mlPublicURL}
+ export MEDIOCRE_BLOG_ML_SMTP_ADDR="${config.mlSMTPAddr}"
+ export MEDIOCRE_BLOG_ML_SMTP_AUTH="${config.mlSMTPAuth}"
+ export MEDIOCRE_BLOG_ML_PUBLIC_URL="${config.mlPublicURL}"
# redis
export MEDIOCRE_BLOG_REDIS_PROTO=unix
- export MEDIOCRE_BLOG_REDIS_ADDR=${config.redisListenPath}
+ export MEDIOCRE_BLOG_REDIS_ADDR="${config.redisListenPath}"
# pow
- export MEDIOCRE_BLOG_POW_SECRET=${config.powSecret}
+ export MEDIOCRE_BLOG_POW_SECRET="${config.powSecret}"
# static proxy
if [ "${config.staticProxyURL}" == "" ]; then
- export MEDIOCRE_BLOG_STATIC_DIR=${staticBuild}
+ export MEDIOCRE_BLOG_STATIC_DIR="${staticBuild}"
else
- export MEDIOCRE_BLOG_STATIC_URL=${config.staticProxyURL}
+ export MEDIOCRE_BLOG_STATIC_URL="${config.staticProxyURL}"
fi
# listening
- export MEDIOCRE_BLOG_LISTEN_PROTO=${config.listenProto}
- export MEDIOCRE_BLOG_LISTEN_ADDR=${config.listenAddr}
+ export MEDIOCRE_BLOG_LISTEN_PROTO="${config.listenProto}"
+ export MEDIOCRE_BLOG_LISTEN_ADDR="${config.listenAddr}"
'';
build = buildGoModule {
pname = "mediocre-blog-srv";
version = "dev";
- src = ./.;
- vendorSha256 = "02szg1lisfjk8pk9pflbyv97ykg9362r4fhd0w0p2a7c81kf9b8y";
+ src = ./src;
+ vendorSha256 = "sha256-/F62WVkI50woo5J0xZOAn0g0WWkDna4wIBeVvbhAGzs=";
# disable tests
checkPhase = '''';
};
bin = writeScript "mediocre-blog-srv-bin" ''
- #!/bin/sh
- mkdir -p "${config.dataDir}"
- source ${env}
+ #!${bash}
+ source ${init}
exec ${build}/bin/mediocre-blog
'';
shell = stdenv.mkDerivation {
name = "mediocre-blog-srv-shell";
+ buildInputs = [ go build ];
shellHook = ''
- source ${env}
+ source ${init}
+ cd src
'';
};
}
diff --git a/srv/api/api.go b/srv/src/api/api.go
index 56f33b2..56f33b2 100644
--- a/srv/api/api.go
+++ b/srv/src/api/api.go
diff --git a/srv/api/apiutils/apiutils.go b/srv/src/api/apiutils/apiutils.go
index 223c2b9..223c2b9 100644
--- a/srv/api/apiutils/apiutils.go
+++ b/srv/src/api/apiutils/apiutils.go
diff --git a/srv/api/chat.go b/srv/src/api/chat.go
index a1acc5a..a1acc5a 100644
--- a/srv/api/chat.go
+++ b/srv/src/api/chat.go
diff --git a/srv/api/csrf.go b/srv/src/api/csrf.go
index 13b6ec6..13b6ec6 100644
--- a/srv/api/csrf.go
+++ b/srv/src/api/csrf.go
diff --git a/srv/api/mailinglist.go b/srv/src/api/mailinglist.go
index d89fe2a..d89fe2a 100644
--- a/srv/api/mailinglist.go
+++ b/srv/src/api/mailinglist.go
diff --git a/srv/api/middleware.go b/srv/src/api/middleware.go
index 6ea0d13..6ea0d13 100644
--- a/srv/api/middleware.go
+++ b/srv/src/api/middleware.go
diff --git a/srv/api/pow.go b/srv/src/api/pow.go
index 1b232b1..1b232b1 100644
--- a/srv/api/pow.go
+++ b/srv/src/api/pow.go
diff --git a/srv/cfg/cfg.go b/srv/src/cfg/cfg.go
index 8513e16..8513e16 100644
--- a/srv/cfg/cfg.go
+++ b/srv/src/cfg/cfg.go
diff --git a/srv/cfg/cfg_test.go b/srv/src/cfg/cfg_test.go
index 7ccf94a..7ccf94a 100644
--- a/srv/cfg/cfg_test.go
+++ b/srv/src/cfg/cfg_test.go
diff --git a/srv/chat/chat.go b/srv/src/chat/chat.go
index 0a88d3b..0a88d3b 100644
--- a/srv/chat/chat.go
+++ b/srv/src/chat/chat.go
diff --git a/srv/chat/chat_test.go b/srv/src/chat/chat_test.go
index d37921c..d37921c 100644
--- a/srv/chat/chat_test.go
+++ b/srv/src/chat/chat_test.go
diff --git a/srv/chat/user.go b/srv/src/chat/user.go
index 3f5ab95..3f5ab95 100644
--- a/srv/chat/user.go
+++ b/srv/src/chat/user.go
diff --git a/srv/chat/user_test.go b/srv/src/chat/user_test.go
index 2169cde..2169cde 100644
--- a/srv/chat/user_test.go
+++ b/srv/src/chat/user_test.go
diff --git a/srv/chat/util.go b/srv/src/chat/util.go
index 05f4830..05f4830 100644
--- a/srv/chat/util.go
+++ b/srv/src/chat/util.go
diff --git a/srv/cmd/mailinglist-cli/main.go b/srv/src/cmd/mailinglist-cli/main.go
index c3207df..c3207df 100644
--- a/srv/cmd/mailinglist-cli/main.go
+++ b/srv/src/cmd/mailinglist-cli/main.go
diff --git a/srv/cmd/mediocre-blog/main.go b/srv/src/cmd/mediocre-blog/main.go
index 4cf3024..4cf3024 100644
--- a/srv/cmd/mediocre-blog/main.go
+++ b/srv/src/cmd/mediocre-blog/main.go
diff --git a/srv/cmd/userid-calc-cli/main.go b/srv/src/cmd/userid-calc-cli/main.go
index 90c44e7..90c44e7 100644
--- a/srv/cmd/userid-calc-cli/main.go
+++ b/srv/src/cmd/userid-calc-cli/main.go
diff --git a/srv/go.mod b/srv/src/go.mod
index 6a912e2..6a912e2 100644
--- a/srv/go.mod
+++ b/srv/src/go.mod
diff --git a/srv/go.sum b/srv/src/go.sum
index 77aac2e..77aac2e 100644
--- a/srv/go.sum
+++ b/srv/src/go.sum
diff --git a/srv/mailinglist/mailer.go b/srv/src/mailinglist/mailer.go
index 07d6c3a..07d6c3a 100644
--- a/srv/mailinglist/mailer.go
+++ b/srv/src/mailinglist/mailer.go
diff --git a/srv/mailinglist/mailinglist.go b/srv/src/mailinglist/mailinglist.go
index fc6e014..fc6e014 100644
--- a/srv/mailinglist/mailinglist.go
+++ b/srv/src/mailinglist/mailinglist.go
diff --git a/srv/mailinglist/store.go b/srv/src/mailinglist/store.go
index f9790c0..f9790c0 100644
--- a/srv/mailinglist/store.go
+++ b/srv/src/mailinglist/store.go
diff --git a/srv/mailinglist/store_test.go b/srv/src/mailinglist/store_test.go
index 25eb150..25eb150 100644
--- a/srv/mailinglist/store_test.go
+++ b/srv/src/mailinglist/store_test.go
diff --git a/srv/pow/pow.go b/srv/src/pow/pow.go
index ada8439..ada8439 100644
--- a/srv/pow/pow.go
+++ b/srv/src/pow/pow.go
diff --git a/srv/pow/pow_test.go b/srv/src/pow/pow_test.go
index cc868b1..cc868b1 100644
--- a/srv/pow/pow_test.go
+++ b/srv/src/pow/pow_test.go
diff --git a/srv/pow/store.go b/srv/src/pow/store.go
index 0b5e7d0..0b5e7d0 100644
--- a/srv/pow/store.go
+++ b/srv/src/pow/store.go
diff --git a/srv/pow/store_test.go b/srv/src/pow/store_test.go
index 324a40c..324a40c 100644
--- a/srv/pow/store_test.go
+++ b/srv/src/pow/store_test.go