Jump to content

Radicale: Difference between revisions

From Official NixOS Wiki
imported>Exyi
Added basic info about Radicale
 
Phobos (talk | contribs)
m formatted code
 
(11 intermediate revisions by 10 users not shown)
Line 1: Line 1:
Radicale is a Free and Open-Source CalDAV (calendars, todo-lists) and CardDAV (contacts) Server. For more information about Radicale itself, see https://radicale.org/
Radicale is a Free and Open-Source CalDAV (calendars, todo-lists) and CardDAV (contacts) Server. For more information about Radicale itself, see https://radicale.org/.


This basic configuration will run the server. Note that you might want to allow the port (5232 in this case) on you [https://nixos.org/nixos/manual/index.html#sec-firewall firewall]
This basic configuration will run the server. Note that you might want to allow the port (5232 in this case) on your [https://nixos.org/nixos/manual/index.html#sec-firewall firewall].


<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
services.radicale = {
services.radicale = {
    enable = true;
  enable = true;
    config =
  settings.server.hosts = [ "0.0.0.0:5232" ];
        ''
        [server]
        # Bind all interfaces on port 5232
        hosts = 0.0.0.0:5232
        ''
};
};
</syntaxhighlight>
</syntaxhighlight>


The <code>config</code> is standard Radicale configuration, see https://radicale.org/configuration/
The <code>settings</code> is standard Radicale configuration, see https://radicale.org/v3.html#configuration.


== Authentication ==
== Authentication ==


The default authentication mode is <code>None</code> which just allows all usernames and passwords. Other option is to use an Apache htpasswd file for authentication.
The default authentication mode is <code>denyall</code>. You can change it to <code>none</code> which just allows all usernames and passwords. The other option is to use an Apache htpasswd file for authentication.
 
{{File|name=radicale.nix|3={ config, ... }: {
  services.radicale = {
    enable = true;
    settings = {
      server.hosts = [ "0.0.0.0:5232" "[::]:5232" ];
      auth = {
        type = "htpasswd";
        htpasswd_filename = "/path/to/htpasswd/file/radicale_users";
        # hash function used for passwords. May be `plain` if you don't want to hash the passwords
        htpasswd_encryption = "bcrypt";
      };
    };
  };
}|lang=nix}}
 
== Web Proxy examples ==
 
Caddy configured to proxy radicale in a subdirectory


<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
services.radicale = {
caddy = {
    enable = true;
  enable = true;
    config =
  extraConfig = ''
        ''
    :80 {
         [server]
      redir /radicale /radicale/
         hosts = 0.0.0.0:5232
      handle /radicale/* {
         uri strip_prefix /radicale
         reverse_proxy localhost:5232 {
          header_up X-Script-Name /radicale
          header_up Authorization {header.Authorization}
        }
      }
    }
  '';
}
</syntaxhighlight>
 
Nginx virtualhost location snippet configured to proxy radicale in a subdirectory


        [auth]
<syntaxhighlight lang="nix">
        type = htpasswd
locations."/radicale/" = {
        htpasswd_filename = /path/to/htpasswd/file/radicale_users
  proxyPass = "http://127.0.0.1:5232/";
        # hash function used for passwords. May be `plain` if you don't want to hash the passwords
  extraConfig = ''
        htpasswd_encryption = bcrypt
    proxy_set_header X-Script-Name /radicale;
        '';
    proxy_pass_header Authorization;
  '';
};
};
</syntaxhighlight>
</syntaxhighlight>


== See also ==
== See also ==
* [https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/networking/radicale.nix Source code of the service]
* [https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/networking/radicale.nix Source code of the service]
* [https://nixos.org/nixos/options.html#services.radicale List of Radicale options supported by NixOS]
* [https://search.nixos.org/options?query=services.radicale List of Radicale options supported by NixOS]
 
[[Category:Server]]

Latest revision as of 18:39, 2 November 2026

Radicale is a Free and Open-Source CalDAV (calendars, todo-lists) and CardDAV (contacts) Server. For more information about Radicale itself, see https://radicale.org/.

This basic configuration will run the server. Note that you might want to allow the port (5232 in this case) on your firewall.

services.radicale = {
  enable = true;
  settings.server.hosts = [ "0.0.0.0:5232" ];
};

The settings is standard Radicale configuration, see https://radicale.org/v3.html#configuration.

Authentication

The default authentication mode is denyall. You can change it to none which just allows all usernames and passwords. The other option is to use an Apache htpasswd file for authentication.

❄︎ radicale.nix
{ config, ... }: {
  services.radicale = {
    enable = true;
    settings = {
      server.hosts = [ "0.0.0.0:5232" "[::]:5232" ];
      auth = {
        type = "htpasswd";
        htpasswd_filename = "/path/to/htpasswd/file/radicale_users";
        # hash function used for passwords. May be `plain` if you don't want to hash the passwords
        htpasswd_encryption = "bcrypt";
      };
    };
  };
}

Web Proxy examples

Caddy configured to proxy radicale in a subdirectory

caddy = {
  enable = true;
  extraConfig = ''
    :80 {
      redir /radicale /radicale/
      handle /radicale/* {
        uri strip_prefix /radicale
        reverse_proxy localhost:5232 {
          header_up X-Script-Name /radicale
          header_up Authorization {header.Authorization}
        }
      }
    }
  '';
}

Nginx virtualhost location snippet configured to proxy radicale in a subdirectory

locations."/radicale/" = {
  proxyPass = "http://127.0.0.1:5232/";
  extraConfig = ''
    proxy_set_header X-Script-Name /radicale;
    proxy_pass_header Authorization;
  '';
};


See also