Update infisical
This commit is contained in:
parent
23e08b5f26
commit
82e96b7dba
@ -0,0 +1,60 @@
|
||||
#!/usr/bin/env bash
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func)
|
||||
# Copyright (c) 2021-2025 community-scripts ORG
|
||||
# Author: Slaviša Arežina (tremor021)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://infisical.com/
|
||||
|
||||
APP="Infisical"
|
||||
var_tags="${var_tags:-auth}"
|
||||
var_cpu="${var_cpu:-2}"
|
||||
var_ram="${var_ram:-2048}"
|
||||
var_disk="${var_disk:-4}"
|
||||
var_os="${var_os:-debian}"
|
||||
var_version="${var_version:-13}"
|
||||
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 /etc/infisical ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
|
||||
msg_info "Stopping service"
|
||||
$STD inisical-ctl stop
|
||||
msg_ok "Service stopped"
|
||||
|
||||
msg_info "Creating backup"
|
||||
DB_PASS=$(grep -Po '(?<=^Database Password:\s).*' ~/infisical.creds | head -n1)
|
||||
PGPASSWORD=$DB_PASS pg_dump -U infisical -h localhost -d infisical_db > /opt/infisical_backup.sql
|
||||
msg_ok "Created backup"
|
||||
|
||||
msg_info "Updating Infisical"
|
||||
$STD apt update
|
||||
$STD apt install -y infisical-core
|
||||
$STD infisical-ctl reconfigure
|
||||
msg_ok "Updated Infisical"
|
||||
|
||||
msg_info "Starting service"
|
||||
infisical-ctl start
|
||||
msg_ok "Started service"
|
||||
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} Access it using the following URL:${CL}"
|
||||
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:3000${CL}"
|
||||
@ -33,8 +33,8 @@ msg_ok "Setup Infisical repository"
|
||||
PG_VERSION="17" setup_postgresql
|
||||
|
||||
msg_info "Setting up PostgreSQL"
|
||||
DB_NAME="infiscal_db"
|
||||
DB_USER="infiscal"
|
||||
DB_NAME="infisical_db"
|
||||
DB_USER="infisical"
|
||||
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 ENCODING 'UTF8' TEMPLATE template0;"
|
||||
@ -46,7 +46,7 @@ $STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET timezone TO 'UTC';"
|
||||
echo "Database Name: $DB_NAME"
|
||||
echo "Database User: $DB_USER"
|
||||
echo "Database Password: $DB_PASS"
|
||||
} >>~/infiscal.creds
|
||||
} >>~/infisical.creds
|
||||
msg_ok "Setup PostgreSQL"
|
||||
|
||||
msg_info "Setting up Infisical"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user