-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
taler-mailbox: init at 0-unstable-2022-07-20
- Loading branch information
Showing
3 changed files
with
82 additions
and
0 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
pkgs/by-name/taler-mailbox/0001-Use-the-existing-mailbox.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
Subject: [PATCH] Use the existing mailbox and don't create a new one | ||
|
||
It's wrong to re-declare a new mailbox inside the main function | ||
since a global one is already defined. | ||
|
||
This is because if the global mailbox is not initialized, the | ||
program will panic whenever we try to read a key from the config. | ||
--- | ||
cmd/mailbox-server/main.go | 2 +- | ||
1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
||
diff --git a/cmd/mailbox-server/main.go b/cmd/mailbox-server/main.go | ||
index 070b7af..458c401 100644 | ||
--- a/cmd/mailbox-server/main.go | ||
+++ b/cmd/mailbox-server/main.go | ||
@@ -40,7 +40,7 @@ func main() { | ||
if len(*cfgFlag) != 0 { | ||
cfgfile = *cfgFlag | ||
} | ||
- m := mailbox.Mailbox{} | ||
+ m = mailbox.Mailbox{} | ||
m.Initialize(cfgfile) | ||
handleRequests() | ||
} | ||
-- | ||
2.44.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[mailbox] | ||
production = false | ||
host = "https://taler-mailbox.gnunet.org" | ||
bind_to = "localhost:11000" | ||
message_fee = KUDOS:1 | ||
default_doc_filetype = text/html | ||
default_doc_lang = en | ||
default_tos_path = terms/ | ||
default_pp_path = privacy/ | ||
supported_doc_filetypes = text/html application/pdf application/epub application/xml text/plain | ||
|
||
[mailbox-pq] | ||
host = "localhost" | ||
port = 5432 | ||
user = "taler-mailbox" | ||
password = "secret" | ||
db_name = "taler-mailbox" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
lib, | ||
buildGoModule, | ||
fetchgit, | ||
}: | ||
buildGoModule { | ||
pname = "taler-mailbox"; | ||
version = "0-unstable-2022-07-20"; | ||
|
||
src = fetchgit { | ||
url = "https://git.taler.net/taler-mailbox.git"; | ||
rev = "ee5c19e9edf7e4e0959becc99e97606d9e6de041"; | ||
hash = "sha256-t5IE8CuAKT5qlCNIqG9m8Gw0zJHa7505wHNK2ENuRQU="; | ||
}; | ||
|
||
vendorHash = "sha256-frrmhfCcbY5DpCxR2g6HeSfN7xuLxpAWRahQl140voI="; | ||
|
||
patches = [ | ||
./0001-Use-the-existing-mailbox.patch | ||
]; | ||
|
||
postInstall = '' | ||
install ./configs/mailbox-example.conf -Dt $out/share/examples/taler-mailbox | ||
''; | ||
|
||
ldflags = [ | ||
"-s" | ||
"-w" | ||
]; | ||
|
||
meta = with lib; { | ||
description = "Service for asynchronous wallet-to-wallet payment messages"; | ||
homepage = "https://git.taler.net/taler-mailbox.git"; | ||
license = licenses.agpl3Only; | ||
maintainers = with maintainers; []; | ||
mainProgram = "mailbox-server"; | ||
}; | ||
} |