Nextcloud: Difference between revisions

Raboof (talk | contribs)
m In previous edit, I didn't add the markup filename + language header.
 
(4 intermediate revisions by 4 users not shown)
Line 13: Line 13:
   hostName = "localhost";
   hostName = "localhost";
   config.adminpassFile = "/etc/nextcloud-admin-pass";
   config.adminpassFile = "/etc/nextcloud-admin-pass";
  config.dbtype = "sqlite";
};
};
</nowiki>}}
</nowiki>|name=/etc/nixos/configuration.nix|lang=nix}}


After that you will be able to login into your Nextcloud instance at <code><nowiki>http://localhost</nowiki></code> with user <code>root</code> and password <code>PWD</code> as configured above.
After that you will be able to login into your Nextcloud instance at <code><nowiki>http://localhost</nowiki></code> with user <code>root</code> and password <code>PWD</code> as configured above.
Line 114: Line 115:
};  
};  
</nowiki>}}
</nowiki>}}
=== Caching ===
[[Redis]] can be enabled as a performant caching backend using following configuration. This will bring faster page loads to your Nextcloud instance.
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
services.nextcloud = {               
  enable = true;       
  configureRedis = true;
  [...]
};
</nowiki>}}
Note that APCu will still be used for local caching, as recommended by Nextcloud upstream.


=== Data storage ===
=== Data storage ===
Line 141: Line 128:
In this example we'll configure a local S3-compatible object store using Minio and connect it to Nextcloud
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>
{{file|||<nowiki>
{ ... } let
{ ... } let


Line 158: Line 145:
       enable = true;
       enable = true;
       bucket = "nextcloud";
       bucket = "nextcloud";
       autocreate = true;
       verify_bucket_exists = true;
       key = accessKey;
       key = accessKey;
       secretFile = "${pkgs.writeText "secret" "test12345"}";
       secretFile = "${pkgs.writeText "secret" "test12345"}";
Line 179: Line 166:


};
};
</nowiki>}}
</nowiki>|name=/etc/nixos/configuration.nix|lang=nix}}


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>.
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>.
Line 348: Line 335:
services.nginx.virtualHosts."${config.services.nextcloud.hostName}".listen = [ { addr = "127.0.0.1"; port = 8080; } ];
services.nginx.virtualHosts."${config.services.nextcloud.hostName}".listen = [ { addr = "127.0.0.1"; port = 8080; } ];
</nowiki>}}
</nowiki>}}
=== Enable Two-factor authentication ===
Two-factor authentication can be enabled for your server via the administration interface in your browser. There is no way to declare this setting via nix configuration, so you should follow the [https://docs.nextcloud.com/server/latest/admin_manual/configuration_user/two_factor-auth.html official documentation] to set up Two-factor authentication.


=== Enable HEIC image preview ===
=== Enable HEIC image preview ===