make secrets dir location configurable
Users of the nix-bitcoin modules shouldn't be forced to add an extra dir under root. The secrets location is unchanged for the default node config.
This commit is contained in:
parent
b1e13e9415
commit
826245484e
12 changed files with 38 additions and 32 deletions
|
|
@ -5,6 +5,7 @@ with lib;
|
|||
let
|
||||
cfg = config.services.electrs;
|
||||
inherit (config) nix-bitcoin-services;
|
||||
secretsDir = config.nix-bitcoin.secretsDir;
|
||||
index-batch-size = "${if cfg.high-memory then "" else "--index-batch-size=10"}";
|
||||
jsonrpc-import = "${if cfg.high-memory then "" else "--jsonrpc-import"}";
|
||||
in {
|
||||
|
|
@ -74,7 +75,7 @@ in {
|
|||
preStart = ''
|
||||
mkdir -m 0770 -p ${cfg.dataDir}
|
||||
chown -R '${cfg.user}:${cfg.group}' ${cfg.dataDir}
|
||||
echo "${pkgs.nix-bitcoin.electrs}/bin/electrs -vvv ${index-batch-size} ${jsonrpc-import} --timestamp --db-dir ${cfg.dataDir} --daemon-dir /var/lib/bitcoind --cookie=${config.services.bitcoind.rpcuser}:$(cat /secrets/bitcoin-rpcpassword) --electrum-rpc-addr=127.0.0.1:${toString cfg.port}" > /run/electrs/startscript.sh
|
||||
echo "${pkgs.nix-bitcoin.electrs}/bin/electrs -vvv ${index-batch-size} ${jsonrpc-import} --timestamp --db-dir ${cfg.dataDir} --daemon-dir /var/lib/bitcoind --cookie=${config.services.bitcoind.rpcuser}:$(cat ${secretsDir}/bitcoin-rpcpassword) --electrum-rpc-addr=127.0.0.1:${toString cfg.port}" > /run/electrs/startscript.sh
|
||||
'';
|
||||
serviceConfig = rec {
|
||||
RuntimeDirectory = "electrs";
|
||||
|
|
@ -103,8 +104,8 @@ in {
|
|||
listen ${toString config.services.electrs.nginxport} ssl;
|
||||
proxy_pass electrs;
|
||||
|
||||
ssl_certificate /secrets/nginx-cert;
|
||||
ssl_certificate_key /secrets/nginx-key;
|
||||
ssl_certificate ${secretsDir}/nginx-cert;
|
||||
ssl_certificate_key ${secretsDir}/nginx-key;
|
||||
ssl_session_cache shared:SSL:1m;
|
||||
ssl_session_timeout 4h;
|
||||
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue