Commit 703af73d7a6e6b0c467033ce2fa13c25f4734c1e

Authored by Alexandre Barbosa
Committed by Sergio Oliveira
1 parent 76e57b77
Exists in master and in 79 other branches add_sisp_to_chef, add_super_archives_plugin, api_for_colab, automates_core_packing, backup_not_prod, changes_in_buttons_on_content_panel, colab_automated_login, colab_spb_plugin_recipe, colab_widgets_settings, design_validation, dev_env_minimal, disable_email_dev, fix_breadcrumbs_position, fix_categories_software_link, fix_edit_institution, fix_edit_software_with_another_license, fix_get_license_info, fix_gitlab_assets_permission, fix_list_style_inside_article, fix_list_style_on_folder_elements, fix_members_pagination, fix_merge_request_url, fix_models_translations, fix_no_license, fix_software_api, fix_software_block_migration, fix_software_communities_translations, fix_software_communities_unit_test, fix_style_create_institution_admin_panel, fix_superarchives_imports, fix_sym_links_noosfero, focus_search_field_theme, gov-user-refactoring, gov-user-refactoring-rails4, header_fix, institution_modal_on_rating, kalibro-conf-refactoring, kalibro-processor-package, lxc_settings, margin_fix, mezuro_cookbook, prezento, refactor_download_block, refactor_software_communities, refactor_software_for_sisp, register_page, release-process, release-process-v2, remove-unused-images, remove_broken_theme, remove_secondary_email_from_user, remove_sisp_buttons, removing_super_archives_email, review_message, scope2method, signals_user_noosfero, sisp_catalog_header, sisp_colab_config, sisp_dev, sisp_dev_master, sisp_simple_version, software_as_organization, software_catalog_style_fix, software_communities_html_refactor, software_infos_api, spb_minimal_env, spb_to_rails4, spec_refactor, stable-4.1, stable-4.2, stable-4.x, temp_soft_comm_refactoring, theme_header, theme_javascript_refactory, thread_dropdown, thread_page, update_search_by_categories, update_software_api, update_softwares_boxes

Convert existents Colab yaml files to py

- database config file
- logging config file
- sentry config file
- remove settings.yaml

Signed-off-by: Alexandre Barbosa <alexandreab@live.com>
Signed-off-by: Paulo Tada <paulohtfs@gmail.com>
cookbooks/colab/templates/00-database.py.erb 0 → 100644
@@ -0,0 +1,8 @@ @@ -0,0 +1,8 @@
  1 +DATABASES = {
  2 + 'default': {
  3 + 'ENGINE': 'django.db.backends.postgresql_psycopg2',
  4 + 'HOST': "<%= node['peers']['database'] %>",
  5 + 'NAME': 'colab',
  6 + 'USER': 'colab'
  7 + }
  8 +}
cookbooks/colab/templates/00-database.yaml.erb
@@ -1,6 +0,0 @@ @@ -1,6 +0,0 @@
1 -DATABASES:  
2 - default:  
3 - ENGINE: django.db.backends.postgresql_psycopg2  
4 - NAME: colab  
5 - USER: colab  
6 - HOST: <%= node['peers']['database'] %>  
cookbooks/colab/templates/02-logging.py.erb 0 → 100644
@@ -0,0 +1,26 @@ @@ -0,0 +1,26 @@
  1 +LOGGING = {
  2 + 'loggers': {
  3 + 'revproxy': {
  4 + 'handlers': ['file'],
  5 + 'level': 'ERROR'},
  6 + 'django': {
  7 + 'handlers': ['file'],
  8 + 'level': 'DEBUG'},
  9 + },
  10 + 'version': 1, 'formatters': {
  11 + 'verbose': {
  12 + 'format': '%(asctime)s (%(name)s) %(levelname)s: %(message)s'
  13 + }
  14 + },
  15 + 'disable_existing_loggers': True, 'handlers': {
  16 + 'file': {
  17 + 'level': 'DEBUG',
  18 + 'interval': 24,
  19 + 'backupCount': 7,
  20 + 'encoding': 'UTF-8',
  21 + 'formatter': 'verbose',
  22 + 'class': 'logging.handlers.TimedRotatingFileHandler',
  23 + 'filename': '/var/log/colab/colab.log'
  24 + }
  25 + }
  26 +}
