summaryrefslogtreecommitdiff
path: root/update.php
diff options
context:
space:
mode:
authorAndrew Dolgov <fox@fakecake.org>2025-04-08 08:55:44 +0300
committerAndrew Dolgov <fox@fakecake.org>2025-04-08 08:55:44 +0300
commit25d3ce4ee8f411a19c3a0e69ebb5c575c16243a8 (patch)
tree81175cf9f11cdf6bf87dfc78f5d1f430d92297a9 /update.php
parent58677fc791604bd891fb1ef4f4cc5e040ce8e39f (diff)
drop SESSION-specific stuff and move encrypt/decrypt helpers to a separate class; add a command line flag to generate encryption keys
Diffstat (limited to 'update.php')
-rwxr-xr-xupdate.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/update.php b/update.php
index 471e323c8..dfac5ab4c 100755
--- a/update.php
+++ b/update.php
@@ -84,6 +84,7 @@
"update-schema::" => ["[force-yes]", "update database schema, optionally without prompting"],
"force-update" => "mark all feeds as pending update",
"gen-search-idx" => "generate basic PostgreSQL fulltext search index",
+ "gen-encryption-key" => "generate an encryption key (ChaCha20-Poly1305)",
"plugins-list" => "list installed plugins",
"debug-feed:" => ["N", "update specified feed with debug output enabled"],
"force-refetch" => "debug update: force refetch feed data",
@@ -323,6 +324,10 @@
}
}
+ if (isset($options["gen-encryption-key"])) {
+ echo "Generated encryption key: " . bin2hex(Crypt::generate_key()) . "\n";
+ }
+
if (isset($options["plugins-list"])) {
$tmppluginhost = new PluginHost();
$tmppluginhost->load_all($tmppluginhost::KIND_ALL);