From a21345c3c7c8b8788954c2e77a844413bdd08525 Mon Sep 17 00:00:00 2001
From: Sascha Nitsch <sascha.nitsch@spsn.net>
Date: Thu, 27 Mar 2025 17:13:50 +0100
Subject: [PATCH] updates based on installation feedback

---
 README.md          | 15 +++++++++++----
 sql/2024-07-21.sql |  2 +-
 sql/2024-07-23.sql |  2 +-
 3 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/README.md b/README.md
index e4c8412..5d98edb 100644
--- a/README.md
+++ b/README.md
@@ -2,6 +2,7 @@
 NOTE: this is work in progress, it is nowhere near completion nor function
 
 ## installation
+install composer via your package manager or via the official documation
 install dependencies by using
 
 > composer install
@@ -27,18 +28,22 @@ Needed SQL commands:
 
 After this, change the settings in the ini file to match above changed passwords.
 change to php/federator and run
-    php maintenance dbupgrade
+    php maintenance.php dbupgrade
 to install all the needed table. Also run this after an update.
 
-If the include redis cache is enabled, create a users.acl for redis with the content:
+If the include redis cache is enabled,
+- install redis
+- create a users.acl for redis with the content:
 
     user federator on ~u_* +get +set  ~s_* +get +setex ~m_* +get +setex >redis*change*password
 
-change password in the rediscache.ini to match your given password.
+- change password in the rediscache.ini to match your given password.
+- install the redis plugin from pecl if not provided via your distro
+- enable openssl in php.ini if not already done
 
 To configure an apache server, add the following rewrite rules:
 
-    <Directory /where/ever/you/put/it>
+    <Directory /where/ever/you/put/it/htdocs>
       RewriteEngine on
       RewriteBase /
       RewriteCond expr "%{HTTP:accept} -strcmatch '*application/ld+json*'" [OR]
@@ -52,6 +57,8 @@ To configure an apache server, add the following rewrite rules:
       RewriteRule ^(nodeinfo/2\.[01])$ /federator.php?_call=$1 [L,END]
     </Directory>
 
+change your document root for the domain you want to use (or default one if using localhost) to the directory you installed it, with the /htdocs at the end. A user should only be able to open that file, not the other data.
+
 With the dummy plugin and everything installed correctly a
 
 > curl -v http://localhost/api/federator/v1/dummy/moo -H "X-Session: somethingvalid" -H "X-Profile: ihaveone"
diff --git a/sql/2024-07-21.sql b/sql/2024-07-21.sql
index 054e354..801ba93 100644
--- a/sql/2024-07-21.sql
+++ b/sql/2024-07-21.sql
@@ -1,2 +1,2 @@
-alter table users add `validuntil` timestamp default 0;
+alter table users add `validuntil` timestamp null default null;
 update settings set `value`="2024-07-21" where `key`="database_version";
\ No newline at end of file
diff --git a/sql/2024-07-23.sql b/sql/2024-07-23.sql
index 04aff80..c3bd58e 100644
--- a/sql/2024-07-23.sql
+++ b/sql/2024-07-23.sql
@@ -1,7 +1,7 @@
 alter table users add `type` enum('person', 'group') default 'person';
 alter table users add `name` varchar(255) default '';
 alter table users add `summary` text default '';
-alter table users add `registered` timestamp default 0;
+alter table users add `registered` timestamp null default null;
 alter table users add `iconmediatype` varchar(255) default '';
 alter table users add `iconurl` varchar(255) default '';
 alter table users add `imagemediatype` varchar(255) default '';