Nextcloud: Difference between revisions

imported>Onny
Removed old closed issue
imported>Onny
Add objectstore example
Line 122: Line 122:


Note that APCu will still be used for local caching, as recommended by Nextcloud upstream.
Note that APCu will still be used for local caching, as recommended by Nextcloud upstream.
=== Object store ===
In this example we'll configure a local S3-compatible object store using Minio and connect it to Nextcloud
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
{ ... } let
  accessKey = "nextcloud";
  secretKey = "test12345";
  rootCredentialsFile = pkgs.writeText "minio-credentials-full" ''
    MINIO_ROOT_USER=nextcloud
    MINIO_ROOT_PASSWORD=test12345
  '';
in {
  services.nextcloud = {               
    [...]
    config.objectstore.s3 = {
      enable = true;
      bucket = "nextcloud";
      autocreate = true;
      key = accessKey;
      secretFile = "${pkgs.writeText "secret" "test12345"}";
      hostname = "localhost";
      useSsl = false;
      port = 9000;
      usePathStyle = true;
      region = "us-east-1";
    };
  };
  services.minio = {
    enable = true;
    listenAddress = "127.0.0.1:9000";
    consoleAddress = "127.0.0.1:9001";
    inherit rootCredentialsFile;
  };
  environment.systemPackages = [ pkgs.minio-client ];
};
</nowiki>}}
We'll need to run two commands to create the bucket <code>nextcloud</code> by using the access key <code>nextcloud</code> and the secret key <code>test12345</code>.
<syntaxhighlight lang="bash">
mc config host add minio http://localhost:9000 ${accessKey} ${secretKey} --api s3v4
mc mb minio/nextcloud
</syntaxhighlight>


=== Mail delivery ===
=== Mail delivery ===