refs #1134 changes all permissions to opengnsys
testing/og-dhcp-API/pipeline/head There was a failure building this commit
Details
testing/og-dhcp-API/pipeline/head There was a failure building this commit
Details
parent
18811105a6
commit
6afc14fb9a
|
|
@ -18,7 +18,7 @@ server {
|
||||||
# Bloque para manejar las solicitudes a index.php
|
# Bloque para manejar las solicitudes a index.php
|
||||||
location ~ ^/index.php(/|$) {
|
location ~ ^/index.php(/|$) {
|
||||||
include fastcgi_params;
|
include fastcgi_params;
|
||||||
fastcgi_pass unix:/run/php/php__PHPVERSION__-fpm-ogdhcp.sock; # Asegúrate de que esto sea correcto
|
fastcgi_pass unix:/run/php/php__PHPVERSION__-fpm.sock; # Asegúrate de que esto sea correcto
|
||||||
fastcgi_split_path_info ^(.+\.php)(/.*)$;
|
fastcgi_split_path_info ^(.+\.php)(/.*)$;
|
||||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
fastcgi_param PATH_INFO $fastcgi_path_info;
|
fastcgi_param PATH_INFO $fastcgi_path_info;
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ function globalSetup() {
|
||||||
current_dir=$(dirname "$0")
|
current_dir=$(dirname "$0")
|
||||||
PROGRAMDIR=$(readlink -e "$current_dir")
|
PROGRAMDIR=$(readlink -e "$current_dir")
|
||||||
PROGRAMNAME=$(basename "$0")
|
PROGRAMNAME=$(basename "$0")
|
||||||
OPENGNSYS_CLIENT_USER="ogdhcp"
|
OPENGNSYS_CLIENT_USER="opengnsys"
|
||||||
current_dir=$(dirname "$0")
|
current_dir=$(dirname "$0")
|
||||||
PROGRAMDIR=$(readlink -e "$current_dir")
|
PROGRAMDIR=$(readlink -e "$current_dir")
|
||||||
|
|
||||||
|
|
@ -182,25 +182,25 @@ function createDirs() {
|
||||||
function create_ogdhcp_project {
|
function create_ogdhcp_project {
|
||||||
# Crea el usuario ogdhcp si no existe
|
# Crea el usuario ogdhcp si no existe
|
||||||
local path_opengnsys_base="$1"
|
local path_opengnsys_base="$1"
|
||||||
if ! id -u ogdhcp &>/dev/null; then
|
if ! id -u opengnsys &>/dev/null; then
|
||||||
echoAndLog "${FUNCNAME}(): creating ogdhcp user"
|
echoAndLog "${FUNCNAME}(): creating opengnsys user"
|
||||||
useradd ogdhcp 2>/dev/null
|
useradd opengnsys 2>/dev/null
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
errorAndLog "${FUNCNAME}(): error creating ogdhcp user"
|
errorAndLog "${FUNCNAME}(): error creating opengnsys user"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Crea el directorio path_opengnsys_base con el usuario ogdhcp
|
# Crea el directorio path_opengnsys_base con el usuario opengnsys
|
||||||
echoAndLog "${FUNCNAME}(): creating directory $path_opengnsys_base with ogdhcp user"
|
echoAndLog "${FUNCNAME}(): creating directory $path_opengnsys_base with opengnsys user"
|
||||||
sudo mkdir -p "$path_opengnsys_base"
|
sudo mkdir -p "$path_opengnsys_base"
|
||||||
sudo chown ogdhcp:ogdhcp $path_opengnsys_base
|
sudo chown opengnsys:opengnsys $path_opengnsys_base
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
errorAndLog "${FUNCNAME}(): error while creating directory $path_opengnsys_base"
|
errorAndLog "${FUNCNAME}(): error while creating directory $path_opengnsys_base"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echoAndLog "Directory $path_opengnsys_base created with ogdhcp user"
|
echoAndLog "Directory $path_opengnsys_base created with opengnsys user"
|
||||||
}
|
}
|
||||||
|
|
||||||
function copyServerFiles() {
|
function copyServerFiles() {
|
||||||
|
|
@ -413,9 +413,9 @@ setup_nginx() {
|
||||||
ln -sf "$NGINX_OUTPUT" /etc/nginx/sites-enabled/ogdhcp.conf
|
ln -sf "$NGINX_OUTPUT" /etc/nginx/sites-enabled/ogdhcp.conf
|
||||||
echo "Enlace simbólico creado en /etc/nginx/sites-enabled/ogdhcp.conf."
|
echo "Enlace simbólico creado en /etc/nginx/sites-enabled/ogdhcp.conf."
|
||||||
|
|
||||||
# Modificar nginx.conf para ejecutar como ogdhcp
|
# Modificar nginx.conf para ejecutar como opengnsys
|
||||||
sed -i 's/user www-data;/user ogdhcp;/g' "$NGINX_CONF_PATH"
|
sed -i 's/user www-data;/user opengnsys;/g' "$NGINX_CONF_PATH"
|
||||||
echo "Nginx configurado para ejecutarse como ogdhcp."
|
echo "Nginx configurado para ejecutarse como opengnsys."
|
||||||
|
|
||||||
# Reiniciar Nginx
|
# Reiniciar Nginx
|
||||||
systemctl restart nginx.service
|
systemctl restart nginx.service
|
||||||
|
|
@ -440,11 +440,11 @@ modify_php_fpm_config() {
|
||||||
|
|
||||||
# Modificar el archivo ogdhcp.conf
|
# Modificar el archivo ogdhcp.conf
|
||||||
sed -i 's/\[www\]/[ogdhcp]/g' "$new_fpm_conf_path"
|
sed -i 's/\[www\]/[ogdhcp]/g' "$new_fpm_conf_path"
|
||||||
sed -i 's/user = www-data/user = ogdhcp/g' "$new_fpm_conf_path"
|
sed -i 's/user = www-data/user = opengnsys/g' "$new_fpm_conf_path"
|
||||||
sed -i 's/group = www-data/group = ogdhcp/g' "$new_fpm_conf_path"
|
sed -i 's/group = www-data/group = opengnsys/g' "$new_fpm_conf_path"
|
||||||
sed -i "s|listen =.*|listen = $socket_path|g" "$new_fpm_conf_path"
|
sed -i "s|listen =.*|listen = $socket_path|g" "$new_fpm_conf_path"
|
||||||
sed -i 's/listen.owner = www-data/listen.owner = ogdhcp/g' "$new_fpm_conf_path"
|
sed -i 's/listen.owner = www-data/listen.owner = opengnsys/g' "$new_fpm_conf_path"
|
||||||
sed -i 's/listen.group = www-data/listen.group = ogdhcp/g' "$new_fpm_conf_path"
|
sed -i 's/listen.group = www-data/listen.group = opengnsys/g' "$new_fpm_conf_path"
|
||||||
|
|
||||||
# Reiniciar PHP-FPM
|
# Reiniciar PHP-FPM
|
||||||
systemctl restart php"$php_version"-fpm.service
|
systemctl restart php"$php_version"-fpm.service
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue