Compare commits

..

10 Commits

Author SHA1 Message Date
tteckster e2e4784136
Update tianji.sh
no update path available
2024-10-19 13:51:56 -04:00
tteckster e995fb4f30
Update tianji-install.sh
tweak
2024-10-19 13:49:36 -04:00
tteckster dd3a32986a
Update cockpit-install.sh
tweak
2024-10-19 11:19:13 -04:00
tteckster 7d26b42163
Update cockpit-install.sh
tweak
2024-10-19 11:10:43 -04:00
tteckster ec24441a2a
Update cockpit-install.sh
test
2024-10-19 11:02:23 -04:00
tteckster f3408ed4f3
Update cockpit.sh
increase resources
2024-10-19 10:36:23 -04:00
tteckster efd6d74edb
Update cockpit-install.sh
tweak
2024-10-19 10:34:53 -04:00
tteckster dbc4ce0231
Update cockpit-install.sh
use backports
2024-10-19 10:25:42 -04:00
tteckster e643fe6699
Update trilium-install.sh
fix release path
2024-10-19 08:55:49 -04:00
tteckster fe9736fd38
Update trilium.sh
- fix release path changes
- fixes https://github.com/tteck/Proxmox/issues/3930
2024-10-19 08:52:08 -04:00
6 changed files with 20 additions and 42 deletions

View File

@ -20,9 +20,9 @@ EOF
header_info header_info
echo -e "Loading..." echo -e "Loading..."
APP="Cockpit" APP="Cockpit"
var_disk="2" var_disk="4"
var_cpu="1" var_cpu="2"
var_ram="512" var_ram="1024"
var_os="debian" var_os="debian"
var_version="12" var_version="12"
variables variables

View File

