refs #799 fix problems with composer routes

nginx_conf
Qindel 2024-10-01 09:34:08 +00:00
parent bab0bcc56a
commit 9ff1941882
2 changed files with 33 additions and 16 deletions

View File

@ -12,4 +12,6 @@ return [
Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true],
Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true],
App\DhcpBundle\DhcpBundle::class => ['all' => true],
Nelmio\ApiDocBundle\NelmioApiDocBundle::class => ['all' => true],
];

View File

@ -172,17 +172,30 @@ function createDirs() {
cp -a "$WORKDIR/ogdhcp/.env" "${path_opengnsys_base}/.env"
}
function create_ogdhcp_project {
# Cambia al usuario ogdhcp y crea el proyecto Symfony
local path_opengnsys_base="$1"
sudo -u ogboot composer create-project symfony/website-skeleton "$path_opengnsys_base"
pushd "$path_opengnsys_base" || return
# Elimina el archivo composer.lock
rm composer.lock
popd || return
echoAndLog "Esqueleto de la aplicación creado y archivo composer.lock eliminado."
}
function create_ogdhcp_project {
# Crea el usuario ogdhcp si no existe
local path_opengnsys_base="$1"
if ! id -u ogdhcp &>/dev/null; then
echoAndLog "${FUNCNAME}(): creating ogdhcp user"
useradd ogdhcp 2>/dev/null
if [ $? -ne 0 ]; then
errorAndLog "${FUNCNAME}(): error creating ogdhcp user"
return 1
fi
fi
# Crea el directorio path_opengnsys_base con el usuario ogdhcp
echoAndLog "${FUNCNAME}(): creating directory $path_opengnsys_base with ogdhcp user"
sudo mkdir -p "$path_opengnsys_base"
sudo chown ogdhcp:ogdhcp $path_opengnsys_base
if [ $? -ne 0 ]; then
errorAndLog "${FUNCNAME}(): error while creating directory $path_opengnsys_base"
return 1
fi
echoAndLog "Directory $path_opengnsys_base created with ogdhcp user"
}
function copyServerFiles() {
if [ $# -ne 1 ]; then
@ -246,9 +259,11 @@ function copyServerFiles() {
function runComposer() {
echoAndLog "Running composer.phar to install dependencies..."
local path_opengnsys_base="$1"
pushd $path_opengnsys_base
pwd
# Ejecutar composer.phar
sudo -u "$OPENGNSYS_CLIENT_USER" composer install
sudo -u "$OPENGNSYS_CLIENT_USER" composer --no-interaction install
# Comprobar si la ejecución fue exitosa
if [ $? -ne 0 ]; then
@ -489,14 +504,14 @@ if [ $? -ne 0 ]; then
fi
runComposer
runComposer ${INSTALL_TARGET}
# Creando configuración de Apache.
installWebConsoleApacheConf $INSTALL_TARGET $APACHECFGDIR
setup_nginx $INSTALL_TARGET
if [ $? -ne 0 ]; then
errorAndLog "Error configuring Apache for OpenGnsys Admin"
exit 1
fi
modify_php_fpm_config
sudo apt-get update
# install_kea
# install_php
@ -506,4 +521,4 @@ sudo apt-get update
# Ahora puedes clonar e instalar el componente ogDhcp
# git clone <URL del repositorio de ogDhcp>
# cd <directorio de ogDhcp>
# composer install
# composer install