Compare commits
15 Commits
postgres_f
...
main
Author | SHA1 | Date | |
---|---|---|---|
![]() |
7db94ad73a | ||
![]() |
56c2682601 | ||
![]() |
11a7c2e410 | ||
![]() |
ed9d8e995d | ||
![]() |
3b67e8dcc1 | ||
![]() |
f09e57c200 | ||
![]() |
72c24d5147 | ||
![]() |
93a179c201 | ||
![]() |
ac2f0e66ae | ||
![]() |
5ccf8a7cd6 | ||
![]() |
db82285b95 | ||
![]() |
58586cbfc8 | ||
![]() |
8708980786 | ||
![]() |
943fa7b7aa | ||
![]() |
5085547f39 |
16
CHANGELOG.md
16
CHANGELOG.md
@ -18,10 +18,13 @@ All LXC instances created using this repository come pre-installed with Midnight
|
||||
|
||||
### 🆕 New Scripts
|
||||
|
||||
- Pulse ([#4728](https://github.com/community-scripts/ProxmoxVE/pull/4728))
|
||||
- Backrest ([#4766](https://github.com/community-scripts/ProxmoxVE/pull/4766))
|
||||
- Pulse ([#4728](https://github.com/community-scripts/ProxmoxVE/pull/4728))
|
||||
|
||||
### 🚀 Updated Scripts
|
||||
|
||||
- Alpine-Vaultwarden: Increase min disk requirements to 1GB [@neyzm](https://github.com/neyzm) ([#4764](https://github.com/community-scripts/ProxmoxVE/pull/4764))
|
||||
|
||||
- #### 🐞 Bug Fixes
|
||||
|
||||
- lldap: fix update-check [@MickLesk](https://github.com/MickLesk) ([#4742](https://github.com/community-scripts/ProxmoxVE/pull/4742))
|
||||
@ -30,6 +33,17 @@ All LXC instances created using this repository come pre-installed with Midnight
|
||||
|
||||
- Big NodeJS Update: Use Helper Function on all Install-Scripts [@MickLesk](https://github.com/MickLesk) ([#4744](https://github.com/community-scripts/ProxmoxVE/pull/4744))
|
||||
|
||||
- #### 🔧 Refactor
|
||||
|
||||
- merge MariaDB to tools.func Installer [@MickLesk](https://github.com/MickLesk) ([#4753](https://github.com/community-scripts/ProxmoxVE/pull/4753))
|
||||
- merge PostgreSQL to tools.func Installer [@MickLesk](https://github.com/MickLesk) ([#4752](https://github.com/community-scripts/ProxmoxVE/pull/4752))
|
||||
|
||||
### 🌐 Website
|
||||
|
||||
- #### 📝 Script Information
|
||||
|
||||
- Increase default RAM allocation for BunkerWeb to 8192MB [@TheophileDiot](https://github.com/TheophileDiot) ([#4762](https://github.com/community-scripts/ProxmoxVE/pull/4762))
|
||||
|
||||
## 2025-05-26
|
||||
|
||||
### 🆕 New Scripts
|
||||
|
@ -9,7 +9,7 @@ APP="Alpine-Vaultwarden"
|
||||
var_tags="${var_tags:-alpine;vault}"
|
||||
var_cpu="${var_cpu:-1}"
|
||||
var_ram="${var_ram:-256}"
|
||||
var_disk="${var_disk:-0.5}"
|
||||
var_disk="${var_disk:-1}"
|
||||
var_os="${var_os:-alpine}"
|
||||
var_version="${var_version:-3.21}"
|
||||
var_unprivileged="${var_unprivileged:-1}"
|
||||
|
66
ct/backrest.sh
Normal file
66
ct/backrest.sh
Normal file
@ -0,0 +1,66 @@
|
||||
#!/usr/bin/env bash
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
|
||||
# Copyright (c) 2021-2025 community-scripts ORG
|
||||
# Author: ksad (enirys31)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://garethgeorge.github.io/backrest/
|
||||
|
||||
APP="Backrest"
|
||||
var_tags="${var_tags:-backup}"
|
||||
var_cpu="${var_cpu:-1}"
|
||||
var_ram="${var_ram:-512}"
|
||||
var_disk="${var_disk:-8}"
|
||||
var_os="${var_os:-debian}"
|
||||
var_version="${var_version:-12}"
|
||||
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/backrest ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
RELEASE=$(curl -fsSL https://api.github.com/repos/garethgeorge/backrest/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
|
||||
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
|
||||
msg_info "Stopping ${APP}"
|
||||
systemctl stop backrest
|
||||
msg_ok "Stopped ${APP}"
|
||||
|
||||
msg_info "Updating ${APP} to ${RELEASE}"
|
||||
temp_file=$(mktemp)
|
||||
rm -f /opt/backrest/bin/backrest
|
||||
curl -fsSL "https://github.com/garethgeorge/backrest/releases/download/v${RELEASE}/backrest_Linux_x86_64.tar.gz" -o "$temp_file"
|
||||
tar xzf $temp_file -C /opt/backrest/bin
|
||||
chmod +x /opt/backrest/bin/backrest
|
||||
echo "${RELEASE}" >/opt/${APP}_version.txt
|
||||
msg_ok "Updated ${APP} to ${RELEASE}"
|
||||
|
||||
msg_info "Starting ${APP}"
|
||||
systemctl start backrest
|
||||
msg_ok "Started ${APP}"
|
||||
|
||||
msg_info "Cleaning up"
|
||||
rm -f "$temp_file"
|
||||
msg_ok "Cleaned up"
|
||||
msg_ok "Updated Successfully"
|
||||
else
|
||||
msg_ok "No update required. ${APP} is already at ${RELEASE}"
|
||||
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}http://${IP}:9898${CL}"
|
@ -8,7 +8,7 @@ source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxV
|
||||
APP="BunkerWeb"
|
||||
var_tags="${var_tags:-webserver}"
|
||||
var_cpu="${var_cpu:-2}"
|
||||
var_ram="${var_ram:-4096}"
|
||||
var_ram="${var_ram:-8192}"
|
||||
var_disk="${var_disk:-4}"
|
||||
var_os="${var_os:-debian}"
|
||||
var_version="${var_version:-12}"
|
||||
@ -55,4 +55,4 @@ 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}http://${IP}/setup${CL}"
|
||||
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}/setup${CL}"
|
||||
|
6
ct/headers/backrest
Normal file
6
ct/headers/backrest
Normal file
@ -0,0 +1,6 @@
|
||||
____ __ __
|
||||
/ __ )____ ______/ /__________ _____/ /_
|
||||
/ __ / __ `/ ___/ //_/ ___/ _ \/ ___/ __/
|
||||
/ /_/ / /_/ / /__/ ,< / / / __(__ ) /_
|
||||
/_____/\__,_/\___/_/|_/_/ \___/____/\__/
|
||||
|
40
frontend/public/json/backrest.json
Normal file
40
frontend/public/json/backrest.json
Normal file
@ -0,0 +1,40 @@
|
||||
{
|
||||
"name": "Backrest",
|
||||
"slug": "backrest",
|
||||
"categories": [
|
||||
7
|
||||
],
|
||||
"date_created": "2025-05-27",
|
||||
"type": "ct",
|
||||
"updateable": true,
|
||||
"privileged": false,
|
||||
"interface_port": 9898,
|
||||
"documentation": "https://garethgeorge.github.io/backrest/introduction/getting-started",
|
||||
"website": "https://garethgeorge.github.io/backrest",
|
||||
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/webp/backrest.webp",
|
||||
"config_path": "/opt/backrest/config/config.json",
|
||||
"description": "Backrest is a web-accessible backup solution built on top of restic and providing a WebUI which wraps the restic CLI and makes it easy to create repos, browse snapshots, and restore files. Additionally, Backrest can run in the background and take an opinionated approach to scheduling snapshots and orchestrating repo health operations.",
|
||||
"install_methods": [
|
||||
{
|
||||
"type": "default",
|
||||
"script": "ct/backrest.sh",
|
||||
"resources": {
|
||||
"cpu": 1,
|
||||
"ram": 512,
|
||||
"hdd": 8,
|
||||
"os": "debian",
|
||||
"version": "12"
|
||||
}
|
||||
}
|
||||
],
|
||||
"default_credentials": {
|
||||
"username": null,
|
||||
"password": null
|
||||
},
|
||||
"notes": [
|
||||
{
|
||||
"type": "info",
|
||||
"text": "`cat ~/.ssh/id_ed25519.pub` to view ssh public key. This key is used to authenticate with sftp targets. You can add this key on the sftp server."
|
||||
}
|
||||
]
|
||||
}
|
@ -20,7 +20,7 @@
|
||||
"script": "ct/bunkerweb.sh",
|
||||
"resources": {
|
||||
"cpu": 2,
|
||||
"ram": 4096,
|
||||
"ram": 8192,
|
||||
"hdd": 4,
|
||||
"os": "debian",
|
||||
"version": "12"
|
||||
|
@ -32,7 +32,7 @@
|
||||
"resources": {
|
||||
"cpu": 1,
|
||||
"ram": 256,
|
||||
"hdd": 0.5,
|
||||
"hdd": 1,
|
||||
"os": "alpine",
|
||||
"version": "3.21"
|
||||
}
|
||||
|
@ -1,4 +1,44 @@
|
||||
[
|
||||
{
|
||||
"name": "mattermost/mattermost",
|
||||
"version": "v10.5.7",
|
||||
"date": "2025-05-27T05:34:42Z"
|
||||
},
|
||||
{
|
||||
"name": "n8n-io/n8n",
|
||||
"version": "n8n@1.94.1",
|
||||
"date": "2025-05-27T10:36:43Z"
|
||||
},
|
||||
{
|
||||
"name": "traefik/traefik",
|
||||
"version": "v2.11.25",
|
||||
"date": "2025-05-27T10:25:28Z"
|
||||
},
|
||||
{
|
||||
"name": "readeck/readeck",
|
||||
"version": "0.19.0",
|
||||
"date": "2025-05-27T09:15:55Z"
|
||||
},
|
||||
{
|
||||
"name": "esphome/esphome",
|
||||
"version": "2025.5.1",
|
||||
"date": "2025-05-27T09:01:29Z"
|
||||
},
|
||||
{
|
||||
"name": "zitadel/zitadel",
|
||||
"version": "v2.65.10",
|
||||
"date": "2025-05-27T08:47:06Z"
|
||||
},
|
||||
{
|
||||
"name": "Jackett/Jackett",
|
||||
"version": "v0.22.1956",
|
||||
"date": "2025-05-27T05:55:21Z"
|
||||
},
|
||||
{
|
||||
"name": "semaphoreui/semaphore",
|
||||
"version": "v2.14.12",
|
||||
"date": "2025-05-27T03:58:59Z"
|
||||
},
|
||||
{
|
||||
"name": "open-webui/open-webui",
|
||||
"version": "v0.6.11",
|
||||
@ -20,14 +60,9 @@
|
||||
"date": "2025-05-23T15:10:33Z"
|
||||
},
|
||||
{
|
||||
"name": "mattermost/mattermost",
|
||||
"version": "mattermost-redux@10.8.0",
|
||||
"date": "2025-05-26T19:17:13Z"
|
||||
},
|
||||
{
|
||||
"name": "semaphoreui/semaphore",
|
||||
"version": "v2.14.12",
|
||||
"date": "2025-05-26T19:08:26Z"
|
||||
"name": "keycloak/keycloak",
|
||||
"version": "26.0.12",
|
||||
"date": "2025-05-15T14:06:52Z"
|
||||
},
|
||||
{
|
||||
"name": "dgtlmoon/changedetection.io",
|
||||
@ -44,16 +79,16 @@
|
||||
"version": "4.8.11.0",
|
||||
"date": "2025-03-10T06:39:11Z"
|
||||
},
|
||||
{
|
||||
"name": "wazuh/wazuh",
|
||||
"version": "coverity-w22-4.13.0",
|
||||
"date": "2025-05-26T15:04:48Z"
|
||||
},
|
||||
{
|
||||
"name": "nzbgetcom/nzbget",
|
||||
"version": "v25.0",
|
||||
"date": "2025-05-12T09:12:04Z"
|
||||
},
|
||||
{
|
||||
"name": "zitadel/zitadel",
|
||||
"version": "v3.2.1",
|
||||
"date": "2025-05-26T14:27:59Z"
|
||||
},
|
||||
{
|
||||
"name": "jupyter/notebook",
|
||||
"version": "v7.4.3",
|
||||
@ -74,11 +109,6 @@
|
||||
"version": "pmm-6401-v1.118.0",
|
||||
"date": "2025-05-26T13:09:32Z"
|
||||
},
|
||||
{
|
||||
"name": "n8n-io/n8n",
|
||||
"version": "n8n@1.91.3",
|
||||
"date": "2025-05-08T12:25:10Z"
|
||||
},
|
||||
{
|
||||
"name": "Graylog2/graylog2-server",
|
||||
"version": "6.3.0-beta.3",
|
||||
@ -104,11 +134,6 @@
|
||||
"version": "v1.5.2",
|
||||
"date": "2025-05-11T16:40:55Z"
|
||||
},
|
||||
{
|
||||
"name": "Jackett/Jackett",
|
||||
"version": "v0.22.1951",
|
||||
"date": "2025-05-26T05:51:18Z"
|
||||
},
|
||||
{
|
||||
"name": "stonith404/pingvin-share",
|
||||
"version": "v1.13.0",
|
||||
@ -136,8 +161,8 @@
|
||||
},
|
||||
{
|
||||
"name": "runtipi/runtipi",
|
||||
"version": "nightly",
|
||||
"date": "2025-05-25T09:44:06Z"
|
||||
"version": "v4.1.1",
|
||||
"date": "2025-05-16T17:37:30Z"
|
||||
},
|
||||
{
|
||||
"name": "Kozea/Radicale",
|
||||
@ -204,16 +229,6 @@
|
||||
"version": "v8.1.4",
|
||||
"date": "2025-05-23T12:29:19Z"
|
||||
},
|
||||
{
|
||||
"name": "wazuh/wazuh",
|
||||
"version": "v4.10.2",
|
||||
"date": "2025-05-23T11:56:41Z"
|
||||
},
|
||||
{
|
||||
"name": "keycloak/keycloak",
|
||||
"version": "26.0.12",
|
||||
"date": "2025-05-15T14:06:52Z"
|
||||
},
|
||||
{
|
||||
"name": "ollama/ollama",
|
||||
"version": "v0.7.1-rc2",
|
||||
@ -299,11 +314,6 @@
|
||||
"version": "10.0.18",
|
||||
"date": "2025-02-12T11:07:02Z"
|
||||
},
|
||||
{
|
||||
"name": "esphome/esphome",
|
||||
"version": "2025.5.0",
|
||||
"date": "2025-05-21T08:32:53Z"
|
||||
},
|
||||
{
|
||||
"name": "inventree/InvenTree",
|
||||
"version": "0.17.12",
|
||||
@ -584,11 +594,6 @@
|
||||
"version": "10.1.41",
|
||||
"date": "2025-05-08T12:45:44Z"
|
||||
},
|
||||
{
|
||||
"name": "readeck/readeck",
|
||||
"version": "0.18.2",
|
||||
"date": "2025-05-07T19:22:22Z"
|
||||
},
|
||||
{
|
||||
"name": "donaldzou/WGDashboard",
|
||||
"version": "v4.2.3",
|
||||
@ -644,11 +649,6 @@
|
||||
"version": "3.5.0",
|
||||
"date": "2025-05-05T16:28:24Z"
|
||||
},
|
||||
{
|
||||
"name": "traefik/traefik",
|
||||
"version": "v3.4.0",
|
||||
"date": "2025-05-05T13:59:23Z"
|
||||
},
|
||||
{
|
||||
"name": "moghtech/komodo",
|
||||
"version": "v1.17.5",
|
||||
|
@ -14,11 +14,8 @@ network_check
|
||||
update_os
|
||||
|
||||
msg_info "Installing Dependencies"
|
||||
|
||||
$STD apt-get install -y \
|
||||
lsb-release \
|
||||
gpg
|
||||
|
||||
lsb-release
|
||||
curl -fsSL https://packages.sury.org/php/apt.gpg | gpg --dearmor -o /usr/share/keyrings/deb.sury.org-php.gpg
|
||||
echo "deb [signed-by=/usr/share/keyrings/deb.sury.org-php.gpg] https://packages.sury.org/php/ $(lsb_release -sc) main" >/etc/apt/sources.list.d/php.list
|
||||
$STD apt-get update
|
||||
@ -26,10 +23,11 @@ $STD apt-get update
|
||||
$STD apt-get install -y \
|
||||
nginx \
|
||||
composer \
|
||||
php8.3-{bcmath,common,ctype,curl,fileinfo,fpm,gd,intl,mbstring,mysql,xml,cli} \
|
||||
mariadb-server
|
||||
php8.3-{bcmath,common,ctype,curl,fileinfo,fpm,gd,intl,mbstring,mysql,xml,cli}
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
install_mariadb
|
||||
|
||||
msg_info "Setting up Database"
|
||||
DB_NAME=2fauth_db
|
||||
DB_USER=2fauth
|
||||
|
@ -25,10 +25,9 @@ $STD apt-get install -y \
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
NODE_VERSION="22" NODE_MODULE="pnpm@latest" install_node_and_modules
|
||||
PG_VERSION="16" install_postgresql
|
||||
PG_VERSION="16" PG_MODULES="postgis" install_postgresql
|
||||
|
||||
msg_info "Install/Set up PostgreSQL Database"
|
||||
$STD apt-get install -y postgresql-16-postgis
|
||||
msg_info "Set up PostgreSQL Database"
|
||||
DB_NAME="adventurelog_db"
|
||||
DB_USER="adventurelog_user"
|
||||
DB_PASS="$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | cut -c1-13)"
|
||||
|
@ -14,31 +14,32 @@ update_os
|
||||
|
||||
msg_info "Installing Dependencies"
|
||||
$STD apt-get install -y \
|
||||
build-essential \
|
||||
jq \
|
||||
libcairo2-dev \
|
||||
libturbojpeg0 \
|
||||
libpng-dev \
|
||||
libtool-bin \
|
||||
libossp-uuid-dev \
|
||||
libvncserver-dev \
|
||||
freerdp2-dev \
|
||||
libssh2-1-dev \
|
||||
libtelnet-dev \
|
||||
libwebsockets-dev \
|
||||
libpulse-dev \
|
||||
libvorbis-dev \
|
||||
libwebp-dev \
|
||||
libssl-dev \
|
||||
libpango1.0-dev \
|
||||
libswscale-dev \
|
||||
libavcodec-dev \
|
||||
libavutil-dev \
|
||||
libavformat-dev \
|
||||
mariadb-server \
|
||||
default-jdk
|
||||
build-essential \
|
||||
jq \
|
||||
libcairo2-dev \
|
||||
libturbojpeg0 \
|
||||
libpng-dev \
|
||||
libtool-bin \
|
||||
libossp-uuid-dev \
|
||||
libvncserver-dev \
|
||||
freerdp2-dev \
|
||||
libssh2-1-dev \
|
||||
libtelnet-dev \
|
||||
libwebsockets-dev \
|
||||
libpulse-dev \
|
||||
libvorbis-dev \
|
||||
libwebp-dev \
|
||||
libssl-dev \
|
||||
libpango1.0-dev \
|
||||
libswscale-dev \
|
||||
libavcodec-dev \
|
||||
libavutil-dev \
|
||||
libavformat-dev \
|
||||
default-jdk
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
install_mariadb
|
||||
|
||||
msg_info "Setup Apache Tomcat"
|
||||
RELEASE=$(curl -fsSL https://dlcdn.apache.org/tomcat/tomcat-9/ | grep -oP '(?<=href=")v[^"/]+(?=/")' | sed 's/^v//' | sort -V | tail -n1)
|
||||
mkdir -p /opt/apache-guacamole/tomcat9
|
||||
@ -79,19 +80,19 @@ mysql -u root -e "CREATE DATABASE $DB_NAME;"
|
||||
mysql -u root -e "CREATE USER '$DB_USER'@'localhost' IDENTIFIED WITH mysql_native_password AS PASSWORD('$DB_PASS');"
|
||||
mysql -u root -e "GRANT ALL ON $DB_NAME.* TO '$DB_USER'@'localhost'; FLUSH PRIVILEGES;"
|
||||
{
|
||||
echo "Guacamole-Credentials"
|
||||
echo "Database User: $DB_USER"
|
||||
echo "Database Password: $DB_PASS"
|
||||
echo "Database Name: $DB_NAME"
|
||||
echo "Guacamole-Credentials"
|
||||
echo "Database User: $DB_USER"
|
||||
echo "Database Password: $DB_PASS"
|
||||
echo "Database Name: $DB_NAME"
|
||||
} >>~/guacamole.creds
|
||||
cd guacamole-auth-jdbc-1.5.5/mysql/schema
|
||||
cat *.sql | mysql -u root ${DB_NAME}
|
||||
{
|
||||
echo "mysql-hostname: 127.0.0.1"
|
||||
echo "mysql-port: 3306"
|
||||
echo "mysql-database: $DB_NAME"
|
||||
echo "mysql-username: $DB_USER"
|
||||
echo "mysql-password: $DB_PASS"
|
||||
echo "mysql-hostname: 127.0.0.1"
|
||||
echo "mysql-port: 3306"
|
||||
echo "mysql-database: $DB_NAME"
|
||||
echo "mysql-username: $DB_USER"
|
||||
echo "mysql-password: $DB_PASS"
|
||||
|
||||
} >>/etc/guacamole/guacamole.properties
|
||||
msg_ok "Setup Database"
|
||||
|
@ -37,7 +37,7 @@ $STD apt-get install -y \
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
setup_uv
|
||||
PG_VERSION="16" install_postgresql
|
||||
PG_VERSION="16" PG_MODULES="contrib" install_postgresql
|
||||
NODE_VERSION="22" install_node_and_modules
|
||||
install_go
|
||||
|
||||
@ -61,8 +61,7 @@ cat <<EOF >/etc/GeoIP.conf
|
||||
EOF
|
||||
msg_ok "Installed GeoIP"
|
||||
|
||||
msg_info "Installing PostgreSQL"
|
||||
$STD apt-get install -y postgresql-16 postgresql-contrib-16
|
||||
msg_info "Setup PostgreSQL Database"
|
||||
DB_NAME="authentik"
|
||||
DB_USER="authentik"
|
||||
DB_PASS="$(openssl rand -base64 18 | cut -c1-13)"
|
||||
|
54
install/backrest-install.sh
Normal file
54
install/backrest-install.sh
Normal file
@ -0,0 +1,54 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2025 community-scripts ORG
|
||||
# Author: ksad (enirys31)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://garethgeorge.github.io/backrest/
|
||||
|
||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||
color
|
||||
verb_ip6
|
||||
catch_errors
|
||||
setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
msg_info "Installing Backrest"
|
||||
RELEASE=$(curl -fsSL https://api.github.com/repos/garethgeorge/backrest/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
|
||||
temp_file=$(mktemp)
|
||||
mkdir -p /opt/backrest/{bin,config,data}
|
||||
curl -fsSL "https://github.com/garethgeorge/backrest/releases/download/v${RELEASE}/backrest_Linux_x86_64.tar.gz" -o "$temp_file"
|
||||
tar xzf $temp_file -C /opt/backrest/bin
|
||||
chmod +x /opt/backrest/bin/backrest
|
||||
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
|
||||
msg_ok "Installed Backrest"
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<EOF >/etc/systemd/system/backrest.service
|
||||
[Unit]
|
||||
Description=Backrest
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=root
|
||||
ExecStart=/opt/backrest/bin/backrest
|
||||
Environment="BACKREST_PORT=9898"
|
||||
Environment="BACKREST_CONFIG=/opt/backrest/config/config.json"
|
||||
Environment="BACKREST_DATA=/opt/backrest/data"
|
||||
Environment="XDG_CACHE_HOME=/opt/backrest/cache"
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now backrest
|
||||
msg_ok "Created Service"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
|
||||
msg_info "Cleaning up"
|
||||
rm -f "$temp_file"
|
||||
$STD apt-get -y autoremove
|
||||
$STD apt-get -y autoclean
|
||||
msg_ok "Cleaned"
|
@ -15,25 +15,26 @@ update_os
|
||||
|
||||
msg_info "Installing Dependencies"
|
||||
$STD apt-get install -y \
|
||||
postgresql \
|
||||
apache2 \
|
||||
libapache2-mod-php \
|
||||
php-{pgsql,dom}
|
||||
apache2 \
|
||||
libapache2-mod-php \
|
||||
php-{pgsql,dom}
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
msg_info "Setting up PostgreSQL"
|
||||
PG_VERSION="16" install_postgresql
|
||||
|
||||
msg_info "Setting up PostgreSQL Database"
|
||||
DB_NAME=baikal
|
||||
DB_USER=baikal
|
||||
DB_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | cut -c1-13)
|
||||
$STD sudo -u postgres psql -c "CREATE ROLE $DB_USER WITH LOGIN PASSWORD '$DB_PASS';"
|
||||
$STD sudo -u postgres psql -c "CREATE DATABASE $DB_NAME WITH OWNER $DB_USER TEMPLATE template0;"
|
||||
{
|
||||
echo "Baikal Credentials"
|
||||
echo "Baikal Database User: $DB_USER"
|
||||
echo "Baikal Database Password: $DB_PASS"
|
||||
echo "Baikal Database Name: $DB_NAME"
|
||||
echo "Baikal Credentials"
|
||||
echo "Baikal Database User: $DB_USER"
|
||||
echo "Baikal Database Password: $DB_PASS"
|
||||
echo "Baikal Database Name: $DB_NAME"
|
||||
} >>~/baikal.creds
|
||||
msg_ok "Set up PostgreSQL"
|
||||
msg_ok "Set up PostgreSQL Database"
|
||||
|
||||
msg_info "Installing Baikal"
|
||||
RELEASE=$(curl -fsSL https://api.github.com/repos/sabre-io/Baikal/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
|
||||
|
@ -15,15 +15,16 @@ update_os
|
||||
|
||||
msg_info "Installing Dependencies (Patience)"
|
||||
$STD apt-get install -y \
|
||||
unzip \
|
||||
mariadb-server \
|
||||
apache2 \
|
||||
php8.2-{mbstring,gd,fpm,curl,intl,ldap,tidy,bz2,mysql,zip,xml} \
|
||||
composer \
|
||||
libapache2-mod-php \
|
||||
make
|
||||
unzip \
|
||||
apache2 \
|
||||
php8.2-{mbstring,gd,fpm,curl,intl,ldap,tidy,bz2,mysql,zip,xml} \
|
||||
composer \
|
||||
libapache2-mod-php \
|
||||
make
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
install_mariadb
|
||||
|
||||
msg_info "Setting up Database"
|
||||
DB_NAME=bookstack
|
||||
DB_USER=bookstack
|
||||
@ -32,10 +33,10 @@ $STD sudo mysql -u root -e "CREATE DATABASE $DB_NAME;"
|
||||
$STD sudo mysql -u root -e "CREATE USER '$DB_USER'@'localhost' IDENTIFIED WITH mysql_native_password AS PASSWORD('$DB_PASS');"
|
||||
$STD sudo mysql -u root -e "GRANT ALL ON $DB_NAME.* TO '$DB_USER'@'localhost'; FLUSH PRIVILEGES;"
|
||||
{
|
||||
echo "Bookstack-Credentials"
|
||||
echo "Bookstack Database User: $DB_USER"
|
||||
echo "Bookstack Database Password: $DB_PASS"
|
||||
echo "Bookstack Database Name: $DB_NAME"
|
||||
echo "Bookstack-Credentials"
|
||||
echo "Bookstack Database User: $DB_USER"
|
||||
echo "Bookstack Database Password: $DB_PASS"
|
||||
echo "Bookstack Database Name: $DB_NAME"
|
||||
} >>~/bookstack.creds
|
||||
msg_ok "Set up database"
|
||||
|
||||
|
@ -16,10 +16,11 @@ update_os
|
||||
msg_info "Installing Dependencies"
|
||||
$STD apt-get install -y \
|
||||
php-imap \
|
||||
debconf-utils \
|
||||
mariadb-server
|
||||
debconf-utils
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
install_mariadb
|
||||
|
||||
msg_info "Setting up Database"
|
||||
ROOT_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
|
||||
$STD sudo mysql -u root -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password AS PASSWORD('$ROOT_PASS'); flush privileges;"
|
||||
|
@ -18,13 +18,14 @@ curl -fsSLo /usr/share/keyrings/deb.sury.org-php.gpg https://packages.sury.org/p
|
||||
echo "deb [signed-by=/usr/share/keyrings/deb.sury.org-php.gpg] https://packages.sury.org/php/ bookworm main" >/etc/apt/sources.list.d/php.list
|
||||
$STD apt-get update
|
||||
$STD apt-get install -y \
|
||||
apache2 \
|
||||
libapache2-mod-php8.4 \
|
||||
php8.4-{bcmath,cli,intl,curl,zip,gd,xml,mbstring,mysql} \
|
||||
mariadb-server \
|
||||
composer
|
||||
apache2 \
|
||||
libapache2-mod-php8.4 \
|
||||
php8.4-{bcmath,cli,intl,curl,zip,gd,xml,mbstring,mysql} \
|
||||
composer
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
install_mariadb
|
||||
|
||||
msg_info "Setting up database"
|
||||
DB_NAME=firefly
|
||||
DB_USER=firefly
|
||||
@ -34,10 +35,10 @@ mysql -u root -e "CREATE DATABASE $DB_NAME;"
|
||||
mysql -u root -e "CREATE USER '$DB_USER'@'localhost' IDENTIFIED WITH mysql_native_password AS PASSWORD('$DB_PASS');"
|
||||
mysql -u root -e "GRANT ALL ON $DB_NAME.* TO '$DB_USER'@'localhost'; FLUSH PRIVILEGES;"
|
||||
{
|
||||
echo "Firefly-Credentials"
|
||||
echo "Firefly Database User: $DB_USER"
|
||||
echo "Firefly Database Password: $DB_PASS"
|
||||
echo "Firefly Database Name: $DB_NAME"
|
||||
echo "Firefly-Credentials"
|
||||
echo "Firefly Database User: $DB_USER"
|
||||
echo "Firefly Database Password: $DB_PASS"
|
||||
echo "Firefly Database Name: $DB_NAME"
|
||||
} >>~/firefly.creds
|
||||
msg_ok "Set up database"
|
||||
|
||||
|
@ -15,12 +15,13 @@ update_os
|
||||
|
||||
msg_info "Installing Dependencies"
|
||||
$STD apt-get install -y \
|
||||
postgresql \
|
||||
apache2 \
|
||||
php-{curl,dom,json,ctype,pgsql,gmp,mbstring,iconv,zip} \
|
||||
libapache2-mod-php
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
PG_VERSION="16" install_postgresql
|
||||
|
||||
msg_info "Setting up PostgreSQL"
|
||||
DB_NAME=freshrss
|
||||
DB_USER=freshrss
|
||||
|
@ -16,10 +16,11 @@ update_os
|
||||
msg_info "Installing Dependencies"
|
||||
$STD apt-get install -y \
|
||||
nginx \
|
||||
mariadb-server \
|
||||
ca-certificates
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
install_mariadb
|
||||
|
||||
msg_info "Configuring Database"
|
||||
DB_NAME=ghost
|
||||
DB_USER=ghostuser
|
||||
|
@ -15,14 +15,15 @@ update_os
|
||||
|
||||
msg_info "Installing Dependencies"
|
||||
$STD apt-get install -y \
|
||||
git \
|
||||
apache2 \
|
||||
php8.2-{apcu,cli,common,curl,gd,imap,ldap,mysql,xmlrpc,xml,mbstring,bcmath,intl,zip,redis,bz2,soap} \
|
||||
php-cas \
|
||||
libapache2-mod-php \
|
||||
mariadb-server
|
||||
git \
|
||||
apache2 \
|
||||
php8.2-{apcu,cli,common,curl,gd,imap,ldap,mysql,xmlrpc,xml,mbstring,bcmath,intl,zip,redis,bz2,soap} \
|
||||
php-cas \
|
||||
libapache2-mod-php
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
install_mariadb
|
||||
|
||||
msg_info "Setting up database"
|
||||
DB_NAME=glpi_db
|
||||
DB_USER=glpi
|
||||
@ -33,10 +34,10 @@ mysql -u root -e "CREATE USER '$DB_USER'@'localhost' IDENTIFIED BY '$DB_PASS';"
|
||||
mysql -u root -e "GRANT ALL PRIVILEGES ON $DB_NAME.* TO '$DB_USER'@'localhost';"
|
||||
mysql -u root -e "GRANT SELECT ON \`mysql\`.\`time_zone_name\` TO '$DB_USER'@'localhost'; FLUSH PRIVILEGES;"
|
||||
{
|
||||
echo "GLPI Database Credentials"
|
||||
echo "Database: $DB_NAME"
|
||||
echo "Username: $DB_USER"
|
||||
echo "Password: $DB_PASS"
|
||||
echo "GLPI Database Credentials"
|
||||
echo "Database: $DB_NAME"
|
||||
echo "Username: $DB_USER"
|
||||
echo "Password: $DB_PASS"
|
||||
} >>~/glpi_db.creds
|
||||
msg_ok "Set up database"
|
||||
|
||||
|
@ -20,10 +20,11 @@ $STD apt-get install -y \
|
||||
git \
|
||||
expect \
|
||||
composer \
|
||||
mariadb-server \
|
||||
lsb-release
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
install_mariadb
|
||||
|
||||
msg_info "Adding PHP8.4 Repository"
|
||||
$STD curl -sSLo /tmp/debsuryorg-archive-keyring.deb https://packages.sury.org/debsuryorg-archive-keyring.deb
|
||||
$STD dpkg -i /tmp/debsuryorg-archive-keyring.deb
|
||||
|
@ -13,11 +13,12 @@ setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
msg_info "Installing MariaDB"
|
||||
$STD apt-get install -y mariadb-server
|
||||
install_mariadb
|
||||
|
||||
msg_info "Setup MariaDB"
|
||||
sed -i 's/^# *\(port *=.*\)/\1/' /etc/mysql/my.cnf
|
||||
sed -i 's/^bind-address/#bind-address/g' /etc/mysql/mariadb.conf.d/50-server.cnf
|
||||
msg_ok "Installed MariaDB"
|
||||
msg_ok "Setup MariaDB"
|
||||
|
||||
read -r -p "${TAB3}Would you like to add PhpMyAdmin? <y/N> " prompt
|
||||
if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then
|
||||
|
@ -15,13 +15,13 @@ update_os
|
||||
|
||||
msg_info "Installing Dependencies"
|
||||
$STD apt-get install -y \
|
||||
mariadb-server \
|
||||
apache2 \
|
||||
libapache2-mod-php \
|
||||
php-{bcmath,curl,dom,gd,gmp,iconv,intl,json,mbstring,mysqli,opcache,pdo-mysql,redis,tokenizer,xml,zip} \
|
||||
composer
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
install_mariadb
|
||||
NODE_VERSION="22" NODE_MODULE="yarn@latest" install_node_and_modules
|
||||
|
||||
msg_info "Setting up MariaDB"
|
||||
|
@ -17,7 +17,6 @@ msg_info "Installing Dependencies"
|
||||
$STD apt-get install -y \
|
||||
apache2 \
|
||||
redis-server \
|
||||
postgresql \
|
||||
build-essential \
|
||||
libxml2-dev \
|
||||
libxslt1-dev \
|
||||
@ -27,6 +26,8 @@ $STD apt-get install -y \
|
||||
zlib1g-dev
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
PG_VERSION="16" install_postgresql
|
||||
|
||||
msg_info "Installing Python"
|
||||
$STD apt-get install -y \
|
||||
python3 \
|
||||
|
@ -16,7 +16,6 @@ update_os
|
||||
msg_info "Installing Dependencies (Patience)"
|
||||
$STD apt-get install -y \
|
||||
redis \
|
||||
postgresql \
|
||||
build-essential \
|
||||
imagemagick \
|
||||
fonts-liberation \
|
||||
@ -37,6 +36,8 @@ $STD apt-get install -y \
|
||||
libleptonica-dev
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
PG_VERSION="16" install_postgresql
|
||||
|
||||
msg_info "Setup Python3"
|
||||
$STD apt-get install -y \
|
||||
python3 \
|
||||
|
@ -15,16 +15,16 @@ update_os
|
||||
|
||||
msg_info "Installing Dependencies"
|
||||
$STD apt-get install -y \
|
||||
git \
|
||||
software-properties-common \
|
||||
apt-transport-https \
|
||||
ca-certificates \
|
||||
gnupg2 \
|
||||
mariadb-server \
|
||||
nginx \
|
||||
redis-server
|
||||
git \
|
||||
software-properties-common \
|
||||
apt-transport-https \
|
||||
ca-certificates \
|
||||
nginx \
|
||||
redis-server
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
install_mariadb
|
||||
|
||||
msg_info "Adding PHP Repository"
|
||||
$STD curl -sSLo /tmp/debsuryorg-archive-keyring.deb https://packages.sury.org/debsuryorg-archive-keyring.deb
|
||||
$STD dpkg -i /tmp/debsuryorg-archive-keyring.deb
|
||||
@ -35,8 +35,8 @@ msg_ok "Added PHP Repository"
|
||||
msg_info "Installing PHP"
|
||||
$STD apt-get remove -y php8.2*
|
||||
$STD apt-get install -y \
|
||||
php8.3 \
|
||||
php8.3-{common,cli,gd,mysql,mbstring,bcmath,xml,curl,zip,intl,fpm,redis}
|
||||
php8.3 \
|
||||
php8.3-{common,cli,gd,mysql,mbstring,bcmath,xml,curl,zip,intl,fpm,redis}
|
||||
msg_info "Installed PHP"
|
||||
|
||||
msg_info "Installing Composer"
|
||||
@ -62,10 +62,10 @@ mysql -u root -e "CREATE DATABASE $DB_NAME;"
|
||||
mysql -u root -e "CREATE USER '$DB_USER'@'localhost' IDENTIFIED BY '$DB_PASS';"
|
||||
mysql -u root -e "GRANT ALL PRIVILEGES ON $DB_NAME.* TO '$DB_USER'@'localhost' WITH GRANT OPTION;"
|
||||
{
|
||||
echo "Paymenter Database Credentials"
|
||||
echo "Database: $DB_NAME"
|
||||
echo "Username: $DB_USER"
|
||||
echo "Password: $DB_PASS"
|
||||
echo "Paymenter Database Credentials"
|
||||
echo "Database: $DB_NAME"
|
||||
echo "Username: $DB_USER"
|
||||
echo "Password: $DB_PASS"
|
||||
} >>~/paymenter_db.creds
|
||||
cp .env.example .env
|
||||
$STD composer install --no-dev --optimize-autoloader --no-interaction
|
||||
|
@ -16,12 +16,12 @@ update_os
|
||||
msg_info "Installing Dependencies"
|
||||
$STD apt-get install -y \
|
||||
lsb-release \
|
||||
mariadb-server \
|
||||
mariadb-client \
|
||||
apache2 \
|
||||
composer
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
install_mariadb
|
||||
|
||||
msg_info "Adding PHP8.4 Repository"
|
||||
$STD curl -sSLo /tmp/debsuryorg-archive-keyring.deb https://packages.sury.org/debsuryorg-archive-keyring.deb
|
||||
$STD dpkg -i /tmp/debsuryorg-archive-keyring.deb
|
||||
|
@ -15,13 +15,14 @@ update_os
|
||||
|
||||
msg_info "Installing Dependencies"
|
||||
$STD apt-get install -y \
|
||||
mariadb-server \
|
||||
apache2 \
|
||||
libapache2-mod-php \
|
||||
php8.2 php8.2-{fpm,curl,cli,mysql,gd,intl,imap,apcu,pspell,tidy,xmlrpc,mbstring,gmp,xml,ldap,common,snmp} \
|
||||
php-pear
|
||||
apache2 \
|
||||
libapache2-mod-php \
|
||||
php8.2 php8.2-{fpm,curl,cli,mysql,gd,intl,imap,apcu,pspell,tidy,xmlrpc,mbstring,gmp,xml,ldap,common,snmp} \
|
||||
php-pear
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
install_mariadb
|
||||
|
||||
msg_info "Setting up MariaDB"
|
||||
DB_NAME=phpipam
|
||||
DB_USER=phpipam
|
||||
@ -30,10 +31,10 @@ $STD mysql -u root -e "CREATE DATABASE $DB_NAME;"
|
||||
$STD mysql -u root -e "CREATE USER '$DB_USER'@'localhost' IDENTIFIED WITH mysql_native_password AS PASSWORD('$DB_PASS');"
|
||||
$STD mysql -u root -e "GRANT ALL ON $DB_NAME.* TO '$DB_USER'@'localhost'; FLUSH PRIVILEGES;"
|
||||
{
|
||||
echo "phpIPAM-Credentials"
|
||||
echo "phpIPAM Database User: $DB_USER"
|
||||
echo "phpIPAM Database Password: $DB_PASS"
|
||||
echo "phpIPAM Database Name: $DB_NAME"
|
||||
echo "phpIPAM-Credentials"
|
||||
echo "phpIPAM Database User: $DB_USER"
|
||||
echo "phpIPAM Database Password: $DB_PASS"
|
||||
echo "phpIPAM Database Name: $DB_NAME"
|
||||
} >>~/phpipam.creds
|
||||
msg_ok "Set up MariaDB"
|
||||
|
||||
@ -45,10 +46,10 @@ unzip -q "phpipam-v${RELEASE}.zip"
|
||||
mysql -u root "${DB_NAME}" </opt/phpipam/db/SCHEMA.sql
|
||||
cp /opt/phpipam/config.dist.php /opt/phpipam/config.php
|
||||
sed -i -e "s/\(\$disable_installer = \).*/\1true;/" \
|
||||
-e "s/\(\$db\['user'\] = \).*/\1'$DB_USER';/" \
|
||||
-e "s/\(\$db\['pass'\] = \).*/\1'$DB_PASS';/" \
|
||||
-e "s/\(\$db\['name'\] = \).*/\1'$DB_NAME';/" \
|
||||
/opt/phpipam/config.php
|
||||
-e "s/\(\$db\['user'\] = \).*/\1'$DB_USER';/" \
|
||||
-e "s/\(\$db\['pass'\] = \).*/\1'$DB_PASS';/" \
|
||||
-e "s/\(\$db\['name'\] = \).*/\1'$DB_NAME';/" \
|
||||
/opt/phpipam/config.php
|
||||
sed -i '/max_execution_time/s/= .*/= 600/' /etc/php/8.2/apache2/php.ini
|
||||
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
|
||||
msg_ok "Installed phpIPAM"
|
||||
|
@ -15,12 +15,12 @@ update_os
|
||||
|
||||
msg_info "Installing Dependencies"
|
||||
$STD apt-get install -y \
|
||||
gnupg2 \
|
||||
mariadb-server \
|
||||
redis \
|
||||
nginx
|
||||
redis \
|
||||
nginx
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
install_mariadb
|
||||
|
||||
msg_info "Setting up Adoptium Repository"
|
||||
mkdir -p /etc/apt/keyrings
|
||||
curl -fsSL "https://packages.adoptium.net/artifactory/api/gpg/key/public" | gpg --dearmor >/etc/apt/trusted.gpg.d/adoptium.gpg
|
||||
@ -41,10 +41,10 @@ $STD mysql -u root -e "CREATE DATABASE $DB_NAME;"
|
||||
$STD mysql -u root -e "CREATE USER '$DB_USER'@'localhost' IDENTIFIED WITH mysql_native_password AS PASSWORD('$DB_PASS');"
|
||||
$STD mysql -u root -e "GRANT ALL ON $DB_NAME.* TO '$DB_USER'@'localhost'; FLUSH PRIVILEGES;"
|
||||
{
|
||||
echo "Plant-it Credentials"
|
||||
echo "Plant-it Database User: $DB_USER"
|
||||
echo "Plant-it Database Password: $DB_PASS"
|
||||
echo "Plant-it Database Name: $DB_NAME"
|
||||
echo "Plant-it Credentials"
|
||||
echo "Plant-it Database User: $DB_USER"
|
||||
echo "Plant-it Database Password: $DB_PASS"
|
||||
echo "Plant-it Database Name: $DB_NAME"
|
||||
} >>~/plant-it.creds
|
||||
msg_ok "Set up MariaDB"
|
||||
|
||||
|
@ -13,19 +13,7 @@ setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
msg_info "Installing Dependencies"
|
||||
$STD apt-get install -y gnupg
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
msg_info "Setting up PostgreSQL Repository"
|
||||
VERSION="$(awk -F'=' '/^VERSION_CODENAME=/{ print $NF }' /etc/os-release)"
|
||||
echo "deb http://apt.postgresql.org/pub/repos/apt ${VERSION}-pgdg main" >/etc/apt/sources.list.d/pgdg.list
|
||||
curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor --output /etc/apt/trusted.gpg.d/postgresql.gpg
|
||||
msg_ok "Setup PostgreSQL Repository"
|
||||
|
||||
msg_info "Installing PostgreSQL"
|
||||
$STD apt-get update
|
||||
$STD apt-get install -y postgresql
|
||||
PG_VERSION="17" install_postgresql
|
||||
|
||||
cat <<EOF >/etc/postgresql/17/main/pg_hba.conf
|
||||
# PostgreSQL Client Authentication Configuration File
|
||||
@ -127,7 +115,7 @@ default_text_search_config = 'pg_catalog.english'
|
||||
include_dir = 'conf.d'
|
||||
EOF
|
||||
|
||||
sudo systemctl restart postgresql
|
||||
systemctl restart postgresql
|
||||
msg_ok "Installed PostgreSQL"
|
||||
|
||||
read -r -p "${TAB3}Would you like to add Adminer? <y/N> " prompt
|
||||
|
@ -15,12 +15,13 @@ update_os
|
||||
|
||||
msg_info "Installing Dependencies"
|
||||
$STD apt-get install -y \
|
||||
mariadb-server \
|
||||
apache2 \
|
||||
libapache2-mod-php \
|
||||
php8.2-{pdo,mysql,mbstring,gettext,fileinfo,gd,xml,zip}
|
||||
apache2 \
|
||||
libapache2-mod-php \
|
||||
php8.2-{pdo,mysql,mbstring,gettext,fileinfo,gd,xml,zip}
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
install_mariadb
|
||||
|
||||
msg_info "Setting up MariaDB"
|
||||
DB_NAME=projectsend
|
||||
DB_USER=projectsend
|
||||
@ -29,10 +30,10 @@ $STD mysql -u root -e "CREATE DATABASE $DB_NAME;"
|
||||
$STD mysql -u root -e "CREATE USER '$DB_USER'@'localhost' IDENTIFIED WITH mysql_native_password AS PASSWORD('$DB_PASS');"
|
||||
$STD mysql -u root -e "GRANT ALL ON $DB_NAME.* TO '$DB_USER'@'localhost'; FLUSH PRIVILEGES;"
|
||||
{
|
||||
echo "projectsend-Credentials"
|
||||
echo "projectsend Database User: $DB_USER"
|
||||
echo "projectsend Database Password: $DB_PASS"
|
||||
echo "projectsend Database Name: $DB_NAME"
|
||||
echo "projectsend-Credentials"
|
||||
echo "projectsend Database User: $DB_USER"
|
||||
echo "projectsend Database Password: $DB_PASS"
|
||||
echo "projectsend Database Name: $DB_NAME"
|
||||
} >>~/projectsend.creds
|
||||
msg_ok "Set up MariaDB"
|
||||
|
||||
@ -47,14 +48,14 @@ chown -R www-data:www-data /opt/projectsend
|
||||
chmod -R 775 /opt/projectsend
|
||||
chmod 644 /opt/projectsend/includes/sys.config.php
|
||||
sed -i -e "s/\(define('DB_NAME', \).*/\1'$DB_NAME');/" \
|
||||
-e "s/\(define('DB_USER', \).*/\1'$DB_USER');/" \
|
||||
-e "s/\(define('DB_PASSWORD', \).*/\1'$DB_PASS');/" \
|
||||
/opt/projectsend/includes/sys.config.php
|
||||
-e "s/\(define('DB_USER', \).*/\1'$DB_USER');/" \
|
||||
-e "s/\(define('DB_PASSWORD', \).*/\1'$DB_PASS');/" \
|
||||
/opt/projectsend/includes/sys.config.php
|
||||
sed -i -e "s/^\(memory_limit = \).*/\1 256M/" \
|
||||
-e "s/^\(post_max_size = \).*/\1 256M/" \
|
||||
-e "s/^\(upload_max_filesize = \).*/\1 256M/" \
|
||||
-e "s/^\(max_execution_time = \).*/\1 300/" \
|
||||
/etc/php/8.2/apache2/php.ini
|
||||
-e "s/^\(post_max_size = \).*/\1 256M/" \
|
||||
-e "s/^\(upload_max_filesize = \).*/\1 256M/" \
|
||||
-e "s/^\(max_execution_time = \).*/\1 300/" \
|
||||
/etc/php/8.2/apache2/php.ini
|
||||
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
|
||||
msg_ok "Installed projectsend"
|
||||
|
||||
|
@ -17,12 +17,12 @@ msg_info "Installing Dependencies"
|
||||
$STD apt-get install -y \
|
||||
lsb-release \
|
||||
redis \
|
||||
mariadb-server \
|
||||
mariadb-client \
|
||||
apache2 \
|
||||
composer
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
install_mariadb
|
||||
|
||||
msg_info "Adding PHP8.4 Repository"
|
||||
$STD curl -sSLo /tmp/debsuryorg-archive-keyring.deb https://packages.sury.org/debsuryorg-archive-keyring.deb
|
||||
$STD dpkg -i /tmp/debsuryorg-archive-keyring.deb
|
||||
|
@ -20,6 +20,7 @@ $STD apt-get install -y ca-certificates
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
NODE_VERSION="22" install_node_and_modules
|
||||
install_mariadb
|
||||
|
||||
msg_info "Installing FFMPEG"
|
||||
$STD apt-get install -y ffmpeg
|
||||
@ -41,7 +42,6 @@ sqluser="root"
|
||||
sqlpass="root"
|
||||
echo "mariadb-server mariadb-server/root_password password $sqlpass" | debconf-set-selections
|
||||
echo "mariadb-server mariadb-server/root_password_again password $sqlpass" | debconf-set-selections
|
||||
$STD apt-get install -y mariadb-server
|
||||
service mysql start
|
||||
mysql -u "$sqluser" -p"$sqlpass" -e "source sql/user.sql" || true
|
||||
msg_ok "Installed Database"
|
||||
|
@ -15,13 +15,14 @@ update_os
|
||||
|
||||
msg_info "Installing Dependencies"
|
||||
$STD apt-get install -y \
|
||||
composer \
|
||||
git \
|
||||
nginx \
|
||||
php8.2-{bcmath,common,ctype,curl,fileinfo,fpm,gd,iconv,intl,mbstring,mysql,soap,xml,xsl,zip,cli} \
|
||||
mariadb-server
|
||||
composer \
|
||||
git \
|
||||
nginx \
|
||||
php8.2-{bcmath,common,ctype,curl,fileinfo,fpm,gd,iconv,intl,mbstring,mysql,soap,xml,xsl,zip,cli}
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
install_mariadb
|
||||
|
||||
msg_info "Setting up database"
|
||||
DB_NAME=snipeit_db
|
||||
DB_USER=snipeit
|
||||
@ -30,10 +31,10 @@ mysql -u root -e "CREATE DATABASE $DB_NAME;"
|
||||
mysql -u root -e "CREATE USER '$DB_USER'@'localhost' IDENTIFIED WITH mysql_native_password AS PASSWORD('$DB_PASS');"
|
||||
mysql -u root -e "GRANT ALL ON $DB_NAME.* TO '$DB_USER'@'localhost'; FLUSH PRIVILEGES;"
|
||||
{
|
||||
echo "SnipeIT-Credentials"
|
||||
echo "SnipeIT Database User: $DB_USER"
|
||||
echo "SnipeIT Database Password: $DB_PASS"
|
||||
echo "SnipeIT Database Name: $DB_NAME"
|
||||
echo "SnipeIT-Credentials"
|
||||
echo "SnipeIT Database User: $DB_USER"
|
||||
echo "SnipeIT Database Password: $DB_PASS"
|
||||
echo "SnipeIT Database Name: $DB_NAME"
|
||||
} >>~/snipeit.creds
|
||||
msg_ok "Set up database"
|
||||
|
||||
@ -48,9 +49,9 @@ cp .env.example .env
|
||||
IPADDRESS=$(hostname -I | awk '{print $1}')
|
||||
|
||||
sed -i -e "s|^APP_URL=.*|APP_URL=http://$IPADDRESS|" \
|
||||
-e "s|^DB_DATABASE=.*|DB_DATABASE=$DB_NAME|" \
|
||||
-e "s|^DB_USERNAME=.*|DB_USERNAME=$DB_USER|" \
|
||||
-e "s|^DB_PASSWORD=.*|DB_PASSWORD=$DB_PASS|" .env
|
||||
-e "s|^DB_DATABASE=.*|DB_DATABASE=$DB_NAME|" \
|
||||
-e "s|^DB_USERNAME=.*|DB_USERNAME=$DB_USER|" \
|
||||
-e "s|^DB_PASSWORD=.*|DB_PASSWORD=$DB_PASS|" .env
|
||||
|
||||
chown -R www-data: /opt/snipe-it
|
||||
chmod -R 755 /opt/snipe-it
|
||||
|
@ -15,11 +15,12 @@ update_os
|
||||
|
||||
msg_info "Installing Dependencies"
|
||||
$STD apt-get install -y \
|
||||
libapache2-mod-php \
|
||||
mariadb-server \
|
||||
php8.2-{curl,mbstring,mysql,xml,zip,gd}
|
||||
libapache2-mod-php \
|
||||
php8.2-{curl,mbstring,mysql,xml,zip,gd}
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
install_mariadb
|
||||
|
||||
msg_info "Setting up Database"
|
||||
DB_NAME=wavelog
|
||||
DB_USER=waveloguser
|
||||
@ -28,10 +29,10 @@ $STD mysql -u root -e "CREATE DATABASE $DB_NAME;"
|
||||
$STD mysql -u root -e "CREATE USER '$DB_USER'@'localhost' IDENTIFIED WITH mysql_native_password AS PASSWORD('$DB_PASS');"
|
||||
$STD mysql -u root -e "GRANT ALL ON $DB_NAME.* TO '$DB_USER'@'localhost'; FLUSH PRIVILEGES;"
|
||||
{
|
||||
echo "Wavelog-Credentials"
|
||||
echo "Wavelog Database User: $DB_USER"
|
||||
echo "Wavelog Database Password: $DB_PASS"
|
||||
echo "Wavelog Database Name: $DB_NAME"
|
||||
echo "Wavelog-Credentials"
|
||||
echo "Wavelog Database User: $DB_USER"
|
||||
echo "Wavelog Database Password: $DB_PASS"
|
||||
echo "Wavelog Database Name: $DB_NAME"
|
||||
} >>~/wavelog.creds
|
||||
msg_ok "Set up database"
|
||||
|
||||
|
@ -15,12 +15,13 @@ update_os
|
||||
|
||||
msg_info "Installing Dependencies (Patience)"
|
||||
$STD apt-get install -y \
|
||||
apache2 \
|
||||
php8.2-{bcmath,common,cli,curl,fpm,gd,snmp,imap,mbstring,mysql,xml,zip} \
|
||||
libapache2-mod-php \
|
||||
mariadb-server
|
||||
apache2 \
|
||||
php8.2-{bcmath,common,cli,curl,fpm,gd,snmp,imap,mbstring,mysql,xml,zip} \
|
||||
libapache2-mod-php
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
install_mariadb
|
||||
|
||||
msg_info "Setting up Database"
|
||||
DB_NAME=wordpress_db
|
||||
DB_USER=wordpress
|
||||
@ -29,10 +30,10 @@ $STD mysql -u root -e "CREATE DATABASE $DB_NAME;"
|
||||
$STD mysql -u root -e "CREATE USER '$DB_USER'@'localhost' IDENTIFIED BY '$DB_PASS';"
|
||||
$STD mysql -u root -e "GRANT ALL PRIVILEGES ON $DB_NAME.* TO '$DB_USER'@'localhost'; FLUSH PRIVILEGES;"
|
||||
{
|
||||
echo "WordPress Credentials"
|
||||
echo "Database User: $DB_USER"
|
||||
echo "Database Password: $DB_PASS"
|
||||
echo "Database Name: $DB_NAME"
|
||||
echo "WordPress Credentials"
|
||||
echo "Database User: $DB_USER"
|
||||
echo "Database Password: $DB_PASS"
|
||||
echo "Database Name: $DB_NAME"
|
||||
} >>~/wordpress.creds
|
||||
msg_ok "Set up Database"
|
||||
|
||||
@ -46,9 +47,9 @@ find . -type d -exec chmod 755 {} \;
|
||||
find . -type f -exec chmod 644 {} \;
|
||||
mv wp-config-sample.php wp-config.php
|
||||
sed -i -e "s|^define( 'DB_NAME', '.*' );|define( 'DB_NAME', '$DB_NAME' );|" \
|
||||
-e "s|^define( 'DB_USER', '.*' );|define( 'DB_USER', '$DB_USER' );|" \
|
||||
-e "s|^define( 'DB_PASSWORD', '.*' );|define( 'DB_PASSWORD', '$DB_PASS' );|" \
|
||||
/var/www/html/wordpress/wp-config.php
|
||||
-e "s|^define( 'DB_USER', '.*' );|define( 'DB_USER', '$DB_USER' );|" \
|
||||
-e "s|^define( 'DB_PASSWORD', '.*' );|define( 'DB_PASSWORD', '$DB_PASS' );|" \
|
||||
/var/www/html/wordpress/wp-config.php
|
||||
msg_ok "Installed Wordpress"
|
||||
|
||||
msg_info "Setup Services"
|
||||
|
171
misc/tools.func
171
misc/tools.func
@ -122,20 +122,22 @@ install_node_and_modules() {
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Installs or upgrades PostgreSQL and performs data migration.
|
||||
# Installs or upgrades PostgreSQL and optional extensions/modules.
|
||||
#
|
||||
# Description:
|
||||
# - Detects existing PostgreSQL version
|
||||
# - Dumps all databases before upgrade
|
||||
# - Adds PGDG repo and installs specified version
|
||||
# - Installs optional PG_MODULES (e.g. postgis, contrib)
|
||||
# - Restores dumped data post-upgrade
|
||||
#
|
||||
# Variables:
|
||||
# PG_VERSION - Major PostgreSQL version (e.g. 15, 16) (default: 16)
|
||||
# PG_MODULES - Comma-separated list of extensions (e.g. "postgis,contrib")
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
install_postgresql() {
|
||||
local PG_VERSION="${PG_VERSION:-16}"
|
||||
local PG_MODULES="${PG_MODULES:-}"
|
||||
local CURRENT_PG_VERSION=""
|
||||
local DISTRO
|
||||
local NEED_PG_INSTALL=false
|
||||
@ -145,10 +147,10 @@ install_postgresql() {
|
||||
CURRENT_PG_VERSION="$(psql -V | awk '{print $3}' | cut -d. -f1)"
|
||||
if [[ "$CURRENT_PG_VERSION" == "$PG_VERSION" ]]; then
|
||||
msg_ok "PostgreSQL $PG_VERSION is already installed"
|
||||
return
|
||||
else
|
||||
msg_info "Detected PostgreSQL $CURRENT_PG_VERSION, preparing upgrade to $PG_VERSION"
|
||||
NEED_PG_INSTALL=true
|
||||
fi
|
||||
msg_info "Detected PostgreSQL $CURRENT_PG_VERSION, preparing upgrade to $PG_VERSION"
|
||||
NEED_PG_INSTALL=true
|
||||
else
|
||||
msg_info "Setup PostgreSQL $PG_VERSION"
|
||||
NEED_PG_INSTALL=true
|
||||
@ -179,20 +181,34 @@ install_postgresql() {
|
||||
$STD apt-get install -y "postgresql-${PG_VERSION}" "postgresql-client-${PG_VERSION}"
|
||||
|
||||
if [[ -n "$CURRENT_PG_VERSION" ]]; then
|
||||
$STD msg_info "Removing old PostgreSQL $CURRENT_PG_VERSION packages"
|
||||
msg_info "Removing old PostgreSQL $CURRENT_PG_VERSION packages"
|
||||
$STD apt-get purge -y "postgresql-${CURRENT_PG_VERSION}" "postgresql-client-${CURRENT_PG_VERSION}" || true
|
||||
fi
|
||||
|
||||
$STD msg_info "Starting PostgreSQL $PG_VERSION"
|
||||
msg_info "Starting PostgreSQL $PG_VERSION"
|
||||
systemctl enable -q --now postgresql
|
||||
|
||||
if [[ -n "$CURRENT_PG_VERSION" ]]; then
|
||||
$STD msg_info "Restoring dumped data"
|
||||
msg_info "Restoring dumped data"
|
||||
su - postgres -c "psql < /var/lib/postgresql/backup_$(date +%F)_v${CURRENT_PG_VERSION}.sql"
|
||||
fi
|
||||
|
||||
msg_ok "PostgreSQL $PG_VERSION installed"
|
||||
fi
|
||||
|
||||
# Install optional PostgreSQL modules
|
||||
if [[ -n "$PG_MODULES" ]]; then
|
||||
IFS=',' read -ra MODULES <<<"$PG_MODULES"
|
||||
for module in "${MODULES[@]}"; do
|
||||
local pkg="postgresql-${PG_VERSION}-${module}"
|
||||
msg_info "Installing PostgreSQL module: $pkg"
|
||||
$STD apt-get install -y "$pkg" || {
|
||||
msg_error "Failed to install $pkg"
|
||||
continue
|
||||
}
|
||||
done
|
||||
msg_ok "All requested PostgreSQL modules installed"
|
||||
fi
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
@ -364,8 +380,10 @@ install_php() {
|
||||
CURRENT_PHP=""
|
||||
fi
|
||||
|
||||
if [[ "$CURRENT_PHP" != "$PHP_VERSION" ]]; then
|
||||
$STD msg_info "PHP $CURRENT_PHP detected, migrating to PHP $PHP_VERSION"
|
||||
if [[ -z "$CURRENT_PHP" ]]; then
|
||||
msg_info "Setup PHP $PHP_VERSION"
|
||||
elif [[ "$CURRENT_PHP" != "$PHP_VERSION" ]]; then
|
||||
msg_info "PHP $CURRENT_PHP detected, migrating to PHP $PHP_VERSION"
|
||||
if [[ ! -f /etc/apt/sources.list.d/php.list ]]; then
|
||||
$STD curl -fsSLo /tmp/debsuryorg-archive-keyring.deb https://packages.sury.org/debsuryorg-archive-keyring.deb
|
||||
$STD dpkg -i /tmp/debsuryorg-archive-keyring.deb
|
||||
@ -382,6 +400,9 @@ install_php() {
|
||||
for mod in "${MODULES[@]}"; do
|
||||
MODULE_LIST+=" php${PHP_VERSION}-${mod}"
|
||||
done
|
||||
if [[ "$PHP_FPM" == "YES" ]]; then
|
||||
MODULE_LIST+=" php${PHP_VERSION}-fpm"
|
||||
fi
|
||||
|
||||
if [[ "$PHP_APACHE" == "YES" ]]; then
|
||||
# Optionally disable old Apache PHP module
|
||||
@ -448,7 +469,7 @@ install_composer() {
|
||||
|
||||
# Download and install latest composer
|
||||
curl -fsSL https://getcomposer.org/installer -o /tmp/composer-setup.php
|
||||
php /tmp/composer-setup.php --install-dir=/usr/local/bin --filename=composer &>/dev/null
|
||||
php /tmp/composer-setup.php --install-dir=/usr/local/bin --filename=composer >/dev/null 2>&1
|
||||
|
||||
if [[ $? -ne 0 ]]; then
|
||||
msg_error "Failed to install Composer"
|
||||
@ -456,7 +477,9 @@ install_composer() {
|
||||
fi
|
||||
|
||||
chmod +x "$COMPOSER_BIN"
|
||||
msg_ok "Installed Composer $($COMPOSER_BIN --version | awk '{print $3}')"
|
||||
composer diagnose >/dev/null 2>&1
|
||||
msg_ok "Setup Composer"
|
||||
#msg_ok "Installed Composer $($COMPOSER_BIN --version | awk '{print $3}')"
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
@ -589,11 +612,21 @@ install_java() {
|
||||
|
||||
install_mongodb() {
|
||||
local MONGO_VERSION="${MONGO_VERSION:-8.0}"
|
||||
local DISTRO_CODENAME
|
||||
DISTRO_CODENAME=$(awk -F= '/VERSION_CODENAME/ { print $2 }' /etc/os-release)
|
||||
local DISTRO_ID DISTRO_CODENAME MONGO_BASE_URL
|
||||
DISTRO_ID=$(awk -F= '/^ID=/{ gsub(/"/,"",$2); print $2 }' /etc/os-release)
|
||||
DISTRO_CODENAME=$(awk -F= '/^VERSION_CODENAME=/{ print $2 }' /etc/os-release)
|
||||
|
||||
case "$DISTRO_ID" in
|
||||
ubuntu) MONGO_BASE_URL="https://repo.mongodb.org/apt/ubuntu" ;;
|
||||
debian) MONGO_BASE_URL="https://repo.mongodb.org/apt/debian" ;;
|
||||
*)
|
||||
msg_error "Unsupported distribution: $DISTRO_ID"
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
|
||||
local REPO_LIST="/etc/apt/sources.list.d/mongodb-org-${MONGO_VERSION}.list"
|
||||
|
||||
# Aktuell installierte Major-Version ermitteln
|
||||
local INSTALLED_VERSION=""
|
||||
if command -v mongod >/dev/null; then
|
||||
INSTALLED_VERSION=$(mongod --version | awk '/db version/{print $3}' | cut -d. -f1,2)
|
||||
@ -607,7 +640,6 @@ install_mongodb() {
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Ältere Version entfernen (nur Packages, nicht Daten!)
|
||||
if [[ -n "$INSTALLED_VERSION" ]]; then
|
||||
msg_info "Replacing MongoDB $INSTALLED_VERSION with $MONGO_VERSION (data will be preserved)"
|
||||
$STD systemctl stop mongod || true
|
||||
@ -618,15 +650,17 @@ install_mongodb() {
|
||||
msg_info "Installing MongoDB $MONGO_VERSION"
|
||||
fi
|
||||
|
||||
# MongoDB Repo hinzufügen
|
||||
curl -fsSL "https://pgp.mongodb.com/server-${MONGO_VERSION}.asc" | gpg --dearmor -o "/etc/apt/trusted.gpg.d/mongodb-${MONGO_VERSION}.gpg"
|
||||
echo "deb [signed-by=/etc/apt/trusted.gpg.d/mongodb-${MONGO_VERSION}.gpg] https://repo.mongodb.org/apt/debian ${DISTRO_CODENAME}/mongodb-org/${MONGO_VERSION} main" \
|
||||
echo "deb [signed-by=/etc/apt/trusted.gpg.d/mongodb-${MONGO_VERSION}.gpg] ${MONGO_BASE_URL} ${DISTRO_CODENAME}/mongodb-org/${MONGO_VERSION} main" \
|
||||
>"$REPO_LIST"
|
||||
|
||||
$STD apt-get update
|
||||
$STD apt-get update || {
|
||||
msg_error "APT update failed — invalid MongoDB repo for ${DISTRO_ID}-${DISTRO_CODENAME}?"
|
||||
return 1
|
||||
}
|
||||
|
||||
$STD apt-get install -y mongodb-org
|
||||
|
||||
# Sicherstellen, dass Datenverzeichnis intakt bleibt
|
||||
mkdir -p /var/lib/mongodb
|
||||
chown -R mongodb:mongodb /var/lib/mongodb
|
||||
|
||||
@ -1212,3 +1246,100 @@ create_selfsigned_certs() {
|
||||
-subj "/C=US/O=$app/OU=Domain Control Validated/CN=localhost"
|
||||
$STD msg_ok "Created Self-Signed Certificate"
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Installs Rust toolchain and optional global crates via cargo.
|
||||
#
|
||||
# Description:
|
||||
# - Installs rustup (if missing)
|
||||
# - Installs or updates desired Rust toolchain (stable, nightly, or versioned)
|
||||
# - Installs or updates specified global crates using `cargo install`
|
||||
#
|
||||
# Notes:
|
||||
# - Skips crate install if exact version is already present
|
||||
# - Updates crate if newer version or different version is requested
|
||||
#
|
||||
# Variables:
|
||||
# RUST_TOOLCHAIN - Rust toolchain to install (default: stable)
|
||||
# RUST_CRATES - Comma-separated list of crates (e.g. "cargo-edit,wasm-pack@0.12.1")
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
install_rust_and_crates() {
|
||||
local RUST_TOOLCHAIN="${RUST_TOOLCHAIN:-stable}"
|
||||
local RUST_CRATES="${RUST_CRATES:-}"
|
||||
local CARGO_BIN="${HOME}/.cargo/bin"
|
||||
|
||||
# rustup & toolchain
|
||||
if ! command -v rustup &>/dev/null; then
|
||||
msg_info "Installing rustup"
|
||||
curl -fsSL https://sh.rustup.rs | $STD sh -s -- -y --default-toolchain "$RUST_TOOLCHAIN"
|
||||
export PATH="$CARGO_BIN:$PATH"
|
||||
echo 'export PATH="$HOME/.cargo/bin:$PATH"' >>"$HOME/.profile"
|
||||
msg_ok "Installed rustup with $RUST_TOOLCHAIN"
|
||||
else
|
||||
$STD rustup install "$RUST_TOOLCHAIN"
|
||||
$STD rustup default "$RUST_TOOLCHAIN"
|
||||
$STD rustup update "$RUST_TOOLCHAIN"
|
||||
msg_ok "Rust toolchain set to $RUST_TOOLCHAIN"
|
||||
fi
|
||||
|
||||
# install/update crates
|
||||
if [[ -n "$RUST_CRATES" ]]; then
|
||||
IFS=',' read -ra CRATES <<<"$RUST_CRATES"
|
||||
for crate in "${CRATES[@]}"; do
|
||||
local NAME VER INSTALLED_VER
|
||||
if [[ "$crate" == *"@"* ]]; then
|
||||
NAME="${crate%@*}"
|
||||
VER="${crate##*@}"
|
||||
else
|
||||
NAME="$crate"
|
||||
VER=""
|
||||
fi
|
||||
|
||||
INSTALLED_VER=$(cargo install --list 2>/dev/null | awk "/^$NAME v[0-9]/ {print \$2}" | tr -d 'v')
|
||||
|
||||
if [[ -n "$INSTALLED_VER" ]]; then
|
||||
if [[ -n "$VER" && "$VER" != "$INSTALLED_VER" ]]; then
|
||||
msg_info "Updating $NAME from $INSTALLED_VER to $VER"
|
||||
$STD cargo install "$NAME" --version "$VER" --force
|
||||
elif [[ -z "$VER" ]]; then
|
||||
msg_info "Updating $NAME to latest"
|
||||
$STD cargo install "$NAME" --force
|
||||
else
|
||||
msg_ok "$NAME@$INSTALLED_VER already up to date"
|
||||
fi
|
||||
else
|
||||
msg_info "Installing $NAME ${VER:+($VER)}"
|
||||
$STD cargo install "$NAME" ${VER:+--version "$VER"}
|
||||
fi
|
||||
done
|
||||
msg_ok "All requested Rust crates processed"
|
||||
fi
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Installs Adminer (Debian/Ubuntu via APT, Alpine via direct download).
|
||||
#
|
||||
# Description:
|
||||
# - Adds Adminer to Apache or web root
|
||||
# - Supports Alpine and Debian-based systems
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
install_adminer() {
|
||||
if grep -qi alpine /etc/os-release; then
|
||||
msg_info "Installing Adminer (Alpine)"
|
||||
mkdir -p /var/www/localhost/htdocs/adminer
|
||||
if ! curl -fsSL https://github.com/vrana/adminer/releases/latest/download/adminer.php \
|
||||
-o /var/www/localhost/htdocs/adminer/index.php; then
|
||||
msg_error "Failed to download Adminer"
|
||||
return 1
|
||||
fi
|
||||
msg_ok "Adminer available at /adminer (Alpine)"
|
||||
else
|
||||
msg_info "Installing Adminer (Debian/Ubuntu)"
|
||||
$STD apt-get install -y adminer
|
||||
$STD a2enconf adminer
|
||||
$STD systemctl reload apache2
|
||||
msg_ok "Adminer available at /adminer (Debian/Ubuntu)"
|
||||
fi
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user