From 0f2aff6827fe7ade7afa85cc4aea7f07ff71d262 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 7 Nov 2017 16:34:22 +0000 Subject: [PATCH 1/6] n version --- src/freedombone-utils-nodejs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/freedombone-utils-nodejs b/src/freedombone-utils-nodejs index eab687bc..2b02db86 100755 --- a/src/freedombone-utils-nodejs +++ b/src/freedombone-utils-nodejs @@ -36,7 +36,7 @@ VARIANTS='mesh' # change these versions at your peril. Things will often crash if you don't # have specifically the correct versions NODEJS_VERSION='6.11.4' -NODEJS_N_VERSION='2.1.8' +NODEJS_N_VERSION='2.1.7' NPM_VERSION='4.0.5' # This file keeps track of the apps needing nodejs From d2bef3057380a3874ad57119deaa8b88ae930889 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 7 Nov 2017 17:53:56 +0000 Subject: [PATCH 2/6] postgresql packages need version numbers --- src/freedombone-utils-postgresql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/freedombone-utils-postgresql b/src/freedombone-utils-postgresql index b92993c8..14e3939b 100755 --- a/src/freedombone-utils-postgresql +++ b/src/freedombone-utils-postgresql @@ -64,7 +64,7 @@ function install_postgresql { fi ${PROJECT_NAME}-pass -u root -a postgresql -p "$POSTGRESQL_PASSWORD" - apt-get -yq install postgresql postgresql-contrib postgresql-client + apt-get -yq install postgresql-9.6 postgresql-contrib-9.6 postgresql-client apt-get -yq remove --purge apache2-bin* if [ -d /etc/apache2 ]; then rm -rf /etc/apache2 From c8f826343b4c13f7b6c588b0cfea1994b7d7b2eb Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 7 Nov 2017 18:41:01 +0000 Subject: [PATCH 3/6] Restart postgresql before creating database --- src/freedombone-app-pleroma | 1 + 1 file changed, 1 insertion(+) diff --git a/src/freedombone-app-pleroma b/src/freedombone-app-pleroma index a4bbc8a2..f729d980 100755 --- a/src/freedombone-app-pleroma +++ b/src/freedombone-app-pleroma @@ -244,6 +244,7 @@ function pleroma_create_database { fi sudo -u pleroma mix local.hex --force sudo -u pleroma mix deps.compile mimerl + systemctl restart postgresql sudo -u pleroma mix ecto.create --force if [ ! "$?" = "0" ]; then run_system_query_postgresql "ALTER USER pleroma NOSUPERUSER;" From 219ad6ac45973c461be4e102f98792f91011e194 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 7 Nov 2017 18:44:33 +0000 Subject: [PATCH 4/6] Another database restart --- src/freedombone-app-pleroma | 1 + 1 file changed, 1 insertion(+) diff --git a/src/freedombone-app-pleroma b/src/freedombone-app-pleroma index f729d980..58195c84 100755 --- a/src/freedombone-app-pleroma +++ b/src/freedombone-app-pleroma @@ -199,6 +199,7 @@ function pleroma_create_database { return fi + systemctl restart postgresql add_postgresql_user pleroma "$PLEROMA_ADMIN_PASSWORD" encrypted run_system_query_postgresql "create database pleroma;" # temporarily allow the user to create databases From 3708790d827a14716e18ca8d08e330e674319502 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 7 Nov 2017 19:48:19 +0000 Subject: [PATCH 5/6] Add timeout command for not very powerful SBCs --- src/freedombone-app-pleroma | 1 + 1 file changed, 1 insertion(+) diff --git a/src/freedombone-app-pleroma b/src/freedombone-app-pleroma index 58195c84..6637ba21 100755 --- a/src/freedombone-app-pleroma +++ b/src/freedombone-app-pleroma @@ -208,6 +208,7 @@ function pleroma_create_database { run_system_query_postgresql "GRANT ALL ON ALL tables IN SCHEMA public TO pleroma;" run_system_query_postgresql "GRANT ALL ON ALL sequences IN SCHEMA public TO pleroma;" run_system_query_postgresql "CREATE EXTENSION citext;" + run_system_query_postgresql "set statement_timeout to 20000;" read_config_param "PLEROMA_SECRET_KEY" if [ ${#PLEROMA_SECRET_KEY} -lt 50 ]; then From 14f3964eae77d4a812ca15587c5a651af290afdd Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 7 Nov 2017 21:17:18 +0000 Subject: [PATCH 6/6] Secret key must be at least 64 bytes --- src/freedombone-app-pleroma | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/freedombone-app-pleroma b/src/freedombone-app-pleroma index 6637ba21..fef6e695 100755 --- a/src/freedombone-app-pleroma +++ b/src/freedombone-app-pleroma @@ -211,9 +211,9 @@ function pleroma_create_database { run_system_query_postgresql "set statement_timeout to 20000;" read_config_param "PLEROMA_SECRET_KEY" - if [ ${#PLEROMA_SECRET_KEY} -lt 50 ]; then - PLEROMA_SECRET_KEY="$(create_password 30)$(create_password 30)" - if [ ${#PLEROMA_SECRET_KEY} -lt 50 ]; then + if [ ${#PLEROMA_SECRET_KEY} -lt 64 ]; then + PLEROMA_SECRET_KEY="$(create_password 30)$(create_password 30)$(create_password 30)" + if [ ${#PLEROMA_SECRET_KEY} -lt 64 ]; then run_system_query_postgresql "ALTER USER pleroma NOSUPERUSER;" run_system_query_postgresql "ALTER USER pleroma NOCREATEDB;" echo $'Pleroma secret key not created'