Explorar el Código

Fix some bugs

gabriel hace 6 años
padre
commit
6d65401e3e

+ 0 - 1
tools/ONU.json

@@ -1 +0,0 @@
-[{"clientId":1,"ponSerialNumber":"1","transitionState":"success","tenancyId":3}]

+ 0 - 10
tools/grafana.env

@@ -1,10 +0,0 @@
-VIRTUAL_HOST=grafana.${CLIENT}.flowdat.com
-HTTPS_METHOD=nohttps
-GF_SECURITY_ADMIN_PASSWORD=queRini6
-GF_INSTALL_PLUGINS=grafana-simple-json-datasource
-GF_DEFAULT_THEME=light
-GF_AUTH_ANONYMOUS_ORG_NAME="Main Org."
-GF_AUTH_ANONYMOUS_ORG_ROLE=Viewer
-GF_AUTH_ANONYMOUS_ENABLED=true
-GF_DATABASE_URL=mysql://root:235r2342gtfsw@mysql:3306/grafana
-GF_SERVER_ROOT_URL=http://grafana.${CLIENT}.flowdat.com/

+ 0 - 329
tools/installModules.sh

@@ -1,329 +0,0 @@
-#!/usr/bin/env bash
-
-bitbucketid_rsa="-----BEGIN RSA PRIVATE KEY-----
-MIIEpAIBAAKCAQEAsCo4Xa/fLaryiZt6igRK1IPNJsKeDLWBN6CWrv3TQ2iMcwE1
-zhTTX115N+KngVN8p1v5VrSMHKpvyXQDZPG/FJnWm5ry75qSYTmEtY8nfRsGAbwT
-i4swY+4jqrH1RRjbuVMsXPGjFX34SZTTJEl8ouVAFy/7HR+ODUe2+enWVnaouhVs
-Xj+bW2u7/dV1kZctFa5g5iV3hqGH32dBME5ztg4Fh7fAxkRTiJl+NBI7/LIdv9dl
-qmtDAdNdRqaI1dBpy8sHyZhRfjPeVbhdKsjE5IBhDLlYzyxK5FC41us08VCdq+M1
-1qVzIVM61PBosW5NfwlrRgLDPEXkazUdhJO6YwIDAQABAoIBAFEf4D0klH4PTwmX
-k+Ki/2LGH19OGEJ6Azt+tGV5diSArMz5LbHtXTl5bi0SL1ka/TiE3lnTYwKAamI3
-DqkZuojeHzohLOayI96qAjcp6WFvZGDAH7APNQWP0NT2hqB/RhAeATv7+sIW9JPN
-+T2oqcDKGa2T5uwOb/glolmMGaxOzNfAFAgnD7p7cnR0yijW5t3bc4q0sOFu/H3N
-jYsAqvMu6Nkpt9hjlu42x5Muwj9YeKwpZoE1sno62JeQFZo7nO7DrOrE7DOENoWV
-PMDxs8Hz0SRQlZcJn2I/W9wX8A8gCAWGhbAtUGQkS8gCaMp0dOcxoV3EttriQgtU
-X1oUwIECgYEA2Vge4E8E53BzLGTk8sozn1qteYn3cLGgJgC78MEzZN/G57DxVbC9
-ntlSlYaYLlaPlSlNzZyG0s3UhpPY7YgP9srpohfPyXvb0ycfsGYMOcRNjVwdi2ap
-dPiG+p9vLSG3raNoeTxDEtjFZz1EM1rQECx2N40JwIuzeM2g+kE0JjMCgYEAz38r
-NTs1wASG7Bc7geIDxb34PWM8Nnw/DN57ceJP+Miwq/hYAJg6eK57ar9n44Y3xf7a
-mHkkgBU1vzuIyYfC5jVut6XkbialLsJUHfCNi3fPDBR7sEy6soiN34GoGp2vnCVD
-pDf2aCSMeFGfgwe4imFHbqE0R87cnet+q+CjCxECgYA8EbfO5OgFEzYxwdzpIWtt
-EoG5gqEpu134wuEupCcRLSvrIyNAPK3btlK10tJClFfwsM65EhbNMmgXncspsx4+
-Zkx2KUCbfij+TeTbOwkL+i448ImV2pThKEMeB2yRu6zpR617PGWJUvIUG4G689Fn
-dvJhXhCg77t1mtdv8w93swKBgQCIxor0y9LigBlwBuBy/Uj/T/oSfRdz0vK8yOsW
-ZtfQZnoO4eUgfzgL1PgFpaYVlKOvIA938mLdCx4isFu6fIM8vHv/EptBALhh2jcY
-hTjIdnFExTvDOtDWXq0mZ5En+kmH5Ahyd3E1tOHjbep3tN8wWG99vUV5ECLc9h7J
-rYnMAQKBgQDQ/JiBT7ygfzAblxPnq5Dnr52C3CFTE57GNA8FIEx+On6FdtVDRM0g
-cNjoc2e+2MfbaJXFAuMvXDvzb2qxrHgf2TosxeuPTg79iYOfWMU8G62i/v0wPr1M
-0Cj2hszJg4H0dMQPS0kDmO6mZmt6FB4E2gItmeBlTGfMwdJpaQC4rw==
------END RSA PRIVATE KEY-----"
-
-
-ROOT=$(id -u)
-if [ "$ROOT" != "0" ];
-then
-    echo "Este comando debe ejecutarse como root."
-    exit 0
-fi
-###################################################################
-if [ "$1" = "-h" ] || [ "$1" = "--help" ];
-then
-    echo "Comando para instalar flowdat."
-    echo "Si no se pasan parametros se ejecuta el script completo preguntando los datos necesarios"
-    echo "Parametros:"
-    echo "    --ansible    Ejecuta la linea del ansible"
-    exit 1
-fi
-###################################################################
-fcGetYesNo() {
-    while true;
-    do
-        read VALUEYESNO
-        if [ "$VALUEYESNO" = "" ] || [ "$VALUEYESNO" = "y" ] || [ "$VALUEYESNO" = "Y" ] || [ "$VALUEYESNO" = "yes" ] || [ "$VALUEYESNO" = "YES" ];
-        then
-            VALUEYESNO=1
-            return
-        fi
-        if [ "$VALUEYESNO" = "n" ] || [ "$VALUEYESNO" = "N" ] || [ "$VALUEYESNO" = "no" ] || [ "$VALUEYESNO" = "NO" ];
-        then
-            VALUEYESNO=0
-            return
-        fi
-    done
-}
-
-fcCheckExecution () {
-    if [ $? -eq 0 ];
-    then
-        return
-    else
-        echo "Algunos comandos no se ejecutaron correctamente."
-        exit 0
-    fi
-}
-###################################################################
-DIRINSTALLDEFAULT="/opt/flowdat"
-GITDEFUALT="git@gitlab.com:interlink-sa/flowdat3/modules/installer.git ."
-COMMANDGITDEFAULT="git clone $GITDEFUALT"
-FILEANSIBLE="#!/bin/bash\ncd ..\neval \$(cat mysql.host.env running.env) ansible-playbook -i inventory.ini -u root playbook.yml"
-###################################################################
-if [ "$1" != "--ansible" ];
-then
-    echo "Ingrese el nombre del cliente para la instalacion sin espacios. Ej.: galvez"
-    read CLIENTNAME
-    DOMAINNAME="flowdat.net"
-    echo ""
-    echo ""
-    echo ""
-    echo "Las url seran   base.$CLIENTNAME.$DOMAINNAME"
-    echo "Si esto NO es correcto aborte la ejecucion con ctrl+c"
-    echo ""
-    echo ""
-    echo ""
-    ###################################################################
-    echo "Instalar paquetes linux necesarios? (Y/n)"
-    VALUEYESNO=1
-    fcGetYesNo
-    if [ "$VALUEYESNO" = "1" ];
-    then
-        ## no se utiliza un && porque pueden existir error del apt en la consulta de los repo
-        apt-get update
-        apt-get install curl git python
-        curl https://bootstrap.pypa.io/get-pip.py | python
-        pip install -U pip setuptools
-        curl -fsSL get.docker.com | sh
-        pip install docker-compose==1.22
-        fcCheckExecution
-    fi
-    ###################################################################
-    echo ""
-    echo ""
-    DIRINSTALL=$DIRINSTALLDEFAULT
-    echo "Ingrese el directorio absoluto de instalacion: (default: $DIRINSTALLDEFAULT)"
-    read DIRINSTALL
-    if [ "$DIRINSTALL" = "" ];
-    then
-        DIRINSTALL=$DIRINSTALLDEFAULT
-    fi
-    mkdir -p $DIRINSTALL
-    ###################################################################
-    DOCKERMAKEINSTALL="docker run -it -v $DIRINSTALL:$DIRINSTALL -v /var/run/docker.sock:/tmp/docker.sock dind make:install $DIRINSTALL --client=$CLIENTNAME --domain=$DOMAINNAME"
-    DOCKERGETSOURCE="docker run -it -v $DIRINSTALL:$DIRINSTALL -v /var/run/docker.sock:/tmp/docker.sock dind get:source $DIRINSTALL/git.ini --timeout=120"
-    DOCKERFIXNGINX="docker run -it -v $DIRINSTALL:$DIRINSTALL -v /var/run/docker.sock:/tmp/docker.sock dind fix:nginx $DIRINSTALL"
-    DOCKERSERVICE="ln -sf $DIRINSTALL/docker-compose.service /etc/systemd/system/docker-compose.service"
-    ###################################################################
-    echo ""
-    echo ""
-    echo "Ingresando al directorio $DIRINSTALL"
-    cd $DIRINSTALL
-    DIRTOOLS=$DIRINSTALL/tools
-    BRANCH=""
-    echo "Ingrese la rama a instalar. (default: master)"
-    read BRANCH
-    eval `ssh-agent`
-    ssh-add - <<< "$bitbucketid_rsa"
-    if [ "$BRANCH" = "" ];
-    then
-        eval $COMMANDGITDEFAULT
-    else
-        git clone -b $BRANCH $GITDEFUALT
-    fi
-    ###################################################################
-    echo ""
-    echo ""
-    echo "Ingresando al directorio $DIRTOOLS"
-    cd $DIRTOOLS
-    echo "Construimos el dind?(Y/n)"
-    VALUEYESNO=1
-    fcGetYesNo
-    if [ "$VALUEYESNO" = "1" ];
-    then
-        echo "Contruyendo el dind"
-        docker build --build-arg DIR_INSTALL=$DIRTOOLS -t dind .
-    else
-        echo "NO SE CONSTRUYE EL DIND"
-    fi
-    ###################################################################
-    echo ""
-    echo ""
-    echo "Desea instalar los paquetes adicionales?(Y/n)"
-    VALUEYESNO=1
-    fcGetYesNo
-    if [ "$VALUEYESNO" = "1" ];
-    then
-        echo "Instalando paquetes adicionales en dind"
-        docker run -it -v $DIRTOOLS:$DIRTOOLS -v /var/run/docker.sock:/tmp/docker.sock dind composer install
-    else
-        echo "NO SE INSTALAN LOS PAQUETES ADICIONALES"
-    fi
-    ###################################################################
-    echo ""
-    echo ""
-    echo "Desea crear los archivos de instalacion."
-    echo "Opciones:"
-    echo "    Ingrese 'n' para omitir este paso."
-    echo "    Presionar enter para ejecutar el comando por default: $DOCKERMAKEINSTALL"
-    echo "    Puede ingresar el comando que desee ejecutar."
-    read COMMAND
-    if [ "$COMMAND" = "" ];
-    then
-        eval $DOCKERMAKEINSTALL
-    else
-        if [ "$COMMAND" != "n" ] && [ "$COMMAND" != "N" ];
-        then
-            eval $COMMAND
-        fi
-    fi
-    ###################################################################
-    echo ""
-    echo ""
-    echo "Ingresando al directorio $DIRINSTALL"
-    cd $DIRINSTALL
-    echo "Desea obtener el codigo fuente."
-    echo "Opciones:"
-    echo "    Ingrese 'n' para omitir este paso."
-    echo "    Presionar enter para ejecutar el comando por default: $DOCKERGETSOURCE"
-    echo "    Puede ingresar el comando que desee ejecutar."
-    read COMMAND
-    if [ "$COMMAND" = "" ];
-    then
-        eval $DOCKERGETSOURCE
-    else
-        if [ "$COMMAND" != "n" ] && [ "$COMMAND" != "N" ];
-        then
-            eval $COMMAND
-        fi
-    fi
-    ###################################################################
-    echo ""
-    echo ""
-    echo "Desea ejecutar el fix nginx?"
-    echo "Opciones:"
-    echo "    Ingrese 'n' para omitir este paso."
-    echo "    Presionar enter para ejecutar el comando por default: $DOCKERFIXNGINX"
-    echo "    Puede ingresar el comando que desee ejecutar."
-    read COMMAND
-    if [ "$COMMAND" = "" ];
-    then
-        eval $DOCKERFIXNGINX
-    else
-        if [ "$COMMAND" != "n" ] && [ "$COMMAND" != "N" ];
-        then
-            eval $COMMAND
-        fi
-    fi
-    ###################################################################
-    echo ""
-    echo ""
-    echo "Desea registrar el servicio de docker?"
-    echo "Opciones:"
-    echo "    Ingrese 'n' para omitir este paso."
-    echo "    Presionar enter para ejecutar el comando por default: $DOCKERSERVICE"
-    echo "    Puede ingresar el comando que desee ejecutar."
-    read COMMAND
-    if [ "$COMMAND" = "" ];
-    then
-        eval $DOCKERSERVICE
-    else
-        if [ "$COMMAND" != "n" ] && [ "$COMMAND" != "N" ];
-        then
-            eval $COMMAND
-        fi
-    fi
-    ###################################################################
-    echo ""
-    echo ""
-    echo "Desea dar de alta los dominios?(Y/n)"
-    VALUEYESNO=1
-    fcGetYesNo
-    if [ "$VALUEYESNO" = "1" ];
-    then
-        echo "Instalando paquetes requeridos"
-        pip install google google-cloud-dns
-        echo "Ingresando al directorio letsencrypt"
-        cd $DIRINSTALL/letsencrypt
-        echo "Ingrese la ip publica del cliente para acceder al flowdat:"
-        read IPPUBLIC
-        echo "Registrando los dominios"
-        python googledns.py --key=key.json --action=create --client=$CLIENTNAME --ip_address=$IPPUBLIC --domain=$DOMAINNAME
-    else
-        echo "SE ASUME QUE LOS DOMINIOS YA ESTAN DADOS DE ALTA"
-    fi
-    ###################################################################
-    echo ""
-    echo ""
-    echo "Desea crear los certificados ssl?(Y/n)"
-    VALUEYESNO=1
-    fcGetYesNo
-    if [ "$VALUEYESNO" = "1" ];
-    then
-        echo "Agregando el repositorio deb http://ftp.debian.org/debian stretch-backports main"
-        echo "deb http://ftp.debian.org/debian stretch-backports main" >>  /etc/apt/sources.list.d/certbot.debian.list
-        echo "Actualizando paquetes"
-        apt-get update && apt-get install certbot -t stretch-backports
-        echo "#########################################################################################################"
-        echo "En caso de error con certbot y python puede correr esta linea: python -m easy_install --upgrade pyOpenSSL"
-        echo "#########################################################################################################"
-        echo "Instalando paquetes requeridos"
-        pip install certbot-dns-google
-        echo "Ingresando al directorio letsencrypt"
-        cd $DIRINSTALL/letsencrypt
-        sed -i "s/DOMAIN_NAME_REPLACE/$CLIENTNAME.$DOMAINNAME/g" flowdat_deploy.sh
-        echo "Generando certificados"
-        certbot certonly --cert-name $CLIENTNAME.$DOMAINNAME --dns-google --dns-google-credentials $DIRINSTALL/letsencrypt/key.json --server https://acme-v02.api.letsencrypt.org/directory -d "*.$CLIENTNAME.$DOMAINNAME" -d "$CLIENTNAME.$DOMAINNAME" --deploy-hook=$DIRINSTALL/letsencrypt/flowdat_deploy.sh
-        echo ""
-        echo "Verificar que la siguiente línea aparezca entre las últimas a la salida del comando:"
-        echo "    EJECUCION MANUAL: Running deploy-hook command: /opt/flowdat/letsencrypt/flowdat_deploy.sh"
-        echo "la cual indica que el hook se ejecutó. Eso significa que los certificados deberían haberse copiado a la carpeta de Nginx. Verificar con el navegador que el sitio web sea seguro."
-        echo "Probar autorenovación:"
-        echo "    EJECUCION MANUAL: certbot renew --dry-run"
-    else
-        echo "SE ASUME QUE LOS DOMINIOS YA ESTAN DADOS DE ALTA"
-    fi
-else
-    echo ""
-    echo ""
-    DIRINSTALL=$DIRINSTALLDEFAULT
-    echo "Ingrese el directorio absoluto de instalacion: (default: $DIRINSTALLDEFAULT)"
-    read DIRINSTALL
-    if [ "$DIRINSTALL" = "" ];
-    then
-        DIRINSTALL=$DIRINSTALLDEFAULT
-    fi
-    echo "Ingresando al directorio $DIRINSTALL"
-    cd $DIRINSTALL
-fi
-###################################################################
-echo ""
-echo ""
-echo "Creando archivo de ejecucion ansible"
-echo "El archivo se creara con las siguientes instrucciones"
-echo $FILEANSIBLE
-echo ""
-echo "Desea modificar el archivo? Si se deja en blanco se toma el default. Sino ingrese las lineas para crear el archivo de ejecucion"
-echo "Opciones:"
-echo "    Ingrese 'n' para omitir este paso."
-echo "    Presionar enter crear el archivo por default que se muestra arriba"
-echo "    Puede ingresar el comando que desee ejecutar."
-read COMMAND
-if [ "$COMMAND" = "" ];
-then
-    echo -e $FILEANSIBLE > $DIRINSTALL/ansible.run
-else
-    if [ "$COMMAND" != "n" ] && [ "$COMMAND" != "N" ];
-    then
-        echo -e $COMMAND > $DIRINSTALL/ansible.run
-    fi
-fi
-docker run -it -v $DIRINSTALL:$DIRINSTALL -v /var/run/docker.sock:/tmp/docker.sock dind ansible
-exit 1

+ 0 - 7
tools/installer.sh

@@ -1,7 +0,0 @@
-#!/bin/bash
-
-export $(cat mysql.host.env)
-export $(cat running.env)
-env
-ansible-playbook -i inventory.ini -u root playbook.yml
-

+ 0 - 38
tools/playbook.yml

@@ -18,12 +18,6 @@
   connection: local
   tags: start_mysql
   tasks:
-#    - name: Docker build
-#      command: "docker-compose build"
-#
-#    - name: Docker build mysql
-#      command: "docker-compose pull mysql"
-
     - name: Docker mysql up
       command: "docker-compose up -d --force-recreate mysql"
 
@@ -185,9 +179,6 @@
         state: absent
         path: "/opt/base/var/cache/"
 
-    - name: Composer install
-      shell: "eval $(ssh-agent) ;  ssh-add /opt/keys/bitbucket.id_rsa ; composer install --no-interaction"
-
     - name: Load redirections
       set_fact:
         uris: "{{ uris }} --redirect_uri=https://{{ item }}.{{ lookup('env', 'CLIENT') }}.{{ lookup('env', 'DOMAIN') }}/login_check"
@@ -203,27 +194,6 @@
       args:
         executable: /bin/bash
 
-
-    - name: Update variable usersetting
-      set_fact:
-        usersetting: "{{ lookup('file', '{{ playbook_dir }}/user_system.json')|from_json }}"
-
-    - name: Create user iksop
-      shell: "bin/console user:create {{ item.user }} {{ item.email }} {{ item.password }} {{ item.tenancy }} {{ item.extra }}"
-      args:
-        executable: /bin/bash
-      with_items: "{{ usersetting.users }}"
-
-    - name: Promote users to ADMIN
-      shell: " bin/console fos:user:promote admin ROLE_ADMIN"
-      args:
-        executable: /bin/bash
-
-    - name: Promote users to IKSOP
-      shell: " bin/console fos:user:promote iksop ROLE_SUPER_ADMIN"
-      args:
-        executable: /bin/bash
-
     - name: Copy file oauth.data.log to host
       fetch:
         src: /opt/base/oauth.data.log
