Cleanup ask.openstack.org

This was retired with I8a31f8fcf9b3064c0ae58e463a6014dc14b518a7

Change-Id: Ieafac856b0feb91f41f05084aa669e2ccb92569d
This commit is contained in:
Ian Wienand 2021-06-08 14:35:28 +10:00
parent 1077849a52
commit 7de885b5ee
11 changed files with 0 additions and 1585 deletions

View File

@ -1,132 +0,0 @@
:title: Askbot
.. _askbot:
Askbot
######
Askbot is a publicly available Q&A support site for OpenStack.
At a Glance
===========
:Hosts:
* https://ask.openstack.org
:Puppet:
* https://opendev.org/opendev/puppet-askbot
* https://github.com/vamsee/puppet-solr
* :git_file:`modules/openstack_project/manifests/ask.pp`
:Projects:
* https://askbot.com
* http://lucene.apache.org/solr
* http://redis.io
Overview
========
The site ask.openstack.org based on the officially released askbot pip distribution.
The stable deployment is extended with a custom OpenStack theme available at
https://opendev.org/opendev/askbot-theme.
System Architecture
===================
::
+--------+ +----------+
| apache | ---- | mod_wsgi |
+--------+ +----------+
|
+-------------+ +---------------+
| askbot site |--- | celery daemon |
+-------------+ +---------------+
/ | \
/ | \
+-------+ +------------+ +-------------+
| redis | | postgresql | | apache solr |
+-------+ +------------+ +-------------+
Apache / mod_wsgi
-----------------
Serve the incoming http request using the mod_wsgi Python WSGI adapter, through
an SSL virtual host. The site vhost also contains url aliases to serve static
content of the theme and all uploaded image files, including the site logo.
Askbot site
-----------
The Askbot django application, the custom site specific assets live under
/srv/askbot-sites/slot0 directory, including the configuration, application
level log files, static content, custom OpenStack theme and uploaded files.
The authentication based on Google, Yahoo and Launchpad OpenID providers.
Local login and all other providers except Google, Yahoo and Launchpad are
disabled in site configuration.
The askbot-theme repository contains just the pure Sass source of the theme,
so this must be precompiled by compass Sass tool.
Application management tool can be found under /srv/askbot-sites/slot0/config:
``python manage.py <command>``
Configuration files:
* :git_file:`modules/askbot/templates/askbot.vhost.erb`
* :git_file:`modules/askbot/templates/settings.py.erb`
In addition to the file-based configuration, Askbot provides a web interface
to tweak its own settings. Toggles and fields for reputation thresholds,
user communications rules, data entry and formatting rules, keys for external
services and static content can be found at `$URL/en/settings/`.
As per Django standard, `$URL/admin` provides access to the Django
administration interface. Effectively a limited web portal to the data in the
database - but sometimes useful for debugging login problems using the
`Django_authopenid` plugin.
Celery daemon
-------------
This upstart based daemon is responsible for async tasks of the Askbot site,
and can be managed by standard service management tools:
``server askbot-celeryd <start|stop|status>``
Redis
-----
Askbot is using redis for handling local caching of configuration and page
data. It is useful to clear the redis cache with the ``FLUSHALL`` command
after a service restart.
Postgresql
----------
A postgresql database hosts the content and dynamic site configuration.
Apache Solr
-----------
Apache Solr handling the full-text indexes of the site, based on a
multi-core setup, and assigning cores for specific languages. Currently
the English (en) and Chinese (zh) languages are supported.
Solr schema templates can be found at:
* :git_file:`modules/askbot/templates/solr/schema.en.xml.erb`
* :git_file:`modules/askbot/templates/solr/schema.cn.xml.erb`
Operational notes
=================
The askbot website contains a ``surprisingly`` askbot based support forum,
and a lot of operational related information is available there. Additional
maintenance commands:
* activate virtualenv: ``source /usr/askbot-env/bin/activate``
* synchronize db schema: ``python manage.py syncdb``
* migrate database between upgrades: ``python manage.py migrate``
* rebuild solr index: ``python manage.py askbot_rebuild_index -l <language-code>``
* assign administrator right to a user: ``python manage.py add_admin <user-id>``
* update site url setting in askbot database: ``update livesettings_setting set value = '<site-url>' where "group" = 'QA_SITE_SETTINGS' and key = 'APP_URL';``

View File

@ -31,7 +31,6 @@ Major Systems
storyboard
kerberos
afs
askbot
translate
openstack-health
refstack

