mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-08-31 03:43:58 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d9fe867d10 | ||
|
|
ea49ecfa1a | ||
|
|
592b8ad142 |
@@ -0,0 +1,6 @@
|
||||
____ ____
|
||||
/ __ \____ ___ ____ / __ )____ _____
|
||||
/ / / / __ \/ _ \/ __ \/ __ / __ `/ __ \
|
||||
/ /_/ / /_/ / __/ / / / /_/ / /_/ / /_/ /
|
||||
\____/ .___/\___/_/ /_/_____/\__,_/\____/
|
||||
/_/
|
||||
Executable
+68
@@ -0,0 +1,68 @@
|
||||
#!/usr/bin/env bash
|
||||
_CS_DEFAULT_URL="https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main"
|
||||
_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: Marc Went (Dunky13)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://openbao.org/
|
||||
|
||||
APP="OpenBao"
|
||||
var_tags="${var_tags:-security;secrets}"
|
||||
var_cpu="${var_cpu:-1}"
|
||||
var_ram="${var_ram:-1024}"
|
||||
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/bin/bao ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
|
||||
if check_for_gh_release "openbao" "openbao/openbao"; then
|
||||
msg_info "Stopping Service"
|
||||
systemctl stop openbao
|
||||
msg_ok "Stopped Service"
|
||||
|
||||
create_backup /etc/openbao
|
||||
DPKG_FORCE_CONFOLD=1 fetch_and_deploy_gh_release "openbao" "openbao/openbao" "binary" "latest" "/opt/openbao" "openbao_*_linux_$(arch_resolve).deb"
|
||||
restore_backup
|
||||
|
||||
msg_info "Starting Service"
|
||||
$STD systemctl daemon-reload
|
||||
systemctl start openbao
|
||||
msg_ok "Started Service"
|
||||
for _ in {1..15}; do
|
||||
BAO_ADDR=https://127.0.0.1:8200 BAO_SKIP_VERIFY=true bao status -format=json 2>/dev/null | jq -e '.sealed == false' >/dev/null && break
|
||||
sleep 2
|
||||
done
|
||||
if ! BAO_ADDR=https://127.0.0.1:8200 BAO_SKIP_VERIFY=true bao status -format=json 2>/dev/null | jq -e '.sealed == false' >/dev/null; then
|
||||
msg_error "OpenBao did not unseal within 30 seconds"
|
||||
exit 1
|
||||
fi
|
||||
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 "${TAB}${GATEWAY}${BGN}https://${IP}:8200${CL}"
|
||||
Executable
+67
@@ -0,0 +1,67 @@
|
||||
#!/usr/bin/env bash
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: Marc Went (Dunky13)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://openbao.org/
|
||||
|
||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||
color
|
||||
verb_ip6
|
||||
catch_errors
|
||||
setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
fetch_and_deploy_gh_release "openbao" "openbao/openbao" "binary" "latest" "/opt/openbao" "openbao_*_linux_$(arch_resolve).deb"
|
||||
|
||||
msg_info "Configuring CLI Environment"
|
||||
cat <<EOF >/etc/profile.d/openbao.sh
|
||||
export BAO_ADDR=https://127.0.0.1:8200
|
||||
export BAO_SKIP_VERIFY=true
|
||||
EOF
|
||||
source /etc/profile.d/openbao.sh
|
||||
msg_ok "Configured CLI Environment"
|
||||
|
||||
msg_info "Starting OpenBao"
|
||||
systemctl enable -q --now openbao
|
||||
for _ in {1..30}; do
|
||||
curl -fsSk -o /dev/null "https://127.0.0.1:8200/v1/sys/seal-status" && break
|
||||
sleep 2
|
||||
done
|
||||
msg_ok "Started OpenBao"
|
||||
|
||||
msg_info "Initializing OpenBao"
|
||||
(
|
||||
umask 077
|
||||
cat <<'EOF' >/etc/openbao/openbao-init.json
|
||||
EOF
|
||||
)
|
||||
bao operator init -key-shares=1 -key-threshold=1 -format=json >/etc/openbao/openbao-init.json
|
||||
chmod 600 /etc/openbao/openbao.env
|
||||
chown root:root /etc/openbao/openbao.env
|
||||
cat <<EOF >>/etc/openbao/openbao.env
|
||||
BAO_ADDR=https://127.0.0.1:8200
|
||||
BAO_SKIP_VERIFY=true
|
||||
BAO_UNSEAL_KEY=$(jq -r '.unseal_keys_b64[0]' /etc/openbao/openbao-init.json)
|
||||
BAO_ROOT_TOKEN=$(jq -r '.root_token' /etc/openbao/openbao-init.json)
|
||||
EOF
|
||||
rm -f /etc/openbao/openbao-init.json
|
||||
msg_ok "Initialized OpenBao"
|
||||
|
||||
msg_info "Enabling Auto-Unseal"
|
||||
mkdir -p /etc/systemd/system/openbao.service.d
|
||||
cat <<'EOF' >/etc/systemd/system/openbao.service.d/unseal.conf
|
||||
[Service]
|
||||
ExecStartPost=-/usr/bin/bao operator unseal ${BAO_UNSEAL_KEY}
|
||||
EOF
|
||||
systemctl daemon-reload
|
||||
systemctl restart openbao
|
||||
for _ in {1..15}; do
|
||||
bao status -format=json 2>/dev/null | jq -e '.sealed == false' >/dev/null && break
|
||||
sleep 2
|
||||
done
|
||||
msg_ok "Enabled Auto-Unseal"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
@@ -136,7 +136,7 @@ network_check() {
|
||||
fi
|
||||
|
||||
# DNS resolution checks for GitHub-related domains
|
||||
GIT_HOSTS=("github.com" "raw.githubusercontent.com" "api.github.com")
|
||||
GIT_HOSTS=("github.com" "raw.githubusercontent.com" "api.github.com" "git.community-scripts.org")
|
||||
GIT_STATUS="Git DNS:"
|
||||
DNS_FAILED=false
|
||||
|
||||
|
||||
@@ -10,6 +10,10 @@
|
||||
# including colors, formatting, validation checks, message output, and
|
||||
# execution helpers used throughout the Community-Scripts ecosystem.
|
||||
#
|
||||
# Usage:
|
||||
# source <(curl -fsSL https://git.community-scripts.org/.../core.func)
|
||||
# load_functions
|
||||
#
|
||||
# ==============================================================================
|
||||
|
||||
[[ -n "${_CORE_FUNC_LOADED:-}" ]] && return
|
||||
|
||||
+1
-1
@@ -211,7 +211,7 @@ network_check() {
|
||||
fi
|
||||
|
||||
# DNS resolution checks for GitHub-related domains (IPv4 and/or IPv6)
|
||||
GIT_HOSTS=("github.com" "raw.githubusercontent.com" "api.github.com")
|
||||
GIT_HOSTS=("github.com" "raw.githubusercontent.com" "api.github.com" "git.community-scripts.org")
|
||||
GIT_STATUS="Git DNS:"
|
||||
DNS_FAILED=false
|
||||
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ declare -A MSG_INFO_SHOWN
|
||||
[[ -n "${_CORE_FUNC_LOADED:-}" ]] && return
|
||||
_CORE_FUNC_LOADED=1
|
||||
|
||||
COMMUNITY_SCRIPTS_URL="${COMMUNITY_SCRIPTS_URL:-https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main}"
|
||||
COMMUNITY_SCRIPTS_URL="${COMMUNITY_SCRIPTS_URL:-https://git.community-scripts.org/community-scripts/ProxmoxVE/raw/branch/main}"
|
||||
|
||||
load_api_functions() {
|
||||
if ! declare -f post_to_api_vm >/dev/null 2>&1; then
|
||||
|
||||
@@ -10,7 +10,7 @@ if ! command -v curl >/dev/null 2>&1; then
|
||||
apt-get update >/dev/null 2>&1
|
||||
apt-get install -y curl >/dev/null 2>&1
|
||||
fi
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/core.func)
|
||||
source <(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVE/raw/branch/main/misc/core.func)
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
|
||||
load_functions
|
||||
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "pve-privilege-converter" "pve"
|
||||
|
||||
+3
-3
@@ -8,9 +8,9 @@
|
||||
# Docker VM - Creates a Docker-ready Virtual Machine
|
||||
# ==============================================================================
|
||||
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func)
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/vm-core.func)
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/cloud-init.func) || true
|
||||
source <(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVE/raw/branch/main/misc/api.func) 2>/dev/null
|
||||
source <(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVE/raw/branch/main/misc/vm-core.func) 2>/dev/null
|
||||
source <(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVE/raw/branch/main/misc/cloud-init.func) 2>/dev/null || true
|
||||
|
||||
# ==============================================================================
|
||||
# SCRIPT VARIABLES
|
||||
|
||||
Reference in New Issue
Block a user