@@ -15,10 +15,10 @@ update_os
1515
1616msg_info " Installing Dependencies"
1717$STD apt-get install -y \
18- gnupg \
19- mkcert \
20- git \
21- redis
18+ gnupg \
19+ mkcert \
20+ git \
21+ redis
2222msg_ok " Installed Dependencies"
2323
2424msg_info " Setting up Node.js Repository"
@@ -43,7 +43,6 @@ $STD apt-get install -y postgresql-16
4343DB_NAME=" outline"
4444DB_USER=" outline"
4545DB_PASS=" $( openssl rand -base64 18 | tr -dc ' a-zA-Z0-9' | cut -c1-13) "
46- SECRET_KEY=" $( openssl rand -hex 32) "
4746$STD sudo -u postgres psql -c " CREATE ROLE $DB_USER WITH LOGIN PASSWORD '$DB_PASS ';"
4847$STD sudo -u postgres psql -c " CREATE DATABASE $DB_NAME WITH OWNER $DB_USER ENCODING 'UTF8' TEMPLATE template0;"
4948$STD sudo -u postgres psql -c " ALTER ROLE $DB_USER SET client_encoding TO 'utf8';"
@@ -52,6 +51,7 @@ $STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET timezone TO 'UTC';"
5251msg_ok " Set up PostgreSQL"
5352
5453msg_info " Setup Outline (Patience)"
54+ SECRET_KEY=" $( openssl rand -hex 32) "
5555temp_file=$( mktemp)
5656LOCAL_IP=" $( hostname -I | awk ' {print $1}' ) "
5757RELEASE=$( curl -fsSL https://api.github.com/repos/outline/outline/releases/latest | grep " tag_name" | awk ' {print substr($2, 3, length($2)-4) }' )
@@ -60,6 +60,7 @@ tar zxf $temp_file
6060mv outline-${RELEASE} /opt/outline
6161cd /opt/outline
6262cp .env.sample .env
63+ export NODE_ENV=development
6364sed -i ' s/NODE_ENV=production/NODE_ENV=development/g' /opt/outline/.env
6465sed -i " s/generate_a_new_key/${SECRET_KEY} /g" /opt/outline/.env
6566sed -i " s/user:pass@postgres/${DB_USER} :${DB_PASS} @localhost/g" /opt/outline/.env
@@ -70,6 +71,7 @@ $STD yarn install --frozen-lockfile
7071export NODE_OPTIONS=" --max-old-space-size=3584"
7172$STD yarn build
7273sed -i ' s/NODE_ENV=development/NODE_ENV=production/g' /opt/outline/.env
74+ export NODE_ENV=production
7375echo " ${RELEASE} " > " /opt/${APPLICATION} _version.txt"
7476msg_ok " Setup Outline"
7577
@@ -83,7 +85,7 @@ After=network.target
8385Type=simple
8486User=root
8587WorkingDirectory=/opt/outline
86- ExecStart=/usr/bin/node ./build/server/index.js
88+ ExecStart=/usr/bin/yarn start
8789Restart=always
8890EnvironmentFile=/opt/outline/.env
8991
0 commit comments