View File

@ -184,7 +184,6 @@ cacti_hosts:
- afsdb02.openstack.org
- afsdb03.openstack.org
- apps.openstack.org
- ask.openstack.org
- backup01.ord.rax.opendev.org
- backup02.ca-ymq-1.vexxhost.opendev.org
- bridge.openstack.org

View File

@ -49,13 +49,6 @@ all:
region_name: DFW
public_v4: 104.130.158.72
public_v6: 2001:4800:7818:104:be76:4eff:fe04:2952
ask01.openstack.org:
ansible_host: 104.239.149.165
location:
cloud: openstackci-rax
region_name: DFW
public_ipv4: 104.239.149.165
public_ipv6: 2001:4800:7819:105:be76:4eff:fe01:e6ff
backup02.ca-ymq-1.vexxhost.opendev.org:
ansible_host: 199.204.45.196
location:

View File

@ -15,7 +15,6 @@ groups:
- afsdb*.open*.org
- afs[0-9]*.open*.org
- static[0-9]*.opendev.org
ask: ask*.open*.org
borg-backup:
- etherpad[0-9]*.opendev.org
- gitea01.opendev.org
@ -26,7 +25,6 @@ groups:
# All these servers are "special-cased" in specifically
# as they are puppet and should be replaced "soon"
- ethercalc02.openstack.org
- ask01.openstack.org
- lists.openstack.org
- storyboard01.opendev.org
- translate01.openstack.org
@ -131,7 +129,6 @@ groups:
paste:
- paste[0-9]*.open*.org
puppet:
- ask*.open*.org
- cacti[0-9]*.open*.org
- elasticsearch[0-9]*.open*.org
- ethercalc[0-9]*.open*.org
@ -151,7 +148,6 @@ groups:
- wiki-dev[0-9]*.openstack.org
- wiki[0-9]*.openstack.org
puppet4:
- ask*.open*.org
- cacti[0-9]*.open*.org
- elasticsearch[0-9]*.open*.org
- ethercalc[0-9]*.open*.org
@ -195,7 +191,6 @@ groups:
translate:
- translate[0-9]*.open*.org
webservers:
- ask*.open*.org
- cacti[0-9]*.open*.org
- codesearch[0-9]*.opendev.org
- eavesdrop[0-9]*.opendev.org

View File

@ -318,21 +318,6 @@ node /^openstackid-dev\d*\.openstack\.org$/ {
}
}
# Node-OS: xenial
node /^ask\d*\.open.*\.org$/ {
class { 'openstack_project::server': }
class { 'openstack_project::ask':
db_user => hiera('ask_db_user', 'ask'),
db_password => hiera('ask_db_password'),
redis_password => hiera('ask_redis_password'),
site_ssl_cert_file_contents => hiera('ask_site_ssl_cert_file_contents', undef),
site_ssl_key_file_contents => hiera('ask_site_ssl_key_file_contents', undef),
site_ssl_chain_file_contents => hiera('ask_site_ssl_chain_file_contents', undef),
}
}
# Node-OS: xenial
node /^translate\d+\.open.*\.org$/ {
$group = "translate"

View File

@ -1,206 +0,0 @@
# == Class: openstack_project::ask
#
# ask.openstack.org Q&A support website
#
class openstack_project::ask (
$db_password,
$redis_password,
$site_ssl_cert_file_contents,
$site_ssl_key_file_contents,
$site_ssl_chain_file_contents,
$db_name = 'askbotdb',
$db_user = 'ask',
$redis_port = '6378',
$redis_max_memory = '512m',
$redis_bind = '127.0.0.1',
$solr_version = '4.10.4',
$askbot_revision = '87086ebcefc5be29e80d3228e465e6bec4523fcf'
) {
if $::lsbdistcodename == "xenial" {
# NOTE(ianw) This is a horrible, horrible hack because puppet-solr
# has not been updated to handle Xenial where jetty split into a
# jetty8 package. This equivs deb pre-depends on jetty8, and sets
# up a few links to fool (confuse?) puppet-solr enough to install
# and run...
file { '/root/jetty_1.0_all.deb':
ensure => present,
owner => 'root',
group => 'root',
mode => '0644',
source => 'puppet:///modules/openstack_project/ask/jetty_1.0_all.deb'
}
package { 'jetty':
provider => dpkg,
ensure => present,
source => "/root/jetty_1.0_all.deb",
require => File['/root/jetty_1.0_all.deb']
}
}
file { '/srv/dist':
ensure => directory,
owner => 'root',
group => 'root',
mode => '0755',
}
# solr search engine
file { '/srv/dist/solr':
ensure => directory,
owner => 'root',
group => 'root',
mode => '0755',
require => File['/srv/dist'],
}
class { 'solr':
mirror => 'https://archive.apache.org/dist/lucene/solr',
version => $solr_version,
cores => [ 'core-default', 'core-en', 'core-zh' ],
dist_root => '/srv/dist/solr',
require => File['/srv/dist/solr'],
}
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 => "/srv/dist/solr/solr-${solr_version}/contrib/analysis-extras/lucene-libs/lucene-analyzers-smartcn-${solr_version}.jar",
owner => 'root',
group => 'root',
mode => '0644',
require => [ Exec['copy-solr'], File['/srv/dist/solr'] ],
}
# postgresql database
class { 'postgresql::server': }
postgresql::server::db { $db_name:
user => $db_user,
password => postgresql_password($db_user, $db_password),
}
# Streaming backup of db; see borg-backup role
file { '/etc/borg-streams':
ensure => directory,
owner => 'root',
group => 'root',
mode => '0755',
}
file { '/etc/borg-streams/pgsql':
ensure => file,
owner => 'root',
group => 'root',
mode => '0755',
content => '/usr/bin/pg_dump -h localhost -U ask -p 5432 askbotdb',
require => File['/etc/borg-streams'],
}
# redis cache
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'],
}
# askbot site
class { 'askbot':
askbot_revision => $askbot_revision,
db_provider => 'pgsql',
db_name => $db_name,
db_user => $db_user,
db_password => $db_password,
redis_enabled => true,
redis_port => $redis_port,
redis_max_memory => $redis_max_memory,
redis_bind => $redis_bind,
redis_password => $redis_password,
custom_theme_enabled => true,
custom_theme_name => 'os',
site_name => 'ask.openstack.org',
askbot_debug => false,
solr_enabled => true,
site_ssl_enabled => true,
site_ssl_cert_file => '/etc/ssl/certs/ask.openstack.org.pem',
site_ssl_key_file => '/etc/ssl/private/ask.openstack.org.key',
site_ssl_chain_file => '/etc/ssl/certs/ask.openstack.org_ca.pem',
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,
template_settings => 'openstack_project/askbot/settings.py.erb',
}
# askbot-theme openstack theme
git { 'askbot-theme':
ensure => present,
path => '/srv/askbot-site/themes',
branch => 'master',
origin => 'https://opendev.org/opendev/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'],
}
# site backup
pgsql_backup::backup { $db_name:
database_user => $db_user,
database_password => $db_password,
require => Postgresql::Server::Db[$db_name],
num_backups => '10',
}
class { '::httpd::logrotate':
options => [
'daily',
'missingok',
'rotate 7',
'compress',
'delaycompress',
'notifempty',
'create 640 root adm',
],
postrotate => [
"if service ${::httpd::params::apache_name} status > /dev/null; then \\",
" service ${::httpd::params::apache_name} restart > /dev/null; fi; \\",
],
}
}

View File

@ -1,176 +0,0 @@
<?xml version="1.0" ?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You 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.
-->
<schema name="default" version="1.4">
<types>
<fieldtype name="string" class="solr.StrField" sortMissingLast="true" omitNorms="true"/>
<fieldType name="boolean" class="solr.BoolField" sortMissingLast="true" omitNorms="true"/>
<fieldtype name="binary" class="solr.BinaryField"/>
<!-- Numeric field types that manipulate the value into
a string value that isn't human-readable in its internal form,
but with a lexicographic ordering the same as the numeric ordering,
so that range queries work correctly. -->
<fieldType name="int" class="solr.TrieIntField" precisionStep="0" omitNorms="true" sortMissingLast="true" positionIncrementGap="0"/>
<fieldType name="float" class="solr.TrieFloatField" precisionStep="0" omitNorms="true" sortMissingLast="true" positionIncrementGap="0"/>
<fieldType name="long" class="solr.TrieLongField" precisionStep="0" omitNorms="true" sortMissingLast="true" positionIncrementGap="0"/>
<fieldType name="double" class="solr.TrieDoubleField" precisionStep="0" omitNorms="true" sortMissingLast="true" positionIncrementGap="0"/>
<fieldType name="tint" class="solr.TrieIntField" precisionStep="8" omitNorms="true" positionIncrementGap="0"/>
<fieldType name="tfloat" class="solr.TrieFloatField" precisionStep="8" omitNorms="true" positionIncrementGap="0"/>
<fieldType name="tlong" class="solr.TrieLongField" precisionStep="8" omitNorms="true" positionIncrementGap="0"/>
<fieldType name="tdouble" class="solr.TrieDoubleField" precisionStep="8" omitNorms="true" positionIncrementGap="0"/>
<fieldType name="date" class="solr.TrieDateField" omitNorms="true" precisionStep="0" positionIncrementGap="0"/>
<!-- A Trie based date field for faster date range queries and date faceting. -->
<fieldType name="tdate" class="solr.TrieDateField" omitNorms="true" precisionStep="6" positionIncrementGap="0"/>
<fieldType name="point" class="solr.PointType" dimension="2" subFieldSuffix="_d"/>
<fieldType name="location" class="solr.LatLonType" subFieldSuffix="_coordinate"/>
<fieldtype name="geohash" class="solr.GeoHashField"/>
<fieldType name="text_general" class="solr.TextField" positionIncrementGap="100">
<analyzer type="index">
<tokenizer class="solr.SmartChineseSentenceTokenizerFactory"/>
<filter class="solr.SmartChineseWordTokenFilterFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
<!-- <filter class="solr.PositionFilterFactory" /> -->
</analyzer>
<analyzer type="query">
<tokenizer class="solr.SmartChineseSentenceTokenizerFactory"/>
<filter class="solr.SmartChineseWordTokenFilterFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
<!-- <filter class="solr.PositionFilterFactory" /> -->
</analyzer>
</fieldType>
<fieldType name="text_en" class="solr.TextField" positionIncrementGap="100">
<analyzer type="index">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.StopFilterFactory"
ignoreCase="true"
words="stopwords.txt"
enablePositionIncrements="true"
/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.EnglishPossessiveFilterFactory"/>
<filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
<!-- Optionally you may want to use this less aggressive stemmer instead of PorterStemFilterFactory:
<filter class="solr.EnglishMinimalStemFilterFactory"/>
-->
<filter class="solr.PorterStemFilterFactory"/>
</analyzer>
<analyzer type="query">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
<filter class="solr.StopFilterFactory"
ignoreCase="true"
words="stopwords.txt"
enablePositionIncrements="true"
/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.EnglishPossessiveFilterFactory"/>
<filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
<!-- Optionally you may want to use this less aggressive stemmer instead of PorterStemFilterFactory:
<filter class="solr.EnglishMinimalStemFilterFactory"/>
-->
<filter class="solr.PorterStemFilterFactory"/>
</analyzer>
</fieldType>
<fieldType name="text_ws" class="solr.TextField" positionIncrementGap="100">
<analyzer>
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
</analyzer>
</fieldType>
<fieldType name="ngram" class="solr.TextField" >
<analyzer type="index">
<tokenizer class="solr.KeywordTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.NGramFilterFactory" minGramSize="3" maxGramSize="15" />
</analyzer>
<analyzer type="query">
<tokenizer class="solr.KeywordTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
</fieldType>
<fieldType name="edge_ngram" class="solr.TextField" positionIncrementGap="1">
<analyzer type="index">
<tokenizer class="solr.WhitespaceTokenizerFactory" />
<filter class="solr.LowerCaseFilterFactory" />
<filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/>
<filter class="solr.EdgeNGramFilterFactory" minGramSize="2" maxGramSize="15" side="front" />
</analyzer>
<analyzer type="query">
<tokenizer class="solr.WhitespaceTokenizerFactory" />
<filter class="solr.LowerCaseFilterFactory" />
<filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/>
</analyzer>
</fieldType>
</types>
<fields>
<field name="_version_" type="long" indexed="true" stored="true"/>
<field name="_root_" type="string" indexed="true" stored="false"/>
<!-- general -->
<field name="id" type="string" indexed="true" stored="true" multiValued="false" required="true"/>
<field name="django_ct" type="string" indexed="true" stored="true" multiValued="false"/>
<field name="django_id" type="string" indexed="true" stored="true" multiValued="false"/>
<dynamicField name="*_i" type="int" indexed="true" stored="true"/>
<dynamicField name="*_s" type="string" indexed="true" stored="true"/>
<dynamicField name="*_l" type="long" indexed="true" stored="true"/>
<dynamicField name="*_t" type="text_en" indexed="true" stored="true"/>
<dynamicField name="*_b" type="boolean" indexed="true" stored="true"/>
<dynamicField name="*_f" type="float" indexed="true" stored="true"/>
<dynamicField name="*_d" type="double" indexed="true" stored="true"/>
<dynamicField name="*_dt" type="date" indexed="true" stored="true"/>
<dynamicField name="*_p" type="location" indexed="true" stored="true"/>
<dynamicField name="*_coordinate" type="tdouble" indexed="true" stored="false"/>
<field name="thread_id" type="long" indexed="true" stored="true" multiValued="false" />
<field name="author" type="text_en" indexed="true" stored="true" multiValued="false" />
<field name="text" type="text_en" indexed="true" stored="true" multiValued="false" />
<field name="post_text" type="text_en" indexed="true" stored="true" multiValued="false" />
<field name="tags" type="text_en" indexed="true" stored="true" multiValued="true" />
<field name="title" type="text_en" indexed="true" stored="true" multiValued="false" />
</fields>
<!-- field to use to determine and enforce document uniqueness. -->
<uniqueKey>id</uniqueKey>
<!-- field for the QueryParser to use when an explicit fieldname is absent -->
<defaultSearchField>text</defaultSearchField>
<!-- SolrQueryParser configuration: defaultOperator="AND|OR" -->
<solrQueryParser defaultOperator="AND"/>
</schema>

