Ver Fonte

Merge branch 'master' of bitbucket.org:ikflowdat/ftth

Luciano Andrade há 7 anos atrás
pai
commit
7189284c21

+ 5 - 8
.drone.yml

@@ -1,6 +1,6 @@
 services:
   database:
-    image: mysql:5.5
+    image: mysql:5.7
     environment:
       - MYSQL_ROOT_PASSWORD=
       - MYSQL_ALLOW_EMPTY_PASSWORD=yes
@@ -48,12 +48,10 @@ pipeline:
    image: plugins/docker
    email: luciano@interlink.com.ar
    registry: docker.infra.flowdat.com
-   username: drone
-   password: 6hd2dLfL
    tag: 
      - latest
    when:
-     event: [pull_request, push, tag]
+     event: [push]
      branch: [master]
 
  docker_version:
@@ -61,11 +59,10 @@ pipeline:
    image: plugins/docker
    email: luciano@interlink.com.ar
    registry: docker.infra.flowdat.com
-   username: drone
-   password: 6hd2dLfL
    tag: 
-     - ${DRONE_TAG##v}
+     - "${DRONE_TAG:1:5}"
+     - "${DRONE_TAG:1:3}"
    when:
-     event: [pull_request, push, tag]
+     event: [tag]
      branch: [v*]
 

+ 25 - 4
app/AppKernel.php

@@ -2,6 +2,8 @@
 
 use Symfony\Component\HttpKernel\Kernel;
 use Symfony\Component\Config\Loader\LoaderInterface;
+use Symfony\Component\HttpKernel\HttpKernelInterface;
+use Symfony\Component\HttpFoundation\Request;
 
 class AppKernel extends Kernel
 {
@@ -53,7 +55,7 @@ class AppKernel extends Kernel
 
         }
 
-	$bundles[] = new Symfony\Bundle\WebServerBundle\WebServerBundle();
+        $bundles[] = new Symfony\Bundle\WebServerBundle\WebServerBundle();
 
         return $bundles;
     }
@@ -65,16 +67,35 @@ class AppKernel extends Kernel
 
     public function getCacheDir()
     {
-        return dirname(__DIR__).'/var/cache/'.$this->getEnvironment();
+        return dirname(__DIR__) . '/var/cache/' . $this->getEnvironment();
     }
 
     public function getLogDir()
     {
-        return dirname(__DIR__).'/var/logs';
+        return dirname(__DIR__) . '/var/logs';
     }
 
     public function registerContainerConfiguration(LoaderInterface $loader)
     {
-        $loader->load($this->getRootDir().'/config/config_'.$this->getEnvironment().'.yml');
+        $loader->load($this->getRootDir() . '/config/config_' . $this->getEnvironment() . '.yml');
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
+    {
+        if (false === $this->booted) {
+            $this->boot();
+        }
+        // se puede sacar la variable nginx-proxy porque es el nombre del docker y puede variar
+        // con REMOTRA_ADDR obtengo el mismo valor (http://symfony.com/doc/current/deployment/proxies.html)
+        //gethostbyname("nginx-proxy") == $request->server->get('REMOTE_ADDR')
+        if ($this->container->hasParameter("nginx_name")) {
+            Request::setTrustedProxies(
+                array('127.0.0.1', $this->container->getParameter("nginx_name")),
+                Request::HEADER_X_FORWARDED_FOR);
+        }
+        return parent::handle($request, $type, $catch);
     }
 }

Diff do ficheiro suprimidas por serem muito extensas
+ 70 - 0
app/DoctrineMigrations/Templates20171205183401/inicio.yml


+ 19 - 0
app/DoctrineMigrations/Version20171205183401.php

@@ -0,0 +1,19 @@
+<?php
+
+namespace Application\Migrations;
+
+use Doctrine\DBAL\Migrations\AbstractMigration;
+use Doctrine\DBAL\Schema\Schema;
+use MigrationsBundle\Migrations\MigrationsBase;
+
+/**
+ * Auto-generated Migration: Please modify to your needs!
+ */
+class Version20171205183401 extends MigrationsBase
+{
+    public function postUp(Schema $schema)
+    {
+        $this->executeYaml(__DIR__ . "/Templates20171205183401/", "inicio.yml");
+        $this->showResult();
+    }
+}

+ 3 - 1
app/config/parameters.yml.dist

@@ -43,4 +43,6 @@ parameters:
     cookie_domain: '%cookie_domain_client%.fd3.flowdat.com'
     session_names: [flowdat_base_session, flowdat_ftth_session, flowdat_mapas_session, flowdat_stats_session, flowdat_radius_session, flowdat_cablemodem_session]
 
-    onu.distance.nap: 0.2
+    # nombre del servicio del nginx
+    nginx_name: nginx-proxy
+    onu.distance.nap: 0.2

+ 3 - 1
app/config/parameters.yml.docker

@@ -38,4 +38,6 @@ parameters:
     cookie_domain: '%cookie_domain_client%.flowdat.com'
     session_names: [flowdat_base_session, flowdat_ftth_session, flowdat_mapas_session, flowdat_stats_session, flowdat_radius_session, flowdat_cablemodem_session]
 
-    onu.distance.nap: 0.2
+    # nombre del servicio del nginx
+    nginx_name: nginx-proxy
+    onu.distance.nap: 0.2

+ 15 - 3
app/config/security.yml

@@ -10,15 +10,27 @@ security:
     firewalls:       
                                 
         dev:
+            # es una llave que se utiliza para guardar y traer los datos de la session. Los firewalls que posean
+            # el mismo context, van a compartir la informacion. PARA QUE FUNCION "stateless" debe estar en FALSE
+            context: ik_share
+            stateless: false
             pattern: ^/(_(profiler|wdt)|css|images|js)/
             security: false
             
         api:
-          pattern: ^/api
-          stateless: true
-          oauth_proxy: true
+            # es una llave que se utiliza para guardar y traer los datos de la session. Los firewalls que posean
+            # el mismo context, van a compartir la informacion. PARA QUE FUNCION "stateless" debe estar en FALSE
+            context: ik_share
+            stateless: false
+            pattern: ^/api
+            stateless: true
+            oauth_proxy: true
 
         secured_area:
+            # es una llave que se utiliza para guardar y traer los datos de la session. Los firewalls que posean
+            # el mismo context, van a compartir la informacion. PARA QUE FUNCION "stateless" debe estar en FALSE
+            context: ik_share
+            stateless: false
             pattern: ^/
             logout:
                 path:   /logout