Skip to content

Commit bedfbd2

Browse files
authored
Update wikijs-install.sh
1 parent 3c289e7 commit bedfbd2

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

install/wikijs-install.sh

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ msg_ok "Set up PostgreSQL Repository"
3737
msg_info "Installing Node.js"
3838
$STD apt-get update
3939
$STD apt-get install -y nodejs
40+
$STD npm install --global yarn
4041
msg_ok "Installed Node.js"
4142

4243
msg_info "Set up PostgreSQL"
@@ -65,7 +66,21 @@ wget -q "https://github.com/Requarks/wiki/archive/refs/tags/v${RELEASE}.tar.gz"
6566
tar -xzf "$temp_file"
6667
mv wiki-${RELEASE} /opt/wikijs
6768
mv /opt/wikijs/config.sample.yml /opt/wikijs/config.yml
68-
sed -i -E "s|(host: ).*|\1localhost|; s|(port: ).*|\15432|; s|(user: ).*|\1$DB_USER|; s|(pass: ).*|\1$DB_PASS|; s|(db: ).*|\1$DB_NAME|; s|(ssl: ).*|\1false|" /opt/wikijs/config.yml
69+
sed -i -E '
70+
/db:/,/^$/ {
71+
s|(host: ).*|\1localhost|;
72+
s|(port: ).*|\15432|;
73+
s|(user: ).*|\1'"$DB_USER"'|;
74+
s|(pass: ).*|\1'"$DB_PASS"'|;
75+
s|(db: ).*|\1'"$DB_NAME"'|;
76+
}
77+
/^ssl:/,/^$/ {
78+
s|(enabled: ).*|\1false|;
79+
}
80+
' /opt/wikijs/config.yml
81+
cd /opt/wikijs
82+
$STD yarn build
83+
$STD yarn install
6984
echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt"
7085
msg_ok "Installed Wiki.js"
7186

@@ -77,7 +92,7 @@ After=network.target
7792
7893
[Service]
7994
Type=simple
80-
ExecStart=/usr/bin/node server
95+
ExecStart=/usr/bin/yarn start
8196
Restart=always
8297
User=root
8398
Environment=NODE_ENV=production

0 commit comments

Comments
 (0)