nrdxp / cfdyndns

CloudFlare Dynamic DNS Client
MIT License
12 stars 15 forks source link

Nixos, SOPS, and apitokenfile = Invalid format for Authorization header #37

Open xxxcrow opened 12 months ago

xxxcrow commented 12 months ago

my systemctl status:

× cfdyndns.service - CloudFlare Dynamic DNS Client
     Loaded: loaded (/etc/systemd/system/cfdyndns.service; enabled; preset: enabled)
     Active: failed (Result: exit-code) since Sat 2023-11-11 08:35:01 UTC; 1min 34s ago
   Duration: 1.137s
TriggeredBy: ● cfdyndns.timer
    Process: 2985448 ExecStart=/nix/store/fgqyp2skdzka08p1d9n8cj5hkqhlg7ag-unit-script-cfdyndns-start/bin/cfdyndns-start (code=exited, status=1/FAILURE)
   Main PID: 2985448 (code=exited, status=1/FAILURE)
         IP: 5.1K in, 1.8K out
        CPU: 139ms

Nov 11 08:35:01 immortal cfdyndns-start[2985451]:  INFO  cfdyndns::ip > 123.123.123.123
Nov 11 08:35:01 immortal cfdyndns-start[2985451]:  INFO  cfdyndns::ip > 1234:ab12:1234:ab12:1234:ab12:1234:ab12
Nov 11 08:35:01 immortal cfdyndns-start[2985451]: Error: HTTP 400 Bad Request
Nov 11 08:35:01 immortal cfdyndns-start[2985451]: 6003: Invalid request headers ({"error_chain": Array [Object {"code": Number(6111), "message": String("Invalid format for Authorization header")}]})
Nov 11 08:35:01 immortal cfdyndns-start[2985451]: success: false
Nov 11 08:35:01 immortal cfdyndns-start[2985451]: result: null
Nov 11 08:35:01 immortal cfdyndns-start[2985451]: messages: []
Nov 11 08:35:01 immortal systemd[1]: cfdyndns.service: Main process exited, code=exited, status=1/FAILURE
Nov 11 08:35:01 immortal systemd[1]: cfdyndns.service: Failed with result 'exit-code'.
Nov 11 08:35:01 immortal systemd[1]: cfdyndns.service: Consumed 139ms CPU time, received 5.0K IP traffic, sent 1.7K IP traffic.

my config:

{ pkgs
, config
, ...
}: {
  sops.secrets."cloudflare/cfdyndns" = { };
  services.cfdyndns = {
    enable = true;
    records = [ "domain.one" "domain.two" ];
    apiTokenFile = config.sops.secrets."cloudflare/cfdyndns".path;
  };
}