diff --git a/.gitignore b/.gitignore deleted file mode 100644 index dade81e..0000000 --- a/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -Gemfile.lock -.bundled_gems/ diff --git a/Gemfile b/Gemfile deleted file mode 100644 index 019213a..0000000 --- a/Gemfile +++ /dev/null @@ -1,15 +0,0 @@ -source 'https://rubygems.org' - -if File.exists?('/home/zuul/src/git.openstack.org/openstack-infra/puppet-openstack_infra_spec_helper') - gem_checkout_method = {:path => '/home/zuul/src/git.openstack.org/openstack-infra/puppet-openstack_infra_spec_helper'} -else - gem_checkout_method = {:git => 'https://git.openstack.org/openstack-infra/puppet-openstack_infra_spec_helper'} -end -gem_checkout_method[:require] = false - -group :development, :test, :system_tests do - gem 'puppet-openstack_infra_spec_helper', - gem_checkout_method -end - -# vim:ft=ruby diff --git a/LICENSE b/LICENSE deleted file mode 100644 index d645695..0000000 --- a/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/README.md b/README.md index fb2f421..ec889a9 100644 --- a/README.md +++ b/README.md @@ -1,86 +1,9 @@ -# OpenStack Askbot +This project is no longer maintained. -Marton Kiss +The contents of this repository are still available in the Git +source code management system. To see the contents of this +repository before it reached its end of life, please check out the +previous commit with "git checkout HEAD^1". -This module manages and installs Askbot with an optional custom Sass based -theme. - -# Quick Start - - class { 'askbot': - db_provider => 'pgsql', - require => Postgresql::Server::Db[$db_name], - } - - askbot::site { 'ask.example.com': - db_name => 'askbotdb', - db_user => 'askbot', - db_password => 'changeme', - require => [ Class['redis'], Class['askbot'] ], - } - } - -# Configuration - -The Askbot puppet module is separated into individual components which Askbot -needs to run. - -## ::askbot - -A module that installs a standalone Askbot application with dependencies based -on configuration settings. This class synchronize and install the database -schema, configure the askbot-celeryd daemon required for scheduled tasks, and -finally apply a proper log rotation. - -The source of deployement is a git repository defined in askbot_repo and -askbot_revision parameters. - - class { 'askbot': - dist_root => '/srv/dist', - site_root => '/srv/askbot-site', - askbot_branch => 'master', - askbot_repo => 'https://github.com/ASKBOT/askbot-devel.git', - www_user => 'www-data', - www_group => 'www-data', - site_name => undef, - # custom theme - custom_theme_enabled => false, - custom_theme_name => undef, - # debug settings - askbot_debug => false, - # redis cache configuration - redis_enabled => false, - redis_prefix => 'askbot', - redis_port => undef, - redis_max_memory => undef, - redis_bind => undef, - redis_password => undef, - # site ssl configuration - site_ssl_enabled => false, - site_ssl_cert_file_contents => undef, - site_ssl_key_file_contents => undef, - site_ssl_chain_file_contents => undef, - site_ssl_cert_file => '', - site_ssl_key_file => '', - site_ssl_chain_file => '', - # smtp settings - smtp_host => 'localhost', - smtp_port => '25', - # database connection parameters - db_provider => 'mysql', - db_name => undef, - db_user => undef, - db_password => undef, - db_host => 'localhost', - } - -## ::askbot::compass - -A helper module to compile the Sass style sheets for a custom theme. As -OpenStack Askbot theme contains pure Sass files in the repository, for a -production deployment those files must be compiled into css. - - askbot::theme::compass { 'os': - require => Git['askbot-theme'], - before => Exec['askbot-static-generate'], - } +For any further questions, please email +service-discuss@lists.opendev.org or join #opendev on OFTC. diff --git a/Rakefile b/Rakefile deleted file mode 100644 index ff1f0d7..0000000 --- a/Rakefile +++ /dev/null @@ -1,8 +0,0 @@ -require 'rubygems' -require 'puppetlabs_spec_helper/rake_tasks' -require 'puppet-lint/tasks/puppet-lint' -PuppetLint.configuration.fail_on_warnings = true -PuppetLint.configuration.send('disable_80chars') -PuppetLint.configuration.send('disable_autoloader_layout') -PuppetLint.configuration.send('disable_class_inherits_from_params_class') -PuppetLint.configuration.send('disable_class_parameter_defaults') diff --git a/bindep.txt b/bindep.txt deleted file mode 100644 index 7cdd58e..0000000 --- a/bindep.txt +++ /dev/null @@ -1,11 +0,0 @@ -# This is a cross-platform list tracking distribution packages needed by tests; -# see http://docs.openstack.org/infra/bindep/ for additional information. - -libxml2-devel [test platform:rpm] -libxml2-dev [test platform:dpkg] -libxslt-devel [test platform:rpm] -libxslt1-dev [test platform:dpkg] -ruby-devel [test platform:rpm] -ruby-dev [test platform:dpkg] -zlib1g-dev [test platform:dpkg] -zlib-devel [test platform:rpm] diff --git a/examples/site.pp b/examples/site.pp deleted file mode 100644 index a899ab8..0000000 --- a/examples/site.pp +++ /dev/null @@ -1,139 +0,0 @@ -node 'default' { - - # Database configuration - - $db_provider = 'pgsql' - $db_name = 'askbotdb' - $db_user = 'askbot' - $db_password = 'mys3cr3tpassw0rd' - - # Redis configuration - $redis_enabled = true - $redis_port = 6378 - $redis_max_memory = '256m' - $redis_bind = '127.0.0.1' - $redis_password = 's3cr3t' - - $site_name = 'askbot-dev.local' - - $solr_version = '4.7.2' - - case $db_provider { - 'mysql': { - class { 'mysql::server': - } - - mysql::db { 'askbotdb': - user => 'askbot', - password => 's3cr3t', - host => 'localhost', - grant => ['all'], - before => Class['askbot'], - } - } - 'pgsql': { - class { 'postgresql::server': } - - postgresql::server::db { $db_name: - user => $db_user, - password => postgresql_password($db_user, $db_password), - before => Class['askbot'], - } - } - default: { - fail("Database provider ${db_provider} is not supported.") - } - } - - # redis (custom module written by tipit) - class { 'redis': - redis_port => $redis_port, - redis_max_memory => $redis_max_memory, - redis_bind => $redis_bind, - redis_password => $redis_password, - version => '2.8.4', - before => Class['askbot'], - } - - # solr search engine - class { 'solr': - mirror => 'http://apache.mesi.com.ar/lucene/solr', - version => $solr_version, - cores => [ 'core-default', 'core-en', 'core-zh' ], - } - - file { '/usr/share/solr/core-en/conf/schema.xml': - ensure => present, - content => template('openstack_project/askbot/schema.en.xml.erb'), - replace => true, - owner => 'jetty', - group => 'jetty', - mode => '0644', - require => File['/usr/share/solr/core-zh/conf'], - } - - file { '/usr/share/solr/core-zh/conf/schema.xml': - ensure => present, - content => template('openstack_project/askbot/schema.cn.xml.erb'), - replace => true, - owner => 'jetty', - group => 'jetty', - mode => '0644', - require => File['/usr/share/solr/core-en/conf'], - } - - # deploy smartcn Chinese analyzer from solr contrib/analysys-extras - file { "/usr/share/solr/WEB-INF/lib/lucene-analyzers-smartcn-${solr_version}.jar": - ensure => present, - replace => 'no', - source => "/tmp/solr-${solr_version}/contrib/analysis-extras/lucene-libs/lucene-analyzers-smartcn-${solr_version}.jar", - owner => 'root', - group => 'root', - mode => '0644', - require => Exec['copy-solr'], - } - - class { 'askbot': - db_provider => $db_provider, - db_name => $db_name, - db_user => $db_user, - db_password => $db_password, - redis_enabled => $redis_enabled, - redis_port => $redis_port, - redis_max_memory => $redis_max_memory, - redis_bind => $redis_bind, - redis_password => $redis_password, - custom_theme_enabled => false, - custom_theme_name => 'os', - site_name => $site_name, - askbot_debug => true, - solr_enabled => true, - # ssl setup - site_ssl_enabled => true, - site_ssl_cert_file => '/etc/ssl/certs/ssl-cert-snakeoil.pem', - site_ssl_key_file => '/etc/ssl/private/ssl-cert-snakeoil.key', - } - - # custom theme - git { 'askbot-theme': - ensure => present, - path => '/srv/askbot-site/themes', - branch => 'feature/development', - origin => 'https://git.openstack.org/openstack-infra/askbot-theme', - latest => true, - require => [ - File['/srv/askbot-site'], Package['git'] - ], - before => Exec['askbot-syncdb'], - notify => [ - Exec['theme-bundle-install-os'], - Exec['theme-bundle-compile-os'], - Exec['askbot-static-generate'], - ], - } - - askbot::theme::compass { 'os': - require => Git['askbot-theme'], - before => Exec['askbot-static-generate'], - } -} diff --git a/examples/solr/schema.cn.xml.erb b/examples/solr/schema.cn.xml.erb deleted file mode 100644 index 04143fc..0000000 --- a/examples/solr/schema.cn.xml.erb +++ /dev/null @@ -1,176 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id - - - text - - - - \ No newline at end of file diff --git a/examples/solr/schema.en.xml.erb b/examples/solr/schema.en.xml.erb deleted file mode 100644 index b2778f7..0000000 --- a/examples/solr/schema.en.xml.erb +++ /dev/null @@ -1,170 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id - - - text - - - - \ No newline at end of file diff --git a/manifests/config.pp b/manifests/config.pp deleted file mode 100644 index 682d4a8..0000000 --- a/manifests/config.pp +++ /dev/null @@ -1,111 +0,0 @@ -# == Class: askbot::config -# This class sets up askbot install -# -# == Parameters -# -# == Actions -class askbot::config ( - $db_password, - $redis_password, - $akismet_api_key = undef, - $askbot_debug = false, - $custom_theme_enabled = false, - $custom_theme_name = undef, - $db_host = 'localhost', - $db_name = 'askbotdb', - $db_provider = 'www-data', - $db_user = 'askbot', - $dist_root = '/srv/dist', - $redis_enabled = false, - $redis_prefix = 'askbot', - $redis_port = 6378, - $redis_max_memory = '256m', - $redis_bind = '127.0.0.1', - $site_name = 'askbot', - $site_root = '/srv/askbot-site', - $site_ssl_cert_file = '/etc/ssl/certs/ssl-cert-snakeoil.pem', - $site_ssl_cert_file_contents = undef, - $site_ssl_chain_file = undef, - $site_ssl_chain_file_contents = undef, - $site_ssl_enabled = false, - $site_ssl_key_file_contents = undef, - $site_ssl_key_file = '/etc/ssl/private/ssl-cert-snakeoil.key', - $solr_enabled = false, - $smtp_host = 'localhost', - $smtp_port = 25, - $template_settings = 'askbot/settings.py.erb', - $www_group = 'www-data', -) { - file { $site_root: - ensure => directory, - owner => 'root', - group => 'root', - mode => '0755', - } - - file { "${site_root}/upfiles": - ensure => directory, - owner => 'root', - group => $www_group, - mode => '0775', - require => File[$site_root], - } - - if $site_ssl_enabled { - class { 'askbot::site::ssl': - site_name => $site_name, - site_ssl_cert_file_contents => $site_ssl_cert_file_contents, - site_ssl_key_file_contents => $site_ssl_key_file_contents, - site_ssl_chain_file_contents => $site_ssl_chain_file_contents, - site_ssl_cert_file => $site_ssl_cert_file, - site_ssl_key_file => $site_ssl_key_file, - site_ssl_chain_file => $site_ssl_chain_file, - } - } - - class { 'askbot::site::http': - site_root => $site_root, - site_name => $site_name, - } - - class { 'askbot::site::celeryd': - site_root => $site_root, - } - - class { 'askbot::site::config': - site_root => $site_root, - dist_root => $dist_root, - db_provider => $db_provider, - db_name => $db_name, - db_user => $db_user, - db_password => $db_password, - db_host => $db_host, - askbot_debug => $askbot_debug, - smtp_port => $smtp_port, - smtp_host => $smtp_host, - redis_enabled => $redis_enabled, - redis_prefix => $redis_prefix, - redis_port => $redis_port, - redis_max_memory => $redis_max_memory, - redis_bind => $redis_bind, - redis_password => $redis_password, - custom_theme_enabled => $custom_theme_enabled, - custom_theme_name => $custom_theme_name, - solr_enabled => $solr_enabled, - template_settings => $template_settings, - } - - class { 'askbot::site::static': - site_root => $site_root, - } - - class { 'askbot::site::log': - site_root => $site_root, - www_group => $www_group, - } - - class { 'askbot::site::cron': - site_root => $site_root, - } - -} diff --git a/manifests/init.pp b/manifests/init.pp deleted file mode 100644 index 633ea98..0000000 --- a/manifests/init.pp +++ /dev/null @@ -1,176 +0,0 @@ -# == Class: askbot -# This class sets up an askbot site -# -# == Parameters -# - $www_group: group name for web writeable directories like upfiles and log -# - $www_user: user name for web process -# - $askbot_debug: set to true to enable askbot debug mode -# - $dist_root: root directory of distribution releases -# - $site_root: root directory of site config and assets -# - $site_name: fqdn of askbot site -# - $template_settings: settings.py configuration template -# -# Source repository: -# - askbot_repo: git repository of askbot source files -# - versions to checkout (askbot_revision|askbot_branch|askbot_tag) -# - askbot_revision: commit ref of askbot repo used for deployment -# - askbot_branch: branch of askbot repo -# - askbot_tag: a specific version or tag of the askbot repo -# -# Custom askbot theme settings: -# - $custom_theme_enabled: set to true to enable custom themes, default: false -# - $custom_theme_name: name of custom theme set to default -# -# Redis configuration: -# - $redis_enabled: set to true to use redis as cache backend -# - $redis_prefix: redis key prefix (required for multi-site setups) -# - $redis_port: port of redis service -# - $redis_max_memory: memory allocation for redis -# - $redis_bind: bind address of redis service -# - $redis_password: password required for redis connection -# -# SSL Settings: -# - $site_ssl_enabled: set to true for SSL based vhost -# - $site_ssl_cert_file_contents: x509 certificate in pem format -# - $site_ssl_key_file_contents: the key of site certificate in pem format -# - $site_ssl_chain_file_contents: the issuer certs of site cert (optional) -# - $site_ssl_cert_file: file name of site certificate -# - $site_ssl_key_file: file name of the site certificate's key file -# - $site_ssl_chain_file: file name of the issuer certificates -# -# Email configuration: -# - $smtp_host: hostname of smtp service used for email sending -# - $smtp_port: port of smtp service -# -# Database provider and connection details: -# - $db_provider: database provider (mysql or pgsql) -# - $db_name: database name -# - $db_user: user name required for db connection -# - $db_password: password required for db connection -# - $db_host: database host -# -# Solr support: -# - solr_enabled: set true to use solr as a search indexing engine -# -# == Actions -# -class askbot ( - $db_password, - $redis_password, - $akismet_api_key = undef, - $askbot_branch = 'master', - $askbot_debug = false, - $askbot_ensure = 'present', - $askbot_tag = undef, - $askbot_revision = undef, - $askbot_repo = 'https://github.com/ASKBOT/askbot-devel.git', - $custom_theme_enabled = false, - $custom_theme_name = undef, - $db_host = 'localhost', - $db_name = 'askbotdb', - $db_provider = 'mysql', - $db_user = 'askbot', - $dist_root = '/srv/dist', - $redis_enabled = false, - $redis_prefix = 'askbot', - $redis_port = 6378, - $redis_max_memory = '256m', - $redis_bind = '127.0.0.1', - $site_ssl_enabled = false, - $site_ssl_cert_file_contents = undef, - $site_ssl_key_file_contents = undef, - $site_ssl_chain_file_contents = undef, - $site_ssl_cert_file = '/etc/ssl/certs/ssl-cert-snakeoil.pem', - $site_ssl_key_file = '/etc/ssl/private/ssl-cert-snakeoil.key', - $site_ssl_chain_file = undef, - $site_name = 'askbot', - $site_root = '/srv/askbot-site', - $solr_enabled = false, - $smtp_host = 'localhost', - $smtp_port = '25', - $template_settings = 'askbot/settings.py.erb', - $www_group = 'www-data', - $www_user = 'www-data', -) { - - class { 'askbot::install': - db_provider => $db_provider, - dist_root => $dist_root, - askbot_repo => $askbot_repo, - askbot_revision => $askbot_revision, - redis_enabled => $redis_enabled, - solr_enabled => $solr_enabled, - } - - if !defined(File[$dist_root]) { - file { $dist_root: - ensure => directory, - owner => 'root', - group => 'root', - mode => '0755', - } - } - - if ($askbot_revision) { - git { 'askbot': - ensure => present, - path => "${dist_root}/askbot", - origin => $askbot_repo, - latest => true, - commit => $askbot_revision, - require => [ File[$dist_root], Package['git'] ], - } - } elsif ($askbot_tag) { - git { 'askbot': - ensure => present, - path => "${dist_root}/askbot", - origin => $askbot_repo, - latest => true, - tag => $askbot_tag, - require => [ File[$dist_root], Package['git'] ], - } - } else { - git { 'askbot': - ensure => present, - path => "${dist_root}/askbot", - origin => $askbot_repo, - latest => true, - branch => $askbot_branch, - require => [ File[$dist_root], Package['git'] ], - } - } - - class { 'askbot::config': - site_root => $site_root, - dist_root => $dist_root, - www_group => $www_group, - db_provider => $db_provider, - db_name => $db_name, - db_user => $db_user, - db_password => $db_password, - db_host => $db_host, - askbot_debug => $askbot_debug, - redis_enabled => $redis_enabled, - redis_prefix => $redis_prefix, - redis_port => $redis_port, - redis_max_memory => $redis_max_memory, - redis_bind => $redis_bind, - redis_password => $redis_password, - akismet_api_key => $akismet_api_key, - site_ssl_enabled => $site_ssl_enabled, - site_ssl_cert_file_contents => $site_ssl_cert_file_contents, - site_ssl_key_file_contents => $site_ssl_key_file_contents, - site_ssl_chain_file_contents => $site_ssl_chain_file_contents, - site_ssl_cert_file => $site_ssl_cert_file, - site_ssl_key_file => $site_ssl_key_file, - site_ssl_chain_file => $site_ssl_chain_file, - site_name => $site_name, - custom_theme_enabled => $custom_theme_enabled, - custom_theme_name => $custom_theme_name, - solr_enabled => $solr_enabled, - smtp_port => $smtp_port, - smtp_host => $smtp_host, - template_settings => $template_settings, - require => [ Git['askbot'], Class['askbot::install'] ], - } -} diff --git a/manifests/install.pp b/manifests/install.pp deleted file mode 100644 index af5dc24..0000000 --- a/manifests/install.pp +++ /dev/null @@ -1,152 +0,0 @@ -# == Class: askbot::install -# This class installs the required packages for askbot -class askbot::install ( - $db_provider = 'mysql', - $dist_root = '/srv/dist', - $askbot_repo = 'https://github.com/ASKBOT/askbot-devel.git', - $askbot_revision = 'master', - $redis_enabled = false, - $solr_enabled = false, -) { - - if !defined(Package['git']) { - package { 'git': - ensure => present, - } - } - - package { 'libjpeg-dev': - ensure => present, - } - - class { 'python': - pip => true, - dev => true, - } - - exec { 'create_askbot_env': - command => 'virtualenv /usr/askbot-env', - path => '/usr/local/bin:/usr/bin:/bin', - creates => '/usr/askbot-env', - } - - case $db_provider { - 'mysql': { - package { 'libmysqlclient-dev': - ensure => present, - } - - python::pip { 'MySQL-python': - ensure => '1.2.3', - pkgname => 'MySQL-python', - virtualenv => '/usr/askbot-env', - require => [ Package['libmysqlclient-dev'], Exec['create_askbot_env'] ], - } - } - 'pgsql': { - package { 'libpq-dev': - ensure => present, - } - - python::pip { 'psycopg2': - ensure => '2.4.5', - pkgname => 'psycopg2', - virtualenv => '/usr/askbot-env', - require => [ Package['libpq-dev'], Exec['create_askbot_env'] ], - } - } - default: { - fail("Unsupported database provider: ${db_provider}") - } - } - - python::pip { 'captcha': - ensure => '0.2.1', - pkgname => 'captcha', - virtualenv => '/usr/askbot-env', - require => Exec['create_askbot_env'], - } - - if $redis_enabled { - - # This seems to be the only version that works; after this start - # getting errors about CacheKey input types; you can search and find - # this is something to do with redis 3. - python::pip { 'redis': - ensure => '2.10.3', - pkgname => 'redis', - virtualenv => '/usr/askbot-env', - require => Exec['create_askbot_env'], - } - - python::pip { 'django-redis-cache': - ensure => '1.3.0', - pkgname => 'django-redis-cache', - virtualenv => '/usr/askbot-env', - require => Exec['create_askbot_env'], - } - } - - if $solr_enabled { - python::pip { 'django-haystack': - ensure => '2.3.1', - pkgname => 'django-haystack', - virtualenv => '/usr/askbot-env', - require => Exec['create_askbot_env'], - } - - python::pip { 'pysolr': - ensure => '3.3.0', - pkgname => 'pysolr', - virtualenv => '/usr/askbot-env', - require => Exec['create_askbot_env'], - } - } - - exec { 'pip-requirements-install': - path => [ '/bin', '/sbin' , '/usr/bin', '/usr/sbin', '/usr/local/bin' ], - command => "/usr/askbot-env/bin/pip install -r ${dist_root}/askbot/askbot_requirements.txt", - cwd => "${dist_root}/askbot", - logoutput => on_failure, - subscribe => Git['askbot'], - refreshonly => true, - require => Exec['create_askbot_env'], - } - - python::pip { 'stopforumspam': - ensure => '1.4.2', - pkgname => 'stopforumspam', - virtualenv => '/usr/askbot-env', - require => Exec[ 'pip-requirements-install' ], - } - - # six 1.11.0 fails with this old django, - # use an earlier one; see - # https://github.com/benjaminp/six/issues/210 - python::pip { 'six': - ensure => '1.10.0', - pkgname => 'six', - virtualenv => '/usr/askbot-env', - require => Exec['create_askbot_env'], - } - - include httpd::mod::wsgi - - exec { 'askbot-install': - path => [ '/bin', '/sbin' , '/usr/bin', '/usr/sbin', '/usr/local/bin' ], - cwd => "${dist_root}/askbot", - command => '/usr/askbot-env/bin/pip install .', - logoutput => on_failure, - before => [Exec['askbot-syncdb'], Exec['askbot-migrate'] ], - subscribe => Git['askbot'], - refreshonly => true, - require => [ - Exec['create_askbot_env'], - Exec[ 'pip-requirements-install' ], - Python::Pip[ 'six' ], - Python::Pip[ 'stopforumspam' ], - Python::Pip[ 'captcha' ], - ], - } - -} diff --git a/manifests/site/celeryd.pp b/manifests/site/celeryd.pp deleted file mode 100644 index ca9b877..0000000 --- a/manifests/site/celeryd.pp +++ /dev/null @@ -1,53 +0,0 @@ -# == Class: askbot::site::celeryd -# This class describes the askbot celery daemon configuration -class askbot::site::celeryd ( - $site_root, -) { - - if ($::operatingsystem == 'Ubuntu') and versioncmp($::operatingsystemrelease, '16.04') >= 0 { - - file { '/etc/systemd/system/askbot-celeryd.service': - ensure => present, - owner => 'root', - group => 'root', - content => template('askbot/askbot-celeryd.service.erb'), - require => Exec['askbot-migrate'], - } - - service { 'askbot-celeryd': - ensure => running, - enable => true, - hasrestart => false, - require => File['/etc/systemd/system/askbot-celeryd.service'], - } - - # This is a hack to make sure that systemd is aware of the new service - # before we attempt to start it. - exec { 'celeryd-systemd-daemon-reload': - command => '/bin/systemctl daemon-reload', - before => Service['askbot-celeryd'], - subscribe => File['/etc/systemd/system/askbot-celeryd.service'], - refreshonly => true, - } - - } else { - - file { '/etc/init/askbot-celeryd.conf': - ensure => present, - owner => 'root', - group => 'root', - mode => '0644', - content => template('askbot/celeryd.upstart.conf.erb'), - require => Exec['askbot-migrate'], - } - - service { 'askbot-celeryd': - ensure => running, - enable => true, - hasrestart => true, - require => File['/etc/init/askbot-celeryd.conf'], - subscribe => [ Exec['askbot-migrate'], File["${site_root}/config/settings.py"] ] - } - - } -} diff --git a/manifests/site/config.pp b/manifests/site/config.pp deleted file mode 100644 index 5deed7c..0000000 --- a/manifests/site/config.pp +++ /dev/null @@ -1,102 +0,0 @@ -# == Class: askbot::site::config -# This class configure and askbot site -class askbot::site::config ( - $askbot_debug, - $custom_theme_enabled, - $custom_theme_name, - $db_host, - $db_name, - $db_password, - $db_provider, - $db_user, - $redis_enabled, - $redis_prefix, - $redis_port, - $redis_max_memory, - $redis_bind, - $redis_password, - $dist_root, - $site_root, - $smtp_host, - $smtp_port, - $solr_enabled, - $template_settings, - $akismet_api_key = undef, -) { - - case $db_provider { - 'mysql': { - $db_engine = 'django.db.backends.mysql' - } - 'pgsql': { - $db_engine = 'django.db.backends.postgresql_psycopg2' - } - default: { - fail("Unsupported database provider: ${db_provider}") - } - } - - file { "${site_root}/config": - ensure => directory, - owner => 'root', - group => 'root', - mode => '0755', - require => File[$site_root], - } - - $setup_templates = [ '__init__.py', 'manage.py', 'urls.py', 'django.wsgi'] - askbot::site::setup_template { $setup_templates: - template_path => "${dist_root}/askbot/askbot/setup_templates", - dest_dir => "${site_root}/config", - require => File["${site_root}/config"], - } - - file { "${site_root}/config/settings.py": - ensure => present, - owner => 'root', - group => 'root', - mode => '0644', - content => template($template_settings), - require => File["${site_root}/config"], - } - - # post-configuration - Exec { - path => ['/bin', '/usr/bin', '/sbin', '/usr/sbin'], - logoutput => on_failure, - } - - $post_config_dependency = [ - File["${site_root}/static"], - File["${site_root}/log"], - Askbot::Site::Setup_template[ $setup_templates ], - File["${site_root}/config/settings.py"], - Git['askbot'], - ] - - exec { 'askbot-static-generate': - cwd => "${site_root}/config", - command => '/usr/askbot-env/bin/python manage.py collectstatic --noinput', - require => $post_config_dependency, - subscribe => [Git['askbot'], File["${site_root}/config/settings.py"] ], - refreshonly => true, - } - - exec { 'askbot-syncdb': - cwd => "${site_root}/config", - command => '/usr/askbot-env/bin/python manage.py syncdb --noinput', - require => $post_config_dependency, - subscribe => [Git['askbot'], File["${site_root}/config/settings.py"] ], - refreshonly => true, - } - - exec { 'askbot-migrate': - cwd => "${site_root}/config", - command => '/usr/askbot-env/bin/python manage.py migrate --noinput', - notify => [Service['askbot-celeryd'], Service['apache2'] ], - require => Exec['askbot-syncdb'], - subscribe => [Git['askbot'], File["${site_root}/config/settings.py"] ], - refreshonly => true, - } - -} diff --git a/manifests/site/cron.pp b/manifests/site/cron.pp deleted file mode 100644 index a06916e..0000000 --- a/manifests/site/cron.pp +++ /dev/null @@ -1,86 +0,0 @@ -# == Class: askbot::site::cron -# This class describes the askbot scheduled tasks -class askbot::site::cron ( - $site_root, -) { - file { "${site_root}/cron": - ensure => directory, - owner => 'root', - group => 'root', - mode => '0755', - require => File[$site_root], - } - - file { "${site_root}/cron/send_email_alerts.sh": - ensure => present, - owner => 'root', - group => 'root', - mode => '0644', - content => template('askbot/cron/send_email_alerts.sh.erb'), - require => File["${site_root}/cron"], - } - - file { "${site_root}/cron/clean_session.sh": - ensure => present, - owner => 'root', - group => 'root', - mode => '0644', - content => template('askbot/cron/clean_session.sh.erb'), - require => File["${site_root}/cron"], - } - - # 0 3 * * * - cron { 'askbot-send-email-alerts': - name => 'askbot-send-mail-alerts.cron', - command => "/bin/bash ${site_root}/cron/send_email_alerts.sh", - user => root, - minute => '0', - hour => '3', - require => [ - File["${site_root}/cron/send_email_alerts.sh"], - ] - } - - # 10 * * * * - cron { 'askbot-clean-session': - name => 'askbot-clean-session.cron', - command => "/bin/bash ${site_root}/cron/clean_session.sh", - user => root, - minute => '10', - require => [ - File["${site_root}/cron/clean_session.sh"], - ] - } - - # gzip old jetty logs - cron { 'jetty-log-gzip': - user => 'root', - hour => '1', - minute => '0', - # Jetty just outputs to a log file YYYY_mm_dd.log, thus - # we do not want to touch the current days log as that is active - command => "find /var/log/jetty \\( ! -daystart -mtime 0 \\) -a -name '*.log' -execdir gzip {} \\;", - environment => 'PATH=/usr/bin:/bin:/usr/sbin:/sbin' - } - - # remove old jetty logs - cron { 'jetty-log-cleanup': - user => 'root', - hour => '1', - minute => '30', - # because we're gzipping logs behind jetty's back, remove the old - # logs after a period. - command => "find /var/log/jetty -name '*.log.gz' -mtime +7 -execdir rm {} \\;", - environment => 'PATH=/usr/bin:/bin:/usr/sbin:/sbin' - } - - # remove old apache logs - cron { 'apache-log-cleanup': - user => 'root', - hour => '1', - minute => '45', - command => "find /var/log/apache2 -name '*.log.gz' -mtime +30 -execdir rm {} \\;", - environment => 'PATH=/usr/bin:/bin:/usr/sbin:/sbin' - } - -} diff --git a/manifests/site/http.pp b/manifests/site/http.pp deleted file mode 100644 index 58e2a02..0000000 --- a/manifests/site/http.pp +++ /dev/null @@ -1,14 +0,0 @@ -# == Class: askbot::site::http -# This class describes the http server configuration -class askbot::site::http ( - $site_name, - $site_root, - $site_template = 'askbot/askbot.vhost.erb', -) { - ::httpd::vhost { $site_name: - port => 80, - priority => 10, - docroot => $site_root, - template => $site_template, - } -} diff --git a/manifests/site/log.pp b/manifests/site/log.pp deleted file mode 100644 index ae741a7..0000000 --- a/manifests/site/log.pp +++ /dev/null @@ -1,61 +0,0 @@ -# == Class: askbot::site::log -# This class describes the askbot site log files -class askbot::site::log ( - $site_root, - $www_group, -) { - - file { "${site_root}/log": - ensure => directory, - owner => 'root', - group => $www_group, - mode => '0775', - require => File[$site_root], - } - - file { "${site_root}/log/askbot.log": - ensure => present, - replace => 'no', - owner => 'root', - group => $www_group, - mode => '0664', - require => File["${site_root}/log"], - } - - file { "${site_root}/log/clean_session.log": - ensure => present, - replace => 'no', - owner => 'root', - group => $www_group, - mode => '0664', - require => File["${site_root}/log"], - } - - include logrotate - logrotate::file { 'askbot': - log => "${site_root}/log/askbot.log", - options => [ - 'compress', - 'copytruncate', - 'missingok', - 'rotate 7', - 'daily', - 'notifempty', - ], - require => File["${site_root}/log/askbot.log"], - } - - logrotate::file { 'clean_session': - log => "${site_root}/log/clean_session.log", - options => [ - 'compress', - 'copytruncate', - 'missingok', - 'rotate 7', - 'daily', - 'notifempty', - ], - require => File["${site_root}/log/clean_session.log"], - } - -} diff --git a/manifests/site/setup_template.pp b/manifests/site/setup_template.pp deleted file mode 100644 index 043aa5d..0000000 --- a/manifests/site/setup_template.pp +++ /dev/null @@ -1,21 +0,0 @@ -# Define: askbot::helper::template_file -# -# Define a setup_templates file, cloned from a template -# directory. -# -# Parameters: -# - $template_path: root directory of setup_templates. -# - $dest_dir: destination directory of target files. -# -define askbot::site::setup_template ( - $dest_dir, - $template_path, -) { - file { "${dest_dir}/${name}": - ensure => present, - owner => 'root', - group => 'root', - mode => '0644', - source => "${template_path}/${name}", - } -} diff --git a/manifests/site/ssl.pp b/manifests/site/ssl.pp deleted file mode 100644 index 5b2b36e..0000000 --- a/manifests/site/ssl.pp +++ /dev/null @@ -1,46 +0,0 @@ -# == Class: askbot::site::ssl -# This class describes the http server's SSL configuration -class askbot::site::ssl ( - $site_name, - $site_ssl_cert_file = '/etc/ssl/certs/ssl-cert-snakeoil.pem', - $site_ssl_cert_file_contents = undef, - $site_ssl_chain_file = undef, - $site_ssl_chain_file_contents = undef, - $site_ssl_key_file = '/etc/ssl/private/ssl-cert-snakeoil.key', - $site_ssl_key_file_contents = undef, -) { - include httpd::ssl - - # site x509 certificate - if $site_ssl_cert_file_contents != undef { - file { $site_ssl_cert_file: - owner => 'root', - group => 'root', - mode => '0640', - content => $site_ssl_cert_file_contents, - before => Httpd::Vhost[$site_name], - } - } - - # site ssl key - if $site_ssl_key_file_contents != undef { - file { $site_ssl_key_file: - owner => 'root', - group => 'root', - mode => '0640', - content => $site_ssl_key_file_contents, - before => Httpd::Vhost[$site_name], - } - } - - # site ca certificates file - if $site_ssl_chain_file_contents != undef { - file { $site_ssl_chain_file: - owner => 'root', - group => 'root', - mode => '0640', - content => $site_ssl_chain_file_contents, - before => Httpd::Vhost[$site_name], - } - } -} diff --git a/manifests/site/static.pp b/manifests/site/static.pp deleted file mode 100644 index e35d847..0000000 --- a/manifests/site/static.pp +++ /dev/null @@ -1,13 +0,0 @@ -# == Class: askbot::site::static -# This class describes askbot site static files -class askbot::site::static ( - $site_root, -) { - file { "${site_root}/static": - ensure => directory, - owner => 'root', - group => 'root', - mode => '0755', - require => File[$site_root], - } -} diff --git a/manifests/theme/compass.pp b/manifests/theme/compass.pp deleted file mode 100644 index b4b0f58..0000000 --- a/manifests/theme/compass.pp +++ /dev/null @@ -1,55 +0,0 @@ -# Define: askbot::theme::compass -# -# This class installs the Ruby based bundler command and compiles -# the Sass files of a custom theme. The theme must contain a -# proper Gemfile to define compass version and dependencies. -# -# Actions: -# - Install Ruby / Compass -# - Compile Sass files into Css stylesheets -# -define askbot::theme::compass( -) { - if $::lsbdistcodename == 'precise' { - # add ruby, bundler packages if not defined somewhere else - if ! defined(Package['rubygems']) { - package { 'rubygems': - ensure => present, - } - } - - if ! defined(Package['bundler']) { - package { 'bundler': - ensure => latest, - provider => gem, - require => Package['rubygems'], - } - } - } else { - # add bundler as a debian package - package { 'bundler': - ensure => latest, - } - } - - # install bundle requirements in Gemfiles, compile Sass - exec { "theme-bundle-install-${name}": - cwd => '/srv/askbot-site/themes', - path => ['/bin', '/usr/bin', '/sbin', '/usr/sbin', '/usr/local/bin'], - logoutput => on_failure, - command => 'bundle install', - require => Package['bundler'], - refreshonly => true, - } - - exec { "theme-bundle-compile-${name}": - cwd => '/srv/askbot-site/themes', - path => ['/bin', '/usr/bin', '/sbin', '/usr/sbin', '/usr/local/bin'], - logoutput => on_failure, - command => 'bundle exec compass compile', - require => Exec["theme-bundle-install-${name}"], - refreshonly => true, - notify => Exec['askbot-static-generate'], - } - -} diff --git a/metadata.json b/metadata.json deleted file mode 100644 index ef4a1b7..0000000 --- a/metadata.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "name": "openstackinfra-askbot", - "version": "0.0.2", - "author": "Openstack CI", - "summary": "Puppet module for askbot", - "license": "Apache 2.0", - "source": "https://git.openstack.org/openstack-infra/puppet-askbot.git", - "project_page": "http://docs.openstack.org/infra/system-config/", - "issues_url": "https://storyboard.openstack.org/#!/project/767", - "operatingsystem_support": [ - { "operatingsystem": "Ubuntu", - "operatingsystemrelease": [ - "12.04", - "14.04" - ] - } - ], - "requirements": [ - { "name": "pe", "version_requirement": ">= 3.2.0 < 3.4.0" }, - { "name": "puppet", "version_requirement": "3.x" } - ], - "dependencies": [ - { "name": "puppetlabs/stdlib", "version_requirement": ">= 3.2.0" }, - { "name": "puppetlabs/mysql", "version_requirement": ">= 0.6.1" }, - { "name": "openstackinfra/httpd", "version_requirement": "0.x" }, - { "name": "openstackinfra/redis", "version_requirement": ">= 0.0.1" }, - { "name": "stankevich/python", "version_requirement": ">= 1.9.4" }, - { "name": "puppet-community/git_resource", "version_requirement": "= 0.3.0" } - ] -} diff --git a/spec/acceptance/nodesets/default.yml b/spec/acceptance/nodesets/default.yml deleted file mode 100644 index 3bb3e62..0000000 --- a/spec/acceptance/nodesets/default.yml +++ /dev/null @@ -1,11 +0,0 @@ -HOSTS: - ubuntu-server-1404-x64: - roles: - - master - platform: ubuntu-14.04-amd64 - box: puppetlabs/ubuntu-14.04-64-nocm - box_url: https://vagrantcloud.com/puppetlabs/ubuntu-14.04-64-nocm - hypervisor: vagrant -CONFIG: - log_level: debug - type: git diff --git a/spec/acceptance/nodesets/nodepool-centos7.yml b/spec/acceptance/nodesets/nodepool-centos7.yml deleted file mode 100644 index c552874..0000000 --- a/spec/acceptance/nodesets/nodepool-centos7.yml +++ /dev/null @@ -1,10 +0,0 @@ -HOSTS: - centos-70-x64: - roles: - - master - platform: el-7-x86_64 - hypervisor: none - ip: 127.0.0.1 -CONFIG: - type: foss - set_env: false diff --git a/spec/acceptance/nodesets/nodepool-trusty.yml b/spec/acceptance/nodesets/nodepool-trusty.yml deleted file mode 100644 index 9fc624e..0000000 --- a/spec/acceptance/nodesets/nodepool-trusty.yml +++ /dev/null @@ -1,10 +0,0 @@ -HOSTS: - ubuntu-14.04-amd64: - roles: - - master - platform: ubuntu-14.04-amd64 - hypervisor: none - ip: 127.0.0.1 -CONFIG: - type: foss - set_env: false diff --git a/spec/acceptance/nodesets/nodepool-xenial.yml b/spec/acceptance/nodesets/nodepool-xenial.yml deleted file mode 100644 index 99dd318..0000000 --- a/spec/acceptance/nodesets/nodepool-xenial.yml +++ /dev/null @@ -1,10 +0,0 @@ -HOSTS: - ubuntu-16.04-amd64: - roles: - - master - platform: ubuntu-16.04-amd64 - hypervisor: none - ip: 127.0.0.1 -CONFIG: - type: foss - set_env: false diff --git a/templates/askbot-celeryd.service.erb b/templates/askbot-celeryd.service.erb deleted file mode 100644 index 6fa26e4..0000000 --- a/templates/askbot-celeryd.service.erb +++ /dev/null @@ -1,14 +0,0 @@ -[Unit] -Description=Celery Service -After=network.target - -[Service] -Type=simple -User=www-data -Group=www-data -WorkingDirectory=/srv/askbot-site/config -ExecStart=/usr/askbot-env/bin/python manage.py celeryd -c 5 --maxtasksperchild=1000 --time-limit=30 -ExecStop=/bin/kill -INT $MAINPID - -[Install] -WantedBy=multi-user.target diff --git a/templates/askbot.vhost.erb b/templates/askbot.vhost.erb deleted file mode 100644 index 1ab7bf4..0000000 --- a/templates/askbot.vhost.erb +++ /dev/null @@ -1,55 +0,0 @@ -# ************************************ -# Askbot vhost template -# Managed by Puppet -# ************************************ - -WSGIRestrictStdout On -WSGIRestrictSignal Off - -NameVirtualHost <%= @vhost_name %>:80 -:80> -<% if scope.lookupvar('::askbot::config::site_ssl_enabled') %> - ServerName <%= @srvname %> - Redirect / https://<%= @srvname %>/ - - -NameVirtualHost <%= @vhost_name %>:443 -:443> - SSLEngine on - SSLProtocol All -SSLv2 -SSLv3 - SSLCertificateFile <%= scope.lookupvar('::askbot::config::site_ssl_cert_file') %> - SSLCertificateKeyFile <%= scope.lookupvar('::askbot::config::site_ssl_key_file') %> -<% if ![nil, :undef].include?(scope.lookupvar('::askbot::config::site_ssl_chain_file_contents')) %> - SSLCertificateChainFile <%= scope.lookupvar('::askbot::config::site_ssl_chain_file') %> -<% end %> -<% end %> - ServerName <%= @srvname %> - # DocumentRoot <%= @docroot %> - - # media files - Alias /m/ <%= @docroot %>/static/ - /static/> - Require all granted - - - # uploaded files - Alias /upfiles/ <%= @docroot %>/upfiles/ - /upfiles/> - Require all granted - - - # wsgi daemon - WSGIDaemonProcess askbot user=<%= scope.lookupvar('::askbot::www_user') %> group=<%= scope.lookupvar('::askbot::www_group') %> maximum-requests=1000 display-name=askbot processes=2 threads=1 shutdown-timeout=10 python-path=<%= @docroot %>:/usr/askbot-env/lib/python2.7/site-packages - - WSGIScriptAlias / <%= @docroot %>/config/django.wsgi - - - WSGIProcessGroup askbot - Require all granted - - - ErrorLog /var/log/apache2/<%= @name %>_error.log - LogLevel warn - CustomLog /var/log/apache2/<%= @name %>_access.log combined - ServerSignature Off - diff --git a/templates/celeryd.upstart.conf.erb b/templates/celeryd.upstart.conf.erb deleted file mode 100644 index c9a4903..0000000 --- a/templates/celeryd.upstart.conf.erb +++ /dev/null @@ -1,12 +0,0 @@ -description "Askbot celeryd service" -author "Marton Kiss " - -start on runlevel [2345] -stop on runlevel [016] - -kill timeout 30 -respawn -script - chdir /srv/askbot-site/config - exec su -s /bin/sh -c 'exec "$0" "$@"' www-data -- /usr/askbot-env/bin/python manage.py celeryd -c 5 --maxtasksperchild=1000 --time-limit=30 -end script diff --git a/templates/cron/clean_session.sh.erb b/templates/cron/clean_session.sh.erb deleted file mode 100644 index 02a1621..0000000 --- a/templates/cron/clean_session.sh.erb +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -cd <%= @site_root %>/config -DATE=`date --rfc-3339=seconds` -echo "Start clean session run at $DATE" >><%= @site_root %>/log/clean_session.log -/usr/askbot-env/bin/python manage.py clean_session >><%= @site_root %>/log/clean_session.log -DATE=`date --rfc-3339=seconds` -echo "End clean session run at $DATE" >><%= @site_root %>/log/clean_session.log diff --git a/templates/cron/send_email_alerts.sh.erb b/templates/cron/send_email_alerts.sh.erb deleted file mode 100644 index 1698967..0000000 --- a/templates/cron/send_email_alerts.sh.erb +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -cd <%= @site_root %>/config -/usr/askbot-env/bin/python manage.py send_email_alerts \ No newline at end of file diff --git a/templates/settings.py.erb b/templates/settings.py.erb deleted file mode 100644 index be58277..0000000 --- a/templates/settings.py.erb +++ /dev/null @@ -1,436 +0,0 @@ -## Django settings for ASKBOT enabled project. -import os.path -import logging -import sys -import askbot -import site - -#this line is added so that we can import pre-packaged askbot dependencies -ASKBOT_ROOT = os.path.abspath(os.path.dirname(askbot.__file__)) -site.addsitedir(os.path.join(ASKBOT_ROOT, 'deps')) - -DEBUG = <%if @askbot_debug %>True<%else%>False<%end%> # set to True to enable debugging -TEMPLATE_DEBUG = False # keep false when debugging jinja2 templates -INTERNAL_IPS = ('127.0.0.1',) -ALLOWED_HOSTS = ['*',]#change this for better security on your site - -ADMINS = ( - ('Your Name', 'your_email@domain.com'), -) - -MANAGERS = ADMINS - -DATABASES = { - 'default': { - 'ENGINE': '<%= @db_engine %>', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. - 'NAME': '<%= @db_name %>', # Or path to database file if using sqlite3. - 'USER': '<%= @db_user %>', # Not used with sqlite3. - 'PASSWORD': '<%= @db_password %>', # Not used with sqlite3. - 'HOST': '<%= @db_host %>', # Set to empty string for localhost. Not used with sqlite3. - 'PORT': '', # Set to empty string for default. Not used with sqlite3. - 'TEST_CHARSET': 'utf8', # Setting the character set and collation to utf-8 - 'TEST_COLLATION': 'utf8_general_ci', # is necessary for MySQL tests to work properly. - } -} - -#outgoing mail server settings -SERVER_EMAIL = 'noreply@openstack.org' -DEFAULT_FROM_EMAIL = 'noreply@openstack.org' -EMAIL_HOST_USER = '' -EMAIL_HOST_PASSWORD = '' -EMAIL_SUBJECT_PREFIX = '' -EMAIL_HOST='<%= @smtp_host %>' -EMAIL_PORT='<%= @smtp_port %>' -EMAIL_USE_TLS=False -#EMAIL_BACKEND = 'django.core.mail.backends.dummy.EmailBackend' -EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' - -#incoming mail settings -#after filling out these settings - please -#go to the site's live settings and enable the feature -#"Email settings" -> "allow asking by email" -# -# WARNING: command post_emailed_questions DELETES all -# emails from the mailbox each time -# do not use your personal mail box here!!! -# -IMAP_HOST = '' -IMAP_HOST_USER = '' -IMAP_HOST_PASSWORD = '' -IMAP_PORT = '' -IMAP_USE_TLS = False - -# Local time zone for this installation. Choices can be found here: -# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name -# although not all choices may be available on all operating systems. -# On Unix systems, a value of None will cause Django to use the same -# timezone as the operating system. -# If running in a Windows environment this must be set to the same as your -# system time zone. -TIME_ZONE = 'America/Chicago' - -SITE_ID = 1 - -# If you set this to False, Django will make some optimizations so as not -# to load the internationalization machinery. -USE_I18N = True -LANGUAGE_CODE = 'en' - -# Absolute path to the directory that holds uploaded media -# Example: "/home/media/media.lawrence.com/" -#MEDIA_ROOT = os.path.join(os.path.dirname(__file__), 'askbot', 'upfiles') -MEDIA_ROOT = '/srv/askbot-site/upfiles' -MEDIA_URL = '/upfiles/' -STATIC_URL = '/m/'#this must be different from MEDIA_URL - -PROJECT_ROOT = os.path.dirname(__file__) -STATIC_ROOT = os.path.join(PROJECT_ROOT, 'static') - -# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a -# trailing slash. -# Examples: "http://foo.com/media/", "/media/". -ADMIN_MEDIA_PREFIX = STATIC_URL + 'admin/' - -# Make up some unique string, and don't share it with anybody. -SECRET_KEY = '44fb9b7219e3743bffabb6861cbc9a28' - -<% if @akismet_api_key != nil -%> -# To help mitigate spam, Akismet integration needs the API key for your account -AKISMET_API_KEY = '<%= @akismet_api_key %>' -<% end -%> - -# List of callables that know how to import templates from various sources. -TEMPLATE_LOADERS = ( - 'askbot.skins.loaders.Loader', - 'askbot.skins.loaders.JinjaAppDirectoryLoader', - 'django.template.loaders.app_directories.Loader', - 'django.template.loaders.filesystem.Loader', - #'django.template.loaders.eggs.load_template_source', -) - - -MIDDLEWARE_CLASSES = ( - #'django.middleware.gzip.GZipMiddleware', - #'askbot.middleware.locale.LocaleMiddleware', - 'django.middleware.locale.LocaleMiddleware', - 'django.contrib.sessions.middleware.SessionMiddleware', - 'django.contrib.messages.middleware.MessageMiddleware', - #'django.middleware.cache.UpdateCacheMiddleware', - 'django.middleware.common.CommonMiddleware', - #'django.middleware.cache.FetchFromCacheMiddleware', - 'django.contrib.auth.middleware.AuthenticationMiddleware', - 'stopforumspam.middleware.StopForumSpamMiddleware', - #'django.middleware.sqlprint.SqlPrintingMiddleware', - - #below is askbot stuff for this tuple - 'askbot.middleware.anon_user.ConnectToSessionMessagesMiddleware', - 'askbot.middleware.forum_mode.ForumModeMiddleware', - 'askbot.middleware.cancel.CancelActionMiddleware', - 'django.middleware.transaction.TransactionMiddleware', - #'debug_toolbar.middleware.DebugToolbarMiddleware', - 'askbot.middleware.view_log.ViewLogMiddleware', - 'askbot.middleware.spaceless.SpacelessMiddleware', - 'askbot.middleware.csrf.CsrfViewMiddleware', -) - - - -ROOT_URLCONF = os.path.basename(os.path.dirname(__file__)) + '.urls' - - -#UPLOAD SETTINGS -FILE_UPLOAD_TEMP_DIR = os.path.join( - os.path.dirname(__file__), - 'tmp' - ).replace('\\','/') - -FILE_UPLOAD_HANDLERS = ( - 'django.core.files.uploadhandler.MemoryFileUploadHandler', - 'django.core.files.uploadhandler.TemporaryFileUploadHandler', -) -ASKBOT_ALLOWED_UPLOAD_FILE_TYPES = ('.jpg', '.jpeg', '.gif', '.bmp', '.png', '.tiff') -ASKBOT_MAX_UPLOAD_FILE_SIZE = 1024 * 1024 #result in bytes -DEFAULT_FILE_STORAGE = 'django.core.files.storage.FileSystemStorage' - - -#TEMPLATE_DIRS = (,) #template have no effect in askbot, use the variable below -#ASKBOT_EXTRA_SKINS_DIR = #path to your private skin collection -#take a look here http://askbot.org/en/question/207/ - -<% if @custom_theme_enabled %> -ASKBOT_EXTRA_SKINS_DIR = '<%= @site_root %>/themes' -<% end %> - -TEMPLATE_CONTEXT_PROCESSORS = ( - 'django.core.context_processors.request', - 'askbot.context.application_settings', - #'django.core.context_processors.i18n', - 'askbot.user_messages.context_processors.user_messages',#must be before auth - 'django.contrib.auth.context_processors.auth', #this is required for the admin app - 'django.core.context_processors.csrf', #necessary for csrf protection - 'askbot.deps.group_messaging.context.group_messaging_context', -) - - -INSTALLED_APPS = ( - 'longerusername', - 'django.contrib.auth', - 'django.contrib.contenttypes', - 'django.contrib.sessions', - 'django.contrib.sites', - 'django.contrib.staticfiles', - - #all of these are needed for the askbot - 'django.contrib.admin', - 'django.contrib.humanize', - 'django.contrib.sitemaps', - 'django.contrib.messages', - #'debug_toolbar', -<% if @solr_enabled %> - #Optional, to enable haystack search - 'haystack', -<% end %> - 'compressor', - 'askbot', - 'askbot.deps.django_authopenid', - #'askbot.importers.stackexchange', #se loader - 'south', - 'askbot.deps.livesettings', - 'keyedcache', - 'robots', - 'django_countries', - 'djcelery', - 'djkombu', - 'followit', - 'tinymce', - 'group_messaging', - 'captcha', - #'avatar',#experimental use git clone git://github.com/ericflo/django-avatar.git$ -) - -NOCAPTCHA = True - -#setup memcached for production use! -#see http://docs.djangoproject.com/en/1.1/topics/cache/ for details -CACHE_BACKEND = 'locmem://' - -#needed for django-keyedcache -CACHE_TIMEOUT = 6000 -#sets a special timeout for livesettings if you want to make them different -LIVESETTINGS_CACHE_TIMEOUT = CACHE_TIMEOUT -#CACHE_PREFIX = 'askbot' #make this unique -CACHE_MIDDLEWARE_ANONYMOUS_ONLY = True -#If you use memcache you may want to uncomment the following line to enable memcached based sessions -#SESSION_ENGINE = 'django.contrib.sessions.backends.cached_db' - -<% if @redis_enabled %> -CACHES = { - 'default': { - 'BACKEND': 'redis_cache.RedisCache', - 'LOCATION': '<%= @redis_bind %>:<%= @redis_port %>', - 'KEY_PREFIX': '<%= @redis_prefix %>', #make unique same as db - 'OPTIONS': { - 'DB': 1, - 'PASSWORD': '<%= @redis_password %>', - # 'PARSER_CLASS': 'redis.connection.HiredisParser' - } - } -} -<%end%> - -AUTHENTICATION_BACKENDS = ( - 'django.contrib.auth.backends.ModelBackend', - 'askbot.deps.django_authopenid.backends.AuthBackend', -) - -#logging settings -LOG_FILENAME = 'askbot.log' -logging.basicConfig( - filename=os.path.join('<%= @site_root %>/log', LOG_FILENAME), - level=logging.CRITICAL, - format='%(pathname)s TIME: %(asctime)s MSG: %(filename)s:%(funcName)s:%(lineno)d %(message)s', -) - -########################### -# -# this will allow running your forum with url like http://site.com/forum -# -# ASKBOT_URL = 'forum/' -# -ASKBOT_URL = '' #no leading slash, default = '' empty string -ASKBOT_TRANSLATE_URL = False #translate specific URLs -_ = lambda v:v #fake translation function for the login url -LOGIN_URL = '/%s%s%s' % (ASKBOT_URL,_('account/'),_('signin/')) -LOGIN_REDIRECT_URL = ASKBOT_URL #adjust, if needed -#note - it is important that upload dir url is NOT translated!!! -#also, this url must not have the leading slash -ALLOW_UNICODE_SLUGS = False -ASKBOT_USE_STACKEXCHANGE_URLS = False #mimic url scheme of stackexchange - -#Celery Settings -BROKER_TRANSPORT = "djkombu.transport.DatabaseTransport" -CELERY_ALWAYS_EAGER = False - -import djcelery -djcelery.setup_loader() -DOMAIN_NAME = '' - -CSRF_COOKIE_NAME = '_csrf' -#https://docs.djangoproject.com/en/1.3/ref/contrib/csrf/ -#CSRF_COOKIE_DOMAIN = DOMAIN_NAME - -STATIC_ROOT = os.path.join(PROJECT_ROOT, "static") -STATIC_ROOT = '<%= @site_root %>/static' -STATICFILES_DIRS = ( - ('default/media', os.path.join(ASKBOT_ROOT, 'media')), - <% if @custom_theme_enabled %>'<%= @site_root %>/themes',<% end %> -) -STATICFILES_FINDERS = ( - 'django.contrib.staticfiles.finders.FileSystemFinder', - 'django.contrib.staticfiles.finders.AppDirectoriesFinder', - 'compressor.finders.CompressorFinder', -) - -RECAPTCHA_USE_SSL = True - -#HAYSTACK_SETTINGS -ENABLE_HAYSTACK_SEARCH = False -#Uncomment for multilingual setup: -#HAYSTACK_ROUTERS = ['askbot.search.haystack.routers.LanguageRouter',] - -#Uncomment if you use haystack -#More info in http://django-haystack.readthedocs.org/en/latest/settings.html -#HAYSTACK_CONNECTIONS = { -# 'default': { -# 'ENGINE': 'haystack.backends.simple_backend.SimpleEngine', -# } -#} - -<% if @solr_enabled %> -#HAYSTACK_SETTINGS -# -# Notice: -# the default and default_en url must match to avoid a bug -# in r0.7.53 that broke the working model of UI search and -# cli indexing. -ENABLE_HAYSTACK_SEARCH = True - -HAYSTACK_ROUTERS = ['askbot.search.haystack.routers.LanguageRouter',] - -HAYSTACK_CONNECTIONS = { - 'default': { - 'ENGINE': 'haystack.backends.solr_backend.SolrEngine', - 'URL': 'http://127.0.0.1:8983/solr/core-en' - }, - 'default_en': { - 'ENGINE': 'haystack.backends.solr_backend.SolrEngine', - 'URL': 'http://127.0.0.1:8983/solr/core-en' - }, - 'default_zh': { - 'ENGINE': 'haystack.backends.solr_backend.SolrEngine', - 'URL': 'http://127.0.0.1:8983/solr/core-zh' - }, -} - -HAYSTACK_SIGNAL_PROCESSOR = 'askbot.search.haystack.signals.AskbotRealtimeSignalProcessor' -<% end %> - - -TINYMCE_COMPRESSOR = True -TINYMCE_SPELLCHECKER = False -TINYMCE_JS_ROOT = os.path.join(STATIC_ROOT, 'default/media/tinymce/') -#TINYMCE_JS_URL = STATIC_URL + 'default/media/js/tinymce/tiny_mce.js' -TINYMCE_DEFAULT_CONFIG = { - 'plugins': 'askbot_imageuploader,askbot_attachment', - 'convert_urls': False, - 'theme': 'advanced', - 'content_css': STATIC_URL + 'default/media/style/tinymce/content.css', - 'force_br_newlines': True, - 'force_p_newlines': False, - 'forced_root_block': '', - 'mode' : 'textareas', - 'oninit': "TinyMCE.onInitHook", - 'plugins': 'askbot_imageuploader,askbot_attachment', - 'theme_advanced_toolbar_location' : 'top', - 'theme_advanced_toolbar_align': 'left', - 'theme_advanced_buttons1': 'bold,italic,underline,|,bullist,numlist,|,undo,redo,|,link,unlink,askbot_imageuploader,askbot_attachment', - 'theme_advanced_buttons2': '', - 'theme_advanced_buttons3' : '', - 'theme_advanced_path': False, - 'theme_advanced_resizing': True, - 'theme_advanced_resize_horizontal': False, - 'theme_advanced_statusbar_location': 'bottom', - 'editor_deselector': 'mceNoEditor', - 'width': '100%', - 'height': '250' -} - -LIVESETTINGS_OPTIONS = { - 1: { - 'DB': True, - 'SETTINGS': { - 'GENERAL_SKIN_SETTINGS': { - <% if @custom_theme_enabled %> - 'ASKBOT_DEFAULT_SKIN': '<%= @custom_theme_name %>', - <%end%> - 'SHOW_LOGO': True - }, - 'LOGIN_PROVIDERS': { - 'SIGNIN_MOZILLA_PERSONA_ENABLED': False, - 'SIGNIN_ALWAYS_SHOW_LOCAL_LOGIN': False, - 'SIGNIN_LOCAL_ENABLED': False, - 'SIGNIN_AOL_ENABLED': False, - 'SIGNIN_LIVEJOURNAL_ENABLED': False, - 'SIGNIN_VERISIGN_ENABLED': False, - 'SIGNIN_IDENTI.CA_ENABLED': False, - 'SIGNIN_WORDPRESS_ENABLED': False, - 'SIGNIN_CLAIMID_ENABLED': False, - 'SIGNIN_TECHNORATI_ENABLED': False, - 'SIGNIN_TWITTER_ENABLED': False, - 'SIGNIN_VIDOOP_ENABLED': False, - 'SIGNIN_BLOGGER_ENABLED': False, - 'SIGNIN_LINKEDIN_ENABLED': False, - 'SIGNIN_FLICKR_ENABLED': False, - 'SIGNIN_FACEBOOK_ENABLED': False, - 'SIGNIN_LAUNCHPAD_ENABLED': True, - 'SIGNIN_OPENID_ENABLED': True - } - }, - } -} - -#delayed notifications, time in seconds, 15 mins by default -NOTIFICATION_DELAY_TIME = 60 * 15 - -GROUP_MESSAGING = { - 'BASE_URL_GETTER_FUNCTION': 'askbot.models.user_get_profile_url', - 'BASE_URL_PARAMS': {'section': 'messages', 'sort': 'inbox'} -} - -ASKBOT_LANGUAGE_MODE = 'url-lang' - -LANGUAGES = ( - ('en', 'English'), - ('zh', 'Chinese'), -) -COUNTRY_CODES = { - 'en': 'us', - 'zh': 'cn', -} - -ASKBOT_CSS_DEVEL = False -if 'ASKBOT_CSS_DEVEL' in locals() and ASKBOT_CSS_DEVEL == True: - COMPRESS_PRECOMPILERS = ( - ('text/less', 'lessc {infile} {outfile}'), - ) - -COMPRESS_JS_FILTERS = [] -COMPRESS_PARSER = 'compressor.parser.HtmlParser' -JINJA2_EXTENSIONS = ('compressor.contrib.jinja2ext.CompressorExtension',) -JINJA2_TEMPLATES = ('captcha',) - -# Use syncdb for tests instead of South migrations. Without this, some tests -# fail spuriously in MySQL. -SOUTH_TESTS_MIGRATE = False - -VERIFIER_EXPIRE_DAYS = 3