From 6d637e453e63335649350252e4439dfcbe3a4531 Mon Sep 17 00:00:00 2001
From: CanbiZ <47820557+MickLesk@users.noreply.github.com>
Date: Tue, 24 Sep 2024 15:19:21 +0200
Subject: [PATCH] Tweak for Zipline

Zipline is sensitiv with special characters
---
 install/zipline-install.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/install/zipline-install.sh b/install/zipline-install.sh
index 1c444f8e..2c47d035 100644
--- a/install/zipline-install.sh
+++ b/install/zipline-install.sh
@@ -39,8 +39,8 @@ msg_ok "Installed Node.js"
 msg_info "Setting up PostgreSQL"
 DB_NAME=ziplinedb
 DB_USER=zipline
-DB_PASS="$(openssl rand -base64 18 | cut -c1-13)"
-SECRET_KEY="$(openssl rand -base64 32 | cut -c1-24)"
+DB_PASS="$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | cut -c1-13)"
+SECRET_KEY="$(openssl rand -base64 32 | tr -dc 'a-zA-Z0-9' | cut -c1-13)"
 $STD sudo -u postgres psql -c "CREATE ROLE $DB_USER WITH LOGIN PASSWORD '$DB_PASS';"
 $STD sudo -u postgres psql -c "CREATE DATABASE $DB_NAME WITH OWNER $DB_USER ENCODING 'UTF8' TEMPLATE template0;"
 $STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET client_encoding TO 'utf8';"