Ajustes SigERP (db user) e SigPDV (CliSiTef)

This commit is contained in:
Christian Tosta
2025-06-03 15:05:09 -03:00
parent 2f74d906c3
commit ddb1432fa7

View File

@@ -3,7 +3,7 @@
set -euo pipefail
self=$(basename ${0})
self=${self/.*bash}
version=2505.6
version=2506.1
# == Funções Gerais ============================================================================== #
@@ -593,7 +593,7 @@ function produto.install {
# Runner and systemd units
download "installer/config/${PRODUTO}/sigerp-runner-pyenv-${_pdpy}.sh" \
"/srv/sig/${PRODUTO}/sigerp-runner" \
&& chmod +x "/srv/sig/${PRODUTO}/sigerp-runner" \
&& chmod +x "/srv/sig/${PRODUTO}/sigerp-runner" \
&& ln -snf \
"/srv/sig/${PRODUTO}/sigerp-runner" \
"/usr/local/bin/sigerp-runner"
@@ -626,21 +626,29 @@ function produto.install {
-x "${CACHEDIR}/${PRODUTO}/artwork-sigerp.zip"
# Runtime dependencies
SIGERP_PACKAGES="libmysqlclient21"
SIGERP_PACKAGES="\
atop \
libmysqlclient21 \
net-tools \
rclone \
tmate \
vim-nox \
"
system.install_pkgs ${SIGERP_PACKAGES}
# Create/Alter PostgreSQL user
local _dbuser="openerp"
local _password=$(openssl rand -base64 32 | sed 's/\//|/g')
${ui}.status info $"Criando/Atualizando usuário do banco de dados [%s]" ${PRODUTO}
sudo -iu postgres \
psql -c \
"CREATE USER ${PRODUTO} WITH \
"CREATE USER ${_dbuser} WITH \
PASSWORD '${_password}' \
CREATEDB;" \
|| \
sudo -iu postgres \
psql -c \
"ALTER USER ${PRODUTO} WITH \
"ALTER USER ${_dbuser} WITH \
PASSWORD '${_password}' \
CREATEDB;"
@@ -664,11 +672,13 @@ function produto.install {
# TODO: Simplificar essa baderna
SIGPV_PACKAGES="
atop \
libmysqlclient21 \
mousepad \
net-tools \
qt5dxcb-plugin \
system-config-printer \
terminator \
rclone \
tmate \
vim-nox \
"
@@ -735,6 +745,11 @@ function produto.install {
download "installer/config/${PRODUTO}/CliSiTef.ini" \
"/usr/local/sigext/CliSiTef.ini"
for amb in homologacao producao lib_ssl_antiga; do
ln -snf \
"/usr/local/sigext/CliSiTef.ini" \
/srv/sig/${PRODUTO}/sigtef/lib_x86_64/${amb}/
done
# PostgreSQL user and database
local _password=$(openssl rand -base64 32 | sed 's/\//|/g')