Compare commits

..

1 Commits

Author SHA1 Message Date
3745711cd9 Update pulse.sh 2025-07-07 20:36:54 +02:00
5 changed files with 39 additions and 27 deletions

View File

@ -14,9 +14,7 @@ Exercise vigilance regarding copycat or coat-tailing sites that seek to exploit
### 🚀 Updated Scripts ### 🚀 Updated Scripts
- Fix unbound var in pulse.sh [@michelroegl-brunner](https://github.com/michelroegl-brunner) ([#5807](https://github.com/community-scripts/ProxmoxVE/pull/5807)) - Fix/stirling pdf script [@JcMinarro](https://github.com/JcMinarro) ([#5803](https://github.com/community-scripts/ProxmoxVE/pull/5803))
- Refactor: Docmost [@tremor021](https://github.com/tremor021) ([#5806](https://github.com/community-scripts/ProxmoxVE/pull/5806))
- Fix/stirling pdf script [@JcMinarro](https://github.com/JcMinarro) ([#5803](https://github.com/community-scripts/ProxmoxVE/pull/5803))
- gitea-mirror: update repo-url [@CrazyWolf13](https://github.com/CrazyWolf13) ([#5794](https://github.com/community-scripts/ProxmoxVE/pull/5794)) - gitea-mirror: update repo-url [@CrazyWolf13](https://github.com/CrazyWolf13) ([#5794](https://github.com/community-scripts/ProxmoxVE/pull/5794))
- #### 🐞 Bug Fixes - #### 🐞 Bug Fixes

View File

@ -27,35 +27,48 @@ function update_script() {
exit exit
fi fi
if ! command -v node >/dev/null || [[ "$(/usr/bin/env node -v | grep -oP '^v\K[0-9]+')" != "22" ]]; then if ! command -v node >/dev/null || [[ "$(/usr/bin/env node -v | grep -oP '^v\K[0-9]+')" != "22" ]]; then
NODE_VERSION="22" NODE_MODULE="pnpm@$(curl -s https://raw.githubusercontent.com/docmost/docmost/main/package.json | jq -r '.packageManager | split("@")[1]')" setup_nodejs msg_info "Installing Node.js 22"
$STD apt-get purge -y nodejs
rm -f /etc/apt/sources.list.d/nodesource.list
rm -f /etc/apt/keyrings/nodesource.gpg
mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_22.x nodistro main" >/etc/apt/sources.list.d/nodesource.list
$STD apt-get update
$STD apt-get install -y nodejs
$STD npm install -g pnpm@10.4.0
msg_ok "Node.js 22 installed"
fi fi
export NODE_OPTIONS="--max_old_space_size=4096" export NODE_OPTIONS="--max_old_space_size=4096"
RELEASE=$(curl -fsSL https://api.github.com/repos/docmost/docmost/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') RELEASE=$(curl -fsSL https://api.github.com/repos/docmost/docmost/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
if [[ "${RELEASE}" != "$(cat ~/.docmost 2>/dev/null)" ]] || [[ ! -f ~/.docmost ]]; then if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
msg_info "Stopping ${APP}" msg_info "Stopping ${APP}"
systemctl stop docmost systemctl stop docmost
msg_ok "${APP} Stopped" msg_ok "${APP} Stopped"
msg_info "Backing up data" msg_info "Updating ${APP} to v${RELEASE}"
cp /opt/docmost/.env /opt/ cp /opt/docmost/.env /opt/
cp -r /opt/docmost/data /opt/ cp -r /opt/docmost/data /opt/
rm -rf /opt/docmost rm -rf /opt/docmost
msg_ok "Data backed up" temp_file=$(mktemp)
curl -fsSL "https://github.com/docmost/docmost/archive/refs/tags/v${RELEASE}.tar.gz" -o "$temp_file"
fetch_and_deploy_gh_release "docmost" "docmost/docmost" tar -xzf "$temp_file"
mv docmost-${RELEASE} /opt/docmost
msg_info "Updating ${APP} to v${RELEASE}"
cd /opt/docmost cd /opt/docmost
mv /opt/.env /opt/docmost/.env mv /opt/.env /opt/docmost/.env
mv /opt/data /opt/docmost/data mv /opt/data /opt/docmost/data
$STD pnpm install --force $STD pnpm install --force
$STD pnpm build $STD pnpm build
echo "${RELEASE}" >/opt/${APP}_version.txt
msg_ok "Updated ${APP}" msg_ok "Updated ${APP}"
msg_info "Starting ${APP}" msg_info "Starting ${APP}"
systemctl start docmost systemctl start docmost
msg_ok "Started ${APP}" msg_ok "Started ${APP}"
msg_info "Cleaning Up"
rm -f ${temp_file}
msg_ok "Cleaned"
msg_ok "Updated Successfully" msg_ok "Updated Successfully"
else else
msg_ok "No update required. ${APP} is already at ${RELEASE}" msg_ok "No update required. ${APP} is already at ${RELEASE}"

View File

@ -31,10 +31,5 @@
"username": null, "username": null,
"password": null "password": null
}, },
"notes": [ "notes": []
{
"text": "Use `cat ~/docmost.creds` to see database credentials.",
"type": "info"
}
]
} }

View File

@ -24,13 +24,13 @@ RELEASE=$(curl -s https://api.github.com/repos/steveiliop56/tinyauth/releases/la
curl -fsSL "https://github.com/steveiliop56/tinyauth/releases/download/v${RELEASE}/tinyauth-amd64" -o /opt/tinyauth/tinyauth curl -fsSL "https://github.com/steveiliop56/tinyauth/releases/download/v${RELEASE}/tinyauth-amd64" -o /opt/tinyauth/tinyauth
chmod +x /opt/tinyauth/tinyauth chmod +x /opt/tinyauth/tinyauth
PASS=$(openssl rand -base64 8 | tr -dc 'a-zA-Z0-9' | head -c 8) PASSWORD=$(openssl rand -base64 8 | tr -dc 'a-zA-Z0-9' | head -c 8)
USER=$(htpasswd -Bbn "tinyauth" "${PASS}") USER=$(htpasswd -Bbn "tinyauth" "${PASSWORD}")
cat <<EOF >/opt/tinyauth/credentials.txt cat <<EOF > /opt/tinyauth/credentials.txt
Tinyauth Credentials Tinyauth Credentials
Username: tinyauth Username: tinyauth
Password: ${PASS} Password: ${PASSWORD}
EOF EOF
echo "${RELEASE}" >/opt/tinyauth_version.txt echo "${RELEASE}" >/opt/tinyauth_version.txt
@ -82,9 +82,9 @@ chmod +x /etc/init.d/tinyauth
$STD rc-update add tinyauth default $STD rc-update add tinyauth default
msg_ok "Enabled Tinyauth Service" msg_ok "Enabled Tinyauth Service"
motd_ssh
customize
msg_info "Starting Tinyauth" msg_info "Starting Tinyauth"
$STD service tinyauth start $STD service tinyauth start
msg_ok "Started Tinyauth" msg_ok "Started Tinyauth"
motd_ssh
customize

View File

@ -22,7 +22,6 @@ msg_ok "Installed Dependencies"
NODE_VERSION="22" NODE_MODULE="pnpm@$(curl -s https://raw.githubusercontent.com/docmost/docmost/main/package.json | jq -r '.packageManager | split("@")[1]')" setup_nodejs NODE_VERSION="22" NODE_MODULE="pnpm@$(curl -s https://raw.githubusercontent.com/docmost/docmost/main/package.json | jq -r '.packageManager | split("@")[1]')" setup_nodejs
PG_VERSION="16" setup_postgresql PG_VERSION="16" setup_postgresql
fetch_and_deploy_gh_release "docmost" "docmost/docmost"
msg_info "Setting up PostgreSQL" msg_info "Setting up PostgreSQL"
DB_NAME="docmost_db" DB_NAME="docmost_db"
@ -41,7 +40,12 @@ $STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET timezone TO 'UTC'"
} >>~/docmost.creds } >>~/docmost.creds
msg_ok "Set up PostgreSQL" msg_ok "Set up PostgreSQL"
msg_info "Configuring Docmost (Patience)" msg_info "Installing Docmost (Patience)"
temp_file=$(mktemp)
RELEASE=$(curl -fsSL https://api.github.com/repos/docmost/docmost/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
curl -fsSL "https://github.com/docmost/docmost/archive/refs/tags/v${RELEASE}.tar.gz" -o ""$temp_file""
tar -xzf "$temp_file"
mv docmost-${RELEASE} /opt/docmost
cd /opt/docmost cd /opt/docmost
mv .env.example .env mv .env.example .env
mkdir data mkdir data
@ -52,7 +56,8 @@ sed -i -e "s|APP_SECRET=.*|APP_SECRET=$(openssl rand -base64 32 | tr -dc 'a-zA-Z
export NODE_OPTIONS="--max-old-space-size=2048" export NODE_OPTIONS="--max-old-space-size=2048"
$STD pnpm install $STD pnpm install
$STD pnpm build $STD pnpm build
msg_ok "Configured Docmost" echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt"
msg_ok "Installed Docmost"
msg_info "Creating Service" msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/docmost.service cat <<EOF >/etc/systemd/system/docmost.service
@ -76,6 +81,7 @@ motd_ssh
customize customize
msg_info "Cleaning up" msg_info "Cleaning up"
rm -f "$temp_file"
$STD apt-get -y autoremove $STD apt-get -y autoremove
$STD apt-get -y autoclean $STD apt-get -y autoclean
msg_ok "Cleaned" msg_ok "Cleaned"