View File

@ -1,170 +0,0 @@
<?xml version="1.0" ?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You 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.
-->
<schema name="default" version="1.4">
<types>
<fieldtype name="string" class="solr.StrField" sortMissingLast="true" omitNorms="true"/>
<fieldType name="boolean" class="solr.BoolField" sortMissingLast="true" omitNorms="true"/>
<fieldtype name="binary" class="solr.BinaryField"/>
<!-- Numeric field types that manipulate the value into
a string value that isn't human-readable in its internal form,
but with a lexicographic ordering the same as the numeric ordering,
so that range queries work correctly. -->
<fieldType name="int" class="solr.TrieIntField" precisionStep="0" omitNorms="true" sortMissingLast="true" positionIncrementGap="0"/>
<fieldType name="float" class="solr.TrieFloatField" precisionStep="0" omitNorms="true" sortMissingLast="true" positionIncrementGap="0"/>
<fieldType name="long" class="solr.TrieLongField" precisionStep="0" omitNorms="true" sortMissingLast="true" positionIncrementGap="0"/>
<fieldType name="double" class="solr.TrieDoubleField" precisionStep="0" omitNorms="true" sortMissingLast="true" positionIncrementGap="0"/>
<fieldType name="tint" class="solr.TrieIntField" precisionStep="8" omitNorms="true" positionIncrementGap="0"/>
<fieldType name="tfloat" class="solr.TrieFloatField" precisionStep="8" omitNorms="true" positionIncrementGap="0"/>
<fieldType name="tlong" class="solr.TrieLongField" precisionStep="8" omitNorms="true" positionIncrementGap="0"/>
<fieldType name="tdouble" class="solr.TrieDoubleField" precisionStep="8" omitNorms="true" positionIncrementGap="0"/>
<fieldType name="date" class="solr.TrieDateField" omitNorms="true" precisionStep="0" positionIncrementGap="0"/>
<!-- A Trie based date field for faster date range queries and date faceting. -->
<fieldType name="tdate" class="solr.TrieDateField" omitNorms="true" precisionStep="6" positionIncrementGap="0"/>
<fieldType name="point" class="solr.PointType" dimension="2" subFieldSuffix="_d"/>
<fieldType name="location" class="solr.LatLonType" subFieldSuffix="_coordinate"/>
<fieldtype name="geohash" class="solr.GeoHashField"/>
<fieldType name="text_general" class="solr.TextField" positionIncrementGap="100">
<analyzer type="index">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
</analyzer>
<analyzer type="query">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
</analyzer>
</fieldType>
<fieldType name="text_en" class="solr.TextField" positionIncrementGap="100">
<analyzer type="index">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.StopFilterFactory"
ignoreCase="true"
words="stopwords.txt"
enablePositionIncrements="true"
/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.EnglishPossessiveFilterFactory"/>
<filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
<!-- Optionally you may want to use this less aggressive stemmer instead of PorterStemFilterFactory:
<filter class="solr.EnglishMinimalStemFilterFactory"/>
-->
<filter class="solr.PorterStemFilterFactory"/>
</analyzer>
<analyzer type="query">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
<filter class="solr.StopFilterFactory"
ignoreCase="true"
words="stopwords.txt"
enablePositionIncrements="true"
/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.EnglishPossessiveFilterFactory"/>
<filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
<!-- Optionally you may want to use this less aggressive stemmer instead of PorterStemFilterFactory:
<filter class="solr.EnglishMinimalStemFilterFactory"/>
-->
<filter class="solr.PorterStemFilterFactory"/>
</analyzer>
</fieldType>
<fieldType name="text_ws" class="solr.TextField" positionIncrementGap="100">
<analyzer>
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
</analyzer>
</fieldType>
<fieldType name="ngram" class="solr.TextField" >
<analyzer type="index">
<tokenizer class="solr.KeywordTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.NGramFilterFactory" minGramSize="3" maxGramSize="15" />
</analyzer>
<analyzer type="query">
<tokenizer class="solr.KeywordTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
</fieldType>
<fieldType name="edge_ngram" class="solr.TextField" positionIncrementGap="1">
<analyzer type="index">
<tokenizer class="solr.WhitespaceTokenizerFactory" />
<filter class="solr.LowerCaseFilterFactory" />
<filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/>
<filter class="solr.EdgeNGramFilterFactory" minGramSize="2" maxGramSize="15" side="front" />
</analyzer>
<analyzer type="query">
<tokenizer class="solr.WhitespaceTokenizerFactory" />
<filter class="solr.LowerCaseFilterFactory" />
<filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/>
</analyzer>
</fieldType>
</types>
<fields>
<field name="_version_" type="long" indexed="true" stored="true"/>
<field name="_root_" type="string" indexed="true" stored="false"/>
<!-- general -->
<field name="id" type="string" indexed="true" stored="true" multiValued="false" required="true"/>
<field name="django_ct" type="string" indexed="true" stored="true" multiValued="false"/>
<field name="django_id" type="string" indexed="true" stored="true" multiValued="false"/>
<dynamicField name="*_i" type="int" indexed="true" stored="true"/>
<dynamicField name="*_s" type="string" indexed="true" stored="true"/>
<dynamicField name="*_l" type="long" indexed="true" stored="true"/>
<dynamicField name="*_t" type="text_en" indexed="true" stored="true"/>
<dynamicField name="*_b" type="boolean" indexed="true" stored="true"/>
<dynamicField name="*_f" type="float" indexed="true" stored="true"/>
<dynamicField name="*_d" type="double" indexed="true" stored="true"/>
<dynamicField name="*_dt" type="date" indexed="true" stored="true"/>
<dynamicField name="*_p" type="location" indexed="true" stored="true"/>
<dynamicField name="*_coordinate" type="tdouble" indexed="true" stored="false"/>
<field name="thread_id" type="long" indexed="true" stored="true" multiValued="false" />
<field name="author" type="text_en" indexed="true" stored="true" multiValued="false" />
<field name="text" type="text_en" indexed="true" stored="true" multiValued="false" />
<field name="post_text" type="text_en" indexed="true" stored="true" multiValued="false" />
<field name="tags" type="text_en" indexed="true" stored="true" multiValued="true" />
<field name="title" type="text_en" indexed="true" stored="true" multiValued="false" />
</fields>
<!-- field to use to determine and enforce document uniqueness. -->
<uniqueKey>id</uniqueKey>
<!-- field for the QueryParser to use when an explicit fieldname is absent -->
<defaultSearchField>text</defaultSearchField>
<!-- SolrQueryParser configuration: defaultOperator="AND|OR" -->
<solrQueryParser defaultOperator="AND"/>
</schema>

View File

@ -1,432 +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'
# 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

View File

@ -1,440 +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'
# 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': {
'ACCESS_CONTROL': {
'READ_ONLY_MODE_ENABLED': True,
'READ_ONLY_MESSAGE':
'The ask.openstack.org website will be read-only from '
'now on. Please ask questions on the <a href=\'http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-discuss\'>openstack-discuss</a> '
'mailing-list, <a href=\'https://stackoverflow.com/questions/tagged/openstack\'>stackoverflow.com</a> for coding or '
'<a href=\'https://serverfault.com/tags/openstack/info\'>serverfault.com</a> for operations.'
},
'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