Commits

Vittore Zen committed 2ecce36

debian 1

Comments (0)

Files changed (17)

app/debian/DebianKernel.php

+<?php
+
+use Symfony\Component\HttpKernel\Kernel;
+use Symfony\Component\Config\Loader\LoaderInterface;
+
+class DebianKernel extends Kernel {
+    public function registerRootDir()
+    {
+        return __DIR__;
+    }
+    public function registerBundles() {
+        $bundles = array(
+            new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
+            new Symfony\Bundle\SecurityBundle\SecurityBundle(),
+            new Symfony\Bundle\TwigBundle\TwigBundle(),
+            new Symfony\Bundle\MonologBundle\MonologBundle(),
+            new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
+            new Symfony\Bundle\AsseticBundle\AsseticBundle(),
+            new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
+            new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
+            new JMS\AopBundle\JMSAopBundle(),
+            new JMS\DiExtraBundle\JMSDiExtraBundle($this),
+            new JMS\SecurityExtraBundle\JMSSecurityExtraBundle(),
+            new IMAG\LdapBundle\IMAGLdapBundle(),
+            new Zen\IgrooveBundle\ZenIgrooveBundle(),
+            new Ps\PdfBundle\PsPdfBundle(),
+            new Knp\Bundle\PaginatorBundle\KnpPaginatorBundle(),
+            new Knp\Bundle\GaufretteBundle\KnpGaufretteBundle(),
+            new Braincrafted\Bundle\BootstrapBundle\BraincraftedBootstrapBundle(),
+            new Khepin\YamlFixturesBundle\KhepinYamlFixturesBundle()
+            );
+
+        if (in_array($this->getEnvironment(), array('dev', 'test'))) {
+            $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
+            $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
+            $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
+        }
+
+        return $bundles;
+    }
+
+    public function registerContainerConfiguration(LoaderInterface $loader) {
+        $loader->load(__DIR__ . '/config/config_' . $this->getEnvironment() . '.yml');
+    }
+
+}

app/debian/autoload.php

+<?php
+
+use Doctrine\Common\Annotations\AnnotationRegistry;
+
+
+
+$loader = require __DIR__.'/../vendor/autoload.php';
+
+// intl
+if (!function_exists('intl_get_error_code')) {
+    require_once __DIR__.'/../vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/stubs/functions.php';
+
+    $loader->add('', __DIR__.'/../vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/stubs');
+}
+
+
+$loader->add('Zend_', __DIR__.'/../vendor/zendframework/zendframework1/library');
+set_include_path(__DIR__.'/../vendor/zendframework/zendframework1/library'.PATH_SEPARATOR.get_include_path());
+
+AnnotationRegistry::registerLoader(array($loader, 'loadClass'));
+
+// require_once __DIR__.'/../vendor/adLDAP/adLDAP.php';

app/debian/config/behat.yml

+default:
+  formatter:
+    name: progress
+  extensions:
+    Behat\Symfony2Extension\Extension:
+      mink_driver: true
+      kernel:
+        env: test
+        debug: false
+    Behat\MinkExtension\Extension:
+      base_url: 'http://33.33.33.10/'
+      javascript_session:  'selenium2'
+      browser_name: firefox
+      goutte: 
+        guzzle_parameters:
+          curl.options:
+            CURLOPT_PORT: 80          
+      selenium2: 
+        wd_host: 33.33.33.1:4444/wd/hub
+      
+      
+      

app/debian/config/config.yml

