Update Notesnook
This commit is contained in:
parent
0da431294f
commit
a63e8e58f3
@ -20,8 +20,7 @@ $STD apt-get install -y \
|
|||||||
caddy
|
caddy
|
||||||
msg_ok "Installed Dependencies"
|
msg_ok "Installed Dependencies"
|
||||||
|
|
||||||
LOCAL_IP=$(hostname -I | awk '{print $1}')
|
NODE_VERSION="22" setup_nodejs
|
||||||
NODE_MODULE="yarn" setup_nodejs
|
|
||||||
fetch_and_deploy_gh_release "notesnook" "streetwriters/notesnook" "tarball"
|
fetch_and_deploy_gh_release "notesnook" "streetwriters/notesnook" "tarball"
|
||||||
|
|
||||||
msg_info "Configuring Notesnook (Patience)"
|
msg_info "Configuring Notesnook (Patience)"
|
||||||
@ -31,6 +30,19 @@ $STD npm install
|
|||||||
$STD npm run build:web
|
$STD npm run build:web
|
||||||
msg_ok "Configured Notesnook"
|
msg_ok "Configured Notesnook"
|
||||||
|
|
||||||
|
msg_info "Configuring Caddy"
|
||||||
|
LOCAL_IP=$(hostname -I | awk '{print $1}')
|
||||||
|
cat <<EOF >/etc/caddy/Caddyfile
|
||||||
|
{
|
||||||
|
email admin@example.com
|
||||||
|
}
|
||||||
|
|
||||||
|
${LOCAL_IP} {
|
||||||
|
reverse_proxy 127.0.0.1:3000
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
msg_ok "Configured Caddy"
|
||||||
|
|
||||||
msg_info "Creating Service"
|
msg_info "Creating Service"
|
||||||
cat <<EOF >/etc/systemd/system/notesnook.service
|
cat <<EOF >/etc/systemd/system/notesnook.service
|
||||||
[Unit]
|
[Unit]
|
||||||
@ -41,16 +53,13 @@ After=network-online.target
|
|||||||
Type=simple
|
Type=simple
|
||||||
User=root
|
User=root
|
||||||
WorkingDirectory=/opt/notesnook
|
WorkingDirectory=/opt/notesnook
|
||||||
ExecStart=/usr/bin/npx serve -l tcp://0.0.0.0:3000 apps/web/build
|
ExecStart=/usr/bin/npx serve apps/web/build
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
EOF
|
EOF
|
||||||
sed -i "s|^ExecStart=.*|ExecStart=/usr/bin/caddy reverse-proxy --from https://$LOCAL_IP --to localhost:3000|" /lib/systemd/system/caddy.service
|
systemctl reload caddy
|
||||||
sed -i "/^ExecReload=/d" /lib/systemd/system/caddy.service
|
|
||||||
systemctl daemon-reload
|
|
||||||
systemctl restart caddy
|
|
||||||
systemctl enable -q --now notesnook
|
systemctl enable -q --now notesnook
|
||||||
msg_ok "Created Service"
|
msg_ok "Created Service"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user