@@ -270,14 +240,6 @@
     - name: "Doctrine schema update"
       shell: "bin/console doctrine:schema:update --force"
 
-- name: "Run assets:install. Tag=install_assets"
-  hosts: "{{ lookup('env', 'MODULES_INSTALL') }}"
-  connection: docker
-  tags: install_assets
-  tasks:
-    - name: "Make static assets"
-      shell: "bin/console assets:install web"
-
   # Generate self-signed cert files for Nginx (intended for development, please replace with proper ones)
 - name: "Generate self-signed cert files for Nginx"
   hosts: 127.0.0.1

+ 0 - 28
tools/playbookSupport.yml

@@ -174,26 +174,6 @@
       args:
         executable: /bin/bash
 
-    - name: Update variable usersetting
-      set_fact:
-        usersetting: "{{ lookup('file', '{{ playbook_dir }}/user_system.json')|from_json }}"
-
-    - name: Create user iksop
-      shell: "bin/console user:create {{ item.user }} {{ item.email }} {{ item.password }} {{ item.tenancy }} {{ item.extra }}"
-      args:
-        executable: /bin/bash
-      with_items: "{{ usersetting.users }}"
-
-    - name: Promote users to ADMIN
-      shell: " bin/console fos:user:promote admin ROLE_ADMIN"
-      args:
-        executable: /bin/bash
-
-    - name: Promote users to IKSOP
-      shell: " bin/console fos:user:promote iksop ROLE_SUPER_ADMIN"
-      args:
-        executable: /bin/bash
-
     - name: Copy file oauth.data.log to host
       fetch:
         src: /opt/base/oauth.data.log
@@ -240,14 +220,6 @@
     - name: "Doctrine schema update"
       shell: "bin/console doctrine:schema:update --force"
 
-- name: "Run assets:install. Tag=install_assets"
-  hosts: "{{ lookup('env', 'MODULES_INSTALL') }}"
-  connection: docker
-  tags: install_assets
-  tasks:
-    - name: "Make static assets"
-      shell: "bin/console assets:install web"
-
   # Generate self-signed cert files for Nginx (intended for development, please replace with proper ones)
 - name: "Generate self-signed cert files for Nginx"
   hosts: 127.0.0.1

+ 0 - 8
tools/playbookUpdateSupport.yml

@@ -89,14 +89,6 @@
     - name: "Doctrine schema update"
       shell: "bin/console doctrine:schema:update --force"
 
-- name: "Run assets:install. Tag=install_assets"
-  hosts: "{{ lookup('env', 'MODULES_INSTALL') }}"
-  connection: docker
-  tags: install_assets
-  tasks:
-    - name: "Make static assets"
-      shell: "bin/console assets:install web"
-
 - name: "Run up all. Tag=up_all"
   hosts: 127.0.0.1
   connection: local

+ 0 - 272
tools/playbook_v2.yml

@@ -1,272 +0,0 @@
----
-
-- name: Launch docker for mysql database. Tag=start_mysql
-  hosts: 127.0.0.1
-  connection: local
-  tags: start_mysql
-  tasks:
-
-    - name: Docker mysql up
-      command: "docker-compose up -d --force-recreate mysql"
-
-- name: Configure mysql database. Tag=configure_mysql
-  hosts: mysql
-  connection: docker
-  gather_facts: no
-  tags: configure_mysql
-  tasks:
-    - name: Wait for mysql be ready
-      wait_for:
-        host: 127.0.0.1
-        port: 3306
-        state: started
-        delay: 5
-        connect_timeout: 15
-        timeout: 360
-
-    - name: Create database fd_session
-      mysql_db:
-        name: fd_session
-        login_password: "{{ lookup('env', 'MYSQL_PASSWORD') }}"
-        state: present
-
-    - name: Create database freeradius
-      mysql_db:
-        name: freeradius
-        login_password: "{{ lookup('env', 'MYSQL_PASSWORD') }}"
-        state: present
-
-    - name: Create database grafana
-      mysql_db:
-        name: grafana
-        login_password: "{{ lookup('env', 'MYSQL_PASSWORD') }}"
-        state: present
-
-    - name: Create database statsd_db
-      mysql_db:
-        name: statsd_db
-        login_password: "{{ lookup('env', 'MYSQL_PASSWORD') }}"
-        state: present
-
-    - name: Create database base
-      mysql_db:
-        name: fd3_base
-        login_password: "{{ lookup('env', 'MYSQL_PASSWORD') }}"
-        state: present
-
-    - name: Create database ftth
-      mysql_db:
-        name: fd3_ftth
-        login_password: "{{ lookup('env', 'MYSQL_PASSWORD') }}"
-        state: present
-
-    - name: Create database mapas
-      mysql_db:
-        name: fd3_mapas
-        login_password: "{{ lookup('env', 'MYSQL_PASSWORD') }}"
-        state: present
-
-    - name: Create database stats
-      mysql_db:
-        name: fd3_stats
-        login_password: "{{ lookup('env', 'MYSQL_PASSWORD') }}"
-        state: present
-
-    - name: Create database cablemodem
-      mysql_db:
-        name: fd3_cablemodem
-        login_password: "{{ lookup('env', 'MYSQL_PASSWORD') }}"
-        state: present
-
-    - name: Create database Radius
-      mysql_db:
-        name: fd3_radius
-        login_password: "{{ lookup('env', 'MYSQL_PASSWORD') }}"
-        state: present
-
-    - name: Create database dhcp
-      mysql_db:
-        name: fd3_dhcp
-        login_password: "{{ lookup('env', 'MYSQL_PASSWORD') }}"
-        state: present
-
-    - copy:
-        src: "{{ playbook_dir }}/freeradius_schema.sql"
-        dest: /tmp/freeradius_schema.sql
-
-    - name: Create freeradius MySQL schema
-      mysql_db:
-        login_password: "{{ lookup('env', 'MYSQL_PASSWORD') }}"
-        state: import
-        name: freeradius
-        target: "/tmp/freeradius_schema.sql"
-
-    - name: Create user iksop
-      mysql_user:
-        name: 'iksop'
-        password: "{{ lookup('env', 'MYSQL_PASSWORD') }}"
-        login_password: "{{ lookup('env', 'MYSQL_PASSWORD') }}"
-        priv: '*.*:ALL'
-        state: present
-
-    - copy:
-        src: "{{ playbook_dir }}/mysql_scripts.sql"
-        dest: /tmp/mysql_scripts.sql
-
-    - name: Replace password mysql_scripts.sql
-      shell: "sed -i -- 's/#password#/{{ lookup('env', 'MYSQL_PASSWORD') }}/g' /tmp/mysql_scripts.sql"
-
-    - name: Run SQL commands against DB to create table
-      mysql_db:
-        login_password: "{{ lookup('env', 'MYSQL_PASSWORD') }}"
-        state: import
-        name: fd_session
-        target: "/tmp/mysql_scripts.sql"
-
-- name: Launch docker for amqp. Tag=start_amqp
-  hosts: 127.0.0.1
-  connection: local
-  tags: start_base
-  tasks:
-    - name: Docker base up
-      command: "docker-compose up -d amqp"
-
-    - name: "Wait for amqp. Timeout: 1 minutes"
-      pause:
-        minutes: 1
-
-- name: Launch docker for module base. Tag=start_base
-  hosts: 127.0.0.1
-  connection: local
-  tags: start_base
-  tasks:
-    - name: Docker base up
-      command: "docker-compose up -d --force-recreate base"
-
-- name: Configure module base. Tag=configure_base
-  hosts: base
-  connection: docker
-  tags: configure_base
-  vars:
-    uris: ""
-  tasks:
-    - name: "Wait for autoload_classmap.php. Timeout: 10 minutes"
-      wait_for:
-          path: "/opt/base/vendor/composer/autoload_classmap.php"
-          state: present
-          sleep: 30
-          timeout: 600
-
-    - name: Load redirections
-      set_fact:
-        uris: "{{ uris }} --redirect_uri=https://{{ item }}.{{ lookup('env', 'CLIENT') }}.flowdat.net/login_check"
-      with_items: "{{ lookup('env', 'MODULES_INSTALL').split(',') }}"
-
-    - name: Load redirections app_dev
-      set_fact:
-        uris: "{{ uris }} --redirect_uri=https://{{ item }}.{{ lookup('env', 'CLIENT') }}.flowdat.net/app_dev.php/login_check"
-      with_items: "{{ lookup('env', 'MODULES_INSTALL').split(',') }}"
-
-    - name: Create oauth client
-      shell: "bin/console oauth:client:createRedirects {{ uris }} > oauth.data.log"
-      args:
-        executable: /bin/bash
-
-    - name: Update variable usersetting
-      set_fact:
-        usersetting: "{{ lookup('file', '{{ playbook_dir }}/user_system.json')|from_json }}"
-
-    - name: Create user iksop
-      shell: "bin/console user:create {{ item.user }} {{ item.email }} {{ item.password }} {{ item.tenancy }} {{ item.extra }}"
-      args:
-        executable: /bin/bash
-      with_items: "{{ usersetting.users }}"
-
-    - name: Promote users to ADMIN
-      shell: " bin/console fos:user:promote admin ROLE_ADMIN"
-      args:
-        executable: /bin/bash
-
-    - name: Promote users to IKSOP
-      shell: " bin/console fos:user:promote iksop ROLE_SUPER_ADMIN"
-      args:
-        executable: /bin/bash
-
-    - name: Copy file oauth.data.log to host
-      fetch:
-        src: /opt/base/oauth.data.log
-        dest: /tmp/
-        flat: yes
-
-- name: Configure oauth data for other container. Tag=configure_oauth
-  hosts: 127.0.0.1
-  connection: local
-  tags: configure_oauth
-  tasks:
-    - name: "Add outh client id"
-      shell:  "cp /tmp/oauth.data.log {{ item }}.oauth.env"
-      args:
-        executable: /bin/bash
-      with_items: "{{ lookup('env', 'MODULES_INSTALL').split(',') }}"
-
-- name: "Launch docker's. Tag=launch_dockers"
-  hosts: 127.0.0.1
-  connection: local
-  tags: launch_dockers
-  tasks:
-    - name: "Dockers up"
-      command: "docker-compose up -d --force-recreate {{ item }}"
-      with_items: "{{ lookup('env', 'MODULES_INSTALL').split(',') }}"
-
-- name: "Run modules. Timeout: 10 minutes. Tag=run_modules"
-  hosts: "{{ lookup('env', 'MODULES_INSTALL') }}"
-  connection: docker
-  tags: run_modules
-  tasks:
-    - name: "Docker's schema update"
-      wait_for:
-        path: "./vendor/composer/autoload_classmap.php"
-        state: present
-        sleep: 30
-        timeout: 600
-
-- name: "Run doctrine:schema:update for modules. Tag=dsu_modules"
-  hosts: "{{ lookup('env', 'MODULES_INSTALL') }}"
-  connection: docker
-  tags: dsu_modules
-  tasks:
-    - name: "Doctrine schema update"
-      shell: "bin/console doctrine:schema:update --force"
-
-  # Generate self-signed cert files for Nginx (intended for development, please replace with proper ones)
-- name: "Generate self-signed cert files for Nginx"
-  hosts: 127.0.0.1
-  connection: local
-  tags: self_cert
-  tasks:
-    - name: "Make sure certs dir exists"
-      shell: "mkdir -p /opt/flowdat/certs"
-    - name: "Generate self-signed certs for Nginx"
-      shell: "openssl req -x509 -nodes -batch -days 365 -newkey rsa:2048 -keyout /opt/flowdat/certs/privkey.pem -out /opt/flowdat/certs/fullchain.pem -subj '/C=AR/ST=Santa Fe/L=Rosario/O=Interlink/OU=R&D/CN=*.{{ lookup('env','CLIENT') }}.{{ lookup('env','DOMAIN') }}/emailAddress=idev@interlink.com.ar'"
-
-- name: "Copy certs dir to extra/nginx/certs"
-  hosts: 127.0.0.1
-  connection: local
-  tags: copy_cert
-  tasks:
-    - name: "Copy certs directory"
-      shell: "cp -nr /opt/flowdat/certs/* /opt/flowdat/extra/nginx/certs"
-
-- name: "Run up all. Tag=up_all"
-  hosts: 127.0.0.1
-  connection: local
-  tags: up_all 
-  tasks:
-    - name: Docker up all modules
-      command: "docker-compose up -d "
-
-    - name: Docker stop nginx
-      command: "docker-compose stop nginx "
-
-    - name: Docker up nginx
-      command: "docker-compose up -d nginx"

