mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-03-08 13:19:05 +00:00
New Script: Excalidraw (#2285)
* add excalidraw script * made suggested fixes * more fixes * some more fixes * even more fixes * fix debian --------- Co-authored-by: CanbiZ <47820557+MickLesk@users.noreply.github.com>
This commit is contained in:
parent
067c962baf
commit
80053c1cc3
74
ct/excalidraw.sh
Normal file
74
ct/excalidraw.sh
Normal file
@ -0,0 +1,74 @@
|
||||
#!/usr/bin/env bash
|
||||
source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
|
||||
# Copyright (c) 2021-2025 community-scripts ORG
|
||||
# Author: Slaviša Arežina (tremor021)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://github.com/excalidraw/excalidraw
|
||||
|
||||
APP="Excalidraw"
|
||||
TAGS="diagrams"
|
||||
var_cpu="2"
|
||||
var_ram="3072"
|
||||
var_disk="6"
|
||||
var_os="debian"
|
||||
var_version="12"
|
||||
var_unprivileged="1"
|
||||
|
||||
header_info "$APP"
|
||||
base_settings
|
||||
|
||||
variables
|
||||
color
|
||||
catch_errors
|
||||
|
||||
function update_script() {
|
||||
header_info
|
||||
check_container_storage
|
||||
check_container_resources
|
||||
|
||||
if [[ ! -d /opt/excalidraw ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
|
||||
RELEASE=$(curl -s https://api.github.com/repos/excalidraw/excalidraw/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
|
||||
if [[ "${RELEASE}" != "$(cat /opt/excalidraw_version.txt)" ]] || [[ ! -f /opt/excalidraw_version.txt ]]; then
|
||||
msg_info "Stopping $APP"
|
||||
systemctl stop excalidraw
|
||||
msg_ok "Stopped $APP"
|
||||
|
||||
msg_info "Updating $APP to v${RELEASE}"
|
||||
cd /tmp
|
||||
temp_file=$(mktemp)
|
||||
wget -q "https://github.com/excalidraw/excalidraw/archive/refs/tags/v${RELEASE}.tar.gz" -O $temp_file
|
||||
tar xzf $temp_file
|
||||
rm -rf /opt/excalidraw
|
||||
mv excalidraw-${RELEASE} /opt/excalidraw
|
||||
cd /opt/excalidraw
|
||||
yarn &> /dev/null
|
||||
msg_ok "Updated $APP to v${RELEASE}"
|
||||
|
||||
msg_info "Starting $APP"
|
||||
systemctl start excalidraw
|
||||
msg_ok "Started $APP"
|
||||
|
||||
msg_info "Cleaning Up"
|
||||
rm -rf $temp_file
|
||||
msg_ok "Cleanup Completed"
|
||||
|
||||
echo "${RELEASE}" >/opt/excalidraw_version.txt
|
||||
msg_ok "Update Successful"
|
||||
else
|
||||
msg_ok "No update required. ${APP} is already at v${RELEASE}"
|
||||
fi
|
||||
exit
|
||||
}
|
||||
|
||||
start
|
||||
build_container
|
||||
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}http://${IP}:3000${CL}"
|
73
install/excalidraw-install.sh
Normal file
73
install/excalidraw-install.sh
Normal file
@ -0,0 +1,73 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2025 community-scripts ORG
|
||||
# Author: Slaviša Arežina (tremor021)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://github.com/excalidraw/excalidraw
|
||||
|
||||
source /dev/stdin <<< "$FUNCTIONS_FILE_PATH"
|
||||
color
|
||||
verb_ip6
|
||||
catch_errors
|
||||
setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
msg_info "Installing Dependencies"
|
||||
$STD apt-get install -y \
|
||||
curl \
|
||||
sudo \
|
||||
mc \
|
||||
gnupg \
|
||||
xdg-utils
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
msg_info "Setup Node.js Repository"
|
||||
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
|
||||
msg_ok "Setup Node.js Repository"
|
||||
|
||||
msg_info "Setup Node.js"
|
||||
$STD apt-get update
|
||||
$STD apt-get install -y nodejs
|
||||
$STD npm install -g yarn
|
||||
msg_ok "Setup Node.js"
|
||||
|
||||
msg_info "Setup Excalidraw"
|
||||
temp_file=$(mktemp)
|
||||
RELEASE=$(curl -s https://api.github.com/repos/excalidraw/excalidraw/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
|
||||
wget -q "https://github.com/excalidraw/excalidraw/archive/refs/tags/v${RELEASE}.tar.gz" -O $temp_file
|
||||
tar xzf $temp_file
|
||||
mv excalidraw-${RELEASE} /opt/excalidraw
|
||||
cd /opt/excalidraw
|
||||
$STD yarn
|
||||
echo "${RELEASE}" >/opt/excalidraw_version.txt
|
||||
msg_ok "Setup Excalidraw"
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<EOF >/etc/systemd/system/excalidraw.service
|
||||
[Unit]
|
||||
Description=Excalidraw Service
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
WorkingDirectory=/opt/excalidraw
|
||||
ExecStart=/usr/bin/yarn start --host
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now excalidraw
|
||||
msg_ok "Created Service"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
|
||||
msg_info "Cleaning up"
|
||||
rm -f $temp_file
|
||||
$STD apt-get -y autoremove
|
||||
$STD apt-get -y autoclean
|
||||
msg_ok "Cleaned"
|
34
json/excalidraw.json
Normal file
34
json/excalidraw.json
Normal file
@ -0,0 +1,34 @@
|
||||
{
|
||||
"name": "Excalidraw",
|
||||
"slug": "excalidraw",
|
||||
"categories": [
|
||||
12
|
||||
],
|
||||
"date_created": "2025-02-12",
|
||||
"type": "ct",
|
||||
"updateable": true,
|
||||
"privileged": false,
|
||||
"interface_port": 3000,
|
||||
"documentation": "https://docs.excalidraw.com/docs",
|
||||
"website": "https://excalidraw.com/",
|
||||
"logo": "https://docs.excalidraw.com/img/logo.svg",
|
||||
"description": "An open source virtual hand-drawn style whiteboard. Collaborative and end-to-end encrypted.",
|
||||
"install_methods": [
|
||||
{
|
||||
"type": "default",
|
||||
"script": "ct/excalidraw.sh",
|
||||
"resources": {
|
||||
"cpu": 2,
|
||||
"ram": 3072,
|
||||
"hdd": 6,
|
||||
"os": "debian",
|
||||
"version": "12"
|
||||
}
|
||||
}
|
||||
],
|
||||
"default_credentials": {
|
||||
"username": null,
|
||||
"password": null
|
||||
},
|
||||
"notes": []
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user