From e222d106001a5acb4b56cbb02d977f8863189ee4 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Wed, 26 Jan 2022 00:50:38 +0100 Subject: [PATCH 1/3] change directory correctly --- deployment/bare_metal/setup.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deployment/bare_metal/setup.md b/deployment/bare_metal/setup.md index a23d3fbe4..55f657df2 100644 --- a/deployment/bare_metal/setup.md +++ b/deployment/bare_metal/setup.md @@ -73,9 +73,9 @@ > sudo /etc/init.d/fail2ban restart # Install gradido -> sudo apt-get install git +> sudo apt-get install -y git +> cd ~ > git clone https://github.com/gradido/gradido.git -> cd gradido/deployment/bare_metal # Timezone # Note: This is not needed - UTC(default) is REQUIRED for production data From 1c36192a6579736cc358371b6a0d8bd9ef3ac918 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Wed, 26 Jan 2022 00:52:58 +0100 Subject: [PATCH 2/3] install curl in correct order note on the error of nginx ssl setup include install command for logrotate even tho its currently installed by default on debian 11 --- deployment/bare_metal/install.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/deployment/bare_metal/install.sh b/deployment/bare_metal/install.sh index b6ea5cd78..caa9c1240 100755 --- a/deployment/bare_metal/install.sh +++ b/deployment/bare_metal/install.sh @@ -50,12 +50,12 @@ sudo nano /etc/sudoers.d/gradido sudo chmod a+rw /etc/nginx/sites-enabled # Install node 16.x +sudo apt-get install -y curl curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash - sudo apt-get install -y nodejs sudo apt-get install -y build-essential # Install yarn -sudo apt-get install -y curl sudo apt-get install -y gnupg curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list @@ -75,9 +75,11 @@ sudo certbot > Please read the Terms of Service at > Y > Would you be willing, once your first certificate is successfully issued, to > N > No names were found in your configuration files. Please enter in your domain > stage1.gradido.net +# Note: this will throw an error regarding not beeing able to identify the nginx corresponding +# config but produce the required certificate - thats perfectly fine this way # Install logrotate -# sudo apt-get install -y logrotate +sudo apt-get install -y logrotate envsubst "$(env | sed -e 's/=.*//' -e 's/^/\$/g')" < $SCRIPT_DIR/logrotate/gradido.conf.template > $SCRIPT_DIR/logrotate/gradido.conf sudo mv $SCRIPT_DIR/logrotate/gradido.conf /etc/logrotate.d/gradido.conf sudo chown root:root /etc/logrotate.d/gradido.conf From 1324da1fe50a5864d5444cdc7bc87cff7b57f3d1 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Wed, 26 Jan 2022 15:13:54 +0100 Subject: [PATCH 3/3] fix collate conversion due to inconsistencies with encoding --- database/migrations/0006-login_users_collation.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/database/migrations/0006-login_users_collation.ts b/database/migrations/0006-login_users_collation.ts index 579bb0a7a..2a730f5e7 100644 --- a/database/migrations/0006-login_users_collation.ts +++ b/database/migrations/0006-login_users_collation.ts @@ -6,11 +6,13 @@ */ export async function upgrade(queryFn: (query: string, values?: any[]) => Promise>) { + // Explicitly change the charset and collate to the one used to then change it + await queryFn('ALTER TABLE `login_users` CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;') await queryFn( 'ALTER TABLE `login_users` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;', ) } export async function downgrade(queryFn: (query: string, values?: any[]) => Promise>) { - await queryFn('ALTER TABLE `login_users` CONVERT TO CHARACTER SET utf8mb4;') + await queryFn('ALTER TABLE `login_users` CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;') }