2024-10-30 15:25:02 +01:00
|
|
|
#!/usr/bin/env bash
|
2025-04-01 10:25:46 +02:00
|
|
|
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
|
2025-01-01 13:37:29 +01:00
|
|
|
# Copyright (c) 2021-2025 tteck
|
2024-12-16 12:42:51 +01:00
|
|
|
# Author: MickLesk (Canbiz)
|
|
|
|
|
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
|
|
|
|
# Source: https://www.usememos.com/
|
2024-10-30 15:25:02 +01:00
|
|
|
|
|
|
|
|
APP="Memos"
|
2025-04-10 11:56:52 +02:00
|
|
|
var_tags="${var_tags:-notes}"
|
|
|
|
|
var_cpu="${var_cpu:-2}"
|
|
|
|
|
var_ram="${var_ram:-3072}"
|
|
|
|
|
var_disk="${var_disk:-7}"
|
|
|
|
|
var_os="${var_os:-debian}"
|
|
|
|
|
var_version="${var_version:-12}"
|
|
|
|
|
var_unprivileged="${var_unprivileged:-1}"
|
2024-12-16 12:42:51 +01:00
|
|
|
|
|
|
|
|
header_info "$APP"
|
2024-10-30 15:25:02 +01:00
|
|
|
variables
|
|
|
|
|
color
|
|
|
|
|
catch_errors
|
|
|
|
|
|
|
|
|
|
function update_script() {
|
2024-12-16 12:42:51 +01:00
|
|
|
header_info
|
|
|
|
|
check_container_storage
|
|
|
|
|
check_container_resources
|
|
|
|
|
if [[ ! -d /opt/memos ]]; then
|
|
|
|
|
msg_error "No ${APP} Installation Found!"
|
|
|
|
|
exit
|
|
|
|
|
fi
|
|
|
|
|
msg_info "Updating $APP (Patience)"
|
|
|
|
|
cd /opt/memos
|
2025-01-03 19:18:04 +01:00
|
|
|
git reset --hard HEAD
|
2024-12-16 12:42:51 +01:00
|
|
|
output=$(git pull --no-rebase)
|
|
|
|
|
if echo "$output" | grep -q "Already up to date."; then
|
|
|
|
|
msg_ok "$APP is already up to date."
|
|
|
|
|
exit
|
|
|
|
|
fi
|
|
|
|
|
systemctl stop memos
|
2025-03-14 18:50:27 +01:00
|
|
|
export NODE_OPTIONS="--max-old-space-size=2048"
|
2024-12-16 12:42:51 +01:00
|
|
|
cd /opt/memos/web
|
2025-02-24 12:49:16 +01:00
|
|
|
$STD pnpm i --frozen-lockfile
|
|
|
|
|
$STD pnpm build
|
2024-12-16 12:42:51 +01:00
|
|
|
cd /opt/memos
|
|
|
|
|
mkdir -p /opt/memos/server/dist
|
|
|
|
|
cp -r web/dist/* /opt/memos/server/dist/
|
|
|
|
|
cp -r web/dist/* /opt/memos/server/router/frontend/dist/
|
2025-02-24 12:49:16 +01:00
|
|
|
$STD go build -o /opt/memos/memos -tags=embed bin/memos/main.go
|
2024-12-16 12:42:51 +01:00
|
|
|
systemctl start memos
|
|
|
|
|
msg_ok "Updated $APP"
|
2024-10-30 15:25:02 +01:00
|
|
|
exit
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
start
|
|
|
|
|
build_container
|
|
|
|
|
description
|
|
|
|
|
|
|
|
|
|
msg_ok "Completed Successfully!\n"
|
2024-12-16 12:42:51 +01:00
|
|
|
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
|
|
|
|
|
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
|
2025-04-01 10:25:46 +02:00
|
|
|
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:9030${CL}"
|