mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-07-13 17:35:06 +02:00
Add leafwiki (ct)
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
__ _____ ___ __ _
|
||||
/ / ___ ____ _/ __/ | / (_) /__(_)
|
||||
/ / / _ \/ __ `/ /_ | | /| / / / //_/ /
|
||||
/ /___/ __/ /_/ / __/ | |/ |/ / / ,< / /
|
||||
/_____/\___/\__,_/_/ |__/|__/_/_/|_/_/
|
||||
|
||||
@@ -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}"
|
||||
@@ -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 <<EOF >/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 <<EOF >/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
|
||||
Reference in New Issue
Block a user