+ 33 - 35
tools/src/Command/ImportONUCommand.php

@@ -17,16 +17,15 @@ use GuzzleHttp\Psr7;
 use GuzzleHttp\Cookie\CookieJar;
 
 
-
 class ImportONUCommand extends Command
 {
 
     protected function configure()
     {
         $this
-                ->setName('import:ftth:onu')
-                ->setDescription('Import ONU entities from json file')
-                ->setHelp('ONU.json shuld be a valid json file, probably looking like the following example:
+            ->setName('import:ftth:onu')
+            ->setDescription('Import ONU entities from json file')
+            ->setHelp('ONU.json shuld be a valid json file, probably looking like the following example:
 [
  {"clientId":1,"ponSerialNumber":"1","transitionState":"success","tenancyId":3},
  {"clientId":1,"ponSerialNumber":"2","transitionState":"success","tenancyId":3},
@@ -34,15 +33,14 @@ class ImportONUCommand extends Command
 ]
 
 ')
-                ->addArgument('base_url', InputArgument::REQUIRED, 'The base url of the FD3 Client.')
-                ->addArgument('data_file.json', InputArgument::OPTIONAL, 'The data source from where to get data.', "ONU.json")
-                //->addOption('oauth_token', null, InputOption::VALUE_REQUIRED, 'The FD3 OAuth Client ID.', 'http://base.galvez.flowdat.com/oauth/v2/token')
-                //->addOption('client_id', null, InputOption::VALUE_REQUIRED, 'The FD3 OAuth Client ID.', '2_2giq1sosvyxwsgwswcw4s44w0o0go0wc0oo4ck4kgo008w80k0')
-                //->addOption('client_secret', null, InputOption::VALUE_REQUIRED, 'The FD3 OAuth Client Secret.', 'kuu06cynskgkc0swokkkg4gg8k84w0ks00cw00wk4ow480okg')
-                ->addOption('uri', null, InputOption::VALUE_REQUIRED, 'uri after the base_url for the complete URL', '/api/onus.json')
-                ->addOption('user', null, InputOption::VALUE_REQUIRED, 'The FD3 Username.', 'admin')
-                ->addOption('pass', null, InputOption::VALUE_REQUIRED, 'The FD3 Password.', 'adminpass')
-        ;
+            ->addArgument('base_url', InputArgument::REQUIRED, 'The base url of the FD3 Client.')
+            ->addArgument('data_file.json', InputArgument::OPTIONAL, 'The data source from where to get data.', "ONU.json")
+            //->addOption('oauth_token', null, InputOption::VALUE_REQUIRED, 'The FD3 OAuth Client ID.', 'http://base.galvez.flowdat.com/oauth/v2/token')
+            //->addOption('client_id', null, InputOption::VALUE_REQUIRED, 'The FD3 OAuth Client ID.', '2_2giq1sosvyxwsgwswcw4s44w0o0go0wc0oo4ck4kgo008w80k0')
+            //->addOption('client_secret', null, InputOption::VALUE_REQUIRED, 'The FD3 OAuth Client Secret.', 'kuu06cynskgkc0swokkkg4gg8k84w0ks00cw00wk4ow480okg')
+            ->addOption('uri', null, InputOption::VALUE_REQUIRED, 'uri after the base_url for the complete URL', '/api/onus.json')
+            ->addOption('user', null, InputOption::VALUE_REQUIRED, 'The FD3 Username.', 'admin')
+            ->addOption('pass', null, InputOption::VALUE_REQUIRED, 'The FD3 Password.', 'adminpass');
     }
 
     protected function execute(InputInterface $input, OutputInterface $output)
@@ -53,19 +51,19 @@ class ImportONUCommand extends Command
         $password = $input->getOption('pass');
 
         $file = $input->getArgument("data_file.json");
-        
+
         $url = $base_url . $uri;
         $client = new GuzzClient();
         $parser = new \JsonCollectionParser\Parser();
         //$cookieJar = $this->getCookieJar($username, $token);
-        
-        $parser->parse($file, function($data) use ($client, $url, $username, $password) {
+
+        $parser->parse($file, function ($data) use ($client, $url, $username, $password) {
             try {
-                $res = $client->request("POST", $url.'?filters[disableTenancy]', [
-                   // 'headers' => ['Authorization' => "Bearer {$token['access_token']}"]
-                    'auth'=> [$username, $password],
+                $res = $client->request("POST", $url . '?filters[disableTenancy]', [
+                    // 'headers' => ['Authorization' => "Bearer {$token['access_token']}"]
+                    'auth' => [$username, $password],
                     'body' => json_encode($data)
-                    ]);
+                ]);
                 echo $res->getBody();
             } catch (RequestException $e) {
                 echo Psr7\str($e->getRequest());
@@ -76,28 +74,28 @@ class ImportONUCommand extends Command
         }
         );
     }
-    
+
 
     /**
      * Retorna un token OAuth
-     * 
+     *
      * @param string $username
      * @param string $password
      * @param string $client_id
      * @param string $client_secret
      * @param string $url
-     * 
+     *
      * @return array
      */
     private function getRefreshToken($token, $client_id, $client_secret, $url)
     {
         $body = ['grant_type' => 'refresh_token',
             'refresh_token' => $token['refresh_token']
-	];
+        ];
 
         $client = new GuzzClient();
         $res = $client->request("POST", $url, [
-	    'auth' => [$client_id, $client_secret],
+            'auth' => [$client_id, $client_secret],
             'headers' => ['Content-Type' => 'application/x-www-form-urlencoded'],
             'body' => http_build_query($body),
         ]);
@@ -106,7 +104,7 @@ class ImportONUCommand extends Command
         return json_decode($body, true);
     }
 
- 
+
     private function getAccessToken($username, $password, $client_id, $client_secret, $url = 'http://base.fd3.flowdat.com/oauth/v2/token')
     {
         $body = ['grant_type' => 'password',
@@ -120,17 +118,17 @@ class ImportONUCommand extends Command
             'headers' => ['Content-Type' => 'application/x-www-form-urlencoded'],
             'body' => http_build_query($body),
         ]);
-    
+
         return json_decode($res->getBody(), true);
     }
-    
+
     /**
      * Guardo en session al OAuthUser
      * Retorno una cookie con la info de session
-     * 
+     *
      * @param string $username
      * @param array $token
-     * 
+     *
      * @return CookieJar
      */
     private function getCookieJar($username, $token)
@@ -146,15 +144,15 @@ class ImportONUCommand extends Command
         $OAuthToken->setRawToken($token);
         $user = new OAuthUser($username);
         $OAuthToken->setUser($user);
-        
-        $session->set('_security_'.$firewall, $OAuthToken->serialize());
+
+        $session->set('_security_' . $firewall, $OAuthToken->serialize());
         $session->save();
 
         $cookie = new Cookie($session->getName(), $session->getId());
-        
+
         return CookieJar::fromArray([
-                    $cookie->getName() => $cookie->getValue(),
-                ], 'flowdat.com'); 
+            $cookie->getName() => $cookie->getValue(),
+        ], 'flowdat.com');
     }
 
 }

