mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-11-24 18:36:31 +01:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
78b843c44e |
No files matched your search
@@ -1,61 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
_cs_boot="${COMMUNITY_SCRIPTS_CORE_DIR:-$(dirname "${BASH_SOURCE[0]}")/../../core}/core/build.func"
|
||||
source "$_cs_boot" 2>/dev/null || source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_URL:-https://raw.githubusercontent.com/community-scripts/core/main}/core/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/hedgedoc/hedgedoc
|
||||
|
||||
APP="HedgeDoc"
|
||||
var_tags="${var_tags:-notes;markdown}"
|
||||
var_cpu="${var_cpu:-2}"
|
||||
var_ram="${var_ram:-2048}"
|
||||
var_disk="${var_disk:-8}"
|
||||
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 [[ ! -d /opt/hedgedoc ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
|
||||
if check_for_gh_release "hedgedoc" "hedgedoc/hedgedoc"; then
|
||||
msg_info "Stopping HedgeDoc"
|
||||
systemctl stop hedgedoc
|
||||
msg_ok "Stopped HedgeDoc"
|
||||
|
||||
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "hedgedoc" "hedgedoc/hedgedoc" "prebuild" "latest" "/opt/hedgedoc" "hedgedoc-*.tar.gz"
|
||||
|
||||
msg_info "Installing HedgeDoc Dependencies"
|
||||
cd /opt/hedgedoc
|
||||
$STD yarn workspaces focus --production
|
||||
msg_ok "Installed HedgeDoc Dependencies"
|
||||
|
||||
msg_info "Starting HedgeDoc"
|
||||
systemctl start hedgedoc
|
||||
msg_ok "Started HedgeDoc"
|
||||
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}:3000${CL}"
|
||||
Executable
+55
@@ -0,0 +1,55 @@
|
||||
#!/usr/bin/env bash
|
||||
# Engine comes from community-scripts/core; this repo only ships the scripts.
|
||||
# A local core checkout wins (COMMUNITY_SCRIPTS_CORE_DIR, else a sibling ../core),
|
||||
# so a fork or branch of core can be tested without editing this file.
|
||||
_cs_boot="${COMMUNITY_SCRIPTS_CORE_DIR:-$(dirname "${BASH_SOURCE[0]}")/../../core}/core/build.func"
|
||||
source "$_cs_boot" 2>/dev/null || source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_URL:-https://raw.githubusercontent.com/community-scripts/core/main}/core/build.func")
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: Nick Berardi (nberardi)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://nextdns.io | https://github.com/nextdns/nextdns
|
||||
|
||||
APP="NextDNS"
|
||||
var_tags="${var_tags:-dns;adblock;network}"
|
||||
var_cpu="${var_cpu:-1}"
|
||||
var_ram="${var_ram:-512}"
|
||||
var_disk="${var_disk:-2}"
|
||||
var_os="${var_os:-debian}"
|
||||
var_version="${var_version:-13}"
|
||||
#var_arm64="${var_arm64:-no}" # unset = ask the user; set yes/no only when verified
|
||||
var_unprivileged="${var_unprivileged:-1}"
|
||||
export var_nextdns_profile="${var_nextdns_profile:-}"
|
||||
|
||||
header_info "$APP"
|
||||
variables
|
||||
color
|
||||
catch_errors
|
||||
|
||||
function update_script() {
|
||||
header_info
|
||||
check_container_storage
|
||||
check_container_resources
|
||||
|
||||
if [[ ! -x /usr/bin/nextdns ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
|
||||
msg_info "Updating ${APP}"
|
||||
$STD apt update
|
||||
$STD apt install -y nextdns
|
||||
msg_ok "Updated ${APP}"
|
||||
msg_ok "Updated successfully!"
|
||||
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}NextDNS is configured and serving DNS on:${CL}"
|
||||
echo -e "${GATEWAY}${BGN}${IP}:53${CL} ${YW}(TCP/UDP)${CL}"
|
||||
echo -e "${INFO}${YW}Profiles are managed at: https://my.nextdns.io${CL}"
|
||||
echo -e "${INFO}${YW}Point DHCP clients or your router upstream DNS at the container IP.${CL}"
|
||||
@@ -1,84 +0,0 @@
|
||||
#!/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/hedgedoc/hedgedoc
|
||||
|
||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||
color
|
||||
verb_ip6
|
||||
catch_errors
|
||||
setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
msg_info "Installing Dependencies"
|
||||
$STD apt install -y \
|
||||
build-essential \
|
||||
git \
|
||||
python3
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
PG_VERSION="18" setup_postgresql
|
||||
PG_DB_NAME="hedgedoc" PG_DB_USER="hedgedoc" setup_postgresql_db
|
||||
NODE_VERSION="24" NODE_MODULE="yarn" setup_nodejs
|
||||
|
||||
fetch_and_deploy_gh_release "hedgedoc" "hedgedoc/hedgedoc" "prebuild" "latest" "/opt/hedgedoc" "hedgedoc-*.tar.gz"
|
||||
|
||||
msg_info "Installing HedgeDoc Dependencies"
|
||||
cd /opt/hedgedoc
|
||||
$STD yarn workspaces focus --production
|
||||
msg_ok "Installed HedgeDoc Dependencies"
|
||||
|
||||
msg_info "Configuring HedgeDoc"
|
||||
mkdir -p /opt/hedgedoc_data/uploads
|
||||
cat <<EOF >/opt/hedgedoc_data/config.json
|
||||
{
|
||||
"production": {
|
||||
"domain": "${LOCAL_IP}",
|
||||
"urlAddPort": true,
|
||||
"sessionSecret": "$(openssl rand -hex 64)",
|
||||
"db": {
|
||||
"dialect": "postgres",
|
||||
"host": "localhost",
|
||||
"port": 5432,
|
||||
"database": "${PG_DB_NAME}",
|
||||
"username": "${PG_DB_USER}",
|
||||
"password": "${PG_DB_PASS}"
|
||||
},
|
||||
"uploadsPath": "/opt/hedgedoc_data/uploads",
|
||||
"allowAnonymous": false,
|
||||
"allowAnonymousEdits": true,
|
||||
"enableStatsApi": false
|
||||
}
|
||||
}
|
||||
EOF
|
||||
chmod 600 /opt/hedgedoc_data/config.json
|
||||
msg_ok "Configured HedgeDoc"
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<EOF >/etc/systemd/system/hedgedoc.service
|
||||
[Unit]
|
||||
Description=HedgeDoc
|
||||
After=network.target postgresql.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=root
|
||||
WorkingDirectory=/opt/hedgedoc
|
||||
Environment=NODE_ENV=production
|
||||
Environment=CMD_CONFIG_FILE=/opt/hedgedoc_data/config.json
|
||||
ExecStart=/usr/bin/node app.js
|
||||
Restart=on-failure
|
||||
RestartSec=5
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now hedgedoc
|
||||
msg_ok "Created Service"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
Executable
+53
@@ -0,0 +1,53 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: Nick Berardi (nberardi)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://nextdns.io | https://github.com/nextdns/nextdns
|
||||
|
||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||
color
|
||||
verb_ip6
|
||||
catch_errors
|
||||
setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
setup_deb822_repo \
|
||||
"nextdns" \
|
||||
"https://repo.nextdns.io/nextdns.gpg" \
|
||||
"https://repo.nextdns.io/deb" \
|
||||
"stable" \
|
||||
"main"
|
||||
|
||||
msg_info "Installing NextDNS"
|
||||
$STD apt install -y nextdns
|
||||
msg_ok "Installed NextDNS"
|
||||
|
||||
if [[ -z "${var_nextdns_profile:-}" ]]; then
|
||||
echo -e "${INFO}${YW}Get your profile ID from: https://my.nextdns.io${CL}"
|
||||
read -r -p "${TAB3}NextDNS Profile ID: " var_nextdns_profile || true
|
||||
fi
|
||||
var_nextdns_profile="${var_nextdns_profile//[[:space:]]/}"
|
||||
if [[ -z "${var_nextdns_profile}" ]]; then
|
||||
msg_error "NextDNS Profile ID is required (set var_nextdns_profile or enter it when prompted)"
|
||||
exit 64
|
||||
fi
|
||||
|
||||
msg_info "Configuring NextDNS"
|
||||
nextdns install \
|
||||
-profile "${var_nextdns_profile}" \
|
||||
-report-client-info \
|
||||
-setup-router
|
||||
mkdir -p /etc/systemd/system/nextdns.service.d
|
||||
cat <<EOF >/etc/systemd/system/nextdns.service.d/network-online.conf
|
||||
[Unit]
|
||||
Wants=network-online.target
|
||||
After=network-online.target
|
||||
EOF
|
||||
systemctl daemon-reload
|
||||
msg_ok "Configured NextDNS (profile ${var_nextdns_profile})"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
Reference in new issue
Block a user