File etherpad-lite_move_autogenerated_key_files_to_var.patch of Package etherpad-lite

diff '--color=auto' -ur a/bin/createUserSession.ts b/bin/createUserSession.ts
--- a/bin/createUserSession.ts	2024-06-02 12:59:38.000000000 +0200
+++ b/bin/createUserSession.ts	2024-06-22 16:24:55.502723058 +0200
@@ -22,7 +22,7 @@
   axios.defaults.baseURL = `http://${settings.ip}:${settings.port}`;
   const api = axios;
 
-  const filePath = path.join(__dirname, '../APIKEY.txt');
+  const filePath = '/var/lib/etherpad-lite/APIKEY.txt';
   const apikey = fs.readFileSync(filePath, {encoding: 'utf-8'});
 
   let res;
diff '--color=auto' -ur a/bin/deleteAllGroupSessions.ts b/bin/deleteAllGroupSessions.ts
--- a/bin/deleteAllGroupSessions.ts	2024-06-02 12:59:38.000000000 +0200
+++ b/bin/deleteAllGroupSessions.ts	2024-06-22 16:25:07.239468927 +0200
@@ -17,7 +17,7 @@
 let deleteCount = 0;
 
 // get the API Key
-const filePath = path.join(__dirname, '../APIKEY.txt');
+const filePath = '/var/lib/etherpad-lite/APIKEY.txt';
 console.log('Deleting all group sessions, please be patient.');
 const settings = require('ep_etherpad-lite/tests/container/loadSettings').loadSettings();
 
diff '--color=auto' -ur a/bin/deletePad.ts b/bin/deletePad.ts
--- a/bin/deletePad.ts	2024-06-02 12:59:38.000000000 +0200
+++ b/bin/deletePad.ts	2024-06-22 16:25:21.169562932 +0200
@@ -25,7 +25,7 @@
 const padId = process.argv[2];
 
 // get the API Key
-const filePath = path.join(__dirname, '../APIKEY.txt');
+const filePath = '/var/lib/etherpad-lite/APIKEY.txt';
 const apikey = fs.readFileSync(filePath, {encoding: 'utf-8'});
 
 (async () => {

diff '--color=auto' -ur a/src/node/handler/APIKeyHandler.ts b/src/node/handler/APIKeyHandler.ts
--- a/src/node/handler/APIKeyHandler.ts	2024-06-02 12:59:38.000000000 +0200
+++ b/src/node/handler/APIKeyHandler.ts	2024-06-22 16:26:15.693264205 +0200
@@ -9,7 +9,7 @@
 
 // ensure we have an apikey
 export let apikey:string|null = null;
-const apikeyFilename = absolutePaths.makeAbsolute(argv.apikey || './APIKEY.txt');
+const apikeyFilename = absolutePaths.makeAbsolute(argv.apikey || '/var/lib/etherpad-lite/APIKEY.txt');
 
 
 if(settings.authenticationMethod === 'apikey') {
openSUSE Build Service is sponsored by