Radarr: Difference between revisions

Tesy (talk | contribs)
m make the code runnable
Djacu (talk | contribs)
m Lost a `trust` configuration for postgres in the previous edit.
 
(2 intermediate revisions by 2 users not shown)
Line 29: Line 29:
Both the <code>user</code> and <code>group</code> options are used to specify which user and group is used to run Radarr. The <code>dataDir</code> option specifies the directory where Radarr stores its data files, and can be set to a custom location. When setting the <code>dataDir</code> option, be careful of permissions as a specified user still needs the correct read/write permissions in this directory.
Both the <code>user</code> and <code>group</code> options are used to specify which user and group is used to run Radarr. The <code>dataDir</code> option specifies the directory where Radarr stores its data files, and can be set to a custom location. When setting the <code>dataDir</code> option, be careful of permissions as a specified user still needs the correct read/write permissions in this directory.


= Postgresql configuration =
Radarr uses SQLite by default. It can be configured to use PostgreSQL.<syntaxhighlight lang="nix">
services.radarr = {
  #...
  settings = {
    postgres.host = "127.0.0.1";
    postgres.logdb = "radarr-log";
    postgres.maindb = "radarr-main";
    postgres.password = config.services.radarr.user;
    # Not secure if the port is exposed
    postgres.user = config.services.radarr.user;
    server.port = 7878;
  };
};


services.postgresql = {
  authentication = ''
    # this is for local database access with psql
    local all all trust
    # this is for radarr to connect
    host all ${config.services.radarr.user} 127.0.0.1/32 trust
    host all ${config.services.radarr.user} ::1/128      trust
  '';
  enable = true;
  ensureDatabases = [
    "radarr-log"
    "radarr-main"
  ];
  ensureUsers = [
    {
      name = config.services.radarr.user;
      # required for table creation
      ensureClauses.superuser = true;
    }
  ];
};
</syntaxhighlight>This is a minimal configuration to ensure that the necessary databases are created and accessible to Radarr. See the [https://wiki.servarr.com/radarr/postgres-setup Radarr Postgres Setup] wiki page for information about the databases necessary, supported versions, and migrations. See the [https://wiki.servarr.com/radarr/environment-variables Radarr Environment Variables] wiki page for information about settings.
[[Category:Applications]]
[[Category:Applications]]
[[Category:Server]]