mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-07-03 20:47:38 +00:00
Compare commits
5 Commits
pr-update-
...
refactor_t
Author | SHA1 | Date | |
---|---|---|---|
a0c2688545 | |||
b39fc207d6 | |||
ca2797adb3 | |||
e7552530ea | |||
158bf4aee9 |
@ -3,9 +3,9 @@ source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxV
|
||||
# Copyright (c) 2021-2025 tteck
|
||||
# Author: tteck (tteckster)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://triliumnext.github.io/Docs/
|
||||
# Source: https://github.com/TriliumNext/Trilium
|
||||
|
||||
APP="Trilium"
|
||||
APP="Trilium Notes"
|
||||
var_tags="${var_tags:-notes}"
|
||||
var_cpu="${var_cpu:-1}"
|
||||
var_ram="${var_ram:-512}"
|
||||
@ -27,57 +27,52 @@ function update_script() {
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
if [[ ! -f /opt/${APP}_version.txt ]]; then touch /opt/${APP}_version.txt; fi
|
||||
RELEASE=$(curl -fsSL https://api.github.com/repos/TriliumNext/Notes/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
|
||||
if [[ "v${RELEASE}" != "$(cat /opt/${APP}_version.txt 2>/dev/null)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then
|
||||
|
||||
if [[ -d /opt/trilium/db ]]; then
|
||||
DB_PATH="/opt/trilium/db"
|
||||
DB_RESTORE_PATH="/opt/trilium/db"
|
||||
elif [[ -d /opt/trilium/assets/db ]]; then
|
||||
DB_PATH="/opt/trilium/assets/db"
|
||||
DB_RESTORE_PATH="/opt/trilium/assets/db"
|
||||
RELEASE=$(curl -fsSL https://api.github.com/repos/TriliumNext/Trilium/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
|
||||
if [[ "${RELEASE}" != "$(cat ~/.Trilium 2>/dev/null)" ]] || [[ ! -f ~/.Trilium ]]; then
|
||||
|
||||
if [[ -d /opt/trilium/db ]]; then
|
||||
DB_PATH="/opt/trilium/db"
|
||||
DB_RESTORE_PATH="/opt/trilium/db"
|
||||
elif [[ -d /opt/trilium/assets/db ]]; then
|
||||
DB_PATH="/opt/trilium/assets/db"
|
||||
DB_RESTORE_PATH="/opt/trilium/assets/db"
|
||||
else
|
||||
msg_error "Database not found in either /opt/trilium/db or /opt/trilium/assets/db"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
msg_info "Stopping ${APP}"
|
||||
systemctl stop trilium
|
||||
sleep 1
|
||||
msg_ok "Stopped ${APP}"
|
||||
|
||||
msg_info "Backing up Database"
|
||||
mkdir -p /opt/trilium_backup
|
||||
cp -r "${DB_PATH}" /opt/trilium_backup/
|
||||
rm -rf /opt/trilium
|
||||
msg_ok "Backed up Database"
|
||||
|
||||
fetch_and_deploy_gh_release "Trilium" "TriliumNext/Trilium" "prebuild" "latest" "/opt/trilium" "TriliumNotes-Server-*linux-x64.tar.xz"
|
||||
|
||||
msg_info "Restoring Database"
|
||||
mkdir -p "$(dirname "${DB_RESTORE_PATH}")"
|
||||
cp -r /opt/trilium_backup/$(basename "${DB_PATH}") "${DB_RESTORE_PATH}"
|
||||
msg_ok "Restored Database"
|
||||
|
||||
msg_info "Cleaning up"
|
||||
rm -rf /opt/trilium_backup
|
||||
msg_ok "Cleaned"
|
||||
|
||||
msg_info "Starting ${APP}"
|
||||
systemctl start trilium
|
||||
sleep 1
|
||||
msg_ok "Started ${APP}"
|
||||
msg_ok "Updated Successfully"
|
||||
else
|
||||
msg_error "Database not found in either /opt/trilium/db or /opt/trilium/assets/db"
|
||||
exit 1
|
||||
msg_ok "No update required. ${APP} is already at ${RELEASE}"
|
||||
fi
|
||||
|
||||
msg_info "Stopping ${APP}"
|
||||
systemctl stop trilium
|
||||
sleep 1
|
||||
msg_ok "Stopped ${APP}"
|
||||
|
||||
msg_info "Updating to ${RELEASE}"
|
||||
mkdir -p /opt/trilium_backup
|
||||
cp -r "${DB_PATH}" /opt/trilium_backup/
|
||||
rm -rf /opt/trilium
|
||||
cd /tmp
|
||||
curl -fsSL "https://github.com/TriliumNext/trilium/releases/download/v${RELEASE}/TriliumNextNotes-Server-v${RELEASE}-linux-x64.tar.xz" -o "TriliumNextNotes-Server-v${RELEASE}-linux-x64.tar.xz"
|
||||
tar -xf "TriliumNextNotes-Server-v${RELEASE}-linux-x64.tar.xz"
|
||||
mv "TriliumNextNotes-Server-${RELEASE}-linux-x64" /opt/trilium
|
||||
|
||||
# Restore database
|
||||
mkdir -p "$(dirname "${DB_RESTORE_PATH}")"
|
||||
cp -r /opt/trilium_backup/$(basename "${DB_PATH}") "${DB_RESTORE_PATH}"
|
||||
|
||||
echo "v${RELEASE}" >/opt/${APP}_version.txt
|
||||
msg_ok "Updated to ${RELEASE}"
|
||||
|
||||
msg_info "Cleaning up"
|
||||
rm -rf "/tmp/TriliumNextNotes-Server-${RELEASE}-linux-x64.tar.xz"
|
||||
rm -rf /opt/trilium_backup
|
||||
msg_ok "Cleaned"
|
||||
|
||||
msg_info "Starting ${APP}"
|
||||
systemctl start trilium
|
||||
sleep 1
|
||||
msg_ok "Started ${APP}"
|
||||
msg_ok "Updated Successfully"
|
||||
else
|
||||
msg_ok "No update required. ${APP} is already at ${RELEASE}"
|
||||
fi
|
||||
|
||||
exit
|
||||
exit
|
||||
}
|
||||
|
||||
start
|
||||
|
8
frontend/public/json/trilium.json
generated
8
frontend/public/json/trilium.json
generated
@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "TriliumNext",
|
||||
"name": "Trilium Notes",
|
||||
"slug": "trilium",
|
||||
"categories": [
|
||||
12
|
||||
@ -9,11 +9,11 @@
|
||||
"updateable": true,
|
||||
"privileged": false,
|
||||
"interface_port": 8080,
|
||||
"documentation": "https://triliumnext.github.io/Docs/",
|
||||
"documentation": "https://github.com/TriliumNext/trilium/wiki",
|
||||
"website": "https://github.com/TriliumNext/trilium",
|
||||
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/webp/triliumnext.webp",
|
||||
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/webp/trilium-notes.webp",
|
||||
"config_path": "/root/trilium-data/config.ini",
|
||||
"description": "TriliumNext is an newer Fork of Trilium. TriliumNext is an open-source note-taking and personal knowledge management application. It allows users to organize and manage their notes, ideas, and information in a single place, using a hierarchical tree-like structure. Trilium offers a range of features, including rich text formatting, links, images, and attachments, making it easy to create and structure notes. The software is designed to be flexible and customizable, with a range of customization options and plugins available, including themes, export options, and more. Trilium is a self-hosted solution, and can be run on a local machine or a cloud-based server, providing users with full control over their notes and information.",
|
||||
"description": "Trilium Notes is the latest and officially maintained version of the powerful, self-hosted note-taking and personal knowledge management application. It enables users to organize information in a hierarchical tree structure and supports rich text editing, internal linking, images, attachments, and powerful scripting capabilities. This version reflects the most current development efforts under the TriliumNext organization and replaces all prior forks or legacy variants. Trilium is ideal for building personal wikis, structured documentation, and long-term knowledge archives, giving users full local control and privacy.",
|
||||
"install_methods": [
|
||||
{
|
||||
"type": "default",
|
||||
|
@ -3,7 +3,7 @@
|
||||
# Copyright (c) 2021-2025 tteck
|
||||
# Author: tteck (tteckster)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://triliumnext.github.io/Docs/
|
||||
# Source: https://github.com/TriliumNext/Trilium
|
||||
|
||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||
color
|
||||
@ -13,14 +13,7 @@ setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
msg_info "Setup TriliumNext"
|
||||
cd /opt
|
||||
RELEASE=$(curl -fsSL https://api.github.com/repos/TriliumNext/trilium/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
|
||||
curl -fsSL "https://github.com/TriliumNext/trilium/releases/download/v${RELEASE}/TriliumNextNotes-Server-v${RELEASE}-linux-x64.tar.xz" -o "TriliumNextNotes-Server-v${RELEASE}-linux-x64.tar.xz"
|
||||
tar -xf TriliumNextNotes-Server-v${RELEASE}-linux-x64.tar.xz
|
||||
mv TriliumNextNotes-Server-$RELEASE-linux-x64 /opt/trilium
|
||||
echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt"
|
||||
msg_ok "Setup TriliumNext"
|
||||
fetch_and_deploy_gh_release "Trilium" "TriliumNext/Trilium" "prebuild" "latest" "/opt/trilium" "TriliumNotes-Server-*linux-x64.tar.xz"
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<EOF >/etc/systemd/system/trilium.service
|
||||
@ -46,7 +39,6 @@ motd_ssh
|
||||
customize
|
||||
|
||||
msg_info "Cleaning up"
|
||||
rm -rf /opt/TriliumNextNotes-Server-${RELEASE}-linux-x64.tar.xz
|
||||
$STD apt-get -y autoremove
|
||||
$STD apt-get -y autoclean
|
||||
msg_ok "Cleaned"
|
||||
|
Reference in New Issue
Block a user