From 0291dbdbf1708d9d1446a658312e9ce04aab77c2 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 21 May 2018 19:47:29 +0100 Subject: [PATCH] Extra packages --- src/freedombone-app-hackmd | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/freedombone-app-hackmd b/src/freedombone-app-hackmd index e74093b1..617b2760 100755 --- a/src/freedombone-app-hackmd +++ b/src/freedombone-app-hackmd @@ -141,6 +141,14 @@ function upgrade_hackmd { # update to the next commit set_repo_commit "/etc/hackmd" "hackmd commit" "$HACKMD_COMMIT" "$HACKMD_REPO" + + # Remove references to markdown-pdf node package, because it doesn't install on arm + cd /etc/hackmd || return + sed -i '/markdown-pdf/d' lib/response.js + sed -i '/markdownpdf/,/})/d' lib/response.js + mv yarn.lock yarn.lock.old + npm install + chown -R hackmd:hackmd "/etc/hackmd" systemctl restart hackmd } @@ -298,8 +306,11 @@ function remove_hackmd { } function hackmd_create_config { + hackmd_secret=$(create_password "30")$(create_password "30")$(create_password "30") + { echo '{'; echo ' "production": {'; + echo " \"sessionSecret\": \"$hackmd_secret\","; echo ' "domain": "localhost",'; echo ' "hsts": {'; echo ' "enable": false,'; @@ -395,7 +406,19 @@ function install_hackmd { npm install lodash npm install deep-freeze npm install winston - npm install markdown-pdf + npm install graceful-fs + npm install webpack + npm install extract-text-webpack-plugin + npm install html-webpack-plugin + npm install copy-webpack-plugin + npm install eve + npm install js-sequence-diagrams + #npm install markdown-pdf + + sed -i '/markdown-pdf/d' lib/response.js + sed -i '/markdownpdf/,/})/d' lib/response.js + + mv yarn.lock yarn.lock.old npm run build chmod g+w "/var/www/$HACKMD_DOMAIN_NAME/htdocs"