+imports:
+    - { resource: dynamic.yml }
+    - { resource: parameters.yml }
+    - { resource: igroove.yml }
+    - { resource: security.yml }
+
+framework:
+    default_locale: %locale%
+    translator:      { fallback: it }
+    secret:          %secret%
+    router:          { resource: "%kernel.root_dir%/config/routing.yml" }
+    form:            true
+    csrf_protection: true
+    validation:      { enable_annotations: true }
+    templating:      { engines: ['twig'] } #assets_version: SomeVersionScheme
+    session:          ~
+    
+swiftmailer:
+    transport: "%mailer_transport%"
+    host:      "%mailer_host%"
+    username:  "%mailer_user%"
+    password:  "%mailer_password%"
+#    spool:     { type: memory }
+
+
+# Twig Configuration
+twig:
+    debug:            %kernel.debug%
+    strict_variables: %kernel.debug%
+
+# Assetic Configuration
+assetic:
+    debug:          %kernel.debug%
+    use_controller: false
+    # java: /usr/bin/java
+    filters:
+        cssrewrite: ~
+        # closure:
+        #     jar: %kernel.root_dir%/java/compiler.jar
+        # yui_css:
+        #     jar: %kernel.root_dir%/java/yuicompressor-2.4.2.jar
+
+# Doctrine Configuration
+doctrine:
+    dbal:
+        driver:   %database_driver%
+        host:     %database_host%
+        port:     %database_port%
+        dbname:   %dynamic.database_name%
+        user:     %dynamic.database_user%
+        password: %dynamic.database_password%
+        charset:  UTF8
+
+    orm:
+        auto_generate_proxy_classes: %kernel.debug%
+        auto_mapping: true
+
+# Swiftmailer Configuration
+swiftmailer:
+    transport: %mailer_transport%
+    host:      %mailer_host%
+    username:  %mailer_user%
+    password:  %mailer_password%
+
+
+ps_pdf:
+    nodes_file: ~
+    fonts_file: ~
+    complex_attributes_file: ~
+    colors_file: ~
+    use_cache_in_stylesheet: ~
+    cache:
+      type: ~
+      options: ~
+    markdown_stylesheet_filepath: ~
+    markdown_document_template_filepath: ~
+    document_parser_type: ~
+
+knp_paginator:
+    page_range: 5                      # default page range used in pagination control
+    default_options:
+        page_name: page                # page query parameter name
+        sort_field_name: sort          # sort field query parameter name
+        sort_direction_name: direction # sort direction query parameter name
+        distinct: true                 # ensure distinct results, useful when ORM queries are using GROUP BY statements
+
+braincrafted_bootstrap:
+    output_dir:
+    assets_dir: %kernel.root_dir%/../vendor/twbs/bootstrap
+    jquery_path: %kernel.root_dir%/../js/jquery-1.10.2.js
+    less_filter: none
+
+          
+khepin_yaml_fixtures:
+    resources:
+        - ZenIgrooveBundle/mac
+        - ZenIgrooveBundle/guest

app/debian/config/config_dev.yml

+imports:
+    - { resource: config.yml }
+
+framework:
+    router:   { resource: "%kernel.root_dir%/config/routing_dev.yml" }
+    profiler: { only_exceptions: false }
+
+web_profiler:
+    toolbar: true
+    intercept_redirects: false
+
+monolog:
+    handlers:
+        main:
+            type:  stream
+            path:  %kernel.logs_dir%/%kernel.environment%.log
+            level: debug
+        firephp:
+            type:  firephp
+            level: info
+
+assetic:
+    use_controller: true

app/debian/config/config_prod.yml

+imports:
+    - { resource: config.yml }
+
+#doctrine:
+#    orm:
+#        metadata_cache_driver: apc
+#        result_cache_driver: apc
+#        query_cache_driver: apc
+
+
+

app/debian/config/config_test.yml

+imports:
+    - { resource: config_dev.yml }
+
+framework:
+    test: ~
+        
+
+web_profiler:
+    toolbar: false
+    intercept_redirects: false
+
+swiftmailer:
+    disable_delivery: true

app/debian/config/dynamic.yml

+
+parameters:
+    dynamic.doctrine.dbal.default:
+        driver:   pdo_mysql
+        dbname:   igroove
+        user:     root
+        password: ~
+        
+   
+    

app/debian/config/dynamic.yml.dist

+
+parameters:
+    dynamic.doctrine.dbal.default:
+        driver:   pdo_mysql
+        dbname:   igroove
+        user:     root
+        password: ~

app/debian/config/igroove.dist.yml

