diff --git a/deployment/bare_metal/.env.dist b/deployment/bare_metal/.env.dist index 8528b4df7..722a72c88 100644 --- a/deployment/bare_metal/.env.dist +++ b/deployment/bare_metal/.env.dist @@ -50,7 +50,7 @@ DEPLOY_SEED_DATA=false # test email # if true all email will be send to EMAIL_TEST_RECEIVER instead of email address of user EMAIL_TEST_MODUS=false -EMAIL_TEST_RECEIVER=test_team@gddhost.tld +EMAIL_TEST_RECEIVER=test_team@gradido.net # webhook for auto update on github repository changes WEBHOOK_GITHUB_BRANCH=master @@ -103,6 +103,7 @@ META_AUTHOR="Bernd Hückstädt - Gradido-Akademie" # externe gradido services GDT_ACTIVE=false +GDT_API_URL=https://gdt.gradido.net # DLT-Connector (still in develop) # verify transaction additional via gradido blockchain diff --git a/deployment/bare_metal/install-missing-deps.sh b/deployment/bare_metal/install-missing-deps.sh index 1eb2d616e..9b513c026 100644 --- a/deployment/bare_metal/install-missing-deps.sh +++ b/deployment/bare_metal/install-missing-deps.sh @@ -1,10 +1,11 @@ #!/bin/bash +# source profile so PATH/NVM/BUN werden gesetzt (safe for non-login) +if [ -f /home/gradido/.profile ]; then + . /home/gradido/.profile +fi # Ensure required tools are installed -# make sure correct node version is installed -export NVM_DIR="$HOME/.nvm" -[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" if ! command -v nvm > /dev/null then echo "'nvm' is missing, will be installed now!" @@ -14,7 +15,7 @@ install_nvm() { nvm install nvm use nvm alias default - npm i -g yarn pm2 + npm i -g pm2 turbo pm2 startup } nvm use || install_nvm @@ -52,7 +53,7 @@ fi if ! command -v turbo > /dev/null then echo "'turbo' is missing, will be installed now!" - bun install --global turbo + npm i -g turbo fi # rust and grass diff --git a/deployment/bare_metal/start.sh b/deployment/bare_metal/start.sh index 4ba2229bb..dc237bc4b 100755 --- a/deployment/bare_metal/start.sh +++ b/deployment/bare_metal/start.sh @@ -2,6 +2,11 @@ # stop if something fails set -euo pipefail +# source profile so PATH/NVM/BUN werden gesetzt (safe for non-login) +if [ -f /home/gradido/.profile ]; then + . /home/gradido/.profile +fi + # check for parameter FAST_MODE=false POSITIONAL_ARGS=() diff --git a/deployment/hetzner_cloud/install.sh b/deployment/hetzner_cloud/install.sh index 71b4c1bbb..fd0996c19 100755 --- a/deployment/hetzner_cloud/install.sh +++ b/deployment/hetzner_cloud/install.sh @@ -210,11 +210,17 @@ sudo systemctl daemon-reload # setup https with certbot certbot certonly --nginx --non-interactive --agree-tos --domains $COMMUNITY_HOST --email $COMMUNITY_SUPPORT_MAIL +export NVM_DIR="/home/gradido/.nvm" +BUN_VERSION_FILE="$PROJECT_ROOT/.bun-version" +if [ ! -f "$BUN_VERSION_FILE" ]; then + echo ".bun-version file not found at: $BUN_VERSION_FILE" + exit 1 +fi +export BUN_VERSION="$(cat "$BUN_VERSION_FILE" | tr -d '[:space:]')" +export BUN_INSTALL="/home/gradido/.bun" + # run as gradido user (until EOF) -sudo -u gradido bash <<'EOF' - export NVM_DIR="/home/gradido/.nvm" - NODE_VERSION="v18.20.7" - export NVM_DIR +sudo -u gradido bash </dev/null 2>&1; then - nvm install $NODE_VERSION + if ! nvm ls >/dev/null 2>&1; then + nvm install fi - - BUN_VERSION_FILE="$PROJECT_ROOT/.bun-version" - if [ ! -f "$BUN_VERSION_FILE" ]; then - echo ".bun-version file not found at: $BUN_VERSION_FILE" - exit 1 - fi - BUN_VERSION="$(cat "$BUN_VERSION_FILE" | tr -d '[:space:]')" - echo "'bun' v$BUN_VERSION will be installed now!" - curl -fsSL https://bun.com/install | bash -s "bun-v${BUN_VERSION}" - - # Load bun - export BUN_INSTALL="$HOME/.bun" - export PATH="$BUN_INSTALL/bin:$PATH" - # Install pm2 and turbo - bun add -g pm2 turbo + npm i -g pm2 turbo + + echo "'bun' v$BUN_VERSION will be installed now!" + curl -fsSL https://bun.com/install | bash -s "bun-v${BUN_VERSION}" EOF + # Load bun -export BUN_INSTALL="$HOME/.bun" +export BUN_INSTALL="/home/gradido/.bun" export PATH="$BUN_INSTALL/bin:$PATH" # Load nvm @@ -302,5 +298,4 @@ chown -R gradido:gradido $PROJECT_ROOT sudo -u gradido crontab < $LOCAL_SCRIPT_DIR/crontabs.txt # Start gradido -# Note: on first startup some errors will occur - nothing serious sudo -u gradido $SCRIPT_PATH/start.sh $1 \ No newline at end of file