+ 0 - 831
tools/src/Release.php

@@ -1,831 +0,0 @@
-<?php
-
-namespace FD3;
-
-use Docker\Composer\FileFormat;
-use Docker\Composer\NetworkConfig;
-use Docker\Composer\ServiceNotFoundException;
-use FD3\Services\Amqp;
-use FD3\Services\Api;
-use FD3\Services\Base;
-use FD3\Services\Base_log;
-use FD3\Services\Cablemodem;
-use FD3\Services\Cablemodem_cmd;
-use FD3\Services\Cablemodem_task;
-use FD3\Services\Dhcp;
-use FD3\Services\Dhcp_task;
-use FD3\Services\Freeradius;
-use FD3\Services\Ftth;
-use FD3\Services\Ftth_cmd;
-use FD3\Services\Ftth_task;
-use FD3\Services\Genieacs_cwmp;
-use FD3\Services\Genieacs_fs;
-use FD3\Services\Genieacs_gui;
-use FD3\Services\Genieacs_nbi;
-use FD3\Services\Geoserver;
-use FD3\Services\Jsendpoint;
-use FD3\Services\Jsonep_mongo;
-use FD3\Services\Jsonep_mysql;
-use FD3\Services\Kea;
-use FD3\Services\Mongodb;
-use FD3\Services\Mysql;
-use FD3\Services\Nginx;
-use FD3\Services\Pma;
-use FD3\Services\Radius;
-use FD3\Services\Redis;
-use FD3\Services\Stats;
-use FD3\Services\Stats_cmd;
-use FD3\Services\Statsd;
-use FD3\Services\Supervisord;
-use FD3\Services\Swagger;
-use FD3\Services\Tftp;
-use Symfony\Component\Console\Command\Command;
-use Symfony\Component\Console\Exception\LogicException;
-use Symfony\Component\Console\Input\InputArgument;
-use Symfony\Component\Console\Input\InputInterface;
-use Symfony\Component\Console\Input\InputOption;
-use Symfony\Component\Console\Output\OutputInterface;
-use Symfony\Component\Console\Question\ConfirmationQuestion;
-use Symfony\Component\Yaml\Yaml;
-
-class Release extends Command
-{
-    /**
-     * @var string Nombre del archivo de log.
-     */
-    protected $_running_log;
-
-    /**
-     * @var string Contiene la politica de restart de los dockers.
-     */
-    public $_docker_restart_default;
-
-    /**
-     * @var array Contiene las variables que se utilizar en la ejecucion del ansible.
-     */
-    protected $_ansible_vars;
-
-    /**
-     * @var string Contiene el password del usuario root.
-     */
-    public $_mysql_root_pass;
-
-    /**
-     * @var string Contiene el usuario de base de datos.
-     */
-    public $_mysql_user;
-
-    /**
-     * @var string Contiene la contrasena del  usuario de base de datos.
-     */
-    public $_mysql_pass;
-
-    /**
-     * @var DevOps\FileSystem Me permite crear archivos.
-     */
-    protected $_dObj;
-
-    /**
-     * @var string Contiene el dominio.
-     */
-    protected $_domain;
-
-    /**
-     * @var string Contiene el nombre del cliente.
-     */
-    protected $_client;
-
-    /**
-     * @var array Contiene todos los modulos para la instalacion.
-     */
-    public $_modules_all;
-    /**
-     * @var array Contiene todos los modulos extras para la instalacion.
-     */
-    protected $_modules_extra;
-
-    /**
-     * @var array Contiene la configuracion de los modulos.
-     */
-    protected $_modules;
-    /**
-     * @var array Contiene los usuarios que van a poder acceder al sistema.
-     */
-    protected $_user_system;
-
-    /**
-     * @var string $directory Directorio de instalacion
-     */
-    protected $directory;
-
-    /**
-     * @var boolean $_use_nginx_links Para indicar si se crean los links nginx entre los modulos
-     */
-    protected $_use_nginx_links;
-    /**
-     * Add links nginx
-     */
-    protected $_add_nginx_links;
-    /**
-     * @var int Max connection for mysql
-     */
-    public $_mysql_max_connections;
-    /**
-     * @var string Running env file
-     */
-    public $_running_env;
-    /**
-     * @var string Host env file
-     */
-    public $_host_env;
-    /**
-     * @var string IP configuration
-     */
-    public $_network_ip;
-    /**
-     * @var string Network name
-     */
-    public $_network_name;
-
-    /**
-     * Constructor.
-     *
-     * @param string|null $name The name of the command; passing null means it must be set in configure()
-     *
-     * @throws LogicException When the command name is empty
-     */
-    public function __construct($name = null)
-    {
-        parent::__construct($name);
-        $this->_running_log = "running.log";
-        $this->_mysql_user = "iksop";
-        $this->_mysql_pass = "235r2342gtfsw";
-        $this->_mysql_root_pass = "235r2342gtfsw";
-        $this->_mysql_max_connections = 10000;
-        $this->_running_env = "running.env";
-        $this->_host_env = "host.env";
-        $this->_docker_restart_default = "on-failure:10";
-        $this->_network_name = "flowdat3";
-        $this->_user_system = ['users' =>
-            [
-                ['user' => 'admin', 'password' => 'admin', 'tenancy' => 1, 'email' => 'soporte@interlink.com.ar', 'extra' => '--super-admin '],
-                ['user' => 'iksop', 'password' => 'gran5pe', 'tenancy' => 2, 'email' => 'admin@interlink.com.ar', 'extra' => ''],
-                ['user' => 'interno', 'password' => 'gran5pe1nterno', 'tenancy' => 2, 'email' => 'admin@interlink.com.ar', 'extra' => '']
-            ]];
-        $this->_modules = array();
-        $this->_ansible_vars = array();
-        $this->_modules_all = $this->getModules();
-        $this->_add_nginx_links = false;
-    }
-
-    private function getModules()
-    {
-        $dir = __DIR__ . "/Services/";
-        $files = scandir($dir);
-        $modulesRead = [];
-        $resp = [];
-        foreach ($files as $file) {
-            if (is_file($dir . $file) && $file != "InitialService.php") {
-                $class = "FD3\\Services\\" . explode(".", $file)[0];
-                $object = new $class();
-                array_push($modulesRead, $object);
-            }
-        }
-        // obtengo los modulos requeridos por obligacion
-        foreach ($modulesRead as $key => $mod) {
-            if ($mod->isRequired()) {
-                $resp[$mod->getModuleName()] = $mod->getConfig();
-                unset($modulesRead[$key]);
-            }
-        }
-        // obtengo los modulos sin dependencias
-        foreach ($modulesRead as $key => $mod) {
-            if (count($mod->getDepends()) == 0) {
-                $resp[$mod->getModuleName()] = $mod->getConfig();
-                unset($modulesRead[$key]);
-            }
-        }
-        // obtengo el resto de los modulos
-        foreach ($modulesRead as $mod) {
-            $resp[$mod->getModuleName()] = $mod->getConfig();
-        }
-        return $resp;
-    }
-
-    protected function configure()
-    {
-        $this
-            ->setName('make:install')
-            ->setDescription('Create a new install.')
-            ->setHelp('This command allows you to create a new installation...')
-            ->addArgument('dir', InputArgument::REQUIRED, 'The directory where to create the installation.')
-            ->addOption('base-repo', null, InputOption::VALUE_REQUIRED, 'Git clone Url for the app Base', "git@gitlab.com:interlink-sa/flowdat3/modules/base.git")
-            ->addOption('base-ref', null, InputOption::VALUE_REQUIRED, 'Git reference (branch or tag) to clone the Base app', "master")
-            ->addOption('base-build', null, InputOption::VALUE_REQUIRED, 'Generate image build', "false")
-            ->addOption('ftth-repo', null, InputOption::VALUE_REQUIRED, 'Git clone Url for the app FTTH', "git@gitlab.com:interlink-sa/flowdat3/modules/ftth.git")
-            ->addOption('ftth-ref', null, InputOption::VALUE_REQUIRED, 'Git reference (branch or tag) to clone the Ftth ', "master")
-            ->addOption('ftth-build', null, InputOption::VALUE_REQUIRED, 'Generate image build', "false")
-            ->addOption('radius-repo', null, InputOption::VALUE_REQUIRED, 'Git clone Url for the app Radius', "git@gitlab.com:interlink-sa/flowdat3/modules/radius.git")
-            ->addOption('radius-ref', null, InputOption::VALUE_REQUIRED, 'Git reference (branch or tag) to clone the radius app', "master")
-            ->addOption('radius-build', null, InputOption::VALUE_REQUIRED, 'Generate image build', "false")
-            ->addOption('stats-repo', null, InputOption::VALUE_REQUIRED, 'Git clone Url for the app Stats', "git@gitlab.com:interlink-sa/flowdat3/modules/stats.git")
-            ->addOption('stats-ref', null, InputOption::VALUE_REQUIRED, 'Git reference (branch or tag) to clone the Stats app', "master")
-            ->addOption('stats-build', null, InputOption::VALUE_REQUIRED, 'Generate image build', "false")
-            ->addOption('cablemodem-repo', null, InputOption::VALUE_REQUIRED, 'Git clone Url for the app Cablemodem', "git@gitlab.com:interlink-sa/flowdat3/modules/cablemodem.git")
-            ->addOption('cablemodem-ref', null, InputOption::VALUE_REQUIRED, 'Git reference (branch or tag) to clone the Cablemodem files and apps', "master")
-            ->addOption('cablemodem-build', null, InputOption::VALUE_REQUIRED, 'Generate image build', "false")
-            ->addOption('dhcp-repo', null, InputOption::VALUE_REQUIRED, 'Git clone Url for the app DHCP', "git@gitlab.com:interlink-sa/flowdat3/modules/dhcp.git")
-            ->addOption('dhcp-ref', null, InputOption::VALUE_REQUIRED, 'Git reference (branch or tag) to clone the DHCP files and apps', "master")
-            ->addOption('dhcp-build', null, InputOption::VALUE_REQUIRED, 'Generate image build', "false")
-            ->addOption('extra-repo', null, InputOption::VALUE_REQUIRED, 'Git clone Url for Extra repository', "git@gitlab.com:interlink-sa/flowdat3/modules/extra.git")
-            ->addOption('extra-ref', null, InputOption::VALUE_REQUIRED, 'Git reference (branch or tag) to clone the Extra files and apps', "master")
-            ->addOption('extra-build', null, InputOption::VALUE_REQUIRED, 'Generate image build', "false")
-            ->addOption('kea-repo', null, InputOption::VALUE_REQUIRED, 'Git clone Url for KEA', "git@gitlab.com:interlink-sa/flowdat3/vendors/kea.git")
-            ->addOption('kea-ref', null, InputOption::VALUE_REQUIRED, 'Git reference (branch or tag) to clone KEA files and apps', "master")
-            ->addOption('kea-build', null, InputOption::VALUE_REQUIRED, 'Generate image build', "false")
-            ->addOption('host-ip', null, InputOption::VALUE_REQUIRED, 'Ip of the runnning host to be added to the /etc/hosts file, eventually', "127.0.1.1")
-            ->addOption('domain', null, InputOption::VALUE_REQUIRED, 'Domain where the flowdat will be installed', "flowdat.net")
-            ->addOption('client', null, InputOption::VALUE_REQUIRED, 'Client name, if is not provided uses, the dirname of the installation', false)
-            ->addOption('modules', null, InputOption::VALUE_REQUIRED, 'List of modules to install separated by coma.', "all")
-            ->addOption('inventory', null, InputOption::VALUE_REQUIRED, 'Write inventory.ini by default.', true)
-            ->addOption('docker-tag', null, InputOption::VALUE_REQUIRED, 'Docker tag to be used. Ej. v0.1.1', "latest")
-            ->addOption('all-ref', null, InputOption::VALUE_REQUIRED, 'Git reference (branch or tag) to clone all app. Ej. 0.1.1', "")
-            ->addOption('general-version', null, InputOption::VALUE_REQUIRED, 'Set options all-ref and docker-tag with this value. Ej. 0.1.1', "")
-            ->addOption('add-nginx-links', null, InputOption::VALUE_NONE, 'Add NGINX links between dockers', null)
-            ->addOption('ip-network_begin', null, InputOption::VALUE_REQUIRED, 'Flowdat ip network configuration', "172.172.172.0");
-    }
-
-    protected function execute(InputInterface $input, OutputInterface $output)
-    {
-        try {
-            if (strlen(trim($input->getOption("general-version"))) > 0) {
-                $input->setOption('all-ref', 'v' . $input->getOption('general-version'));
-                $input->setOption('docker-tag', $input->getOption('general-version'));
-            }
-            if (strlen(trim($input->getOption("all-ref"))) > 0) {
-                $input->setOption('base-ref', $input->getOption('all-ref'));
-                $input->setOption('ftth-ref', $input->getOption('all-ref'));
-                $input->setOption('radius-ref', $input->getOption('all-ref'));
-                $input->setOption('stats-ref', $input->getOption('all-ref'));
-                $input->setOption('cablemodem-ref', $input->getOption('all-ref'));
-                $input->setOption('dhcp-ref', $input->getOption('all-ref'));
-                $input->setOption('extra-ref', $input->getOption('all-ref'));
-                $input->setOption('kea-ref', $input->getOption('all-ref'));
-            }
-            if (strtolower($input->getOption("modules")) == "all") {
-                // seteo todos los modulos a instalar por defecto
-                $modules = $this->selectInstallModules($input, $output);
-                $input->setOption("modules", $modules);
-            }
-            $this->AddModules(explode(",", $input->getOption("modules")));
-            $this->directory = $input->getArgument('dir');
-            if (!is_dir($this->directory)) {
-                mkdir($this->directory, 0777, true);
-            }
-            if (file_exists($this->directory . "/" . $this->_running_log)) {
-                $helper = $this->getHelper('question');
-                $question = new ConfirmationQuestion('The ' . realpath($this->directory) . "/" . $this->_running_log . ' file exist. Read file (Y) or take parameters (N)? (Y/n)', true);
-                if ($helper->ask($input, $output, $question)) {
-                    $this->setParametersFormFile($input);
-                }
-            }
-            $this->_domain = $input->getOption("domain");
-            $this->_client = $input->getOption("client");
-            $this->_network_ip = $input->getOption("ip-network_begin");
-
-            if (!$this->_client) {
-                $this->_client = basename(realpath($this->directory));
-            }
-
-            $docker_tag = $input->getOption("docker-tag");
-
-            $internal_user_id = 2;
-
-            $this->_ansible_vars["DOMAIN"] = $this->_domain;
-            $this->_ansible_vars["CLIENT"] = $this->_client;
-            $this->_ansible_vars["CMD_USERNAME"] = $this->_user_system['users'][$internal_user_id]['user'];
-            $this->_ansible_vars["CMD_PASSWORD"] = $this->_user_system['users'][$internal_user_id]['password'];
-            $this->_ansible_vars["ENV_LIST"] = "prod,dev,test";
-            $this->_ansible_vars["API_CIDR"] = "172.20.0.0/24";
-            $this->_ansible_vars["IK_SUBRED"] = "200.50.160.0/21";
-            $this->_ansible_vars["MYSQL_ROOT_PASSWORD"] = $this->_mysql_root_pass;
-
-            $this->_add_nginx_links = (boolean)$input->getOption('add-nginx-links');
-
-            $dObj = new DevOps\FileSystem(realpath($this->directory));
-            $dObj->dirExists()->realpath();
-            $this->_dObj = $dObj;
-
-            // agrego las opciones del input a la configuracion _modues
-            $this->addConfigOptions($input);
-            // creo el archivo de log de como se ejecuto
-            $this->createFileRunning($input, $output);
-            // cargo las fuentes a clonar
-            $this->createGitClone($input);
-            // creo el archivo docker-compose.yml
-            $this->getDockerComposer($docker_tag, "host.env", "docker.infra.flowdat.com/");
-            // escribo el archivo de host
-            $this->writeHostsFile($input->getOption("host-ip"));
-            // escribo el archivo con las variables de entorno
-            $this->writeHostEnv();
-            // escribo los archivo oauth
-            $this->writeOAUTH();
-            // escribo un archivo con variables para ansible
-            $this->writeEnvVariables();
-            // escribo un archivo con los usuarios del sistema
-            $this->writeUserSystem();
-
-            $dObj->file('install.yml')->content(
-                yaml::dump(array(
-                        "install_dir" => realpath($this->directory),
-                        'docker_apps' => "base," . implode(",", $this->_ansible_vars),
-                        'domain' => $this->_domain,
-                    )
-                )
-            );
-
-            $dObj->file('ansible.cfg')->content(
-                "[defaults]\n" .
-                "inventory=inventory.ini\n"
-            );
-
-            // copio el playbook
-            copy(getcwd() . "/playbook.yml", $dObj->dirExists()->realpath()->getPath() . "/playbook.yml");
-            // copio el script de base de datos inicial
-            copy(getcwd() . "/mysql_scripts.sql", $dObj->dirExists()->realpath()->getPath() . "/mysql_scripts.sql");
-            // copio el archivo que contiene los usuarios del sistema
-            copy(getcwd() . "/user_system.json", $dObj->dirExists()->realpath()->getPath() . "/user_system.json");
-            // copio script mysql schema freeradius
-            copy(getcwd() . "/mysql/freeradius/schema.sql", $dObj->dirExists()->realpath()->getPath() . "/freeradius_schema.sql");
-            // copio el docker-compose.service
-            copy(getcwd() . "/docker-compose.service", $dObj->dirExists()->realpath()->getPath() . "/docker-compose.service");
-        } finally {
-            $this->_dObj = null;
-            $this->_modules = null;
-        }
-    }
-
-    /**
-     * @param string $module Name of module.
-     * @return bool Return TRUE if depends exists.
-     */
-    public function needInstallModule($module)
-    {
-        foreach ($this->_modules as $key => $value) {
-            if ($key == $module) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    /**
-     * @param array $modules All modules selected.
-     * @param array $depends All modules to depends.
-     * @return bool Return TRUE if depends exists.
-     */
-    public function checkDepends($modules, $depends)
-    {
-        if ($depends) {
-            foreach ($depends as $depend) {
-                if (in_array($depend, $modules)) {
-                    return true;
-                }
-            }
-        }
-        return false;
-    }
-
-    /**
-     * @param InputInterface $input InputInterface
-     * @param OutputInterface $output OutputInterface
-     * @return string Return all modules selected.
-     */
-    public function selectInstallModules(InputInterface $input, OutputInterface $output)
-    {
-        $modules = [];
-        $output->writeln("Seleccione los módulos que desea instalar:");
-        foreach ($this->_modules_all as $name => $value) {
-            if (isset($value['REQUIRED']) && $value['REQUIRED']) {
-                $modules[] = $name;
-                $output->writeln("Se instala el modulo $name, por ser una dependencia obligatoria");
-            } else {
-                if ($this->checkDepends($modules, $value['DEPENDS'])) {
-                    $modules[] = $name;
-                    $value['REQUIRED'] = true;
-                    $output->writeln("Se instala el modulo $name, por tener las siguientes dependencias " .
-                        implode(",", $value['DEPENDS']));
-                } else {
-                    $helper = $this->getHelper('question');
-                    $question = new ConfirmationQuestion((isset($value['HELP']) ? ($value['HELP'] . ". ") : "") .
-                        strtoupper($name) . "? (Y/n) ");
-                    if ($helper->ask($input, $output, $question)) {
-                        $modules [] = $name;
-                        $value['REQUIRED'] = true;
-                    }
-
-                }
-            }
-        }
-        $modules = implode(",", $modules);
-        return $modules;
-    }
-
-    /**
-     * @return array Retorna un array con  los host como key el dominio como valor.
-     */
-    function getHostEnv()
-    {
-        $resp = array();
-        foreach ($this->_modules as $key => $values) {
-            if ($values['HOST_ENV']) {
-                $resp ["HOST_" . strtoupper($key)] = $this->getDomain($key);
-            }
-
-        }
-
-        return $resp;
-    }
-
-    function getHostConfig($config_ip)
-    {
-        $resp = array();
-        foreach ($this->_modules as $key => $values) {
-            if ($values['HOST_ENV']) {
-                $resp [$this->getDomain($key)] = $config_ip;
-            }
-        }
-        return $resp;
-    }
-
-    function getDockerComposer($version = "latest", $host_env_file = "host.env", $registry = "docker.infra.flowdat.com/")
-    {
-        $composer = new FileFormat("../", "3.7");
-        $this->registerVolumes($composer);
-        $nc = new NetworkConfig();
-        $nc->addDriver()->addSubnetGateway("172.172.172.0/24");
-        $composer->getNetwork()->addDriver($this->_network_name)->addConfig($this->_network_name, $nc);
-
-        $base_vars = array(
-            "version" => $version,
-            "host_env_file" => $host_env_file,
-            "registry" => $registry);
-
-        $ip = explode(".", $this->_network_ip);
-        array_pop($ip);
-        $ip = implode(".", $ip);
-        foreach ($this->_modules_all as $module => $env) {
-            if (strpos($module, "genieacs") !== false) {
-                $module = str_replace("-", "_", $module);
-            }
-            $class = "FD3\\Services\\" . ucfirst($module);
-            $object = new $class();
-            $object
-                ->setRelease($this)
-                ->setComposer($composer)
-                ->setConfigVar($base_vars)
-                ->setIp($ip)
-                ->setProduction(false)
-                ->add();
-        }
-
-        $this->checkLinkDependencyDockerCompose($composer);
-        $this->_dObj->file("docker-compose.yml")->content($composer->render());
-
-        // escribo un archivo inventory.ini por defecto para no tener que lanzar los docker
-        $this->writeInventory($composer);
-    }
-
-    /**
-     * Crea un array con la configuracion de los modulos.
-     * @param InputInterface $input Contiene el input.
-     */
-    protected function addConfigOptions(InputInterface $input)
-    {
-        foreach ($this->_modules as $key => $values) {
-            if ($input->hasOption($key . "-repo") &&
-                $input->hasOption($key . "-ref") &&
-                $input->hasOption($key . "-build")
-            ) {
-                $this->_modules[$key]['repo'] = $input->getOption($key . "-repo");
-                $this->_modules[$key]['ref'] = $input->getOption($key . "-ref");
-                $this->_modules[$key]['build'] = $input->getOption($key . "-build");
-            }
-        }
-    }
-
-    /**
-     * Crea un array con las direcciones de a clonar.
-     */
-    protected function createGitClone(InputInterface $input)
-    {
-        $clone = array();
-        $modules = array_keys($this->_modules);
-        foreach ($modules as $name) {
-            if (isset($this->_modules[$name]["repo"]) &&
-                isset($this->_modules[$name]["ref"])) {
-                $clone[$name] = array(
-                    'url' => $this->_modules[$name]["repo"],
-                    'branch' => $this->_modules[$name]["ref"]
-                );
-            }
-        }
-        $name = 'extra';
-        $clone[$name] = array(
-            'url' => $input->getOption($name . "-repo"),
-            'branch' => $input->getOption($name . "-ref")
-        );
-        $this->_dObj->file("git.ini")->writeIniConfig($clone);
-    }
-
-    /**
-     * Crea un archivo conlos parametros con los que se corrio el script.
-     * @param InputInterface $input Contiene el input
-     * @param OutputInterface $output Contiene el output
-     */
-    protected function createFileRunning(InputInterface $input, OutputInterface $output)
-    {
-        $file = array();
-        $file ["Running"] = array("date" => gmdate('Y-m-d h:i:s'));
-        $file ["Arguments"] = $input->getArguments();
-        $file ["Options"] = $input->getOptions();
-        $output->writeln("Writing " . $this->_dObj->getPath() . "/" . $this->_running_log);
-        $this->_dObj->file($this->_running_log)->writeIniConfig($file);
-    }
-
-    /**
-     * @param string $module Contiene el nombre del modulo.
-     * @param array $extras Contiene variables de entorno extra.
-     * @return string|array Retorna un array con los datos de virtual host.
-     */
-    function getEnviromentVarialbes($module, $extras = array())
-    {
-        $env = "";
-        if ($module != null) {
-            foreach ($this->_modules as $nameApp => $app) {
-                if (isset($app['VAR_ENV']) && $nameApp == $module) {
-                    foreach ($app['VAR_ENV'] as $key => $value) {
-                        if ($key == 'VIRTUAL_HOST') {
-                            $env .= "VIRTUAL_HOST=" . $this->getDomain($module) . "\n";
-                        } else if ($key == 'PMA_ABSOLUTE_URI') {
-                            $env .= "PMA_ABSOLUTE_URI=" . $this->getDomain("pma") . "\n";
-                        } else {
-                            $env .= $key . "=" . $value . "\n";
-                        }
-                    }
-                }
-            }
-        }
-        foreach ($extras as $key => $value) {
-            $env .= $key . "=" . $value . "\n";
-        }
-        return $env;
-    }
-
-    /**
-     * Crea el archivo modulo.oauth.env
-     */
-    protected function writeOAUTH()
-    {
-        $oautModules = "";
-        foreach ($this->_modules as $nameApp => $app) {
-            if (isset($app['OAUTH']) && $app['OAUTH']) {
-                if (!file_exists(realpath($this->directory) . $nameApp . ".oauth.env")) {
-                    $this->_dObj->file($nameApp . ".oauth.env")->content("");
-                    $oautModules = $oautModules . $nameApp . ",";
-                }
-            }
-        }
-        $this->_ansible_vars["MODULES_INSTALL"] = substr($oautModules, 0, strlen($oautModules) - 1);
-    }
-
-    /**
-     * Crea el archivo host.env
-     */
-    protected function writeHostEnv()
-    {
-        $hostEnvConfig = $this->getHostEnv();
-        $env_content = "";
-        foreach ($hostEnvConfig as $var => $val) {
-            $env_content .= $var . "=" . $val . "\n";
-        }
-        $this->_dObj->file('host.env')->content($env_content);
-    }
-
-    /**
-     * Crea el archivo hostsDile
-     * @param string $config_ip Contiene la ip.
-     */
-    protected function writeHostsFile($config_ip)
-    {
-        $hostConfig = $this->getHostConfig($config_ip);
-        $hostfile_content = "";
-        foreach ($hostConfig as $host => $ip) {
-            $hostfile_content .= $ip . "\t" . $host . "\n";
-        }
-        $this->_dObj->file("hostsFile")->content($hostfile_content);
-    }
-
-    /**
-     * Crea un archivo con las variables de entorno particulares del modulo.
-     * @param string $name Contiene el nombre del archivo.
-     * @param string $module Contiene el nombre del modulo.
-     * @param array $extras Contiene un array con las variables extras.
-     */
-    public function writeVariablesEnviroment($name, $module = null, $extras = array())
-    {
-        $this->_dObj->file($name)->content(
-            $this->getEnviromentVarialbes($module, $extras));
-    }
-
-    /**
-     * Funcion que agrega el build de acuerdo en la configuracion.
-     * @param string $module Contiene el nombre del modulo.
-     * @param FileFormat $composer Contiene el objeto FileFormat.
-     */
-    public function addBuild($module, FileFormat $composer)
-    {
-        if (isset($this->_modules[$module]['build']) &&
-            filter_var($this->_modules[$module]['build'], FILTER_VALIDATE_BOOLEAN)) {
-            try {
-                $composer->service($module)->build("./$module/");
-            } catch (ServiceNotFoundException $ignore) {
-            }
-        }
-    }
-
-    /**
-     * Funcion que setea los valores que se lean desde el archivo running.log.
-     * Solo se reemplazan las opciones.
-     * Si se toman los argumentos puede pisar el directorio de destino y a lo mejor se quiere replicar la instalacion en
-     * otro directorio.
-     * @param InputInterface $input contiene el input
-     */
-    protected function setParametersFormFile(InputInterface $input)
-    {
-        $parameters = parse_ini_file($input->getArgument('dir') . "/" . $this->_running_log, true);
-        foreach ($parameters["Options"] as $key => $value) {
-            $input->setOption($key, $value);
-        }
-    }
-
-    /**
-     * @param string $module Contiene el nombre del modulo.
-     * @return string Retorna el dominio para el modulo.
-     */
-    public function getDomain($module)
-    {
-        return $module . "." . $this->_client . "." . $this->_domain;
-    }
-
-    /**
-     * @param array $modules Contiene los modulos a implementar
-     */
-    protected function AddModules($modules)
-    {
-        foreach ($modules as $value) {
-            if (array_key_exists($value, $this->_modules_all)) {
-                $this->_modules[$value] = $this->_modules_all[$value];
-            }
-        }
-    }
-
-    /**
-     * Crea el archivo con las variables para ejecutar el ansible.
-     */
-    protected function writeEnvVariables()
-    {
-        $tmp = "";
-        foreach ($this->_ansible_vars as $key => $value) {
-            $tmp = $tmp . "$key=$value\n";
-        }
-        $this->_dObj->file(str_replace(".log", ".env", $this->_running_log))
-            ->content($tmp);
-    }
-
-    /**
-     * Crea el archivo con los usuarios del sistema para que lea el ansible.
-     */
-    protected function writeUserSystem()
-    {
-        $this->_dObj->file("user_system.json")
-            ->content(json_encode($this->_user_system));
-    }
-
-    /**
-     * Crea el archivo con las variables para ejecutar el ansible.
-     */
-    protected function writeInventory(FileFormat $composer)
-    {
-        $tmp = "";
-        $all = "[all]\n";
-        $prefix = basename(realpath($this->directory));
-        foreach ($composer->getServices() as $key => $value) {
-            $tmp .= "[$key]\n";
-            $tmp .= $prefix . "_" . $key . "_1\n\n";
-            $all .= $prefix . "_" . $key . "_1\n";
-        }
-
-        $this->_dObj->file("inventory.ini")->content($tmp . $all);
-    }
-
-    /**
-     * Funcion que agrega links nginx a los modulos principales (para instalacion dev)
-     * @param string $module Contiene el nombre del modulo.
-     * @param FileFormat $composer Contiene el objeto FileFormat.
-     * @throws ServiceNotFoundException
-     */
-    public function addNginxLinks($module, FileFormat $composer)
-    {
-        if ($this->_add_nginx_links) {
-            if (in_array((new Base())->getModuleName(), $this->_modules_all)) {
-                $composer->service($module)->addLinks((new Nginx())->getModuleName(), $this->getDomain((new Base())->getModuleName()));
-            }
-            if (in_array((new Ftth())->getModuleName(), $this->_modules_all)) {
-                $composer->service($module)->addLinks((new Nginx())->getModuleName(), $this->getDomain((new Ftth())->getModuleName()));
-            }
-            if (in_array((new Cablemodem())->getModuleName(), $this->_modules_all)) {
-                $composer->service($module)->addLinks((new Nginx())->getModuleName(), $this->getDomain((new Cablemodem())->getModuleName()));
-            }
-            if (in_array((new Stats())->getModuleName(), $this->_modules_all)) {
-                $composer->service($module)->addLinks((new Nginx())->getModuleName(), $this->getDomain((new Stats())->getModuleName()));
-            }
-            if (in_array((new Dhcp())->getModuleName(), $this->_modules_all)) {
-                $composer->service($module)->addLinks((new Nginx())->getModuleName(), $this->getDomain((new Dhcp())->getModuleName()));
-            }
-            if (in_array((new Radius())->getModuleName(), $this->_modules_all)) {
-                $composer->service($module)->addLinks((new Nginx())->getModuleName(), $this->getDomain((new Radius())->getModuleName()));
-            }
-        }
-    }
-
-    private function registerVolumes(FileFormat $composer)
-    {
-        if (in_array((new Pma())->getModuleName(), $this->_modules_all)) {
-            $composer->getVolumes()->addVolumen(Pma::PMA_VOLUMEN, 'local');
-        }
-        if (in_array((new Swagger())->getModuleName(), $this->_modules_all)) {
-            $composer->getVolumes()->addVolumen(Swagger::SWAGGER_VOLUMEN, 'local');
-        }
-        if (in_array((new Base())->getModuleName(), $this->_modules_all)) {
-            $composer->getVolumes()->addVolumen(Base::BASE_SOCKET_VOLUMEN, 'local');
-        }
-        if (in_array((new Cablemodem())->getModuleName(), $this->_modules_all)) {
-            $composer->getVolumes()->addVolumen(Cablemodem::CABLEMODEM_SOCKET_VOLUMEN, 'local');
-        }
-        if (in_array((new Dhcp())->getModuleName(), $this->_modules_all)) {
-            $composer->getVolumes()->addVolumen(Dhcp::DHCP_SOCKET_VOLUMEN, 'local');
-        }
-        if (in_array((new Ftth())->getModuleName(), $this->_modules_all)) {
-            $composer->getVolumes()->addVolumen(Ftth::FTTH_SOCKET_VOLUMEN, 'local');
-        }
-        if (in_array((new Radius())->getModuleName(), $this->_modules_all)) {
-            $composer->getVolumes()->addVolumen(Radius::RADIUS_SOCKET_VOLUMEN, 'local');
-        }
-        if (in_array((new Stats())->getModuleName(), $this->_modules_all)) {
-            $composer->getVolumes()->addVolumen(Stats::STATS_SOCKET_VOLUMEN, 'local');
-        }
-        if (in_array((new Api())->getModuleName(), $this->_modules_all)) {
-            $composer->getVolumes()->addVolumen(Api::API_SOCKET_VOLUMEN, 'local');
-        }
-    }
-
-    /**
-     * @param FileFormat $composer Contains composer.
-     * @return FileFormat Return composer with corrected link.
-     */
-    private function checkLinkDependencyDockerCompose(FileFormat $composer)
-    {
-        foreach ($composer->getServices() as $key => $value) {
-            // every service in docker compose
-            if ($value->getLinks()) {
-                $arrtmp = [];
-                foreach ($value->getLinks() as $link) {
-                    // every link in service in docker compose
-                    $found = false;
-                    foreach ($this->_modules as $module => $env) {
-                        // every module selected for install
-                        if (strpos($module, "genieacs") !== false) {
-                            $moduleg = str_replace("-", "_", $module);
-                        } else {
-                            $moduleg = "";
-                        }
-                        //remove nginx: to compare because nginx is always TRUE
-                        $linkTmp = str_replace("nginx:", "", $link);
-                        if (strpos($linkTmp, $module) === false) {
-                        } else if ($moduleg != "" && strpos($linkTmp, $moduleg) === false) {
-                        } else {
-                            $found = true;
-                        }
-                    }
-                    if ($found) {
-                        // add link only if is in list of modules install
-                        $arrtmp[] = $link;
-                    }
-                }
-                $value->setLinks($arrtmp);
-            }
-        }
-        return $composer;
-    }
-}

+ 0 - 2
tools/src/ReleaseImages.php

@@ -622,8 +622,6 @@ class ReleaseImages extends Command
                     foreach ($app['VAR_ENV'] as $key => $value) {
                         if ($key == 'VIRTUAL_HOST') {
                             $env .= "VIRTUAL_HOST=" . $this->getDomain($module) . "\n";
-                        } else if ($key == 'PMA_ABSOLUTE_URI') {
-                            $env .= "PMA_ABSOLUTE_URI=" . $this->getDomain("pma") . "\n";
                         } else {
                             $env .= $key . "=" . $value . "\n";
                         }

+ 0 - 0
tools/updateModules.sh