+imag_ldap:
+  client:
+    host: 33.33.33.11
+    port: 389
+    version: 3 
+    referrals_enabled: 0    
+    username: vagrant
+    password: vagrant
+
+  user:
+    base_dn: DC=domain,DC=network
+    name_attribute: samaccountname
+  role:
+    base_dn: DC=domain,DC=network
+    name_attribute: cn
+    user_attribute: member
+    user_id: dn
+security:
+    role_hierarchy:
+        ROLE_DOCENTI:       ROLE_TEACHER
+        ROLE_DOMAIN_ADMINS: ROLE_ADMIN
+        ROLE_PORTINERIA:    ROLE_RECEPTION
+parameters:
+    menu_render:
+        isSchool: true
+        hasHomework: true
+        canChangePassword: true    
+    active_directory:
+       account_suffix: domain
+       base_dn: DC=domain,DC=network
+       domain_controllers: 
+          - 33.33.33.11
+       real_primarygroup: true
+       admin_username: vagrant
+       admin_password: vagrant
+       use_ssl: true
+       generated_group_prefix: _
+       home_folder: \\server.domain.network\home\
+       user_account_lifetime: 365
+       home_folder_lifetime: 60
+       password:
+         min_char: 8
+         complexity: true
+    data_provider:
+        - name: Prima formazione
+          uri: http://33.33.33.11/jsonIgroove
+          json_key: lkhjglkh78435vlsd
+          auto_create_username: true
+          force_imported_password: false
+          tutor_email_in_list: true
+          gmail:
+              create_groups:
+                domain: zenfamily.it
+                admin_username: test@zenfamily.it
+                admin_password: unaPasswordDifficile
+              create_email:
+                domain: zenfamily.it
+                admin_username: test@zenfamily.it
+                admin_password: unaPasswordDifficile
+          internet_teachers_control: true
+          internet:
+            "00:00": off
+            "07:30": on
+            "08.10": off
+            "10.50": off
+            "13.20": off
+            "16.40": off
+            "23:59": off
+        - name: FAD
+          uri: http://sirius.moodleSystem.it/jsonIgroove
+          json_key: lkhjglkdsdskjmw
+          auto_create_username: false
+          force_imported_password: true
+          internet:
+            "00:00": true
+            "13:00": true
+            "16.40": true
+        - name: Formazione continua
+          uri: http://www.mySqlSystem.it/jsonIgroove
+          json_key: kjnwbsijl.ksjs
+          auto_create_username: true
+          force_imported_password: false
+          internet_teachers_control: true
+          radius_suffix: myDomain
+          internet:
+            "00:00": true
+            "13:00": true
+            "16.40": true
+    mikrotik:
+       - ip: 10.10.100.201
+         username: adminUsernameApi
+         password: apiPassword
+       - ip: 10.10.100.202
+         username: adminUsernameApi
+         password: apiPassword

app/debian/config/parameters.yml.dist

+parameters:
+    database_driver:   pdo_mysql
+    database_host:     localhost
+    database_port:     ~
+
+    mailer_transport:  smtp
+    mailer_host:       localhost
+    mailer_user:       ~
+    mailer_password:   ~
+    
+    locale:            it
+    secret:            ThisTokenIsNotSoSecretChangeIt
+    

app/debian/config/routing.yml

+imag_ldap:
+    resource: "@IMAGLdapBundle/Resources/config/routing.yml"
+ZenIgrooveBundle:
+    resource: "@ZenIgrooveBundle/Controller/"
+    type:     annotation
+    prefix:   /

app/debian/config/routing_dev.yml

+_assetic:
+    resource: .
+    type:     assetic
+
+_wdt:
+    resource: "@WebProfilerBundle/Resources/config/routing/wdt.xml"
+    prefix:   /_wdt
+
+_profiler:
+    resource: "@WebProfilerBundle/Resources/config/routing/profiler.xml"
+    prefix:   /_profiler
+
+_configurator:
+    resource: "@SensioDistributionBundle/Resources/config/routing/webconfigurator.xml"
+    prefix:   /_configurator
+
+_main:
+    resource: routing.yml
+

