Compare commits

..

5 Commits

Author SHA1 Message Date
Inex Code 747d6bc88e fix 2024-03-07 23:31:02 +03:00
Inex Code 8e7d87d615 update api version 2024-03-07 23:13:25 +03:00
Inex Code 67054dea22 test 3.1.0 2024-03-07 23:11:36 +03:00
Inex Code d046795ed9 test linklocal fix 2024-03-01 11:02:07 +03:00
Inex Code d3e929bc8d try fix 2024-02-23 20:47:06 +03:00
3 changed files with 10 additions and 32 deletions

View File

@ -1,20 +1,4 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
let
redis-sp-api-srv-name = "sp-api";
sp-print-api-token = pkgs.writeShellApplication {
name = "sp-print-api-token";
runtimeInputs = with pkgs; [ redis ];
text = ''
hash_token="$(redis-cli -s /run/redis-${redis-sp-api-srv-name}/redis.sock keys "token_repo:tokens:*" | head -n 1)"
hash_token="''${hash_token#"token_repo:tokens:"}"
token="$(redis-cli -s /run/redis-${redis-sp-api-srv-name}/redis.sock HGETALL "token_repo:tokens:$hash_token")"
token="$(echo "$token" | sed -n '2p')"
echo "$token"
'';
};
in
{ {
imports = [ imports = [
./selfprivacy-module.nix ./selfprivacy-module.nix
@ -31,7 +15,7 @@ in
services.selfprivacy-api.enable = true; services.selfprivacy-api.enable = true;
services.redis.servers.${redis-sp-api-srv-name} = { services.redis.servers.sp-api = {
enable = true; enable = true;
save = [ save = [
[ [
@ -84,7 +68,6 @@ in
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
git git
jq jq
sp-print-api-token
]; ];
# consider environment.defaultPackages = lib.mkForce []; # consider environment.defaultPackages = lib.mkForce [];
documentation.enable = false; # no {man,info}-pages & docs, etc to save space documentation.enable = false; # no {man,info}-pages & docs, etc to save space

View File

@ -2,11 +2,11 @@
"nodes": { "nodes": {
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1716361217, "lastModified": 1709677081,
"narHash": "sha256-mzZDr00WUiUXVm1ujBVv6A0qRd8okaITyUp4ezYRgc4=", "narHash": "sha256-tix36Y7u0rkn6mTm0lA45b45oab2cFLqAzDbJxeXS+c=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "46397778ef1f73414b03ed553a3368f0e7e33c2f", "rev": "880992dcc006a5e00dd0591446fdf723e6a51a64",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -28,11 +28,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1716580438, "lastModified": 1709843377,
"narHash": "sha256-wWKhCiRmjrFgnHUgcxBb2mtBy9uTrY93yxpMYh/wpVY=", "narHash": "sha256-lQGd4xtKWsIlD5vVurrA/xtNYxYFGfLGyev4oOUeMmY=",
"ref": "master", "ref": "master",
"rev": "4f1d44ce74432e745f0be3b192f8cc4ae06fd169", "rev": "1f1fcc223be4c6ae65eef1d50918aed0826e5ad1",
"revCount": 1304, "revCount": 1259,
"type": "git", "type": "git",
"url": "https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git" "url": "https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git"
}, },

View File

@ -9,17 +9,12 @@ let
CLOUDFLARE_ZONE_API_TOKEN=$TOKEN CLOUDFLARE_ZONE_API_TOKEN=$TOKEN
CLOUDFLARE_POLLING_INTERVAL=30 CLOUDFLARE_POLLING_INTERVAL=30
''; '';
DESEC = '' DESEC = "DESEC_TOKEN=$TOKEN";
DESEC_TOKEN=$TOKEN
DESEC_POLLING_INTERVAL=30
DESEC_PROPAGATION_TIMEOUT=180
DESEC_TTL=3600
'';
}; };
dnsCredentialsTemplate = dnsCredentialsTemplates.${cfg.dns.provider}; dnsCredentialsTemplate = dnsCredentialsTemplates.${cfg.dns.provider};
acme-env-filepath = "/var/lib/selfprivacy/acme-env"; acme-env-filepath = "/var/lib/selfprivacy/acme-env";
secrets-filepath = "/etc/selfprivacy/secrets.json"; secrets-filepath = "/etc/selfprivacy/secrets.json";
dnsPropagationCheckExceptions = [ "DIGITALOCEAN" "DESEC" ]; dnsPropagationCheckExceptions = [ "DIGITALOCEAN" ];
in in
{ {
users.groups.acmereceivers.members = [ "nginx" ]; users.groups.acmereceivers.members = [ "nginx" ];