Hello,

When updating share_v2.php to the latest version, one has to make a
copy of the configuration values in the file, update the file and
then re-apply the config values.

The attached patch allows one to create an external configuration file
that keeps the config values separate from the source, making updates
easier.

-- 
Regards/Mit freundlichen Grüßen
Christian Weiske

-=≡ Geeking around in the name of science since 1982 ≡=-

-- 
You received this message because you are subscribed to the Google Groups 
"prosody-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to prosody-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prosody-dev/20210502104642.343ef002%40boo.home.cweiske.de.
diff -r 1e70538e4641 mod_http_upload_external/share_v2.config.php.dist
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mod_http_upload_external/share_v2.config.php.dist	Sun May 02 10:34:46 2021 +0200
@@ -0,0 +1,17 @@
+<?php
+/**
+ * Copy this file to share_v2.config.php and adjust it.
+ */
+
+//Change this to a directory that is writable by your web server,
+// but is outside your web root
+$CONFIG_STORE_DIR = '/tmp';
+
+//This must be the same as 'http_upload_external_secret' that
+// you set in Prosody's config file
+$CONFIG_SECRET = 'this is your secret string';
+
+//For people who need options to tweak that they don't understand... here you are
+$CONFIG_CHUNK_SIZE = 4096;
+
+?>
diff -r 1e70538e4641 mod_http_upload_external/share_v2.php
--- a/mod_http_upload_external/share_v2.php	Wed Apr 28 08:22:47 2021 +0200
+++ b/mod_http_upload_external/share_v2.php	Sun May 02 10:34:46 2021 +0200
@@ -59,6 +59,13 @@
 /* For people who need options to tweak that they don't understand... here you are */
 $CONFIG_CHUNK_SIZE = 4096;
 
+
+/* Load configuration from external file */
+$configFile = __DIR__ . '/share_v2.config.php';
+if (file_exists($configFile)) {
+    include $configFile;
+}
+
 /*\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\*/
 /*         END OF CONFIGURATION                    */
 /*\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\*/

Reply via email to