mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-08-26 18:15:49 +00:00
Compare commits
1 Commits
add-script
...
add-script
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bd878edc18 |
46
ct/devuan.sh
46
ct/devuan.sh
@@ -1,46 +0,0 @@
|
||||
#!/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: MickLesk (CanbiZ)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://www.devuan.org/
|
||||
|
||||
APP="Devuan"
|
||||
var_tags="${var_tags:-os}"
|
||||
var_cpu="${var_cpu:-1}"
|
||||
var_ram="${var_ram:-512}"
|
||||
var_disk="${var_disk:-4}"
|
||||
var_os="${var_os:-devuan}"
|
||||
var_version="${var_version:-5.0}"
|
||||
#var_arm64="${var_arm64:-no}" # unset = ask the user; set yes/no only when verified
|
||||
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 /var ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
msg_info "Updating Devuan LXC"
|
||||
$STD apt update
|
||||
$STD apt -y upgrade
|
||||
msg_ok "Updated Devuan LXC"
|
||||
exit
|
||||
}
|
||||
|
||||
start
|
||||
build_container
|
||||
description
|
||||
|
||||
msg_ok "Completed successfully!"
|
||||
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
|
||||
68
ct/directus.sh
Normal file
68
ct/directus.sh
Normal file
@@ -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: MickLesk (CanbiZ)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://directus.com/
|
||||
|
||||
APP="Directus"
|
||||
var_tags="${var_tags:-cms;api;database;headless}"
|
||||
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 [[ ! -f /opt/directus/node_modules/.bin/directus ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
|
||||
if check_for_gh_release "directus" "directus/directus"; then
|
||||
msg_info "Stopping Service"
|
||||
systemctl stop directus
|
||||
msg_ok "Stopped Service"
|
||||
|
||||
create_backup /opt/directus/.env \
|
||||
/opt/directus/uploads \
|
||||
/opt/directus/extensions
|
||||
|
||||
msg_info "Updating Directus"
|
||||
cd /opt/directus
|
||||
$STD npm install --omit=dev "directus@${CHECK_UPDATE_RELEASE#v}"
|
||||
cat <<EOF >~/.directus
|
||||
${CHECK_UPDATE_RELEASE#v}
|
||||
EOF
|
||||
restore_backup
|
||||
msg_ok "Updated Directus"
|
||||
|
||||
msg_info "Starting Service"
|
||||
systemctl start directus
|
||||
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}:8055${CL}"
|
||||
@@ -1,6 +0,0 @@
|
||||
____
|
||||
/ __ \___ _ ____ ______ _____
|
||||
/ / / / _ \ | / / / / / __ `/ __ \
|
||||
/ /_/ / __/ |/ / /_/ / /_/ / / / /
|
||||
/_____/\___/|___/\__,_/\__,_/_/ /_/
|
||||
|
||||
6
ct/headers/directus
Normal file
6
ct/headers/directus
Normal file
@@ -0,0 +1,6 @@
|
||||
____ _ __
|
||||
/ __ \(_)_______ _____/ /___ _______
|
||||
/ / / / / ___/ _ \/ ___/ __/ / / / ___/
|
||||
/ /_/ / / / / __/ /__/ /_/ /_/ (__ )
|
||||
/_____/_/_/ \___/\___/\__/\__,_/____/
|
||||
|
||||
@@ -1,18 +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://www.devuan.org/
|
||||
|
||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||
color
|
||||
verb_ip6
|
||||
catch_errors
|
||||
setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
90
install/directus-install.sh
Normal file
90
install/directus-install.sh
Normal file
@@ -0,0 +1,90 @@
|
||||
#!/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://directus.com/
|
||||
|
||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||
color
|
||||
verb_ip6
|
||||
catch_errors
|
||||
setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
NODE_VERSION="22" setup_nodejs
|
||||
PG_VERSION="17" setup_postgresql
|
||||
PG_DB_NAME="directus" PG_DB_USER="directus" setup_postgresql_db
|
||||
|
||||
msg_info "Installing Directus"
|
||||
mkdir -p /opt/directus/uploads /opt/directus/extensions
|
||||
cd /opt/directus
|
||||
$STD npm init -y
|
||||
DIRECTUS_VERSION=$(get_latest_github_release "directus/directus")
|
||||
$STD npm install --omit=dev "directus@${DIRECTUS_VERSION}"
|
||||
cat <<EOF >~/.directus
|
||||
${DIRECTUS_VERSION}
|
||||
EOF
|
||||
msg_ok "Installed Directus"
|
||||
|
||||
msg_info "Configuring Directus"
|
||||
DIRECTUS_KEY=$(openssl rand -hex 32)
|
||||
DIRECTUS_SECRET=$(openssl rand -hex 32)
|
||||
DIRECTUS_ADMIN_PASSWORD=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c16)
|
||||
cat <<EOF >/opt/directus/.env
|
||||
HOST="0.0.0.0"
|
||||
PORT=8055
|
||||
PUBLIC_URL="http://${LOCAL_IP}:8055"
|
||||
KEY="${DIRECTUS_KEY}"
|
||||
SECRET="${DIRECTUS_SECRET}"
|
||||
|
||||
DB_CLIENT="pg"
|
||||
DB_HOST="127.0.0.1"
|
||||
DB_PORT=5432
|
||||
DB_DATABASE="${PG_DB_NAME}"
|
||||
DB_USER="${PG_DB_USER}"
|
||||
DB_PASSWORD="${PG_DB_PASS}"
|
||||
|
||||
ADMIN_EMAIL="admin@community-scripts.org"
|
||||
ADMIN_PASSWORD="${DIRECTUS_ADMIN_PASSWORD}"
|
||||
|
||||
STORAGE_LOCATIONS="local"
|
||||
STORAGE_LOCAL_DRIVER="local"
|
||||
STORAGE_LOCAL_ROOT="/opt/directus/uploads"
|
||||
EXTENSIONS_PATH="/opt/directus/extensions"
|
||||
TELEMETRY=false
|
||||
EOF
|
||||
chmod 640 /opt/directus/.env
|
||||
msg_ok "Configured Directus"
|
||||
|
||||
msg_info "Initializing Directus"
|
||||
cd /opt/directus
|
||||
$STD /opt/directus/node_modules/.bin/directus bootstrap
|
||||
msg_ok "Initialized Directus"
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<EOF >/etc/systemd/system/directus.service
|
||||
[Unit]
|
||||
Description=Directus
|
||||
After=network.target postgresql.service
|
||||
Requires=postgresql.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=root
|
||||
WorkingDirectory=/opt/directus
|
||||
EnvironmentFile=/opt/directus/.env
|
||||
ExecStart=/opt/directus/node_modules/.bin/directus start
|
||||
Restart=on-failure
|
||||
RestartSec=5
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now directus
|
||||
msg_ok "Created Service"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
Reference in New Issue
Block a user