Finished NIP42 implementation

This commit is contained in:
Tony Klink 2024-02-13 09:53:41 -06:00
parent f7b74bd22c
commit d06206bb24
Signed by: klink
GPG key ID: 85175567C4D19231
8 changed files with 101 additions and 17 deletions

View file

@ -41,6 +41,10 @@ in {
Local nixos-container ip address
'';
};
relayUrl = mkOption {
type = types.str;
description = "Relay URL that will be used for NIP-42 AUTH validation";
};
};
config = mkIf cfg.enable {
@ -70,6 +74,7 @@ in {
DATABASE_URL = "${DB_PATH}/sneedstr.db";
ADMIN_PUBKEY = cfg.adminPubkey;
CONFIG_ENABLE_AUTH = cfg.enableAuth;
CONFIG_RELAY_URL = cfg.relayUrl;
};
startLimitBurst = 1;
startLimitIntervalSec = 10;
@ -117,6 +122,10 @@ in {
proxyWebsockets = true; # needed if you need to use WebSocket
recommendedProxySettings = true;
};
locations."/register" = {
proxyPass = "http://${cfg.localAddress}:8085";
recommendedProxySettings = true;
};
};
};
};