Skip to content

Open Source alternative to Algolia + Pinecone and an Easier-to-Use alternative to ElasticSearch ⚡ 🔍 ✨ Fast, typo tolerant, in-memory fuzzy Search Engine for building delightful search experiences

Generate random API key post installation.

kishorenc554154139cb9
diff --git a/debian-pkg/typesense-server/DEBIAN/postinst b/debian-pkg/typesense-server/DEBIAN/postinst
index 1c7ece52..52c70f1d 100755
--- a/debian-pkg/typesense-server/DEBIAN/postinst
+++ b/debian-pkg/typesense-server/DEBIAN/postinst
@@ -1,5 +1,9 @@
#!/bin/sh
+# Generate a random API key
+API_KEY=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 48 | head -n 1)
+sed -i "s/\$API_KEY/$API_KEY/g" /etc/typesense/typesense-server.ini
+
systemctl enable typesense-server
systemctl daemon-reload
systemctl start typesense-server
\ No newline at end of file