cookbooks/colab/templates/02-logging.yaml.erb
@@ -1,39 +0,0 @@ @@ -1,39 +0,0 @@
1 -LOGGING:  
2 - version: 1  
3 - disable_existing_loggers: True  
4 -  
5 - formatters:  
6 - verbose:  
7 - format: '%(asctime)s (%(name)s) %(levelname)s: %(message)s'  
8 -  
9 - simple:  
10 - format: '[colab-spb] (%(name)s) %(levelname)s: %(message)s'  
11 -  
12 - handlers:  
13 - syslog:  
14 - level: WARNING  
15 - class: logging.handlers.SysLogHandler  
16 - formatter: simple  
17 - address: /dev/log  
18 -  
19 - file:  
20 - level: DEBUG  
21 - class: logging.handlers.TimedRotatingFileHandler  
22 - filename: /var/log/colab/colab.log  
23 - interval: 24 # 24 hours  
24 - backupCount: 7 # keep last 7 backups  
25 - encoding: UTF-8  
26 - formatter: verbose  
27 -  
28 - loggers:  
29 - django:  
30 - handlers:  
31 - - file  
32 - - syslog  
33 - level: DEBUG  
34 -  
35 - revproxy:  
36 - handlers:  
37 - - file  
38 - - syslog  
39 - level: ERROR  
cookbooks/colab/templates/03-sentry.py.erb 0 → 100644
@@ -0,0 +1 @@ @@ -0,0 +1 @@
  1 +RAVEN_DSN = "<%= node['config']['raven_dsn'] %>"
cookbooks/colab/templates/03-sentry.yaml.erb
@@ -1,2 +0,0 @@ @@ -1,2 +0,0 @@
1 -  
2 -RAVEN_DSN: <%= node['config']['raven_dsn'] %>  
cookbooks/colab/templates/settings.yaml.erb
@@ -1,47 +0,0 @@ @@ -1,47 +0,0 @@
1 -  
2 -## Set to false in production  
3 -DEBUG: false  
4 -TEMPLATE_DEBUG: false  
5 -  
6 -## System admins  
7 -ADMINS: &admin  
8 -<%- node['config']['admins'].each do |admin| %>  
9 - -  
10 - <%- admin.each do |item| %>  
11 - - <%= item %>  
12 - <%- end %>  
13 -<% end %>  
14 -  
15 -MANAGERS: *admin  
16 -  
17 -# general Django settings  
18 -DEFAULT_FROM_EMAIL: '<%= node['config']['colab_from_address'] %>'  
19 -  
20 -# colab-specific  
21 -COLAB_FROM_ADDRESS: '<%= node['config']['colab_from_address'] %>'  
22 -SERVER_EMAIL: '<%= node['config']['server_email'] %>'  
23 -  
24 -EMAIL_HOST: localhost  
25 -EMAIL_PORT: 25  
26 -EMAIL_SUBJECT_PREFIX: <%= node['config']['email_subject_prefix'] %>  
27 -  
28 -SECRET_KEY: <%= File.read('/etc/colab/secret.key').strip %>  
29 -  
30 -SITE_URL: <%= node['config']['site_url'] %>  
31 -BROWSERID_AUDIENCES:  
32 - - <%= node['config']['site_url'].sub('http:', 'https:') %>  
33 - - <%= node['config']['site_url'].sub('https:', 'http:') %>  
34 -  
35 -ALLOWED_HOSTS:  
36 - - <%= node['config']['external_hostname'] %>  
37 -  
38 -## Disable indexing  
39 -ROBOTS_NOINDEX: false  
40 -  
41 -## Disable planet  
42 -FEEDZILLA_ENABLED: false  
43 -  
44 -## Set URL of Colab home  
45 -COLAB_HOME_URL: '/social'  
46 -  
47 -GOOGLE_ANALYTICS_TRACKING_ID: '<%= node['config']['google_analytics_id'] %>'