app/debian/config/securityAD.dist.yml

+security:
+  firewalls:
+    restricted_area:
+      pattern:          ^/
+      anonymous:        ~
+      provider:         ldap
+      imag_ldap:        ~
+      logout:
+        path:           /logout
+
+  providers:
+    ldap:
+      id: imag_ldap.security.user.provider
+
+  encoders:
+    IMAG\LdapBundle\User\LdapUser: plaintext
+
+  access_control:
+    - { path: ^/checkGuest,     roles: IS_AUTHENTICATED_ANONYMOUSLY }
+    - { path: ^/login,          roles: IS_AUTHENTICATED_ANONYMOUSLY }
+    - { path: ^/,               roles: IS_AUTHENTICATED_FULLY }
+
+#  factories:
+#    - "%kernel.root_dir%/../vendor/bundles/IMAG/LdapBundle/Resources/config/security_factories.xml"
+
+  role_hierarchy:
+        ROLE_ADMIN: [ROLE_RECEPTION, ROLE_TEACHER]

app/debian/config/securityNoAD.dist.yml

+security:
+  firewalls:
+    restricted_area:
+      pattern:          ^/
+      anonymous:        ~
+      logout:
+        path:           /logout
+      http_basic:
+        realm: "Area igroove"
+  providers:
+    in_memory:
+            memory:
+                users:
+                    admin:  { password: unaPasswordDifficile, roles: 'ROLE_ADMIN' }
+                    gestione: { password: antonella, roles: 'ROLE_ADMIN' }
+
+  encoders:
+        Symfony\Component\Security\Core\User\User: plaintext
+
+  access_control:
+    - { path: ^/checkGuest,     roles: IS_AUTHENTICATED_ANONYMOUSLY }
+    - { path: ^/login,          roles: IS_AUTHENTICATED_ANONYMOUSLY }
+    - { path: ^/guest/ibox,      roles: IS_AUTHENTICATED_ANONYMOUSLY }
+    - { path: ^/,               roles: IS_AUTHENTICATED_FULLY }
+
+#  factories:
+#    - "%kernel.root_dir%/../vendor/bundles/IMAG/LdapBundle/Resources/config/security_factories.xml"
+
+  role_hierarchy:
+        ROLE_ADMIN: [ROLE_RECEPTION, ROLE_TEACHER]

packagemanifest.yml

     maintaineremail: 'vittore@zen.pn.it'
 
 apps:
-    main:
-        frontend: app.php
+    debian:
+        frontend: debian.php
         description: 'igroove website'
         dependencies:
            << : [ *database, *web ]
             - 'doctrine:schema:drop --force'
             - 'doctrine:schema:create'
         installfiles:
-            - 'app'
+            - 'app/debian'
             - 'src/autoload.php'
-    static:
-        description: 'All static website content'
-        prebuild:
-            - 'app/main/console assets:install web'
-            - 'mkdir -p web/css'
-            #- 'dev/less/getcss.sh main > web/css/main.css'
-        dependencies:
-            <<: *web
-        bundles: ~
-        assets:
-            - 'web/bundles/'
-            - 'web/css/'
-        profiles:
-            - 'web'
+
+<?php
+
+use Symfony\Component\ClassLoader\ApcClassLoader;
+use Symfony\Component\HttpFoundation\Request;
+
+$loader = require_once __DIR__.'/../app/bootstrap.php.cache';
+
+// Use APC for autoloading to improve performance.
+// Change 'sf2' to a unique prefix in order to prevent cache key conflicts
+// with other applications also using APC.
+/*
+$loader = new ApcClassLoader('sf2', $loader);
+$loader->register(true);
+*/
+
+require_once __DIR__.'/../app/DebianKernel.php';
+//require_once __DIR__.'/../app/AppCache.php';
+
+$kernel = new DebianKernel('prod', false);
+$kernel->loadClassCache();
+//$kernel = new AppCache($kernel);
+$request = Request::createFromGlobals();
+$response = $kernel->handle($request);
+$response->send();
+$kernel->terminate($request, $response);