From 2a28c0c08b78a08b13975b78f38706d7b7d850e4 Mon Sep 17 00:00:00 2001 From: tremor021 Date: Tue, 24 Jun 2025 13:55:33 +0200 Subject: [PATCH 1/2] Add Caddy --- install/notesnook-install.sh | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/install/notesnook-install.sh b/install/notesnook-install.sh index cf38832e..08feb27e 100644 --- a/install/notesnook-install.sh +++ b/install/notesnook-install.sh @@ -16,9 +16,11 @@ update_os msg_info "Installing Dependencies" $STD apt-get install -y \ make \ - git + git \ + caddy msg_ok "Installed Dependencies" +LOCAL_IP=$(hostname -I | awk '{print $1}') NODE_MODULE="yarn" setup_nodejs fetch_and_deploy_gh_release "notesnook" "streetwriters/notesnook" "tarball" @@ -43,6 +45,23 @@ WorkingDirectory=/opt/notesnook ExecStart=/usr/bin/npx serve -l tcp://0.0.0.0:3000 apps/web/build Restart=on-failure +[Install] +WantedBy=multi-user.target +EOF + +cat </etc/systemd/system/caddy.service +[Unit] +Description=Caddy Service +After=network-online.target +Requires=notesnook.service + +[Service] +Type=simple +User=root +WorkingDirectory=/opt/notesnook +ExecStart=/usr/bin/caddy reverse-proxy --from https://$LOCAL_IP --to localhost:3000 +Restart=on-failure + [Install] WantedBy=multi-user.target EOF From 764d19f2af403c8665bd19463566a69121c4b6ac Mon Sep 17 00:00:00 2001 From: tremor021 Date: Tue, 24 Jun 2025 13:56:04 +0200 Subject: [PATCH 2/2] Add Caddy --- ct/notesnook.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ct/notesnook.sh b/ct/notesnook.sh index c5c1d12a..b78853b5 100644 --- a/ct/notesnook.sh +++ b/ct/notesnook.sh @@ -56,4 +56,4 @@ description msg_ok "Completed Successfully!\n" echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" echo -e "${INFO}${YW} Access it using the following URL:${CL}" -echo -e "${TAB}${GATEWAY}${BGN}https://${IP}:3000${CL}" +echo -e "${TAB}${GATEWAY}${BGN}https://${IP}${CL}"