Nextcloud: Difference between revisions

Onny (talk | contribs)
Raboof (talk | contribs)
Configuration: 'dynamic' configuration
Line 227: Line 227:


Consider using a  [[Comparison of secret managing schemes|secret management tool]] instead of referencing an unencrypted local secrets file.
Consider using a  [[Comparison of secret managing schemes|secret management tool]] instead of referencing an unencrypted local secrets file.
==== Dynamic configuration ====
Unfortunately, some options can only be set 'interactively' in the database, and not via the configuration file. One way to set them semi-declaratively is to register a systemd script to reset the options on each redeploy. Of course this is not ideal: changes through the web interface or occ client are still possible but will be overwritten the next redeploy, and removing a line from the script will not remove it from the configuration.
<syntaxHighlight lang="nix">
  systemd.services.nextcloud-custom-config = {
    path = [
      config.services.nextcloud.occ
    ];
    script = ''
      nextcloud-occ theming:config name "My Cloud"
      nextcloud-occ theming:config url "https://cloud.mine.com";
      nextcloud-occ theming:config privacyUrl "https://www.mine.com/privacy";
      nextcloud-occ theming:config color "#3253a5";
      nextcloud-occ theming:config logo ${./logo.png}
    '';
    after = [ "nextcloud-setup.service" ];
    wantedBy = [ "multi-user.target" ];
  };
</syntaxHighlight> 


== Maintenance ==
== Maintenance ==