@ -55,32 +55,7 @@ function default_settings() {
function update_script() { function update_script() {
header_info header_info
if [[ ! -d /opt/tianji ]]; then msg_error "No ${APP} Installation Found!"; exit; fi if [[ ! -d /opt/tianji ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
if (( $(df /boot | awk 'NR==2{gsub("%","",$5); print $5}') > 80 )); then msg_error "There is currently no update path available."
read -r -p "Warning: Storage is dangerously low, continue anyway? <y/N> " prompt
[[ ${prompt,,} =~ ^(y|yes)$ ]] || exit
fi
RELEASE=$(curl -s https://api.github.com/repos/msgbyte/tianji/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
msg_info "Stopping ${APP} Service"
systemctl stop tianji
msg_ok "Stopped ${APP} Service"
msg_info "Updating ${APP} to ${RELEASE}"
cd /opt/tianji
git checkout -f -q v${RELEASE}
cd src/server
pnpm db:migrate:apply >/dev/null 2>&1
echo "${RELEASE}" >/opt/${APP}_version.txt
msg_ok "Updated ${APP} to ${RELEASE}"
msg_info "Starting ${APP}"
systemctl start tianji
msg_ok "Started ${APP}"
msg_ok "Updated Successfully"
else
msg_ok "No update required. ${APP} is already at ${RELEASE}."
fi
exit exit
} }

View File

@ -55,21 +55,21 @@ function default_settings() {
function update_script() { function update_script() {
header_info header_info
if [[ ! -d /opt/trilium ]]; then msg_error "No ${APP} Installation Found!"; exit; fi if [[ ! -d /opt/trilium ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
RELEASE=$(curl -s https://api.github.com/repos/TriliumNext/Notes/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') RELEASE=$(curl -s https://api.github.com/repos/TriliumNext/Notes/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
msg_info "Stopping ${APP}" msg_info "Stopping ${APP}"
systemctl stop trilium.service systemctl stop trilium.service
sleep 1 sleep 1
msg_ok "Stopped ${APP}" msg_ok "Stopped ${APP}"
msg_info "Updating to v${RELEASE}" msg_info "Updating to ${RELEASE}"
wget -q https://github.com/TriliumNext/Notes/releases/download/v$RELEASE/trilium-linux-x64-server-$RELEASE.tar.xz wget -q https://github.com/TriliumNext/Notes/releases/download/${RELEASE}/TriliumNextNotes-${RELEASE}-server-linux-x64.tar.xz
tar -xvf trilium-linux-x64-server-$RELEASE.tar.xz &>/dev/null tar -xf TriliumNextNotes-${RELEASE}-server-linux-x64.tar.xz
cp -r trilium-linux-x64-server/* /opt/trilium/ cp -r trilium-linux-x64-server/* /opt/trilium/
msg_ok "Updated to v${RELEASE}" msg_ok "Updated to ${RELEASE}"
msg_info "Cleaning up" msg_info "Cleaning up"
rm -rf trilium-linux-x64-server-$RELEASE.tar.xz trilium-linux-x64-server rm -rf TriliumNextNotes-${RELEASE}-server-linux-x64.tar.xz trilium-linux-x64-server
msg_ok "Cleaned" msg_ok "Cleaned"
msg_info "Starting ${APP}" msg_info "Starting ${APP}"

View File

@ -22,7 +22,10 @@ $STD apt-get install -y mc
msg_ok "Installed Dependencies" msg_ok "Installed Dependencies"
msg_info "Installing Cockpit" msg_info "Installing Cockpit"
$STD apt install -y cockpit --no-install-recommends source /etc/os-release
echo "deb http://deb.debian.org/debian ${VERSION_CODENAME}-backports main" >/etc/apt/sources.list.d/backports.list
$STD apt-get update
$STD apt-get install -t ${VERSION_CODENAME}-backports cockpit --no-install-recommends -y
sed -i "s/root//g" /etc/cockpit/disallowed-users sed -i "s/root//g" /etc/cockpit/disallowed-users
msg_ok "Installed Cockpit" msg_ok "Installed Cockpit"

View File

@ -31,7 +31,7 @@ $STD apt-get install -y \
mc mc
msg_ok "Installed Dependencies" msg_ok "Installed Dependencies"
msg_info "Installing Node.js, pnpm & pm2" msg_info "Installing Node.js"
mkdir -p /etc/apt/keyrings mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg 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_20.x nodistro main" >/etc/apt/sources.list.d/nodesource.list echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" >/etc/apt/sources.list.d/nodesource.list
@ -39,7 +39,7 @@ $STD apt-get update
$STD apt-get install -y nodejs $STD apt-get install -y nodejs
$STD npm install -g pnpm@9.7.1 $STD npm install -g pnpm@9.7.1
export NODE_OPTIONS="--max_old_space_size=4096" export NODE_OPTIONS="--max_old_space_size=4096"
msg_ok "Installed Node.js, pnpm & pm2" msg_ok "Installed Node.js"
msg_info "Setting up PostgreSQL" msg_info "Setting up PostgreSQL"
DB_NAME=tianji_db DB_NAME=tianji_db

View File

@ -19,11 +19,11 @@ $STD apt-get install -y sudo
$STD apt-get install -y mc $STD apt-get install -y mc
msg_ok "Installed Dependencies" msg_ok "Installed Dependencies"
RELEASE=$(curl -s https://api.github.com/repos/TriliumNext/Notes/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') RELEASE=$(curl -s https://api.github.com/repos/TriliumNext/Notes/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
msg_info "Installing TriliumNext" msg_info "Installing TriliumNext"
wget -q https://github.com/TriliumNext/Notes/releases/download/v$RELEASE/trilium-linux-x64-server-$RELEASE.tar.xz wget -q https://github.com/TriliumNext/Notes/releases/download/${RELEASE}/TriliumNextNotes-${RELEASE}-server-linux-x64.tar.xz
$STD tar -xvf trilium-linux-x64-server-$RELEASE.tar.xz tar -xf TriliumNextNotes-${RELEASE}-server-linux-x64.tar.xz
mv trilium-linux-x64-server /opt/trilium mv trilium-linux-x64-server /opt/trilium
msg_ok "Installed TriliumNext" msg_ok "Installed TriliumNext"
@ -53,5 +53,5 @@ customize
msg_info "Cleaning up" msg_info "Cleaning up"
$STD apt-get -y autoremove $STD apt-get -y autoremove
$STD apt-get -y autoclean $STD apt-get -y autoclean
rm -rf /root/trilium-linux-x64-server-$RELEASE.tar.xz rm -rf TriliumNextNotes-${RELEASE}-server-linux-x64.tar.xz
msg_ok "Cleaned" msg_ok "Cleaned"