From da2c9007190daf7db182271f815aad51d7e129c9 Mon Sep 17 00:00:00 2001 From: "push-app-to-main[bot]" <203845782+push-app-to-main[bot]@users.noreply.github.com> Date: Mon, 13 Jul 2026 14:37:57 +0000 Subject: [PATCH] Add leafwiki (ct) --- ct/headers/leafwiki | 6 ++++ ct/leafwiki.sh | 57 +++++++++++++++++++++++++++++++++++++ install/leafwiki-install.sh | 55 +++++++++++++++++++++++++++++++++++ 3 files changed, 118 insertions(+) create mode 100644 ct/headers/leafwiki create mode 100644 ct/leafwiki.sh create mode 100644 install/leafwiki-install.sh diff --git a/ct/headers/leafwiki b/ct/headers/leafwiki new file mode 100644 index 000000000..dcfacbddf --- /dev/null +++ b/ct/headers/leafwiki @@ -0,0 +1,6 @@ + __ _____ ___ __ _ + / / ___ ____ _/ __/ | / (_) /__(_) + / / / _ \/ __ `/ /_ | | /| / / / //_/ / + / /___/ __/ /_/ / __/ | |/ |/ / / ,< / / +/_____/\___/\__,_/_/ |__/|__/_/_/|_/_/ + diff --git a/ct/leafwiki.sh b/ct/leafwiki.sh new file mode 100644 index 000000000..20633cb57 --- /dev/null +++ b/ct/leafwiki.sh @@ -0,0 +1,57 @@ +#!/usr/bin/env bash +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +# Copyright (c) 2021-2026 community-scripts ORG +# Author: MickLesk (CanbiZ) +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/perber/leafwiki + +APP="LeafWiki" +var_tags="${var_tags:-wiki;markdown;notes}" +var_cpu="${var_cpu:-1}" +var_ram="${var_ram:-512}" +var_disk="${var_disk:-4}" +var_os="${var_os:-debian}" +var_version="${var_version:-13}" +var_arm64="${var_arm64:-yes}" +var_unprivileged="${var_unprivileged:-1}" + +header_info "$APP" +variables +color +catch_errors + +function update_script() { + header_info + check_container_storage + check_container_resources + + if [[ ! -f /usr/local/bin/leafwiki ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + + if check_for_gh_release "leafwiki" "perber/leafwiki"; then + msg_info "Stopping Service" + systemctl stop leafwiki + msg_ok "Stopped Service" + + create_backup /opt/leafwiki/data + fetch_and_deploy_gh_release "leafwiki" "perber/leafwiki" "singlefile" "latest" "/usr/local/bin" "leafwiki-v*-linux-$(arch_resolve)" + restore_backup + + msg_info "Starting Service" + systemctl start leafwiki + msg_ok "Started Service" + msg_ok "Updated successfully!" + 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 "${GATEWAY}${BGN}http://${IP}:8080${CL}" diff --git a/install/leafwiki-install.sh b/install/leafwiki-install.sh new file mode 100644 index 000000000..228ffc702 --- /dev/null +++ b/install/leafwiki-install.sh @@ -0,0 +1,55 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2026 community-scripts ORG +# Author: MickLesk (CanbiZ) +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/perber/leafwiki + +source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +fetch_and_deploy_gh_release "leafwiki" "perber/leafwiki" "singlefile" "latest" "/usr/local/bin" "leafwiki-v*-linux-$(arch_resolve)" + +msg_info "Configuring LeafWiki" +mkdir -p /opt/leafwiki/data +mkdir -p /etc/leafwiki +JWT_SECRET=$(openssl rand -hex 32) +ADMIN_PASS=$(openssl rand -base64 12 | tr -dc 'a-zA-Z0-9' | head -c12) +cat </etc/leafwiki/.env +LEAFWIKI_DATA_DIR=/opt/leafwiki/data +LEAFWIKI_HOST=0.0.0.0 +LEAFWIKI_PORT=8080 +LEAFWIKI_JWT_SECRET=${JWT_SECRET} +LEAFWIKI_ADMIN_PASSWORD=${ADMIN_PASS} +LEAFWIKI_ALLOW_INSECURE=true +EOF +msg_ok "Configured LeafWiki" + +msg_info "Creating Service" +cat </etc/systemd/system/leafwiki.service +[Unit] +Description=LeafWiki +After=network.target + +[Service] +Type=simple +User=root +EnvironmentFile=/etc/leafwiki/.env +ExecStart=/usr/local/bin/leafwiki +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=multi-user.target +EOF +systemctl enable -q --now leafwiki +msg_ok "Created Service" + +motd_ssh +customize +cleanup_lxc