]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - DOCUMENTATION.md
Add monitoring script with smartctl
[perso/Immae/Config/Nix.git] / DOCUMENTATION.md
index 50eeca43fbb8e2740d58cf6cb48d3f5d1144f24c..fcd0b15164863fa040b7d12f907c87aa441f0b54 100644 (file)
@@ -1,7 +1,7 @@
 Get Started
 ===========
 
-- You may run ./nixops/scripts/setup to setup the directory and variables
+- You may run ./scripts/setup to setup the directory and variables
   The script won’t do anything without asking first, you may stop at any
   step.
 
@@ -43,8 +43,7 @@ The directory is divided in several sections:
   of hosts. They tend to be less used now. But sometimes they need to
   have an identity (mostly to be able to send e-mails) The subsection
   "roles" (ou=roles,ou=hosts,dc=immae,dc=eu) was from a Puppet age and
-  is deprecated. Only one host remains handled by Puppet (caldance) and
-  should be replaced with an internal VM.
+  is deprecated.
 - The "groups" section (ou=groups,dc=immae,dc=eu) contains the generic
   groups of users not associated to a service.
 - The "group_users" and "users" sections contain the users (usually with
@@ -58,7 +57,7 @@ How does nixpkgs resolve
 To build nixops machines
 ------------------------
 
-The `NIX_PATH` environment variable is built in nixops/Makefile and
+The `NIX_PATH` environment variable is built in deploy/Makefile and
 contains three paths: nixpkgs, nixpkgsNext, nixpkgsPrevious. Only the
 first one is actually used most of the time. Derivations that need
 pinned nixpkgs should declare it in `nix/sources.json` (it’s the case
@@ -236,13 +235,18 @@ Nextcloud
 ---------
 
 - Do not skip major versions!
+- Check php supported version (lib/versioncheck.php file)
+- Update all the apps: check on https://apps.nextcloud.com/ and build with
+  ```
+  nix-build -E "with import <nixpkgs> {};webapps.nextcloud.withApps (a: builtins.attrValues webapps.nextcloud.allApps)"
+  ```
 - Put nextcloud in maintenance mode :
   ```
   nextcloud-occ maintenance:mode --on
   ```
 - Do a backup :
   ```
-  sudo -u postgres pg_dump -n owncloud webapps > nextcloud.sql
+  sudo -u postgres pg_dump owncloud > nextcloud.sql
   ```
 - Upgrade
 - Run the upgrade task :
@@ -255,3 +259,37 @@ Nextcloud
   ```
 - Issues :
   https://docs.nextcloud.com/server/16/admin_manual/maintenance/manual_upgrade.html
+
+- Farm :
+  Once a new instance thename is created, create the database:
+  ```
+  CREATE USER nextcloud_thename WITH PASSWORD 'somepassword';
+  CREATE DATABASE nextcloud_thename WITH OWNER nextcloud_thename;
+  ```
+  Then add this to the config.php:
+  ```
+  'appstoreenabled' => false,
+  ```
+  Then run:
+  ```
+  nextcloud-occ-thename maintenance:install --database=pgsql --database-name=nextcloud_thename --database-host=/run/postgresql --database-user=nextcloud_thename --admin-user=immae --data-dir=/var/lib/nextcloud_farm/thename/data
+  ```
+  Finally, edit the config.php to add the correct trusted domain
+
+Flakes
+------
+
+Due to a bug in nix build, flakes that refer to relative path (input
+type "path") don't work when called via an url (nix build git+ssh://some-url).
+Relative paths (except in "flakes/private") should be renamed to
+git+https urls ideally. E.g.:
+```
+    inputs.libspf2 = {
+-    path = "../libspf2";
+-    type = "path";
++    url = "https://git.immae.eu/perso/Immae/Config/Nix.git";
++    type = "git";
++    dir = "flakes/libspf2";
+    };
+```
+