├── .coveralls.yml ├── .gitignore ├── .travis.yml ├── README.md ├── app ├── .htaccess ├── AppCache.php ├── AppEnv.php ├── AppKernel.php ├── Resources │ └── views │ │ └── .gitkeep ├── autoload.php └── config │ ├── config.yml │ ├── config_default.yml │ ├── config_test.yml │ ├── default │ └── parameters.yml.dist │ ├── doctrine.yml │ ├── monolog.yml │ ├── rest.yml │ ├── routing.yml │ ├── security.yml │ ├── services.yml │ ├── swiftmailer.yml │ ├── test │ └── parameters.yml │ └── twig.yml ├── bin ├── clover_merge ├── console └── symfony_requirements ├── ci ├── Readme.md ├── jenkins │ ├── provision.yml │ └── run.sh ├── travis │ ├── config │ │ └── parameters.yml │ ├── coveralls.sh │ ├── install.sh │ ├── nginx │ │ ├── default-site.tpl.conf │ │ ├── fastcgi.tpl.conf │ │ ├── hhvm.tpl.ini │ │ ├── install-nginx.sh │ │ ├── nginx.tpl.conf │ │ └── php-fpm.tpl.conf │ ├── solr │ │ └── solr5.sh │ └── uninstall.sh └── vagrant │ └── run.sh ├── composer.json ├── phpunit.xml.dist ├── src └── .htaccess ├── tests ├── phpcs.sh ├── phpmd.sh ├── run.sh └── tests.sh ├── var ├── SymfonyRequirements.php ├── backup │ └── cb_default.sql ├── cache │ └── .gitkeep ├── files │ └── .gitkeep ├── logs │ └── .gitkeep ├── sessions │ └── .gitkeep ├── solr │ ├── default │ │ └── conf │ │ │ ├── cb_solr_fields.xml │ │ │ ├── cb_solr_types.xml │ │ │ ├── protwords.txt │ │ │ ├── schema.xml │ │ │ ├── solrconfig.xml │ │ │ ├── stopwords.txt │ │ │ └── synonyms.txt │ └── log │ │ └── conf │ │ ├── cb_solr_fields.xml │ │ ├── cb_solr_types.xml │ │ ├── protwords.txt │ │ ├── schema.xml │ │ ├── solrconfig.xml │ │ ├── stopwords.txt │ │ └── synonyms.txt └── ssl │ ├── ssl-cert.key │ └── ssl-cert.pem └── web ├── .htaccess ├── favicon.ico ├── index.php ├── logo.png └── robots.txt /.coveralls.yml: -------------------------------------------------------------------------------- 1 | coverage_clover: build/logs/clover-*.xml 2 | json_path: build/logs/coveralls-upload.json 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | app/config/*/parameters.yml 2 | var/bootstrap.php.cache 3 | var/cache/* 4 | var/logs/* 5 | var/files/*/ 6 | !var/logs/.gitkeep 7 | !var/files/.gitkeep 8 | composer.phar 9 | composer.lock 10 | vendor/ 11 | build/ 12 | web/bundles/ 13 | web/css 14 | web/js 15 | web/img 16 | web/min 17 | web/files 18 | .idea/* 19 | *sublime* 20 | nbproject/ 21 | app/config/config_*.yml 22 | !app/config/config_test.yml 23 | !app/config/test/parameters.yml -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: php 3 | php: 4 | - 7.0 5 | 6 | cache: 7 | directories: 8 | - $HOME/download-cache 9 | 10 | services: 11 | - redis-server 12 | 13 | addons: 14 | apt: 15 | packages: 16 | - nginx 17 | - realpath 18 | 19 | hosts: 20 | - localhost 21 | 22 | before_install: 23 | - mkdir -p $HOME/download-cache 24 | - mkdir -p build/logs 25 | 26 | install: 27 | #add databases, install solr with cores install nginx 28 | - bash ci/travis/nginx/install-nginx.sh 29 | - bash ci/travis/install.sh 30 | # install application 31 | - curl -sS https://getcomposer.org/installer | php 32 | - php composer.phar install --no-interaction 33 | 34 | 35 | before_script: 36 | # autoinstall CASEBOX 37 | - echo "CASEBOX | Index Casebox default core." 38 | - bin/console casebox:solr:update --all=true --env=default 39 | - echo "CASEBOX | Clear cache." 40 | - bin/console ca:cl --env=default 41 | - echo "CASEBOX | Update Casebox database schema." 42 | - bin/console doctrine:schema:update --force 43 | 44 | script: 45 | # Run tests 46 | - sleep 10 47 | # - bash tests/run.sh 48 | 49 | after_success: 50 | - php vendor/bin/coveralls 51 | - php vendor/bin/coveralls -v -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Casebox 2 | ====================================================== 3 | 4 | Casebox is a Content Management Platform for record, file and task management. 5 | 6 | Casebox was developed jointly by HURIDOCS and KETSE.com. 7 | 8 | Starting in 2017, HURIDOCS manages its own version of the Casebox codebase for human rights organisations and KETSE.com continues to support the original code. If your request is not related to human rights work and you are not a non-profit, then please contact Ketse at info (at) ketse.com for more information on the commercial services they can provide. 9 | 10 | 11 | # Casebox 12 | 13 | Casebox is a Content Management Platform for record, file and task management. 14 | 15 | Full documentation can be found on the website: 16 | http://docs.casebox.org/en/latest/ 17 | 18 | 19 | ## Installation 20 | 21 | In order to try Casebox on your local machine, we recommend to use [casebox-vagrant](https://github.com/KETSE/casebox-vagrant.git) provision or consult wiki page https://github.com/KETSE/casebox/wiki 22 | -------------------------------------------------------------------------------- /app/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | Require all denied 3 | 4 | 5 | Order deny,allow 6 | Deny from all 7 | 8 | -------------------------------------------------------------------------------- /app/AppCache.php: -------------------------------------------------------------------------------- 1 | getEnvironment(); 43 | } 44 | 45 | public function getLogDir() 46 | { 47 | return dirname(__DIR__).'/var/logs'; 48 | } 49 | 50 | public function registerContainerConfiguration(LoaderInterface $loader) 51 | { 52 | $loader->load($this->getRootDir().'/config/config_'.$this->getEnvironment().'.yml'); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /app/Resources/views/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KETSE/casebox/0f0838fd27f30d57d45878450cc3a3e950fe2e11/app/Resources/views/.gitkeep -------------------------------------------------------------------------------- /app/autoload.php: -------------------------------------------------------------------------------- 1 | [0-9\.]+)/' 21 | 22 | exception: 23 | enabled: true 24 | codes: 25 | 'Symfony\Component\Routing\Exception\ResourceNotFoundException': 404 26 | 'Doctrine\ORM\OptimisticLockException': HTTP_CONFLICT 27 | messages: 28 | 'Symfony\Component\Routing\Exception\ResourceNotFoundException': true 29 | 'Symfony\Component\HttpKernel\Exception\BadRequestHttpException': true 30 | 'Symfony\Component\HttpKernel\Exception\NotFoundHttpException': true 31 | 'Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException': true 32 | 33 | param_fetcher_listener: true 34 | 35 | allowed_methods_listener: true 36 | 37 | body_listener: true 38 | 39 | access_denied_listener: 40 | json: true 41 | 42 | routing_loader: 43 | default_format: json 44 | 45 | service: 46 | exception_handler: fos_rest.view.exception_wrapper_handler 47 | -------------------------------------------------------------------------------- /app/config/routing.yml: -------------------------------------------------------------------------------- 1 | casebox_rest: 2 | resource: "@CaseboxRestBundle/Controller/RestApiController.php" 3 | type: rest 4 | prefix: / 5 | 6 | casebox_core: 7 | resource: "@CaseboxCoreBundle/Controller/" 8 | type: annotation 9 | prefix: / 10 | 11 | casebox_rpc: 12 | resource: "@CaseboxRpcBundle/Controller/" 13 | type: annotation 14 | prefix: / 15 | -------------------------------------------------------------------------------- /app/config/security.yml: -------------------------------------------------------------------------------- 1 | # Security configurations 2 | security: 3 | encoders: 4 | Casebox\CoreBundle\Entity\UsersGroups: sha512 5 | 6 | providers: 7 | db_provider: 8 | entity: { class: Casebox\CoreBundle\Entity\UsersGroups, property: email } 9 | 10 | firewalls: 11 | static: 12 | pattern: ^/(css|images|js)/ 13 | security: false 14 | 15 | webdav: 16 | pattern: ^/dav/* 17 | anonymous: ~ 18 | http_basic: ~ 19 | provider: db_provider 20 | security: true 21 | 22 | main: 23 | anonymous: ~ 24 | 25 | access_control: 26 | - { path: ^/dav/*, roles: ROLE_USER } 27 | 28 | role_hierarchy: 29 | ROLE_USER: ROLE_USER 30 | ROLE_ADMIN: ROLE_USER 31 | ROLE_SUPER_ADMIN: [ ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH ] -------------------------------------------------------------------------------- /app/config/services.yml: -------------------------------------------------------------------------------- 1 | # Generic application services. 2 | services: 3 | -------------------------------------------------------------------------------- /app/config/swiftmailer.yml: -------------------------------------------------------------------------------- 1 | # Monolog configuration 2 | swiftmailer: 3 | transport: "%mailer_transport%" 4 | host: "%mailer_host%" 5 | username: "%mailer_user%" 6 | password: "%mailer_password%" 7 | spool: { type: memory } 8 | -------------------------------------------------------------------------------- /app/config/test/parameters.yml: -------------------------------------------------------------------------------- 1 | # This file is auto-generated during the composer install 2 | parameters: 3 | core_name: test 4 | locale: en 5 | server_name: http://192.168.33.3.xip.io/ 6 | db_host: 127.0.0.1 7 | db_port: 3306 8 | db_name: test 9 | db_user: test 10 | db_pass: 1bd8a3d3135a1ace52b7 11 | solr_host: 127.0.0.1 12 | solr_port: 8983 13 | solr_core: test 14 | solr_core_log: test_log 15 | solr_username: 16 | solr_password: 17 | session.lifetime: 4320 18 | admin_email: admin@example.com 19 | sender_email: emails.sender@example.com 20 | comments_pass: 21 | mailer_transport: smtp 22 | mailer_host: 127.0.0.1 23 | mailer_user: null 24 | mailer_password: null 25 | secret: 2e68c446c2b750709fbe7d3467 26 | prefix: cb 27 | solr_schema: http 28 | convert_doc_unoconv_cmd: /usr/bin/python3 /usr/bin/unoconv 29 | convert_doc_url: http://convert.devops.site/document/convert 30 | converter: unoconv 31 | redis_host: 127.0.0.1 32 | redis_port: 6379 33 | -------------------------------------------------------------------------------- /app/config/twig.yml: -------------------------------------------------------------------------------- 1 | # Twig configuration 2 | twig: 3 | debug: "%kernel.debug%" 4 | strict_variables: "%kernel.debug%" -------------------------------------------------------------------------------- /bin/clover_merge: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | project->asXML(); 25 | } 26 | $fh = fopen($output, 'w'); 27 | if (!$fh) { 28 | echo "Cannot open '$output' for writing\n"; 29 | exit(2); 30 | } 31 | fwrite($fh, sprintf('%s', $buffer)); 32 | fclose($fh); -------------------------------------------------------------------------------- /bin/console: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | getParameterOption(['--env', '-e'], getenv('SYMFONY_ENV') ?: 'default'); 17 | $debug = getenv('SYMFONY_DEBUG') !== '0' && !$input->hasParameterOption(['--no-debug', '']) && $env !== 'default'; 18 | 19 | if ($debug) { 20 | Debug::enable(); 21 | } 22 | 23 | $kernel = new AppKernel($env, $debug); 24 | $application = new Application($kernel); 25 | $application->run($input); 26 | -------------------------------------------------------------------------------- /bin/symfony_requirements: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | getPhpIniConfigPath(); 9 | 10 | echo_title('Symfony Requirements Checker'); 11 | 12 | echo '> PHP is using the following php.ini file:'.PHP_EOL; 13 | if ($iniPath) { 14 | echo_style('green', ' '.$iniPath); 15 | } else { 16 | echo_style('warning', ' WARNING: No configuration file (php.ini) used by PHP!'); 17 | } 18 | 19 | echo PHP_EOL.PHP_EOL; 20 | 21 | echo '> Checking Symfony requirements:'.PHP_EOL.' '; 22 | 23 | $messages = array(); 24 | foreach ($symfonyRequirements->getRequirements() as $req) { 25 | /** @var $req Requirement */ 26 | if ($helpText = get_error_message($req, $lineSize)) { 27 | echo_style('red', 'E'); 28 | $messages['error'][] = $helpText; 29 | } else { 30 | echo_style('green', '.'); 31 | } 32 | } 33 | 34 | $checkPassed = empty($messages['error']); 35 | 36 | foreach ($symfonyRequirements->getRecommendations() as $req) { 37 | if ($helpText = get_error_message($req, $lineSize)) { 38 | echo_style('yellow', 'W'); 39 | $messages['warning'][] = $helpText; 40 | } else { 41 | echo_style('green', '.'); 42 | } 43 | } 44 | 45 | if ($checkPassed) { 46 | echo_block('success', 'OK', 'Your system is ready to run Symfony projects'); 47 | } else { 48 | echo_block('error', 'ERROR', 'Your system is not ready to run Symfony projects'); 49 | 50 | echo_title('Fix the following mandatory requirements', 'red'); 51 | 52 | foreach ($messages['error'] as $helpText) { 53 | echo ' * '.$helpText.PHP_EOL; 54 | } 55 | } 56 | 57 | if (!empty($messages['warning'])) { 58 | echo_title('Optional recommendations to improve your setup', 'yellow'); 59 | 60 | foreach ($messages['warning'] as $helpText) { 61 | echo ' * '.$helpText.PHP_EOL; 62 | } 63 | } 64 | 65 | echo PHP_EOL; 66 | echo_style('title', 'Note'); 67 | echo ' The command console could use a different php.ini file'.PHP_EOL; 68 | echo_style('title', '~~~~'); 69 | echo ' than the one used with your web server. To be on the'.PHP_EOL; 70 | echo ' safe side, please check the requirements from your web'.PHP_EOL; 71 | echo ' server using the '; 72 | echo_style('yellow', 'web/config.php'); 73 | echo ' script.'.PHP_EOL; 74 | echo PHP_EOL; 75 | 76 | exit($checkPassed ? 0 : 1); 77 | 78 | function get_error_message(Requirement $requirement, $lineSize) 79 | { 80 | if ($requirement->isFulfilled()) { 81 | return; 82 | } 83 | 84 | $errorMessage = wordwrap($requirement->getTestMessage(), $lineSize - 3, PHP_EOL.' ').PHP_EOL; 85 | $errorMessage .= ' > '.wordwrap($requirement->getHelpText(), $lineSize - 5, PHP_EOL.' > ').PHP_EOL; 86 | 87 | return $errorMessage; 88 | } 89 | 90 | function echo_title($title, $style = null) 91 | { 92 | $style = $style ?: 'title'; 93 | 94 | echo PHP_EOL; 95 | echo_style($style, $title.PHP_EOL); 96 | echo_style($style, str_repeat('~', strlen($title)).PHP_EOL); 97 | echo PHP_EOL; 98 | } 99 | 100 | function echo_style($style, $message) 101 | { 102 | // ANSI color codes 103 | $styles = array( 104 | 'reset' => "\033[0m", 105 | 'red' => "\033[31m", 106 | 'green' => "\033[32m", 107 | 'yellow' => "\033[33m", 108 | 'error' => "\033[37;41m", 109 | 'success' => "\033[37;42m", 110 | 'title' => "\033[34m", 111 | ); 112 | $supports = has_color_support(); 113 | 114 | echo($supports ? $styles[$style] : '').$message.($supports ? $styles['reset'] : ''); 115 | } 116 | 117 | function echo_block($style, $title, $message) 118 | { 119 | $message = ' '.trim($message).' '; 120 | $width = strlen($message); 121 | 122 | echo PHP_EOL.PHP_EOL; 123 | 124 | echo_style($style, str_repeat(' ', $width).PHP_EOL); 125 | echo_style($style, str_pad(' ['.$title.']', $width, ' ', STR_PAD_RIGHT).PHP_EOL); 126 | echo_style($style, str_pad($message, $width, ' ', STR_PAD_RIGHT).PHP_EOL); 127 | echo_style($style, str_repeat(' ', $width).PHP_EOL); 128 | } 129 | 130 | function has_color_support() 131 | { 132 | static $support; 133 | 134 | if (null === $support) { 135 | if (DIRECTORY_SEPARATOR == '\\') { 136 | $support = false !== getenv('ANSICON') || 'ON' === getenv('ConEmuANSI'); 137 | } else { 138 | $support = function_exists('posix_isatty') && @posix_isatty(STDOUT); 139 | } 140 | } 141 | 142 | return $support; 143 | } 144 | -------------------------------------------------------------------------------- /ci/Readme.md: -------------------------------------------------------------------------------- 1 | Casebox CI 2 | ========== 3 | 4 | Jenkins 5 | ------- 6 | 7 | URL: [http://ci.casebox.org:8080/job/casebox/job/development/](http://ci.casebox.org:8080/job/casebox/job/development/) 8 | 9 | On a clean machine, run once following commands: 10 | 11 | apt-get update --fix-missing; 12 | apt-get install git curl wget nano ansible 13 | apt-get autoremove -y; 14 | 15 | After thar run `jenkins/run.sh` command. 16 | 17 | 18 | Travis 19 | ------ 20 | 21 | Not used any more. 22 | -------------------------------------------------------------------------------- /ci/jenkins/provision.yml: -------------------------------------------------------------------------------- 1 | # 2 | # File: provision.yml 3 | # Description: Casebox environment installation provision. 4 | # 5 | --- 6 | 7 | - hosts: "*" 8 | 9 | # 10 | # Variables 11 | # 12 | vars: 13 | # Common software 14 | - common_packages: 15 | - 'git' 16 | - 'wget' 17 | - 'curl' 18 | - 'imagemagick' 19 | - 'sendmail' 20 | - 'mailutils' 21 | - 'dos2unix' 22 | - 'openssl' 23 | 24 | # Locale 25 | - locales: 26 | - 'export LANGUAGE=en_US.UTF-8' 27 | - 'export LANG=en_US.UTF-8' 28 | - 'export LC_ALL=en_US.UTF-8' 29 | - 'locale-gen en_US.UTF-8' 30 | 31 | # JAVA 32 | - java_packages: 33 | - 'oracle-java8-installer' 34 | - 'ca-certificates' 35 | - 'oracle-java8-set-default' 36 | 37 | # PHP 38 | - php_packages: 39 | - 'php7.0-cli' 40 | - 'php7.0-cgi' 41 | - 'php7.0-dev' 42 | - 'php7.0-fpm' 43 | - 'php7.0-json' 44 | - 'php7.0-tidy' 45 | - 'php7.0-curl' 46 | - 'php7.0-mbstring' 47 | - 'php7.0-bcmath' 48 | - 'php7.0-common' 49 | - 'php7.0-mysql' 50 | - 'php-imagick' 51 | 52 | - php_inifile: '/etc/php/7.0/fpm/php.ini' 53 | 54 | # LibreOFFICE 55 | - libreoffice_packages: 56 | - 'libreoffice-core' 57 | - 'libreoffice-common' 58 | - 'libreoffice-writer' 59 | - 'libreoffice-script-provider-python' 60 | 61 | # MySQL 62 | - root_db_pass_file: '/root/.mysql.root.password' 63 | - mysql_packages: 64 | - 'python-pycurl' 65 | - 'python-mysqldb' 66 | - 'mysql-common' 67 | - 'mysql-client' 68 | - 'mysql-server' 69 | 70 | - os_user: "{{ os_user }}" 71 | 72 | # Casebox 73 | - casebox_server_name: '{{ casebox_server_name }}' 74 | - casebox_core: "{{ casebox_core }}" 75 | - casebox_root_dir: "{{ casebox_root_dir }}" 76 | - casebox_htdocs_dir: '{{ casebox_root_dir }}/web' 77 | 78 | - casebox_git_url: 'https://github.com/KETSE/casebox.git' 79 | - casebox_git_branch: 'master' 80 | 81 | - casebox_db_user: "{{ casebox_core }}" 82 | - casebox_db_pass_file: '~/.mysql.{{ casebox_core }}.password' 83 | - casebox_db_names: 84 | - { db: '{{ casebox_core }}', file: '{{ casebox_root_dir }}/var/backup/cb_default.sql'} 85 | - casebox_db_hosts: 86 | - '127.0.0.1' 87 | - 'localhost' 88 | - '::1' 89 | - '%' 90 | - '{{ ansible_hostname }}' 91 | 92 | - casebox_solr_host: '127.0.0.1' 93 | - casebox_solr_port: '8983' 94 | - casebox_solr_username: '' 95 | - casebox_solr_password: '' 96 | 97 | - casebox_solr_links: 98 | - { src: '{{ casebox_root_dir }}/var/solr/default', dest: '/var/solr/data/configsets/casebox'} 99 | - { src: '{{ casebox_root_dir }}/var/solr/log', dest: '/var/solr/data/configsets/casebox_log'} 100 | 101 | # Nginx 102 | - nginx_sites: 103 | - { src: '/etc/nginx/sites-available/http_{{ casebox_core }}.conf', dest: '/etc/nginx/sites-enabled/http_{{ casebox_core }}.conf' } 104 | - { src: '/etc/nginx/sites-available/https_{{ casebox_core }}.conf', dest: '/etc/nginx/sites-enabled/https_{{ casebox_core }}.conf' } 105 | 106 | # Solr 107 | - solr_url: 'http://www-eu.apache.org/dist/lucene/solr/6.0.0/solr-6.0.0.tgz' 108 | - solr_ver: 'solr-6.0.0' 109 | 110 | # Lock files 111 | - rabbitmq_lock_file: '~/.rabbitmq.lock' 112 | - php_lock_file: '~/.php7.lock' 113 | - composer_lock_file: '~/.composer.lock' 114 | - java_lock_file: '~/.java.lock' 115 | - libreoffice_lock_file: '~/.libreoffice.lock' 116 | - solr_lock_file: '~/.solr.lock' 117 | - solr_configsets_lock_file: '~/.solr.configsets.lock' 118 | - mysql_lock_file: '~/.mysql.lock' 119 | 120 | # 121 | # Tasks 122 | # 123 | tasks: 124 | # Common packages 125 | - name: "APT | Install common packages." 126 | apt: pkg={{ item }} update_cache=yes state=present 127 | with_items: "{{ common_packages }}" 128 | become: yes 129 | 130 | # Locales 131 | - name: "LOCALE | Fix locales." 132 | shell: "{{ item }}" 133 | with_items: "{{ locales }}" 134 | become: yes 135 | 136 | # Nginx webserver 137 | - name: "NGINX | Install Nginx webserver." 138 | apt: pkg={{ item }} update_cache=yes state=present 139 | with_items: 140 | - nginx 141 | become: yes 142 | 143 | - name: "NGINX | Remove Nginx default virtual host." 144 | file: path=/etc/nginx/sites-enabled/default state=absent 145 | become: yes 146 | 147 | # Redis server 148 | - name: "REDIS | Install redis server." 149 | apt: pkg=redis-server update_cache=yes state=present 150 | become: yes 151 | 152 | # RABBITMQ 153 | - name: "RABBITMQ | Lock file." 154 | stat: path="{{ rabbitmq_lock_file }}" 155 | register: rabbitmq_lock 156 | become: yes 157 | 158 | - name: "RABBITMQ | Adding rabbitmq repository." 159 | shell: "echo 'deb http://www.rabbitmq.com/debian/ testing main' | sudo tee /etc/apt/sources.list.d/rabbitmq.list" 160 | when: rabbitmq_lock.stat.exists == False 161 | become: yes 162 | 163 | - name: "RABBITMQ | Obtaining rabbitmq public key." 164 | shell: "wget -O- https://www.rabbitmq.com/rabbitmq-signing-key-public.asc | sudo apt-key add -" 165 | when: rabbitmq_lock.stat.exists == False 166 | become: yes 167 | 168 | - name: "RABBITMQ | APT update." 169 | shell: 'apt-get update --fix-missing' 170 | when: rabbitmq_lock.stat.exists == False 171 | become: yes 172 | 173 | - name: "RABBITMQ | APT install rabbitmq packages." 174 | apt: pkg='rabbitmq-server' state=present 175 | when: rabbitmq_lock.stat.exists == False 176 | become: yes 177 | 178 | - name: "RABBITMQ | Add lock file." 179 | file: path="{{ rabbitmq_lock_file }}" state=touch 180 | when: rabbitmq_lock.stat.exists == False 181 | become: yes 182 | 183 | # PHP 184 | - name: "PHP7 | Lock file." 185 | stat: path="{{ php_lock_file }}" 186 | register: php_lock 187 | become: yes 188 | 189 | - name: "PHP7 | Add PHP7 ppa repository." 190 | apt_repository: repo=ppa:ondrej/php 191 | when: php_lock.stat.exists == False 192 | become: yes 193 | 194 | - name: "PHP7 | Update apt cache." 195 | apt: update_cache=yes 196 | when: php_lock.stat.exists == False 197 | become: yes 198 | 199 | - name: "PHP7 | Install PHP7 packages." 200 | apt: pkg={{ item }} state=latest 201 | with_items: "{{ php_packages }}" 202 | when: php_packages is defined and php_lock.stat.exists == False 203 | become: yes 204 | 205 | - name: "PHP7 | Install pear." 206 | apt: pkg=php-pear state=latest 207 | when: php_lock.stat.exists == False 208 | become: yes 209 | 210 | - name: "PHP7 | Check /etc/php/7.0/fpm/php.ini file." 211 | stat: path={{ php_inifile }} 212 | register: phpfpm 213 | become: yes 214 | 215 | - name: "PHP7 | Update fpm memory limit." 216 | lineinfile: dest="{{ php_inifile }}" regexp='memory_limit = 128M' line='memory_limit = 256M' 217 | when: phpfpm.stat.exists and php_lock.stat.exists == False 218 | become: yes 219 | 220 | - name: "PHP7 | Fix fpm cgi.fix_pathinfo." 221 | lineinfile: dest="{{ php_inifile }}" regexp=';cgi.fix_pathinfo=1' line='cgi.fix_pathinfo = 0' 222 | when: phpfpm.stat.exists and php_lock.stat.exists == False 223 | become: yes 224 | 225 | - name: "PHP7 | Add lock file." 226 | file: path="{{ php_lock_file }}" state=touch 227 | when: php_lock.stat.exists == False 228 | become: yes 229 | 230 | # Composer 231 | - name: "COMPOSER | Lock file." 232 | stat: path="{{ composer_lock_file }}" 233 | register: composer_lock 234 | become: yes 235 | 236 | - name: "COMPOSER | Check if composer exist." 237 | stat: path='/usr/local/bin/composer' 238 | register: composer 239 | become: yes 240 | 241 | - name: "COMPOSER | Download composer." 242 | shell: "cd /tmp; curl -sS https://getcomposer.org/installer | php" 243 | when: composer.stat.exists == False and composer_lock.stat.exists == False 244 | 245 | - name: "COMPOSER | Install composer." 246 | shell: "cd /tmp; mv composer.phar /usr/local/bin/composer" 247 | when: composer.stat.exists == False and composer_lock.stat.exists == False 248 | become: yes 249 | 250 | - name: "COMPOSER | Add lock file." 251 | file: path="{{ composer_lock_file }}" state=touch 252 | when: composer_lock.stat.exists == False 253 | become: yes 254 | 255 | # Java 256 | - name: "JAVA | Lock file." 257 | stat: path="{{ java_lock_file }}" 258 | register: java_lock 259 | become: yes 260 | 261 | - name: "JAVA | Add Oracle Java Repository." 262 | apt_repository: repo='ppa:webupd8team/java' 263 | when: java_lock.stat.exists == False 264 | become: yes 265 | 266 | - name: "JAVA | Accept Java 8 License." 267 | debconf: name='oracle-java8-installer' question='shared/accepted-oracle-license-v1-1' value='true' vtype='select' 268 | when: java_lock.stat.exists == False 269 | become: yes 270 | 271 | - name: "JAVA | Install Oracle Java 8." 272 | apt: name={{item}} state=latest 273 | with_items: "{{ java_packages }}" 274 | when: java_lock.stat.exists == False 275 | become: yes 276 | 277 | - name: "JAVA | Add lock file." 278 | file: path="{{ java_lock_file }}" state=touch 279 | when: java_lock.stat.exists == False 280 | become: yes 281 | 282 | # LibreOffice and Unoconv 283 | - name: "LIBREOFFICE | Lock file." 284 | stat: path="{{ libreoffice_lock_file }}" 285 | register: libreoffice_lock 286 | become: yes 287 | 288 | - name: "LIBREOFFICE | Install LibreOffice." 289 | apt: pkg={{item}} state=present 290 | with_items: "{{ libreoffice_packages }}" 291 | when: libreoffice_lock.stat.exists == False 292 | become: yes 293 | 294 | - name: "UNOCONV | Cleanup." 295 | shell: 'rm -rf /tmp/unoconv' 296 | when: libreoffice_lock.stat.exists == False 297 | become: true 298 | 299 | - name: "UNOCONV | Clone unoconv rep." 300 | git: repo='https://github.com/dagwieers/unoconv.git' dest='/tmp/unoconv' 301 | when: libreoffice_lock.stat.exists == False 302 | 303 | - name: "UNOCONV | Build unoconv." 304 | shell: 'cd /tmp/unoconv; make install' 305 | when: libreoffice_lock.stat.exists == False 306 | become: true 307 | 308 | - name: "UNOCONV | Cleanup." 309 | shell: 'rm -rf /tmp/unoconv' 310 | when: libreoffice_lock.stat.exists == False 311 | become: true 312 | 313 | - name: "UNOCONV | Remove /etc/init.d/unoconvd file." 314 | file: path='/etc/init.d/unoconvd' state=absent 315 | when: libreoffice_lock.stat.exists == False 316 | become: true 317 | 318 | - name: "UNOCONV | Create unoconv service." 319 | lineinfile: dest='/etc/init.d/unoconvd' line={{ item }} create=yes state=present 320 | with_items: 321 | - "### BEGIN INIT INFO\r" 322 | - "# Provides: unoconvd\r" 323 | - "# Required-Start: $network\r" 324 | - "# Required-Stop: $network\r" 325 | - "# Default-Start: 2 3 4 5\r" 326 | - "# Default-Stop: 0 1 6\r" 327 | - "# Description: unoconvd Converting documents\r" 328 | - "### END INIT INFO\r" 329 | - "#!/bin/sh\r" 330 | - "case \"$1\" in\r" 331 | - " status)\r" 332 | - " if [ $(ps ax | grep '/usr/lib/libreoffice/program/soffice.bin' | grep 'accept=socket,host=127.0.0.1,port=2002,tcpNoDelay=1;urp;StarOffice.ComponentContext' | wc -l) -gt 0 ]; then\r" 333 | - " echo 'Unoconv listener active'\r" 334 | - " else\r" 335 | - " echo 'Unoconv listener inactive'\r" 336 | - " fi\r" 337 | - " ;;\r" 338 | - " start)\r" 339 | - " if [ $(ps ax | grep '/usr/lib/libreoffice/program/soffice.bin' | grep 'accept=socket,host=127.0.0.1,port=2002,tcpNoDelay=1;urp;StarOffice.ComponentContext' | wc -l) -gt 0 ]; then\r" 340 | - " echo 'Unoconv listener already started.'\r" 341 | - " else\r" 342 | - " /usr/bin/python3 /usr/bin/unoconv --listener &\r" 343 | - " echo 'Unoconv listener started.'\r" 344 | - " fi\r" 345 | - " ;;\r" 346 | - " stop)\r" 347 | - " if [ $(ps ax | grep '/usr/lib/libreoffice/program/soffice.bin' | grep 'accept=socket,host=127.0.0.1,port=2002,tcpNoDelay=1;urp;StarOffice.ComponentContext' | wc -l) -gt 0 ]; then\r" 348 | - " killall soffice.bin\r" 349 | - " echo 'Unoconv listener stopped.'\r" 350 | - " else\r" 351 | - " echo 'Unoconv isn’t running.'\r" 352 | - " fi\r" 353 | - " ;;\r" 354 | - " restart)\r" 355 | - " $0 stop\r" 356 | - " sleep 1\r" 357 | - " $0 start\r" 358 | - " ;;\r" 359 | - " *)\r" 360 | - " echo 'Usage: /etc/init.d/unoconvd {start|stop|restart|status}'\r" 361 | - " exit 1\r" 362 | - " ;;\r" 363 | - "esac\r" 364 | become: true 365 | when: libreoffice_lock.stat.exists == False 366 | 367 | - name: "UNOCONV | Fix /etc/init.d/unoconvd file format." 368 | shell: 'dos2unix /etc/init.d/unoconvd' 369 | when: libreoffice_lock.stat.exists == False 370 | become: true 371 | 372 | - name: "UNOCONV | Fix /etc/init.d/unoconvd file permissions." 373 | shell: 'chmod +x /etc/init.d/unoconvd' 374 | when: libreoffice_lock.stat.exists == False 375 | become: true 376 | 377 | - name: "UNOCONV | Init service." 378 | command: 'update-rc.d unoconvd defaults' 379 | when: libreoffice_lock.stat.exists == False 380 | become: true 381 | 382 | - name: "UNOCONV | Restart unoconv." 383 | shell: '/etc/init.d/unoconvd restart' 384 | when: libreoffice_lock.stat.exists == False 385 | become: true 386 | 387 | - name: "UNOCONV | Add lock file." 388 | file: path="{{ libreoffice_lock_file }}" state=touch 389 | when: libreoffice_lock.stat.exists == False 390 | become: yes 391 | 392 | # Solr 393 | - name: "SOLR | Lock file." 394 | stat: path="{{ solr_lock_file }}" 395 | register: solr_lock 396 | become: yes 397 | 398 | - name: "SOLR | Check Apache Solr status." 399 | stat: path='/etc/init.d/solr' 400 | register: solr_service_status 401 | become: yes 402 | 403 | - name: "SOLR | Download Apache Solr." 404 | shell: "cd /tmp; wget {{ solr_url }}" 405 | when: solr_service_status.stat.exists == False and solr_lock.stat.exists == False 406 | 407 | - name: "SOLR | Extract Apache Solr." 408 | shell: "cd /tmp; tar xzf {{ solr_ver }}.tgz {{ solr_ver }}/bin/install_solr_service.sh --strip-components=2" 409 | when: solr_service_status.stat.exists == False and solr_lock.stat.exists == False 410 | 411 | - name: "SOLR | Install Apache Solr." 412 | shell: "cd /tmp ; ./install_solr_service.sh {{ solr_ver }}.tgz" 413 | when: solr_service_status.stat.exists == False and solr_lock.stat.exists == False 414 | become: yes 415 | 416 | - name: "SOLR | Add lock file." 417 | file: path="{{ solr_lock_file }}" state=touch 418 | when: solr_lock.stat.exists == False 419 | become: yes 420 | 421 | # Nginx 422 | - name: "NGINX | Remove Casebox http virtual host." 423 | file: path="/etc/nginx/sites-available/http_{{ casebox_core }}.conf" state=absent 424 | become: yes 425 | 426 | - name: "NGINX | Add http virtual host." 427 | lineinfile: dest="/etc/nginx/sites-available/http_{{ casebox_core }}.conf" line="{{ item }}" create=yes state=present insertafter=EOF 428 | with_items: 429 | - "server {" 430 | - " listen 80;\n" 431 | - " server_name {{ casebox_server_name }};" 432 | - " root {{ casebox_htdocs_dir }};" 433 | - " rewrite ^/index\\.php/?(.*)$ /$1 permanent;\n" 434 | - " location / {" 435 | - " index index.php;" 436 | - " try_files $uri @rewriteapp;" 437 | - " }\n" 438 | - " location @rewriteapp { " 439 | - " rewrite ^(.*)$ /index.php/$1 last;" 440 | - " }\n" 441 | - " location ~ ^/(index)\\.php(/|$) {" 442 | - " fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;" 443 | - " fastcgi_split_path_info ^(.+\\.php)(/.*)$;" 444 | - " include fastcgi_params;" 445 | - " fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;" 446 | - " fastcgi_param HTTPS off;" 447 | - " }\n" 448 | - " error_log /var/log/nginx/http_{{ casebox_core }}.error.log;" 449 | - " access_log /var/log/nginx/http_{{ casebox_core }}.access.log;" 450 | - "}\n" 451 | become: yes 452 | 453 | - name: "NGINX | Remove Casebox https virtual host." 454 | file: path="/etc/nginx/sites-available/https_{{ casebox_core }}.conf" state=absent 455 | become: yes 456 | 457 | - name: "NGINX | Add Casebox https virtual host." 458 | lineinfile: dest="/etc/nginx/sites-available/https_{{ casebox_core }}.conf" line="{{ item }}" create=yes state=present insertafter=EOF 459 | with_items: 460 | - "server {" 461 | - " listen 443;\n" 462 | - " server_name {{ casebox_server_name }};" 463 | - " root {{ casebox_htdocs_dir }};" 464 | - " rewrite ^/index\\.php/?(.*)$ /$1 permanent;\n" 465 | - " ssl on;" 466 | - " ssl_certificate {{ casebox_root_dir }}/var/ssl/ssl-cert.pem;" 467 | - " ssl_certificate_key {{ casebox_root_dir }}/var/ssl/ssl-cert.key;\n" 468 | - " location / {" 469 | - " index index.php;" 470 | - " try_files $uri @rewriteapp;" 471 | - " }\n" 472 | - " location @rewriteapp { " 473 | - " rewrite ^(.*)$ /index.php/$1 last;" 474 | - " }\n" 475 | - " location ~ ^/(index)\\.php(/|$) {" 476 | - " fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;" 477 | - " fastcgi_split_path_info ^(.+\\.php)(/.*)$;" 478 | - " include fastcgi_params;" 479 | - " fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;" 480 | - " fastcgi_param HTTPS on;" 481 | - " }\n" 482 | - " error_log /var/log/nginx/https_{{ casebox_core }}.error.log;" 483 | - " access_log /var/log/nginx/https_{{ casebox_core }}.access.log;" 484 | - "}\n" 485 | become: yes 486 | 487 | - name: "NGINX | Enable Casebox virtual hosts." 488 | file: src="{{ item.src }}" dest="{{ item.dest }}" state=link 489 | with_items: "{{ nginx_sites }}" 490 | become: yes 491 | 492 | # MySQL 493 | - name: "MYSQL | Check lock file." 494 | stat: path="{{ mysql_lock_file }}" 495 | register: mysql_lock 496 | become: yes 497 | 498 | - name: "MYSQL | Install MySQL packages." 499 | apt: pkg="{{ item }}" force=yes update_cache=yes state=present 500 | with_items: "{{ mysql_packages }}" 501 | environment: 502 | DEBIAN_FRONTEND: noninteractive 503 | become: yes 504 | when: mysql_lock.stat.exists == False 505 | 506 | - name: "MYSQL | Update MySQL configuration file." 507 | lineinfile: dest='/etc/mysql/my.cnf' line="{{ item }}" create=yes 508 | with_items: 509 | - '[client]' 510 | - 'port=3306' 511 | - 'socket=/var/run/mysqld/mysqld.sock' 512 | - '[mysqld_safe]' 513 | - 'socket=/var/run/mysqld/mysqld.sock' 514 | - 'nice=0' 515 | - '[mysqld]' 516 | - 'user=mysql' 517 | - 'pid-file=/var/run/mysqld/mysqld.pid' 518 | - 'socket=/var/run/mysqld/mysqld.sock' 519 | - 'port=3306' 520 | - 'basedir=/usr' 521 | - 'datadir=/var/lib/mysql' 522 | - 'tmpdir=/tmp' 523 | - 'lc-messages-dir=/usr/share/mysql' 524 | - 'bind-address=0.0.0.0' 525 | - 'max_allowed_packet=16M' 526 | - 'thread_stack=192K' 527 | - 'thread_cache_size=8' 528 | - 'query_cache_limit=1M' 529 | - 'query_cache_size=16M' 530 | - 'log_error=/var/log/mysql/error.log' 531 | - 'expire_logs_days=10' 532 | - 'max_binlog_size=100M' 533 | - '[mysqldump]' 534 | - 'quick' 535 | - 'quote-names' 536 | - 'max_allowed_packet=16M' 537 | - '[mysql]' 538 | - '[isamchk]' 539 | - 'key_buffer=16M' 540 | become: yes 541 | when: mysql_lock.stat.exists == False 542 | 543 | - name: "MYSQL | Add MySQL .mysql.cnf.lock file." 544 | file: path="{{ mysql_lock_file }}" state=touch 545 | when: mysql_lock.stat.exists == False 546 | become: yes 547 | 548 | - name: "MYSQL | Check MySQL root password." 549 | stat: path="{{ root_db_pass_file }}" 550 | register: root_db_pass_file_exist 551 | become: yes 552 | 553 | - name: "MYSQL | Generate MySQL root password." 554 | lineinfile: dest="{{ root_db_pass_file }}" line="{{ lookup('pipe', 'openssl rand -hex 10') }}" create=yes state=present 555 | when: root_db_pass_file_exist.stat.exists == False 556 | become: yes 557 | 558 | - name: "MYSQL | Fetch MySQL root password." 559 | shell: "cat {{ root_db_pass_file }}" 560 | register: mysq_root_password 561 | become: yes 562 | 563 | - name: "MYSQL | Update MySQL root password for localhost." 564 | mysql_user: name=root host="{{ item }}" password="{{ mysq_root_password.stdout }}" 565 | with_items: 566 | - '127.0.0.1' 567 | - '::1' 568 | - 'localhost' 569 | when: root_db_pass_file_exist.stat.exists == False 570 | become: yes 571 | 572 | # Casebox 573 | - name: "CASEBOX | Check casebox directory." 574 | stat: path="{{ casebox_root_dir }}/web/index.php" 575 | register: casebox_dir 576 | become: yes 577 | 578 | - name: "CASEBOX | Create casebox directory." 579 | file: path="{{ casebox_root_dir }}" state=directory mode=0755 580 | when: casebox_dir.stat.exists == False 581 | become: yes 582 | 583 | - name: "CASEBOX | Clone casebox." 584 | git: repo="{{ casebox_git_url }}" dest="{{ casebox_root_dir }}" version="{{ casebox_git_branch }}" 585 | when: casebox_dir.stat.exists == False 586 | become: yes 587 | 588 | - name: "CASEBOX | Check casebox config file." 589 | stat: path="{{ casebox_root_dir }}/app/config/{{ casebox_core }}/parameters.yml" 590 | register: config_file_exist 591 | become: yes 592 | 593 | - name: "CASEBOX | Check MySQL casebox core password." 594 | stat: path={{ casebox_db_pass_file }} 595 | register: db_pass_file_exist 596 | become: yes 597 | 598 | - name: "CASEBOX | Generate MySQL casebox core password." 599 | lineinfile: dest="{{ casebox_db_pass_file }}" line="{{ lookup('pipe', 'openssl rand -hex 10') }}" create=yes state=present 600 | when: db_pass_file_exist.stat.exists == False and config_file_exist.stat.exists == False 601 | become: yes 602 | 603 | - name: "CASEBOX | Fetch MySQL casebox core password." 604 | shell: "cat {{ casebox_db_pass_file }}" 605 | register: mysql_casebox_password 606 | when: config_file_exist.stat.exists == False 607 | become: yes 608 | 609 | - name: "CASEBOX | Fetch mysql root password." 610 | shell: "cat {{ root_db_pass_file }}" 611 | register: mysq_root_password 612 | when: config_file_exist.stat.exists == False 613 | become: yes 614 | 615 | - name: "CASEBOX | Create databases." 616 | mysql_db: name={{ item.db }} login_user=root login_password={{ mysq_root_password.stdout }} state=present 617 | with_items: "{{ casebox_db_names }}" 618 | when: config_file_exist.stat.exists == False 619 | become: yes 620 | 621 | - name: "CASEBOX | Grant user permissions." 622 | mysql_user: name={{ casebox_db_user }} host={{ item[0] }} priv={{ item[1].db }}.*:ALL append_privs=yes password={{ mysql_casebox_password.stdout }} login_user=root login_password={{ mysq_root_password.stdout }} state=present 623 | with_nested: 624 | - "{{ casebox_db_hosts }}" 625 | - "{{ casebox_db_names }}" 626 | when: config_file_exist.stat.exists == False 627 | become: yes 628 | 629 | - name: "CASEBOX | Import Casebox databases." 630 | mysql_db: name={{ item.db }} login_user=root login_password={{ mysq_root_password.stdout }} target={{ item.file }} state=import 631 | with_items: "{{ casebox_db_names }}" 632 | when: config_file_exist.stat.exists == False 633 | become: yes 634 | 635 | - name: "CASEBOX | Check .solr.lock file." 636 | stat: path="{{ solr_configsets_lock_file }}" 637 | register: solr_configsets_lock 638 | become: yes 639 | 640 | - name: "CASEBOX | Creates Solr configsets directory." 641 | file: path='/var/solr/data/configsets' group=solr owner=solr recurse=yes state=directory 642 | when: solr_configsets_lock.stat.exists == False 643 | become: yes 644 | 645 | - name: "CASEBOX | Create Casebox Solr links." 646 | file: src={{ item.src }} dest={{ item.dest }} group=solr owner=solr state=link 647 | with_items: "{{ casebox_solr_links }}" 648 | when: solr_configsets_lock.stat.exists == False 649 | become: yes 650 | 651 | - name: "CASEBOX | Fix Solr configsets directory owner." 652 | shell: "chown solr:solr /var/solr/data/configsets -R" 653 | when: solr_configsets_lock.stat.exists == False 654 | become: yes 655 | 656 | - name: "CASEBOX | Add solr.configsets lock file." 657 | file: path="{{ solr_configsets_lock_file }}" state=touch 658 | when: solr_configsets_lock.stat.exists == False 659 | become: yes 660 | 661 | - name: "CASEBOX | Check config_{core-name}.yml file." 662 | stat: path="{{ casebox_root_dir }}/app/config/config_{{ casebox_core }}.yml" 663 | register: stat_core_config 664 | become: yes 665 | 666 | - name: "CASEBOX | Create config_{core-name}.yml file." 667 | file: path="{{ casebox_root_dir }}/app/config/config_{{ casebox_core }}.yml" 668 | state=touch 669 | when: stat_core_config.stat.exists == False 670 | become: yes 671 | 672 | - name: "CASEBOX | Populate config_{core-name}.yml file." 673 | shell: "echo '{{ item }}' >> {{ casebox_root_dir }}/app/config/config_{{ casebox_core }}.yml" 674 | with_items: 675 | - 'imports:' 676 | - " - { resource: {{ casebox_core }}/parameters.yml }" 677 | - ' - { resource: config.yml }' 678 | when: stat_core_config.stat.exists == False 679 | become: yes 680 | 681 | - name: "CASEBOX | Create directory." 682 | shell: "mkdir -p {{ casebox_root_dir }}/app/config/{{ casebox_core }}" 683 | become: yes 684 | 685 | - name: "CASEBOX | Create casebox parameters file." 686 | file: path="{{ casebox_root_dir }}/app/config/{{ casebox_core }}/parameters.yml" 687 | state=touch 688 | when: config_file_exist.stat.exists == False 689 | become: yes 690 | 691 | - name: "CASEBOX | Populate casebox parameters." 692 | shell: "echo '{{ item }}' >> {{ casebox_root_dir }}/app/config/{{ casebox_core }}/parameters.yml" 693 | with_items: 694 | - '# This file is auto-generated during the composer install' 695 | - 'parameters:' 696 | - " core_name: {{ casebox_core }}" 697 | - ' locale: en' 698 | - " server_name: http://{{ casebox_server_name }}/" 699 | - ' db_host: 127.0.0.1' 700 | - ' db_port: 3306' 701 | - " db_name: {{ casebox_core }}" 702 | - " db_user: {{ casebox_db_user }}" 703 | - " db_pass: {{ mysql_casebox_password.stdout }}" 704 | - " solr_host: {{ casebox_solr_host }}" 705 | - " solr_port: {{ casebox_solr_port }}" 706 | - " solr_core: {{ casebox_core }}" 707 | - " solr_core_log: {{ casebox_core }}_log" 708 | - " solr_username: {{ casebox_solr_username }}" 709 | - " solr_password: {{ casebox_solr_password }}" 710 | - ' session.lifetime: 4320' 711 | - ' admin_email: noreply@ci.casebox.org' 712 | - ' sender_email: noreply@ci.casebox.org' 713 | - ' comments_pass:' 714 | - ' mailer_transport: smtp' 715 | - ' mailer_host: 127.0.0.1' 716 | - ' mailer_user: null' 717 | - ' mailer_password: null' 718 | - " secret: {{ lookup('pipe', 'openssl rand -hex 13') }}" 719 | - ' prefix: cb' 720 | - ' solr_schema: http' 721 | - " convert_doc_unoconv_cmd: /usr/bin/python3 /usr/bin/unoconv" 722 | - " convert_doc_url: http://convert.devops.site/document/convert" 723 | - ' converter: unoconv' 724 | - ' redis_host: 127.0.0.1' 725 | - ' redis_port: 6379' 726 | when: config_file_exist.stat.exists == False 727 | become: yes 728 | 729 | - name: "CASEBOX | Check default parameters file." 730 | stat: path="{{ casebox_root_dir }}/app/config/default/parameters.yml" 731 | register: stat_default_parameters_file 732 | become: yes 733 | 734 | - name: "CASEBOX | Populate default parameters file." 735 | copy: src="{{ casebox_root_dir }}/app/config/{{ casebox_core }}/parameters.yml" 736 | dest="{{ casebox_root_dir }}/app/config/default/parameters.yml" 737 | when: stat_default_parameters_file.stat.exists == False 738 | become: yes 739 | 740 | - name: "CASEBOX | Composer update." 741 | shell: "composer update --working-dir={{ casebox_root_dir }}" 742 | become: yes 743 | 744 | - name: "CASEBOX | Set owner for docroot." 745 | shell: "chown {{ os_user }}:{{ os_user }} {{ casebox_root_dir }} -R" 746 | become: yes 747 | 748 | - name: "CASEBOX | Solr create Casebox default core." 749 | shell: "php {{ casebox_root_dir }}/bin/console casebox:solr:create --env={{ casebox_core }}" 750 | ignore_errors: yes 751 | 752 | - name: "CASEBOX | Solr index Casebox default core." 753 | shell: "php {{ casebox_root_dir }}/bin/console casebox:solr:update --all=true --env={{ casebox_core }}" 754 | ignore_errors: yes 755 | 756 | - name: "CASEBOX | Clear cache." 757 | shell: "php {{ casebox_root_dir }}/bin/console ca:cl --env={{ casebox_core }}" 758 | 759 | - name: "CASEBOX | Set var/* directory write permissions." 760 | shell: "chmod 0777 -R {{ casebox_root_dir }}/var/{{ item }} -R" 761 | with_items: 762 | - 'logs' 763 | - 'cache' 764 | - 'files' 765 | become: yes 766 | 767 | - name: "NGINX | Restart Nginx webserver." 768 | shell: "service nginx restart" 769 | become: yes 770 | 771 | - name: "MYSQL | Restart MySQL server." 772 | service: name=mysql state=restarted 773 | become: yes 774 | 775 | - name: "SOLR | Restart Solr webserver." 776 | service: name=solr state=restarted 777 | become: yes 778 | 779 | - pause: seconds=10 780 | -------------------------------------------------------------------------------- /ci/jenkins/run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) 4 | ROOT=$(realpath "$DIR/../..") 5 | 6 | echo -e "\n[*] Run provision...\n" 7 | /usr/bin/ansible-playbook -i "localhost," -c local $DIR/provision.yml --extra-vars="casebox_core='cbtest' casebox_server_name='development.ci.casebox.org' casebox_root_dir='/var/lib/jenkins/workspace/casebox/development' os_user='jenkins'" 8 | 9 | echo -e "\n[*] Run tests and sniffers...\n" 10 | bash $ROOT/tests/run.sh -------------------------------------------------------------------------------- /ci/travis/config/parameters.yml: -------------------------------------------------------------------------------- 1 | # This file is auto-generated during the composer install 2 | parameters: 3 | core_name: test 4 | locale: en 5 | secret: 2d7fa56245fcfd4385b67ff584 6 | server_name: 'http://localhost:8080/' 7 | prefix: cb 8 | db_host: 127.0.0.1 9 | db_port: 3306 10 | db_name: test 11 | db_user: test 12 | db_pass: test 13 | solr_schema: http 14 | solr_host: 127.0.0.1 15 | solr_port: 8180 16 | solr_core: test 17 | solr_core_log: test_log 18 | solr_username: null 19 | solr_password: null 20 | session.lifetime: 4320 21 | admin_email: admin@example.com 22 | sender_email: noreply@casebox.org 23 | comments_pass: null 24 | mailer_transport: smtp 25 | mailer_host: 127.0.0.1 26 | mailer_user: null 27 | mailer_password: null 28 | convert_doc_unoconv_cmd: '/usr/bin/python3 /usr/bin/unoconv' 29 | convert_doc_url: 'http://convert.devops.site/document/convert' 30 | converter: unoconv 31 | redis_host: 127.0.0.1 32 | redis_port: 6379 33 | -------------------------------------------------------------------------------- /ci/travis/coveralls.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | php vendor/bin/coveralls \ 4 | --coverage_clover=build/logs/clover-rpc.xml \ 5 | --coverage_clover=build/logs/clover-core.xml -------------------------------------------------------------------------------- /ci/travis/install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | set -x 5 | 6 | DIR=$(realpath $(dirname "$0")) 7 | ROOT=$(realpath "$DIR/../..") 8 | 9 | mysql -u root -e "CREATE USER 'test'@'%' IDENTIFIED BY 'test'" 10 | mysql -u root -e "CREATE USER 'test'@'localhost' IDENTIFIED BY 'test'" 11 | mysql -u root -e "GRANT ALL PRIVILEGES ON *.* TO 'test'@'%'" 12 | mysql -u root -e "GRANT ALL PRIVILEGES ON *.* TO 'test'@'localhost'" 13 | 14 | echo "create MySQL database" 15 | mysql -u test --password=test -e "create database IF NOT EXISTS test;" 16 | mysql -u test --password=test -b test < "$ROOT/var/backup/cb_default.sql" 17 | echo "copy and install solr 5.5.0" 18 | export SOLR_VERSION="5.5.0" 19 | export SOLR_PORT="8180" 20 | bash $DIR/solr/solr5.sh --install 21 | 22 | # may take few seconds to start and may not be available when the script is executed 23 | sleep 3 24 | echo "add solr test_log" 25 | export SOLR_CORENAME="test_log" 26 | export SOLR_CONFIGSET="/var/solr/log/conf" 27 | bash $DIR/solr/solr5.sh --addcore 28 | echo "add solr core test" 29 | export SOLR_CORENAME="test" 30 | export SOLR_CONFIGSET="/var/solr/default/conf" 31 | bash $DIR/solr/solr5.sh --addcore 32 | 33 | # create config 34 | cp "$DIR/config/parameters.yml" "$ROOT/app/config/test/parameters.yml" 35 | cp "$DIR/config/parameters.yml" "$ROOT/app/config/default/parameters.yml" 36 | 37 | 38 | -------------------------------------------------------------------------------- /ci/travis/nginx/default-site.tpl.conf: -------------------------------------------------------------------------------- 1 | server { 2 | 3 | listen 8080 default_server; 4 | listen [::]:8080 default_server ipv6only=on; 5 | 6 | root {ROOT}/web; 7 | 8 | access_log /tmp/access.log; 9 | error_log /tmp/error.log; 10 | 11 | rewrite ^/index\.php/?(.*)$ /$1 permanent; 12 | 13 | location / { 14 | index index.php; 15 | try_files $uri @rewriteapp; 16 | } 17 | 18 | location @rewriteapp { 19 | rewrite ^(.*)$ /index.php/$1 last; 20 | } 21 | 22 | location ~ ^/(index)\.php(/|$) { 23 | fastcgi_pass php; 24 | fastcgi_split_path_info ^(.+\.php)(/.*)$; 25 | include fastcgi.conf; 26 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 27 | fastcgi_param HTTPS off; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /ci/travis/nginx/fastcgi.tpl.conf: -------------------------------------------------------------------------------- 1 | fastcgi_param QUERY_STRING $query_string; 2 | fastcgi_param REQUEST_METHOD $request_method; 3 | fastcgi_param CONTENT_TYPE $content_type; 4 | fastcgi_param CONTENT_LENGTH $content_length; 5 | 6 | fastcgi_param SCRIPT_NAME $fastcgi_script_name; 7 | fastcgi_param REQUEST_URI $request_uri; 8 | fastcgi_param DOCUMENT_URI $document_uri; 9 | fastcgi_param DOCUMENT_ROOT $document_root; 10 | fastcgi_param SERVER_PROTOCOL $server_protocol; 11 | fastcgi_param HTTPS $https if_not_empty; 12 | 13 | fastcgi_param GATEWAY_INTERFACE CGI/1.1; 14 | fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; 15 | 16 | fastcgi_param REMOTE_ADDR $remote_addr; 17 | fastcgi_param REMOTE_PORT $remote_port; 18 | fastcgi_param SERVER_ADDR $server_addr; 19 | fastcgi_param SERVER_PORT $server_port; 20 | fastcgi_param SERVER_NAME $server_name; 21 | 22 | # PHP only, required if PHP was built with --enable-force-cgi-redirect 23 | fastcgi_param REDIRECT_STATUS 200; 24 | 25 | fastcgi_split_path_info ^(.+\.php)(.*)$; 26 | fastcgi_param PATH_INFO $fastcgi_path_info; 27 | #fastcgi_index index.php; 28 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 29 | 30 | # fastcgi_intercept_errors on; 31 | fastcgi_ignore_client_abort off; 32 | fastcgi_connect_timeout 60; 33 | fastcgi_send_timeout 1800; 34 | fastcgi_read_timeout 1800; 35 | fastcgi_buffer_size 128k; 36 | fastcgi_buffers 4 256k; 37 | fastcgi_busy_buffers_size 256k; 38 | fastcgi_temp_file_write_size 256k; 39 | fastcgi_keep_conn on; -------------------------------------------------------------------------------- /ci/travis/nginx/hhvm.tpl.ini: -------------------------------------------------------------------------------- 1 | ;hhvm 2 | hhvm.server.user = {USER} 3 | hhvm.server.type = fastcgi 4 | ;hhvm.server.file_socket = {SERVER} 5 | hhvm.server.port = {PORT} 6 | hhvm.log.use_log_file = true 7 | hhvm.log.file = /tmp/error.log 8 | hhvm.log.level = Warning 9 | hhvm.log.always_log_unhandled_exceptions = true 10 | hhvm.log.runtime_error_reporting_level = 8191 11 | hhvm.mysql.typed_results = false 12 | hhvm.eval.jit = false 13 | -------------------------------------------------------------------------------- /ci/travis/nginx/install-nginx.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | set -x 5 | 6 | DIR=$(realpath $(dirname "$0")) 7 | USER=$(whoami) 8 | PHP_VERSION=$(phpenv version-name) 9 | ROOT=$(realpath "$DIR/../../..") 10 | PORT=9000 11 | SERVER="/tmp/php.sock" 12 | 13 | function tpl { 14 | sed \ 15 | -e "s|{DIR}|$DIR|g" \ 16 | -e "s|{USER}|$USER|g" \ 17 | -e "s|{PHP_VERSION}|$PHP_VERSION|g" \ 18 | -e "s|{ROOT}|$ROOT|g" \ 19 | -e "s|{PORT}|$PORT|g" \ 20 | -e "s|{SERVER}|$SERVER|g" \ 21 | < $1 > $2 22 | } 23 | 24 | # Make some working directories. 25 | mkdir "$DIR/nginx" 26 | mkdir "$DIR/nginx/sites-enabled" 27 | mkdir "$DIR/var" 28 | 29 | # Configure the PHP handler. 30 | if [ "$PHP_VERSION" = 'hhvm' ] || [ "$PHP_VERSION" = 'hhvm-nightly' ] 31 | then 32 | HHVM_CONF="$DIR/nginx/hhvm.ini" 33 | 34 | tpl "$DIR/hhvm.tpl.ini" "$HHVM_CONF" 35 | 36 | cat "$HHVM_CONF" 37 | 38 | hhvm \ 39 | --mode=daemon \ 40 | --config="$HHVM_CONF" 41 | else 42 | PHP_FPM_BIN="$HOME/.phpenv/versions/$PHP_VERSION/sbin/php-fpm" 43 | PHP_FPM_CONF="$DIR/nginx/php-fpm.conf" 44 | 45 | # Build the php-fpm.conf. 46 | tpl "$DIR/php-fpm.tpl.conf" "$PHP_FPM_CONF" 47 | 48 | # Start php-fpm 49 | "$PHP_FPM_BIN" --fpm-config "$PHP_FPM_CONF" 50 | fi 51 | 52 | # Build the default nginx config files. 53 | tpl "$DIR/nginx.tpl.conf" "$DIR/nginx/nginx.conf" 54 | tpl "$DIR/fastcgi.tpl.conf" "$DIR/nginx/fastcgi.conf" 55 | tpl "$DIR/default-site.tpl.conf" "$DIR/nginx/sites-enabled/default-site.conf" 56 | 57 | # Start nginx. 58 | nginx -c "$DIR/nginx/nginx.conf" -------------------------------------------------------------------------------- /ci/travis/nginx/nginx.tpl.conf: -------------------------------------------------------------------------------- 1 | error_log /tmp/error.log; 2 | pid /tmp/nginx.pid; 3 | worker_processes 1; 4 | 5 | events { 6 | worker_connections 1024; 7 | } 8 | 9 | http { 10 | # Set an array of temp and cache file options that will otherwise default to restricted locations accessible only to root. 11 | client_body_temp_path /tmp/client_body; 12 | fastcgi_temp_path /tmp/fastcgi_temp; 13 | proxy_temp_path /tmp/proxy_temp; 14 | scgi_temp_path /tmp/scgi_temp; 15 | uwsgi_temp_path /tmp/uwsgi_temp; 16 | 17 | ## 18 | # Basic Settings 19 | ## 20 | sendfile on; 21 | tcp_nopush on; 22 | tcp_nodelay on; 23 | keepalive_timeout 65; 24 | types_hash_max_size 2048; 25 | # server_tokens off; 26 | # server_names_hash_bucket_size 64; 27 | # server_name_in_redirect off; 28 | include /etc/nginx/mime.types; 29 | default_type application/octet-stream; 30 | 31 | ## 32 | # Logging Settings 33 | ## 34 | access_log /tmp/access.log; 35 | error_log /tmp/error.log; 36 | 37 | ## 38 | # Gzip Settings 39 | ## 40 | gzip on; 41 | gzip_disable "msie6"; 42 | 43 | ## 44 | # Virtual Host Configs 45 | ## 46 | # include {DIR}/nginx/conf.d/*.conf; 47 | include {DIR}/nginx/sites-enabled/*; 48 | 49 | upstream php { 50 | server 127.0.0.1:{PORT}; 51 | } 52 | } -------------------------------------------------------------------------------- /ci/travis/nginx/php-fpm.tpl.conf: -------------------------------------------------------------------------------- 1 | [global] 2 | 3 | [travis] 4 | user = {USER} 5 | listen = {PORT} 6 | listen.mode = 0666 7 | pm = static 8 | pm.max_children = 5 9 | php_admin_value[memory_limit] = 32M 10 | -------------------------------------------------------------------------------- /ci/travis/solr/solr5.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | DIR=$(realpath $(dirname "$0")) 6 | ROOT=$(realpath "$DIR/../../..") 7 | 8 | cd $(dirname $0) 9 | 10 | export SOLR_VERSION=${SOLR_VERSION:-5.5.0} 11 | export SOLR_NAME="solr-$SOLR_VERSION" 12 | export SOLR_DIR="`pwd`/${SOLR_NAME}" 13 | export SOLR_PORT=${SOLR_PORT:-8180} 14 | export SOLR_SOURCE_URL="http://archive.apache.org/dist/lucene/solr/${SOLR_VERSION}/${SOLR_NAME}.tgz" 15 | export SOLR_ARCHIVE="${SOLR_NAME}.tgz" 16 | export SOLR_CONFIGSET=${SOLR_CONFIGSET:-basic} 17 | 18 | solr_responding() { 19 | port=$1 20 | curl -o /dev/null "http://localhost:$port/solr/admin/ping" > /dev/null 2>&1 21 | } 22 | 23 | wait_until_solr_responds() { 24 | port=$1 25 | while ! solr_responding $1; do 26 | /bin/echo -n "." 27 | sleep 1 28 | done 29 | } 30 | 31 | 32 | solr_install() { 33 | #if $SOLR_DIR not exist then try to download solr and extrat 34 | if [ ! -e $SOLR_DIR ]; then 35 | 36 | if [ -d "${HOME}/download-cache/" ]; then 37 | export SOLR_ARCHIVE="${HOME}/download-cache/${SOLR_ARCHIVE}" 38 | fi 39 | 40 | if [ -f ${SOLR_ARCHIVE} ]; then 41 | # If the tarball doesn't extract cleanly, remove it so it'll download again: 42 | tar -tf ${SOLR_ARCHIVE} > /dev/null || rm ${SOLR_ARCHIVE} 43 | fi 44 | 45 | 46 | if [ ! -f ${SOLR_ARCHIVE} ]; then 47 | echo "Download ${SOLR_NAME} from ${SOLR_SOURCE_URL}" 48 | curl -Lo $SOLR_ARCHIVE $SOLR_SOURCE_URL 49 | # wget -nv --output-document=`pwd`/$SOLR.tgz $SOLR_SOURCE_URL 50 | fi 51 | 52 | echo "Extracting Solr ${SOLR_ARCHIVE} to ${SOLR_DIR}" 53 | 54 | tar -xf $SOLR_ARCHIVE 55 | 56 | fi 57 | 58 | if [ -d "`pwd`/server" ]; then 59 | echo "Create configsets in ${SOLR_DIR}" 60 | cp -ar "`pwd`/server" $SOLR_DIR 61 | fi 62 | 63 | echo "Changing dir into ${SOLR_DIR}" 64 | cd $SOLR_DIR 65 | 66 | # We use exec to allow process monitors to correctly kill the 67 | # actual Java process rather than this launcher script: 68 | 69 | export CMD="bin/solr start -p ${SOLR_PORT}" 70 | 71 | echo "Starting server on port ${SOLR_PORT}" 72 | exec $CMD 73 | } 74 | 75 | solr_addcore() { 76 | 77 | echo "Waiting solr to launch on ${SOLR_PORT}..." 78 | wait_until_solr_responds $SOLR_PORT 79 | 80 | 81 | if [ -n "$SOLR_CORENAME" ]; then 82 | echo "Add solr cores" 83 | for CORENAME in $SOLR_CORENAME 84 | do 85 | # create core folder 86 | mkdir -p "${SOLR_DIR}/server/solr/${CORENAME}/" 87 | cp -ar "${ROOT}${SOLR_CONFIGSET}" "${SOLR_DIR}/server/solr/${CORENAME}/" 88 | echo "Configuring Core named ${CORENAME}" 89 | #exec $CMD 90 | curl -o /dev/null "http://localhost:${SOLR_PORT}/solr/admin/cores?action=CREATE&name=${CORENAME}&instanceDir=${CORENAME}" > /dev/null 2>&1 91 | done 92 | fi 93 | 94 | } 95 | 96 | 97 | solr_stop() { 98 | 99 | echo "Changing dir into ${SOLR_DIR}" 100 | cd $SOLR_DIR 101 | 102 | export CMD="bin/solr stop -p ${SOLR_PORT}" 103 | echo "Stop server on port ${SOLR_PORT}" 104 | exec $CMD 105 | 106 | } 107 | 108 | while [[ $# -ge 1 ]] 109 | do 110 | key="$1" 111 | 112 | case $key in 113 | --install) 114 | solr_install 115 | ;; 116 | --addcore) 117 | solr_addcore 118 | ;; 119 | --stop) 120 | solr_stop 121 | ;; 122 | *) 123 | #echo $key # unknown option 124 | ;; 125 | esac 126 | shift # past argument or value 127 | done 128 | -------------------------------------------------------------------------------- /ci/travis/uninstall.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | set -x 5 | 6 | DIR=$(realpath $(dirname "$0")) 7 | ROOT=$(realpath "$DIR/../..") 8 | 9 | export SOLR_VERSION="5.5.0" 10 | export SOLR_PORT="8180" 11 | 12 | bash $DIR/solr/solr5.sh --stop -------------------------------------------------------------------------------- /ci/vagrant/run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) 4 | ROOT=$(realpath "$DIR/../..") 5 | echo -e "\n[*] Run provision...\n" 6 | /usr/bin/ansible-playbook -i "localhost," -c local $DIR/../jenkins/provision.yml --extra-vars="casebox_core='default' casebox_server_name='_' casebox_root_dir='/var/www/casebox' os_user='vagrant'" 7 | echo -e "\n[*] Run tests and sniffers...\n" 8 | bash $ROOT/tests/run.sh -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "KETSE/casebox", 3 | "license": "AGPL", 4 | "type": "project", 5 | "config": { 6 | "preferred-install": "dist", 7 | "autoloader-suffix": "Casebox", 8 | "github-protocols": ["https"], 9 | "process-timeout": 600 10 | }, 11 | "autoload": { 12 | "psr-4": { 13 | "": "src/" 14 | }, 15 | "classmap": [ 16 | "app/AppKernel.php", 17 | "app/AppCache.php", 18 | "app/AppEnv.php" 19 | ] 20 | }, 21 | "require": { 22 | "php": ">=5.5.9", 23 | "symfony/symfony": "3.0.*", 24 | "twig/twig": "<2.0", 25 | "doctrine/orm": "^2.5", 26 | "doctrine/doctrine-bundle": "^1.6", 27 | "doctrine/doctrine-cache-bundle": "^1.2", 28 | "symfony/swiftmailer-bundle": "^2.3", 29 | "symfony/monolog-bundle": "^2.8", 30 | "symfony/translation": "*", 31 | "sensio/distribution-bundle": "^5.0", 32 | "sensio/generator-bundle": "^3.0", 33 | "symfony/doctrine-bridge": "^3.0", 34 | "sensio/framework-extra-bundle": "^3.0.2", 35 | "kwi/urllinker": "@dev" 36 | }, 37 | "require-dev": { 38 | "caseboxdev/core-bundle": "@dev", 39 | "caseboxdev/rpc-bundle": "@dev", 40 | "caseboxdev/rest-bundle": "@dev", 41 | "phpunit/phpunit": "^5.2.12", 42 | "phpunit/php-code-coverage": "^3.3.0", 43 | "satooshi/php-coveralls": "dev-master", 44 | "squizlabs/php_codesniffer": "^2.6", 45 | "escapestudios/symfony2-coding-standard": "^2.9", 46 | "phpmd/phpmd": "^2.4" 47 | }, 48 | "scripts": { 49 | "post-install-cmd": [ 50 | "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters", 51 | "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap", 52 | "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache", 53 | "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets", 54 | "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile", 55 | "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget", 56 | "Casebox\\CoreBundle\\Composer\\ScriptHandler::buildAssets" 57 | ], 58 | "post-update-cmd": [ 59 | "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters", 60 | "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap", 61 | "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache", 62 | "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets", 63 | "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile", 64 | "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget", 65 | "Casebox\\CoreBundle\\Composer\\ScriptHandler::buildAssets", 66 | "Casebox\\CoreBundle\\Composer\\ScriptHandler::buildTranslations" 67 | ] 68 | }, 69 | "extra": { 70 | "symfony-app-dir": "app", 71 | "symfony-bin-dir": "bin", 72 | "symfony-var-dir": "var", 73 | "symfony-web-dir": "web", 74 | "symfony-tests-dir": "tests", 75 | "symfony-assets-install": "relative", 76 | "incenteev-parameters": { 77 | "file": "app/config/default/parameters.yml" 78 | } 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /phpunit.xml.dist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | tests 18 | 19 | 20 | 21 | 22 | 23 | src 24 | 25 | src/*Bundle/Resources 26 | src/*/*Bundle/Resources 27 | src/*/Bundle/*Bundle/Resources 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | Require all denied 3 | 4 | 5 | Order deny,allow 6 | Deny from all 7 | 8 | -------------------------------------------------------------------------------- /tests/phpcs.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | PHP=$( which php ) 4 | 5 | DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) 6 | 7 | $PHP vendor/bin/phpcs --config-set installed_paths vendor/escapestudios/symfony2-coding-standard 8 | $PHP vendor/bin/phpcs --standard=Symfony2 --report-file=$DIR/../build/logs/phpcs.xml --report=xml vendor/caseboxdev/rpc-bundle/src/Service/ vendor/caseboxdev/rpc-bundle/src/Controller/ vendor/caseboxdev/core-bundle/src/Service/ vendor/caseboxdev/core-bundle/src/Controller/ 9 | $PHP vendor/bin/phpcs --standard=Symfony2 --report=checkstyle --report-file=$DIR/../build/logs/checkstyle.xml vendor/caseboxdev/rpc-bundle/src/Service/ vendor/caseboxdev/rpc-bundle/src/Controller/ vendor/caseboxdev/core-bundle/src/Service/ vendor/caseboxdev/core-bundle/src/Controller/ -------------------------------------------------------------------------------- /tests/phpmd.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | PHP=$( which php ) 4 | DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) 5 | 6 | $PHP vendor/bin/phpmd vendor/caseboxdev/rpc-bundle/src/Service/ xml codesize,unusedcode,naming --reportfile $DIR/../build/logs/phpmd-rpc-service.xml 7 | $PHP vendor/bin/phpmd vendor/caseboxdev/rpc-bundle/src/Controller/ xml codesize,unusedcode,naming --reportfile $DIR/../build/logs/phpmd-rpc-controller.xml 8 | $PHP vendor/bin/phpmd vendor/caseboxdev/core-bundle/src/Service/ xml codesize,unusedcode,naming --reportfile $DIR/../build/logs/phpmd-core-service.xml 9 | $PHP vendor/bin/phpmd vendor/caseboxdev/core-bundle/src/Controller/ xml codesize,unusedcode,naming --reportfile $DIR/../build/logs/phpmd-core-controller.xml -------------------------------------------------------------------------------- /tests/run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) 4 | 5 | echo -e "\n[*] Run PHPUnit tests.\n" 6 | bash $DIR/tests.sh 7 | echo -e "\n[*] Run PHP Code Sniffer.\n" 8 | bash $DIR/phpcs.sh 9 | echo -e "\n[*] Run PHP Mess Detector.\n" 10 | bash $DIR/phpmd.sh 11 | echo -e "\n[x] Done.\n" -------------------------------------------------------------------------------- /tests/tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash bash 2 | 3 | DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) 4 | PHP=$(which php) 5 | 6 | echo -e "\n[*] Run core-bundle tests.\n" 7 | [ -d var/cache/test/ ] && sudo rm -r var/cache/test 8 | bash $DIR/../vendor/caseboxdev/core-bundle/src/Tests/run.sh 9 | 10 | echo -e "\n[*] Run rpc-bundle tests.\n" 11 | [ -d var/cache/test/ ] && sudo rm -r var/cache/test 12 | bash $DIR/../vendor/caseboxdev/rpc-bundle/src/Tests/run.sh 13 | 14 | echo -e "\n[*] Merge coverage-clover reports to clover.xml file.\n" 15 | [ -d build/logs/clover.xml ] && sudo rm build/logs/clover.xml 16 | $PHP $DIR/../bin/clover_merge -o $DIR/../build/logs/clover.xml -f $DIR/../build/logs/clover-core-app.xml -f $DIR/../build/logs/clover-rpc-api.xml -f $DIR/../build/logs/clover-rpc-app.xml -------------------------------------------------------------------------------- /var/SymfonyRequirements.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | /* 13 | * Users of PHP 5.2 should be able to run the requirements checks. 14 | * This is why the file and all classes must be compatible with PHP 5.2+ 15 | * (e.g. not using namespaces and closures). 16 | * 17 | * ************** CAUTION ************** 18 | * 19 | * DO NOT EDIT THIS FILE as it will be overridden by Composer as part of 20 | * the installation/update process. The original file resides in the 21 | * SensioDistributionBundle. 22 | * 23 | * ************** CAUTION ************** 24 | */ 25 | 26 | /** 27 | * Represents a single PHP requirement, e.g. an installed extension. 28 | * It can be a mandatory requirement or an optional recommendation. 29 | * There is a special subclass, named PhpIniRequirement, to check a php.ini configuration. 30 | * 31 | * @author Tobias Schultze 32 | */ 33 | class Requirement 34 | { 35 | private $fulfilled; 36 | private $testMessage; 37 | private $helpText; 38 | private $helpHtml; 39 | private $optional; 40 | 41 | /** 42 | * Constructor that initializes the requirement. 43 | * 44 | * @param bool $fulfilled Whether the requirement is fulfilled 45 | * @param string $testMessage The message for testing the requirement 46 | * @param string $helpHtml The help text formatted in HTML for resolving the problem 47 | * @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags) 48 | * @param bool $optional Whether this is only an optional recommendation not a mandatory requirement 49 | */ 50 | public function __construct($fulfilled, $testMessage, $helpHtml, $helpText = null, $optional = false) 51 | { 52 | $this->fulfilled = (bool) $fulfilled; 53 | $this->testMessage = (string) $testMessage; 54 | $this->helpHtml = (string) $helpHtml; 55 | $this->helpText = null === $helpText ? strip_tags($this->helpHtml) : (string) $helpText; 56 | $this->optional = (bool) $optional; 57 | } 58 | 59 | /** 60 | * Returns whether the requirement is fulfilled. 61 | * 62 | * @return bool true if fulfilled, otherwise false 63 | */ 64 | public function isFulfilled() 65 | { 66 | return $this->fulfilled; 67 | } 68 | 69 | /** 70 | * Returns the message for testing the requirement. 71 | * 72 | * @return string The test message 73 | */ 74 | public function getTestMessage() 75 | { 76 | return $this->testMessage; 77 | } 78 | 79 | /** 80 | * Returns the help text for resolving the problem. 81 | * 82 | * @return string The help text 83 | */ 84 | public function getHelpText() 85 | { 86 | return $this->helpText; 87 | } 88 | 89 | /** 90 | * Returns the help text formatted in HTML. 91 | * 92 | * @return string The HTML help 93 | */ 94 | public function getHelpHtml() 95 | { 96 | return $this->helpHtml; 97 | } 98 | 99 | /** 100 | * Returns whether this is only an optional recommendation and not a mandatory requirement. 101 | * 102 | * @return bool true if optional, false if mandatory 103 | */ 104 | public function isOptional() 105 | { 106 | return $this->optional; 107 | } 108 | } 109 | 110 | /** 111 | * Represents a PHP requirement in form of a php.ini configuration. 112 | * 113 | * @author Tobias Schultze 114 | */ 115 | class PhpIniRequirement extends Requirement 116 | { 117 | /** 118 | * Constructor that initializes the requirement. 119 | * 120 | * @param string $cfgName The configuration name used for ini_get() 121 | * @param bool|callback $evaluation Either a boolean indicating whether the configuration should evaluate to true or false, 122 | * or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement 123 | * @param bool $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false. 124 | * This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin. 125 | * Example: You require a config to be true but PHP later removes this config and defaults it to true internally. 126 | * @param string|null $testMessage The message for testing the requirement (when null and $evaluation is a boolean a default message is derived) 127 | * @param string|null $helpHtml The help text formatted in HTML for resolving the problem (when null and $evaluation is a boolean a default help is derived) 128 | * @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags) 129 | * @param bool $optional Whether this is only an optional recommendation not a mandatory requirement 130 | */ 131 | public function __construct($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null, $optional = false) 132 | { 133 | $cfgValue = ini_get($cfgName); 134 | 135 | if (is_callable($evaluation)) { 136 | if (null === $testMessage || null === $helpHtml) { 137 | throw new InvalidArgumentException('You must provide the parameters testMessage and helpHtml for a callback evaluation.'); 138 | } 139 | 140 | $fulfilled = call_user_func($evaluation, $cfgValue); 141 | } else { 142 | if (null === $testMessage) { 143 | $testMessage = sprintf('%s %s be %s in php.ini', 144 | $cfgName, 145 | $optional ? 'should' : 'must', 146 | $evaluation ? 'enabled' : 'disabled' 147 | ); 148 | } 149 | 150 | if (null === $helpHtml) { 151 | $helpHtml = sprintf('Set %s to %s in php.ini*.', 152 | $cfgName, 153 | $evaluation ? 'on' : 'off' 154 | ); 155 | } 156 | 157 | $fulfilled = $evaluation == $cfgValue; 158 | } 159 | 160 | parent::__construct($fulfilled || ($approveCfgAbsence && false === $cfgValue), $testMessage, $helpHtml, $helpText, $optional); 161 | } 162 | } 163 | 164 | /** 165 | * A RequirementCollection represents a set of Requirement instances. 166 | * 167 | * @author Tobias Schultze 168 | */ 169 | class RequirementCollection implements IteratorAggregate 170 | { 171 | private $requirements = array(); 172 | 173 | /** 174 | * Gets the current RequirementCollection as an Iterator. 175 | * 176 | * @return Traversable A Traversable interface 177 | */ 178 | public function getIterator() 179 | { 180 | return new ArrayIterator($this->requirements); 181 | } 182 | 183 | /** 184 | * Adds a Requirement. 185 | * 186 | * @param Requirement $requirement A Requirement instance 187 | */ 188 | public function add(Requirement $requirement) 189 | { 190 | $this->requirements[] = $requirement; 191 | } 192 | 193 | /** 194 | * Adds a mandatory requirement. 195 | * 196 | * @param bool $fulfilled Whether the requirement is fulfilled 197 | * @param string $testMessage The message for testing the requirement 198 | * @param string $helpHtml The help text formatted in HTML for resolving the problem 199 | * @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags) 200 | */ 201 | public function addRequirement($fulfilled, $testMessage, $helpHtml, $helpText = null) 202 | { 203 | $this->add(new Requirement($fulfilled, $testMessage, $helpHtml, $helpText, false)); 204 | } 205 | 206 | /** 207 | * Adds an optional recommendation. 208 | * 209 | * @param bool $fulfilled Whether the recommendation is fulfilled 210 | * @param string $testMessage The message for testing the recommendation 211 | * @param string $helpHtml The help text formatted in HTML for resolving the problem 212 | * @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags) 213 | */ 214 | public function addRecommendation($fulfilled, $testMessage, $helpHtml, $helpText = null) 215 | { 216 | $this->add(new Requirement($fulfilled, $testMessage, $helpHtml, $helpText, true)); 217 | } 218 | 219 | /** 220 | * Adds a mandatory requirement in form of a php.ini configuration. 221 | * 222 | * @param string $cfgName The configuration name used for ini_get() 223 | * @param bool|callback $evaluation Either a boolean indicating whether the configuration should evaluate to true or false, 224 | * or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement 225 | * @param bool $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false. 226 | * This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin. 227 | * Example: You require a config to be true but PHP later removes this config and defaults it to true internally. 228 | * @param string $testMessage The message for testing the requirement (when null and $evaluation is a boolean a default message is derived) 229 | * @param string $helpHtml The help text formatted in HTML for resolving the problem (when null and $evaluation is a boolean a default help is derived) 230 | * @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags) 231 | */ 232 | public function addPhpIniRequirement($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null) 233 | { 234 | $this->add(new PhpIniRequirement($cfgName, $evaluation, $approveCfgAbsence, $testMessage, $helpHtml, $helpText, false)); 235 | } 236 | 237 | /** 238 | * Adds an optional recommendation in form of a php.ini configuration. 239 | * 240 | * @param string $cfgName The configuration name used for ini_get() 241 | * @param bool|callback $evaluation Either a boolean indicating whether the configuration should evaluate to true or false, 242 | * or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement 243 | * @param bool $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false. 244 | * This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin. 245 | * Example: You require a config to be true but PHP later removes this config and defaults it to true internally. 246 | * @param string $testMessage The message for testing the requirement (when null and $evaluation is a boolean a default message is derived) 247 | * @param string $helpHtml The help text formatted in HTML for resolving the problem (when null and $evaluation is a boolean a default help is derived) 248 | * @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags) 249 | */ 250 | public function addPhpIniRecommendation($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null) 251 | { 252 | $this->add(new PhpIniRequirement($cfgName, $evaluation, $approveCfgAbsence, $testMessage, $helpHtml, $helpText, true)); 253 | } 254 | 255 | /** 256 | * Adds a requirement collection to the current set of requirements. 257 | * 258 | * @param RequirementCollection $collection A RequirementCollection instance 259 | */ 260 | public function addCollection(RequirementCollection $collection) 261 | { 262 | $this->requirements = array_merge($this->requirements, $collection->all()); 263 | } 264 | 265 | /** 266 | * Returns both requirements and recommendations. 267 | * 268 | * @return array Array of Requirement instances 269 | */ 270 | public function all() 271 | { 272 | return $this->requirements; 273 | } 274 | 275 | /** 276 | * Returns all mandatory requirements. 277 | * 278 | * @return array Array of Requirement instances 279 | */ 280 | public function getRequirements() 281 | { 282 | $array = array(); 283 | foreach ($this->requirements as $req) { 284 | if (!$req->isOptional()) { 285 | $array[] = $req; 286 | } 287 | } 288 | 289 | return $array; 290 | } 291 | 292 | /** 293 | * Returns the mandatory requirements that were not met. 294 | * 295 | * @return array Array of Requirement instances 296 | */ 297 | public function getFailedRequirements() 298 | { 299 | $array = array(); 300 | foreach ($this->requirements as $req) { 301 | if (!$req->isFulfilled() && !$req->isOptional()) { 302 | $array[] = $req; 303 | } 304 | } 305 | 306 | return $array; 307 | } 308 | 309 | /** 310 | * Returns all optional recommendations. 311 | * 312 | * @return array Array of Requirement instances 313 | */ 314 | public function getRecommendations() 315 | { 316 | $array = array(); 317 | foreach ($this->requirements as $req) { 318 | if ($req->isOptional()) { 319 | $array[] = $req; 320 | } 321 | } 322 | 323 | return $array; 324 | } 325 | 326 | /** 327 | * Returns the recommendations that were not met. 328 | * 329 | * @return array Array of Requirement instances 330 | */ 331 | public function getFailedRecommendations() 332 | { 333 | $array = array(); 334 | foreach ($this->requirements as $req) { 335 | if (!$req->isFulfilled() && $req->isOptional()) { 336 | $array[] = $req; 337 | } 338 | } 339 | 340 | return $array; 341 | } 342 | 343 | /** 344 | * Returns whether a php.ini configuration is not correct. 345 | * 346 | * @return bool php.ini configuration problem? 347 | */ 348 | public function hasPhpIniConfigIssue() 349 | { 350 | foreach ($this->requirements as $req) { 351 | if (!$req->isFulfilled() && $req instanceof PhpIniRequirement) { 352 | return true; 353 | } 354 | } 355 | 356 | return false; 357 | } 358 | 359 | /** 360 | * Returns the PHP configuration file (php.ini) path. 361 | * 362 | * @return string|false php.ini file path 363 | */ 364 | public function getPhpIniConfigPath() 365 | { 366 | return get_cfg_var('cfg_file_path'); 367 | } 368 | } 369 | 370 | /** 371 | * This class specifies all requirements and optional recommendations that 372 | * are necessary to run the Symfony Standard Edition. 373 | * 374 | * @author Tobias Schultze 375 | * @author Fabien Potencier 376 | */ 377 | class SymfonyRequirements extends RequirementCollection 378 | { 379 | const REQUIRED_PHP_VERSION = '5.3.3'; 380 | 381 | /** 382 | * Constructor that initializes the requirements. 383 | */ 384 | public function __construct() 385 | { 386 | /* mandatory requirements follow */ 387 | 388 | $installedPhpVersion = phpversion(); 389 | 390 | $this->addRequirement( 391 | version_compare($installedPhpVersion, self::REQUIRED_PHP_VERSION, '>='), 392 | sprintf('PHP version must be at least %s (%s installed)', self::REQUIRED_PHP_VERSION, $installedPhpVersion), 393 | sprintf('You are running PHP version "%s", but Symfony needs at least PHP "%s" to run. 394 | Before using Symfony, upgrade your PHP installation, preferably to the latest version.', 395 | $installedPhpVersion, self::REQUIRED_PHP_VERSION), 396 | sprintf('Install PHP %s or newer (installed version is %s)', self::REQUIRED_PHP_VERSION, $installedPhpVersion) 397 | ); 398 | 399 | $this->addRequirement( 400 | version_compare($installedPhpVersion, '5.3.16', '!='), 401 | 'PHP version must not be 5.3.16 as Symfony won\'t work properly with it', 402 | 'Install PHP 5.3.17 or newer (or downgrade to an earlier PHP version)' 403 | ); 404 | 405 | $this->addRequirement( 406 | is_dir(__DIR__.'/../vendor/composer'), 407 | 'Vendor libraries must be installed', 408 | 'Vendor libraries are missing. Install composer following instructions from http://getcomposer.org/. '. 409 | 'Then run "php composer.phar install" to install them.' 410 | ); 411 | 412 | $cacheDir = is_dir(__DIR__.'/../var/cache') ? __DIR__.'/../var/cache' : __DIR__.'/cache'; 413 | 414 | $this->addRequirement( 415 | is_writable($cacheDir), 416 | 'app/cache/ or var/cache/ directory must be writable', 417 | 'Change the permissions of either "app/cache/" or "var/cache/" directory so that the web server can write into it.' 418 | ); 419 | 420 | $logsDir = is_dir(__DIR__.'/../var/logs') ? __DIR__.'/../var/logs' : __DIR__.'/logs'; 421 | 422 | $this->addRequirement( 423 | is_writable($logsDir), 424 | 'app/logs/ or var/logs/ directory must be writable', 425 | 'Change the permissions of either "app/logs/" or "var/logs/" directory so that the web server can write into it.' 426 | ); 427 | 428 | if (version_compare($installedPhpVersion, '7.0.0', '<')) { 429 | $this->addPhpIniRequirement( 430 | 'date.timezone', true, false, 431 | 'date.timezone setting must be set', 432 | 'Set the "date.timezone" setting in php.ini* (like Europe/Paris).' 433 | ); 434 | } 435 | 436 | if (version_compare($installedPhpVersion, self::REQUIRED_PHP_VERSION, '>=')) { 437 | $timezones = array(); 438 | foreach (DateTimeZone::listAbbreviations() as $abbreviations) { 439 | foreach ($abbreviations as $abbreviation) { 440 | $timezones[$abbreviation['timezone_id']] = true; 441 | } 442 | } 443 | 444 | $this->addRequirement( 445 | isset($timezones[@date_default_timezone_get()]), 446 | sprintf('Configured default timezone "%s" must be supported by your installation of PHP', @date_default_timezone_get()), 447 | 'Your default timezone is not supported by PHP. Check for typos in your php.ini file and have a look at the list of deprecated timezones at http://php.net/manual/en/timezones.others.php.' 448 | ); 449 | } 450 | 451 | $this->addRequirement( 452 | function_exists('iconv'), 453 | 'iconv() must be available', 454 | 'Install and enable the iconv extension.' 455 | ); 456 | 457 | $this->addRequirement( 458 | function_exists('json_encode'), 459 | 'json_encode() must be available', 460 | 'Install and enable the JSON extension.' 461 | ); 462 | 463 | $this->addRequirement( 464 | function_exists('session_start'), 465 | 'session_start() must be available', 466 | 'Install and enable the session extension.' 467 | ); 468 | 469 | $this->addRequirement( 470 | function_exists('ctype_alpha'), 471 | 'ctype_alpha() must be available', 472 | 'Install and enable the ctype extension.' 473 | ); 474 | 475 | $this->addRequirement( 476 | function_exists('token_get_all'), 477 | 'token_get_all() must be available', 478 | 'Install and enable the Tokenizer extension.' 479 | ); 480 | 481 | $this->addRequirement( 482 | function_exists('simplexml_import_dom'), 483 | 'simplexml_import_dom() must be available', 484 | 'Install and enable the SimpleXML extension.' 485 | ); 486 | 487 | if (function_exists('apc_store') && ini_get('apc.enabled')) { 488 | if (version_compare($installedPhpVersion, '5.4.0', '>=')) { 489 | $this->addRequirement( 490 | version_compare(phpversion('apc'), '3.1.13', '>='), 491 | 'APC version must be at least 3.1.13 when using PHP 5.4', 492 | 'Upgrade your APC extension (3.1.13+).' 493 | ); 494 | } else { 495 | $this->addRequirement( 496 | version_compare(phpversion('apc'), '3.0.17', '>='), 497 | 'APC version must be at least 3.0.17', 498 | 'Upgrade your APC extension (3.0.17+).' 499 | ); 500 | } 501 | } 502 | 503 | $this->addPhpIniRequirement('detect_unicode', false); 504 | 505 | if (extension_loaded('suhosin')) { 506 | $this->addPhpIniRequirement( 507 | 'suhosin.executor.include.whitelist', 508 | create_function('$cfgValue', 'return false !== stripos($cfgValue, "phar");'), 509 | false, 510 | 'suhosin.executor.include.whitelist must be configured correctly in php.ini', 511 | 'Add "phar" to suhosin.executor.include.whitelist in php.ini*.' 512 | ); 513 | } 514 | 515 | if (extension_loaded('xdebug')) { 516 | $this->addPhpIniRequirement( 517 | 'xdebug.show_exception_trace', false, true 518 | ); 519 | 520 | $this->addPhpIniRequirement( 521 | 'xdebug.scream', false, true 522 | ); 523 | 524 | $this->addPhpIniRecommendation( 525 | 'xdebug.max_nesting_level', 526 | create_function('$cfgValue', 'return $cfgValue > 100;'), 527 | true, 528 | 'xdebug.max_nesting_level should be above 100 in php.ini', 529 | 'Set "xdebug.max_nesting_level" to e.g. "250" in php.ini* to stop Xdebug\'s infinite recursion protection erroneously throwing a fatal error in your project.' 530 | ); 531 | } 532 | 533 | $pcreVersion = defined('PCRE_VERSION') ? (float) PCRE_VERSION : null; 534 | 535 | $this->addRequirement( 536 | null !== $pcreVersion, 537 | 'PCRE extension must be available', 538 | 'Install the PCRE extension (version 8.0+).' 539 | ); 540 | 541 | if (extension_loaded('mbstring')) { 542 | $this->addPhpIniRequirement( 543 | 'mbstring.func_overload', 544 | create_function('$cfgValue', 'return (int) $cfgValue === 0;'), 545 | true, 546 | 'string functions should not be overloaded', 547 | 'Set "mbstring.func_overload" to 0 in php.ini* to disable function overloading by the mbstring extension.' 548 | ); 549 | } 550 | 551 | /* optional recommendations follow */ 552 | 553 | if (file_exists(__DIR__.'/../vendor/composer')) { 554 | require_once __DIR__.'/../vendor/autoload.php'; 555 | 556 | try { 557 | $r = new ReflectionClass('Sensio\Bundle\DistributionBundle\SensioDistributionBundle'); 558 | 559 | $contents = file_get_contents(dirname($r->getFileName()).'/Resources/skeleton/app/SymfonyRequirements.php'); 560 | } catch (ReflectionException $e) { 561 | $contents = ''; 562 | } 563 | $this->addRecommendation( 564 | file_get_contents(__FILE__) === $contents, 565 | 'Requirements file should be up-to-date', 566 | 'Your requirements file is outdated. Run composer install and re-check your configuration.' 567 | ); 568 | } 569 | 570 | $this->addRecommendation( 571 | version_compare($installedPhpVersion, '5.3.4', '>='), 572 | 'You should use at least PHP 5.3.4 due to PHP bug #52083 in earlier versions', 573 | 'Your project might malfunction randomly due to PHP bug #52083 ("Notice: Trying to get property of non-object"). Install PHP 5.3.4 or newer.' 574 | ); 575 | 576 | $this->addRecommendation( 577 | version_compare($installedPhpVersion, '5.3.8', '>='), 578 | 'When using annotations you should have at least PHP 5.3.8 due to PHP bug #55156', 579 | 'Install PHP 5.3.8 or newer if your project uses annotations.' 580 | ); 581 | 582 | $this->addRecommendation( 583 | version_compare($installedPhpVersion, '5.4.0', '!='), 584 | 'You should not use PHP 5.4.0 due to the PHP bug #61453', 585 | 'Your project might not work properly due to the PHP bug #61453 ("Cannot dump definitions which have method calls"). Install PHP 5.4.1 or newer.' 586 | ); 587 | 588 | $this->addRecommendation( 589 | version_compare($installedPhpVersion, '5.4.11', '>='), 590 | 'When using the logout handler from the Symfony Security Component, you should have at least PHP 5.4.11 due to PHP bug #63379 (as a workaround, you can also set invalidate_session to false in the security logout handler configuration)', 591 | 'Install PHP 5.4.11 or newer if your project uses the logout handler from the Symfony Security Component.' 592 | ); 593 | 594 | $this->addRecommendation( 595 | (version_compare($installedPhpVersion, '5.3.18', '>=') && version_compare($installedPhpVersion, '5.4.0', '<')) 596 | || 597 | version_compare($installedPhpVersion, '5.4.8', '>='), 598 | 'You should use PHP 5.3.18+ or PHP 5.4.8+ to always get nice error messages for fatal errors in the development environment due to PHP bug #61767/#60909', 599 | 'Install PHP 5.3.18+ or PHP 5.4.8+ if you want nice error messages for all fatal errors in the development environment.' 600 | ); 601 | 602 | if (null !== $pcreVersion) { 603 | $this->addRecommendation( 604 | $pcreVersion >= 8.0, 605 | sprintf('PCRE extension should be at least version 8.0 (%s installed)', $pcreVersion), 606 | 'PCRE 8.0+ is preconfigured in PHP since 5.3.2 but you are using an outdated version of it. Symfony probably works anyway but it is recommended to upgrade your PCRE extension.' 607 | ); 608 | } 609 | 610 | $this->addRecommendation( 611 | class_exists('DomDocument'), 612 | 'PHP-DOM and PHP-XML modules should be installed', 613 | 'Install and enable the PHP-DOM and the PHP-XML modules.' 614 | ); 615 | 616 | $this->addRecommendation( 617 | function_exists('mb_strlen'), 618 | 'mb_strlen() should be available', 619 | 'Install and enable the mbstring extension.' 620 | ); 621 | 622 | $this->addRecommendation( 623 | function_exists('iconv'), 624 | 'iconv() should be available', 625 | 'Install and enable the iconv extension.' 626 | ); 627 | 628 | $this->addRecommendation( 629 | function_exists('utf8_decode'), 630 | 'utf8_decode() should be available', 631 | 'Install and enable the XML extension.' 632 | ); 633 | 634 | $this->addRecommendation( 635 | function_exists('filter_var'), 636 | 'filter_var() should be available', 637 | 'Install and enable the filter extension.' 638 | ); 639 | 640 | if (!defined('PHP_WINDOWS_VERSION_BUILD')) { 641 | $this->addRecommendation( 642 | function_exists('posix_isatty'), 643 | 'posix_isatty() should be available', 644 | 'Install and enable the php_posix extension (used to colorize the CLI output).' 645 | ); 646 | } 647 | 648 | $this->addRecommendation( 649 | extension_loaded('intl'), 650 | 'intl extension should be available', 651 | 'Install and enable the intl extension (used for validators).' 652 | ); 653 | 654 | if (extension_loaded('intl')) { 655 | // in some WAMP server installations, new Collator() returns null 656 | $this->addRecommendation( 657 | null !== new Collator('fr_FR'), 658 | 'intl extension should be correctly configured', 659 | 'The intl extension does not behave properly. This problem is typical on PHP 5.3.X x64 WIN builds.' 660 | ); 661 | 662 | // check for compatible ICU versions (only done when you have the intl extension) 663 | if (defined('INTL_ICU_VERSION')) { 664 | $version = INTL_ICU_VERSION; 665 | } else { 666 | $reflector = new ReflectionExtension('intl'); 667 | 668 | ob_start(); 669 | $reflector->info(); 670 | $output = strip_tags(ob_get_clean()); 671 | 672 | preg_match('/^ICU version +(?:=> )?(.*)$/m', $output, $matches); 673 | $version = $matches[1]; 674 | } 675 | 676 | $this->addRecommendation( 677 | version_compare($version, '4.0', '>='), 678 | 'intl ICU version should be at least 4+', 679 | 'Upgrade your intl extension with a newer ICU version (4+).' 680 | ); 681 | 682 | if (class_exists('Symfony\Component\Intl\Intl')) { 683 | $this->addRecommendation( 684 | \Symfony\Component\Intl\Intl::getIcuDataVersion() === \Symfony\Component\Intl\Intl::getIcuVersion(), 685 | sprintf('intl ICU version installed on your system (%s) should match the ICU data bundled with Symfony (%s)', \Symfony\Component\Intl\Intl::getIcuVersion(), \Symfony\Component\Intl\Intl::getIcuDataVersion()), 686 | 'In most cases you should be fine, but please verify there is no inconsistencies between data provided by Symfony and the intl extension. See https://github.com/symfony/symfony/issues/15007 for an example of inconsistencies you might run into.' 687 | ); 688 | } 689 | 690 | $this->addPhpIniRecommendation( 691 | 'intl.error_level', 692 | create_function('$cfgValue', 'return (int) $cfgValue === 0;'), 693 | true, 694 | 'intl.error_level should be 0 in php.ini', 695 | 'Set "intl.error_level" to "0" in php.ini* to inhibit the messages when an error occurs in ICU functions.' 696 | ); 697 | } 698 | 699 | $accelerator = 700 | (extension_loaded('eaccelerator') && ini_get('eaccelerator.enable')) 701 | || 702 | (extension_loaded('apc') && ini_get('apc.enabled')) 703 | || 704 | (extension_loaded('Zend Optimizer+') && ini_get('zend_optimizerplus.enable')) 705 | || 706 | (extension_loaded('Zend OPcache') && ini_get('opcache.enable')) 707 | || 708 | (extension_loaded('xcache') && ini_get('xcache.cacher')) 709 | || 710 | (extension_loaded('wincache') && ini_get('wincache.ocenabled')) 711 | ; 712 | 713 | $this->addRecommendation( 714 | $accelerator, 715 | 'a PHP accelerator should be installed', 716 | 'Install and/or enable a PHP accelerator (highly recommended).' 717 | ); 718 | 719 | if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { 720 | $this->addRecommendation( 721 | $this->getRealpathCacheSize() > 1000, 722 | 'realpath_cache_size should be above 1024 in php.ini', 723 | 'Set "realpath_cache_size" to e.g. "1024" in php.ini* to improve performance on windows.' 724 | ); 725 | } 726 | 727 | $this->addPhpIniRecommendation('short_open_tag', false); 728 | 729 | $this->addPhpIniRecommendation('magic_quotes_gpc', false, true); 730 | 731 | $this->addPhpIniRecommendation('register_globals', false, true); 732 | 733 | $this->addPhpIniRecommendation('session.auto_start', false); 734 | 735 | $this->addRecommendation( 736 | class_exists('PDO'), 737 | 'PDO should be installed', 738 | 'Install PDO (mandatory for Doctrine).' 739 | ); 740 | 741 | if (class_exists('PDO')) { 742 | $drivers = PDO::getAvailableDrivers(); 743 | $this->addRecommendation( 744 | count($drivers) > 0, 745 | sprintf('PDO should have some drivers installed (currently available: %s)', count($drivers) ? implode(', ', $drivers) : 'none'), 746 | 'Install PDO drivers (mandatory for Doctrine).' 747 | ); 748 | } 749 | } 750 | 751 | /** 752 | * Loads realpath_cache_size from php.ini and converts it to int. 753 | * 754 | * (e.g. 16k is converted to 16384 int) 755 | * 756 | * @return int 757 | */ 758 | protected function getRealpathCacheSize() 759 | { 760 | $size = ini_get('realpath_cache_size'); 761 | $size = trim($size); 762 | $unit = strtolower(substr($size, -1, 1)); 763 | switch ($unit) { 764 | case 'g': 765 | return $size * 1024 * 1024 * 1024; 766 | case 'm': 767 | return $size * 1024 * 1024; 768 | case 'k': 769 | return $size * 1024; 770 | default: 771 | return (int) $size; 772 | } 773 | } 774 | } 775 | -------------------------------------------------------------------------------- /var/cache/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KETSE/casebox/0f0838fd27f30d57d45878450cc3a3e950fe2e11/var/cache/.gitkeep -------------------------------------------------------------------------------- /var/files/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KETSE/casebox/0f0838fd27f30d57d45878450cc3a3e950fe2e11/var/files/.gitkeep -------------------------------------------------------------------------------- /var/logs/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KETSE/casebox/0f0838fd27f30d57d45878450cc3a3e950fe2e11/var/logs/.gitkeep -------------------------------------------------------------------------------- /var/sessions/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KETSE/casebox/0f0838fd27f30d57d45878450cc3a3e950fe2e11/var/sessions/.gitkeep -------------------------------------------------------------------------------- /var/solr/default/conf/cb_solr_fields.xml: -------------------------------------------------------------------------------- 1 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 220 | 221 | 222 | 223 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 240 | 241 | 242 | 243 | 244 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | -------------------------------------------------------------------------------- /var/solr/default/conf/cb_solr_types.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 14 | 15 | 16 | 17 | 18 | 19 | 32 | 33 | 36 | 37 | 38 | 39 | 40 | 41 | 51 | 52 | 53 | 54 | 55 | 56 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 99 | 100 | 101 | 112 | 113 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 225 | 226 | 227 | 230 | 251 | 252 | 253 | 261 | 262 | 263 | 264 | 268 | 269 | 270 | 273 | 274 | 277 | 278 | 279 | 280 | 291 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 342 | 344 | 345 | 348 | 350 | 351 | -------------------------------------------------------------------------------- /var/solr/default/conf/protwords.txt: -------------------------------------------------------------------------------- 1 | # The ASF licenses this file to You under the Apache License, Version 2.0 2 | # (the "License"); you may not use this file except in compliance with 3 | # the License. You may obtain a copy of the License at 4 | # 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, 9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | # See the License for the specific language governing permissions and 11 | # limitations under the License. 12 | 13 | #----------------------------------------------------------------------- 14 | # Use a protected word file to protect against the stemmer reducing two 15 | # unrelated words to the same base word. 16 | 17 | # Some non-words that normally won't be encountered, 18 | # just to test that they won't be stemmed. 19 | dontstems 20 | zwhacky 21 | 22 | -------------------------------------------------------------------------------- /var/solr/default/conf/schema.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | ]> 6 | 7 | 20 | 21 | 22 | 30 | 31 | &cb_solr_types; 32 | 33 | &cb_solr_fields; 34 | 35 | 39 | 40 | 41 | 42 | 43 | 46 | id 47 | 48 | 49 | content 50 | 51 | 52 | 53 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /var/solr/default/conf/solrconfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | 28 | 5.1.0 29 | 30 | 31 | 32 | 33 | 34 | 35 | ${solr.data.dir:} 36 | 37 | 39 | 40 | 41 | 42 | 43 | ${solr.lock.type:native} 44 | 45 | true 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 59 | 60 | ${solr.ulog.dir:} 61 | 62 | 63 | 64 | 65 | 66 | false 67 | 68 | 69 | 70 | 71 | 75 | 76 | 80 | 81 | 85 | 86 | 87 | 95 | true 96 | 97 | 100 | 200 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | standard 119 | solrpingquery 120 | all 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | blockJoinFacet 131 | 132 | 133 | 134 | 135 | 136 | 137 | *:* 138 | 139 | 140 | 141 | 142 | -------------------------------------------------------------------------------- /var/solr/default/conf/stopwords.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | -------------------------------------------------------------------------------- /var/solr/default/conf/synonyms.txt: -------------------------------------------------------------------------------- 1 | # The ASF licenses this file to You under the Apache License, Version 2.0 2 | # (the "License"); you may not use this file except in compliance with 3 | # the License. You may obtain a copy of the License at 4 | # 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, 9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | # See the License for the specific language governing permissions and 11 | # limitations under the License. 12 | 13 | #----------------------------------------------------------------------- 14 | #some test synonym mappings unlikely to appear in real input text 15 | aaafoo => aaabar 16 | bbbfoo => bbbfoo bbbbar 17 | cccfoo => cccbar cccbaz 18 | fooaaa,baraaa,bazaaa 19 | 20 | # Some synonym groups specific to this example 21 | GB,gib,gigabyte,gigabytes 22 | MB,mib,megabyte,megabytes 23 | Television, Televisions, TV, TVs 24 | #notice we use "gib" instead of "GiB" so any WordDelimiterFilter coming 25 | #after us won't split it into two words. 26 | 27 | # Synonym mappings can be used for spelling correction too 28 | pixima => pixma 29 | 30 | a\,a => b\,b 31 | 32 | -------------------------------------------------------------------------------- /var/solr/log/conf/cb_solr_fields.xml: -------------------------------------------------------------------------------- 1 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /var/solr/log/conf/cb_solr_types.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 34 | 35 | 38 | 39 | 40 | 41 | 42 | 43 | 53 | 54 | 55 | 56 | 57 | 58 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 95 | 96 | 106 | 107 | 118 | 119 | 120 | 131 | 132 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 193 | 201 | 203 | 206 | 207 | 208 | 209 | 228 | 229 | 230 | 233 | 254 | 255 | 256 | 264 | 265 | 269 | 270 | 271 | 274 | 275 | 278 | 279 | 280 | 281 | 292 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | -------------------------------------------------------------------------------- /var/solr/log/conf/protwords.txt: -------------------------------------------------------------------------------- 1 | # The ASF licenses this file to You under the Apache License, Version 2.0 2 | # (the "License"); you may not use this file except in compliance with 3 | # the License. You may obtain a copy of the License at 4 | # 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, 9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | # See the License for the specific language governing permissions and 11 | # limitations under the License. 12 | 13 | #----------------------------------------------------------------------- 14 | # Use a protected word file to protect against the stemmer reducing two 15 | # unrelated words to the same base word. 16 | 17 | # Some non-words that normally won't be encountered, 18 | # just to test that they won't be stemmed. 19 | dontstems 20 | zwhacky 21 | 22 | -------------------------------------------------------------------------------- /var/solr/log/conf/schema.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | ]> 6 | 22 | 23 | 51 | 52 | 53 | 61 | 62 | &cb_solr_types; 63 | &cb_solr_fields; 64 | 65 | 68 | id 69 | 70 | 71 | id 72 | 73 | 74 | 75 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /var/solr/log/conf/solrconfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | 28 | 5.1.0 29 | 30 | 31 | ${solr.data.dir:} 32 | 33 | 35 | 36 | 37 | 38 | 39 | ${solr.lock.type:native} 40 | 41 | true 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 55 | 56 | ${solr.ulog.dir:} 57 | 58 | 59 | 60 | 61 | 62 | false 63 | 64 | 65 | 66 | 67 | 71 | 72 | 76 | 77 | 81 | 82 | 83 | 91 | true 92 | 93 | 96 | 200 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | standard 115 | solrpingquery 116 | all 117 | 118 | 119 | 120 | 121 | 122 | *:* 123 | 124 | 125 | 126 | 127 | -------------------------------------------------------------------------------- /var/solr/log/conf/stopwords.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | -------------------------------------------------------------------------------- /var/solr/log/conf/synonyms.txt: -------------------------------------------------------------------------------- 1 | # The ASF licenses this file to You under the Apache License, Version 2.0 2 | # (the "License"); you may not use this file except in compliance with 3 | # the License. You may obtain a copy of the License at 4 | # 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, 9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | # See the License for the specific language governing permissions and 11 | # limitations under the License. 12 | 13 | #----------------------------------------------------------------------- 14 | #some test synonym mappings unlikely to appear in real input text 15 | aaafoo => aaabar 16 | bbbfoo => bbbfoo bbbbar 17 | cccfoo => cccbar cccbaz 18 | fooaaa,baraaa,bazaaa 19 | 20 | # Some synonym groups specific to this example 21 | GB,gib,gigabyte,gigabytes 22 | MB,mib,megabyte,megabytes 23 | Television, Televisions, TV, TVs 24 | #notice we use "gib" instead of "GiB" so any WordDelimiterFilter coming 25 | #after us won't split it into two words. 26 | 27 | # Synonym mappings can be used for spelling correction too 28 | pixima => pixma 29 | 30 | a\,a => b\,b 31 | 32 | -------------------------------------------------------------------------------- /var/ssl/ssl-cert.key: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCr2DuYMEgZnvQ4 3 | qwDxk2gcWPFENKO58pKrSAv0II36LT/Y3DamMO2Tkh4ckXtRI9O7gURzRWvhTdDl 4 | 3BgK51avpXWELrgHTGPE1quXmqPR46Wg880ufhsj95SK4ajcSppfcNNiaNAG2B2L 5 | LANqH72EJQH5wYBm55pVeRkrfScOrNsN2ZzJI0P9cZGX0OJstLtHvzGwUqFbIv/Z 6 | dDO3Lkm7xZoprHSj8Btc7zPC4Rr6bfyyu3pfNVFuLu8bUFvsIa7Umf2v7T+6rMFS 7 | ut4Skl2h0Pq1DECYBmvQD6MbkkM0xMR2TfBPO40OCd5Pejui9HIBDpO8T563M9+k 8 | N55b18vjAgMBAAECggEAGZV2weCmS1Iz79/doxmcDWRcfxgLLBrmJSPzy6OxH4bv 9 | E30tka6FIExHuV8baegYlLjZFQRH3GI2cJJE7hKlAD908Hn4IfYIgHypTUfTjeMD 10 | fKPvbzWNGty4O7j+59UfiIgGoIcUOYChXV/vHjSdhXfxBFr/n9JpUsJVsfjPAMsS 11 | 01dr9ji4izGkDS8UatK/BpgtY0a8EMwqQDKoY2es6Jmjpzj1tsHOPl75uFITHczn 12 | cNziNd1zbz8CoN1Svj1Qc0h5GUdTxVP4p//L108hSXrXwHqjUM2GDHC4ntKJHyqv 13 | C9qXHvBs+BS9tpVvgYI8NQ6a+Gdf0K60/dd+mLKXqQKBgQDXyRLgLaZryZeQRdUg 14 | +LDTBmqxB5inQUmGbL9T+ncRRUiY94tAnplS860bhv/lGcMKNZCICoojwHAk8odc 15 | q7+rb8mCgOR5T5ofUI/MP3BK1+orq7umcFwLzPM/+TTREB1oI/K2S4F6qI7L4jIB 16 | HkzQNOSj/n3Rg6HVAtfVkeVG/wKBgQDL3sjNMum8k50nXow674mXdfUTtXLPysNu 17 | +PmZ3Wfy2OrUGNjKB0sN/RMt82q8gYDohlenTEFavI7N8NkQlGuZHa+zT/o89/mu 18 | a2voKB4LHH57aKbnJpFZKkNtWkXwP679fCmPPx1HTeaZVPt0gTLARyTspSxk59XL 19 | pVLCTZo/HQKBgHlBcUzt+hWZu4SD6UbU2LBMa8m85ggehM138G+lUCExWKE0gVi3 20 | hpr5eS39x3Aa8OGcxfHcUlHSwnHQo0Xs8RDKCWc/PKP6mjW8lIGGqHg2Kk2N/C2D 21 | +AVdjtdFF2vfbVbm1G2hskmVzGA/ZDACsdFR16VbzaHdISRMq7JEgJ1LAoGAPNmF 22 | I8Ijg7anfH2660hd0AhUGwrYdu71QCUuEt/Dy/c0uBOmeT6OB2HXHKr/273npP+c 23 | IAIhq5yGHy/ZChrStsPmkmW3sgTt0EKd1ZBLz1M06U7GKk4Xqf50W6pLH7dSWrR5 24 | jxjuez7kKjX0S8TYSg2yFrQCOSf9Zyg0OGyDMn0CgYEAlMskBnY+an/rdd3E1b6a 25 | hxlOUp6Jy/bNXvBoiG6/w/T2O3crUX4Ef477LMLjbHhKteyHENnvzhpqcZ6gBn3+ 26 | 51RZfpb3lw9WseYG560D36+2cAbM4xE9VaNMdz6jL51KZZzony2+Ux2DMPrsBGXd 27 | V/UpxIE/DVQENuG6hRvTvJQ= 28 | -----END PRIVATE KEY----- 29 | -------------------------------------------------------------------------------- /var/ssl/ssl-cert.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIICxjCCAa6gAwIBAgIJAPRBS9kzkb8oMA0GCSqGSIb3DQEBCwUAMBsxGTAXBgNV 3 | BAMTEGtvZWwuZGV2b3BzLnNpdGUwHhcNMTYwMTAyMDkxODAyWhcNMjUxMjMwMDkx 4 | ODAyWjAbMRkwFwYDVQQDExBrb2VsLmRldm9wcy5zaXRlMIIBIjANBgkqhkiG9w0B 5 | AQEFAAOCAQ8AMIIBCgKCAQEAq9g7mDBIGZ70OKsA8ZNoHFjxRDSjufKSq0gL9CCN 6 | +i0/2Nw2pjDtk5IeHJF7USPTu4FEc0Vr4U3Q5dwYCudWr6V1hC64B0xjxNarl5qj 7 | 0eOloPPNLn4bI/eUiuGo3EqaX3DTYmjQBtgdiywDah+9hCUB+cGAZueaVXkZK30n 8 | DqzbDdmcySND/XGRl9DibLS7R78xsFKhWyL/2XQzty5Ju8WaKax0o/AbXO8zwuEa 9 | +m38srt6XzVRbi7vG1Bb7CGu1Jn9r+0/uqzBUrreEpJdodD6tQxAmAZr0A+jG5JD 10 | NMTEdk3wTzuNDgneT3o7ovRyAQ6TvE+etzPfpDeeW9fL4wIDAQABow0wCzAJBgNV 11 | HRMEAjAAMA0GCSqGSIb3DQEBCwUAA4IBAQCiq+AYuDtTujOmVhGFv8sVQVKN9mbk 12 | aIHtwNuw5+IOsinZOn1rIoILFckSPaLGVCZW3VO+9wDPwYP+oj59D3pN53AWdDbc 13 | Wyv09QwAVf6+jv5fXbGEa5OLzFMZluNQfdhOVbBnP1o/3c98o4uzngdGBL53Ueyc 14 | IYIMrZJUtESHwi4mE2+sV01i5DeyjB19mM8HKs7xY3awdTjwC2w1IUxopAWW8Ada 15 | whb6kiRDTQvGlQIupXo7bWCiyk9rs3Q/G4JT9OvGkjirYPQb2uV0PNRauA+g7Y3A 16 | qu7Gdj7vQOQMKzHJ+pDOodgjSeygcYIWdteq9jV6ooG/t+VcTZIU5fyf 17 | -----END CERTIFICATE----- 18 | -------------------------------------------------------------------------------- /web/.htaccess: -------------------------------------------------------------------------------- 1 | # Use the front controller as index file. It serves as a fallback solution when 2 | # every other rewrite/redirect fails (e.g. in an aliased environment without 3 | # mod_rewrite). Additionally, this reduces the matching process for the 4 | # start page (path "/") because otherwise Apache will apply the rewriting rules 5 | # to each configured DirectoryIndex file (e.g. index.php, index.html, index.pl). 6 | DirectoryIndex index.php 7 | 8 | # By default, Apache does not evaluate symbolic links if you did not enable this 9 | # feature in your server configuration. Uncomment the following line if you 10 | # install assets as symlinks or if you experience problems related to symlinks 11 | # when compiling LESS/Sass/CoffeScript assets. 12 | # Options FollowSymlinks 13 | 14 | # Disabling MultiViews prevents unwanted negotiation, e.g. "/index" should not resolve 15 | # to the front controller "/index.php" but be rewritten to "/index.php/index". 16 | 17 | Options -MultiViews 18 | 19 | 20 | 21 | RewriteEngine On 22 | 23 | # Determine the RewriteBase automatically and set it as environment variable. 24 | # If you are using Apache aliases to do mass virtual hosting or installed the 25 | # project in a subdirectory, the base path will be prepended to allow proper 26 | # resolution of the index.php file and to redirect to the correct URI. It will 27 | # work in environments without path prefix as well, providing a safe, one-size 28 | # fits all solution. But as you do not need it in this case, you can comment 29 | # the following 2 lines to eliminate the overhead. 30 | RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$ 31 | RewriteRule ^(.*) - [E=BASE:%1] 32 | 33 | # Sets the HTTP_AUTHORIZATION header removed by Apache 34 | RewriteCond %{HTTP:Authorization} . 35 | RewriteRule ^ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] 36 | 37 | # Redirect to URI without front controller to prevent duplicate content 38 | # (with and without `/index.php`). Only do this redirect on the initial 39 | # rewrite by Apache and not on subsequent cycles. Otherwise we would get an 40 | # endless redirect loop (request -> rewrite to front controller -> 41 | # redirect -> request -> ...). 42 | # So in case you get a "too many redirects" error or you always get redirected 43 | # to the start page because your Apache does not expose the REDIRECT_STATUS 44 | # environment variable, you have 2 choices: 45 | # - disable this feature by commenting the following 2 lines or 46 | # - use Apache >= 2.3.9 and replace all L flags by END flags and remove the 47 | # following RewriteCond (best solution) 48 | RewriteCond %{ENV:REDIRECT_STATUS} ^$ 49 | RewriteRule ^index\.php(?:/(.*)|$) %{ENV:BASE}/$1 [R=301,L] 50 | 51 | # If the requested filename exists, simply serve it. 52 | # We only want to let Apache serve files and not directories. 53 | RewriteCond %{REQUEST_FILENAME} -f 54 | RewriteRule ^ - [L] 55 | 56 | 57 | # remove www 58 | RewriteCond %{HTTP_HOST} ^www\.(.*) 59 | RewriteRule (.*) https://%1/$1 [R=301,L] 60 | 61 | #add slash after core 62 | RewriteCond %{REQUEST_URI} ^/?c/[^/]+$ 63 | RewriteRule (.*) $1/ [R=301,L] 64 | 65 | # NEED TESTS and can be moved into some controller 66 | # redirect non existing maps tiles to default image 67 | RewriteCond %{REQUEST_URI} ^/?css/i/MapQuest/.+\.(png|jpg|jpeg|gif)$ 68 | RewriteCond %{REQUEST_FILENAME} !-f 69 | RewriteRule ^.*$ /css/i/error-tile.png [L,NC] 70 | 71 | # NEED TESTS and can be moved into some controller 72 | # WebDav requests 73 | RewriteCond %{REQUEST_URI} ^/dav 74 | RewriteRule . /webdav.php [L] 75 | 76 | #redirect to default if no core specified 77 | # RewriteCond %{REQUEST_URI} !^/?c/.*$ 78 | # RewriteRule ^ %{ENV:BASE}/default.php [L] 79 | 80 | # Rewrite all other queries to the front controller. 81 | RewriteRule ^ %{ENV:BASE}/index.php [L] 82 | 83 | 84 | 85 | 86 | # When mod_rewrite is not available, we instruct a temporary redirect of 87 | # the start page to the front controller explicitly so that the website 88 | # and the generated links can still be used. 89 | RedirectMatch 302 ^/$ /index.php/ 90 | # RedirectTemp cannot be used instead 91 | 92 | 93 | -------------------------------------------------------------------------------- /web/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KETSE/casebox/0f0838fd27f30d57d45878450cc3a3e950fe2e11/web/favicon.ico -------------------------------------------------------------------------------- /web/index.php: -------------------------------------------------------------------------------- 1 | loadClassCache(); 12 | 13 | $request = Request::createFromGlobals(); 14 | $response = $kernel->handle($request); 15 | $response->send(); 16 | $kernel->terminate($request, $response); 17 | -------------------------------------------------------------------------------- /web/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KETSE/casebox/0f0838fd27f30d57d45878450cc3a3e950fe2e11/web/logo.png -------------------------------------------------------------------------------- /web/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: / 3 | --------------------------------------------------------------------------------