Attachment 'production.py'

Download

   1 #-*- coding: utf-8 -*-
   2 """
   3 Django settings for HyperKitty + Postorius
   4 """
   5 
   6 import os
   7 BASE_DIR = os.path.dirname(os.path.abspath(__file__))
   8 VAR_DIR = "/var/spool"
   9 
  10 # SECURITY WARNING: keep the secret key used in production secret!
  11 SECRET_KEY = 'change-that-at-install-time'
  12 
  13 # SECURITY WARNING: don't run with debug turned on in production!
  14 DEBUG = False
  15 
  16 ADMINS = (
  17      ('Mailman Admin', 'root@localhost'),
  18 )
  19 
  20 # Hosts/domain names that are valid for this site; required if DEBUG is False
  21 # See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts
  22 ALLOWED_HOSTS = ["localhost"]
  23 # And for BrowserID too, see
  24 # http://django-browserid.rtfd.org/page/user/settings.html#django.conf.settings.BROWSERID_AUDIENCES
  25 BROWSERID_AUDIENCES = [ "http://localhost", "http://localhost:8000" ]
  26 
  27 # Mailman API credentials
  28 MAILMAN_REST_API_URL = 'http://localhost:8001'
  29 MAILMAN_REST_API_USER = 'restadmin'
  30 MAILMAN_REST_API_PASS = 'restpass'
  31 MAILMAN_ARCHIVER_KEY = 'SecretArchiverAPIKey'
  32 MAILMAN_ARCHIVER_FROM = ('127.0.0.1', '::1', '::ffff:127.0.0.1')
  33 
  34 # Application definition
  35 
  36 INSTALLED_APPS = (
  37     'hyperkitty',
  38     'postorius',
  39     'django_mailman3',
  40     'django.contrib.admin',
  41     # 'django.contrib.admindocs',
  42     'django.contrib.auth',
  43     'django.contrib.contenttypes',
  44     'django.contrib.sessions',
  45     'django.contrib.sites',
  46     'django.contrib.messages',
  47     'django.contrib.staticfiles',
  48     'rest_framework',
  49     'django_gravatar',
  50     'paintstore',
  51     'compressor',
  52     'haystack',
  53     'django_extensions',
  54     'allauth',
  55     'allauth.account',
  56     'allauth.socialaccount',
  57     'allauth.socialaccount.providers.facebook',
  58     'allauth.socialaccount.providers.github',
  59     'allauth.socialaccount.providers.gitlab',
  60     'allauth.socialaccount.providers.google',
  61     #'allauth.socialaccount.providers.openid',
  62     #'allauth.socialaccount.providers.stackexchange',
  63     #'allauth.socialaccount.providers.twitter',
  64     #'django_mailman3.lib.auth.fedora',
  65 )
  66 
  67 
  68 MIDDLEWARE_CLASSES = (
  69     'django.contrib.sessions.middleware.SessionMiddleware',
  70     'django.middleware.common.CommonMiddleware',
  71     'django.middleware.csrf.CsrfViewMiddleware',
  72     'django.middleware.locale.LocaleMiddleware',
  73     'django.contrib.auth.middleware.AuthenticationMiddleware',
  74     'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
  75     'django.contrib.messages.middleware.MessageMiddleware',
  76     'django.middleware.clickjacking.XFrameOptionsMiddleware',
  77     'django.middleware.security.SecurityMiddleware',
  78     'django_mailman3.middleware.TimezoneMiddleware',
  79     'postorius.middleware.PostoriusMiddleware',
  80 )
  81 
  82 ROOT_URLCONF = 'mailman_web.urls'
  83 
  84 
  85 #
  86 # Postorius
  87 #
  88 
  89 ## Email confirmation / address activation
  90 # Add a from-address for email-confirmation:
  91 # EMAIL_CONFIRMATION_FROM = 'postmaster@example.org'
  92 
  93 # These can be set to override the defaults but are not mandatory:
  94 # EMAIL_CONFIRMATION_TEMPLATE = 'postorius/address_confirmation_message.txt'
  95 # EMAIL_CONFIRMATION_SUBJECT = 'Confirmation needed'
  96 
  97 
  98 
  99 # Database
 100 # https://docs.djangoproject.com/en/1.6/ref/settings/#databases
 101 
 102 DATABASES = {
 103     'default': {
 104         'ENGINE': 'django.db.backends.postgresql_psycopg2', # Last part is one of 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
 105         'NAME': 'mailmanweb',  # Example, change as needed
 106         'USER': 'mailmanweb',  # Example, change as needed
 107         'PASSWORD': 'change-this-password',  # Example, obviously
 108         'HOST': '127.0.0.1',   # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP.
 109         'PORT': '',            # Set to empty string for default.
 110     }
 111 }
 112 
 113 
 114 # If you're behind a proxy, use the X-Forwarded-Host header
 115 # See https://docs.djangoproject.com/en/1.5/ref/settings/#use-x-forwarded-host
 116 #USE_X_FORWARDED_HOST = True
 117 # And if your proxy does your SSL encoding for you, set SECURE_PROXY_SSL_HEADER
 118 # see https://docs.djangoproject.com/en/1.5/ref/settings/#secure-proxy-ssl-header
 119 #SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
 120 
 121 # Internationalization
 122 # https://docs.djangoproject.com/en/1.6/topics/i18n/
 123 
 124 LANGUAGE_CODE = 'en-us'
 125 
 126 TIME_ZONE = 'America/Chicago'
 127 
 128 USE_I18N = True
 129 
 130 USE_L10N = True
 131 
 132 USE_TZ = True
 133 
 134 
 135 # Static files (CSS, JavaScript, Images)
 136 # https://docs.djangoproject.com/en/1.6/howto/static-files/
 137 
 138 # Absolute filesystem path to the directory that will hold user-uploaded files.
 139 # Example: "/var/www/example.com/media/"
 140 MEDIA_ROOT = ''
 141 
 142 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
 143 # trailing slash.
 144 # Examples: "http://example.com/media/", "http://media.example.com/"
 145 MEDIA_URL = ''
 146 
 147 # Absolute path to the directory static files should be collected to.
 148 # Don't put anything in this directory yourself; store your static files
 149 # in apps' "static/" subdirectories and in STATICFILES_DIRS.
 150 # Example: "/var/www/example.com/static/"
 151 #STATIC_ROOT = ''
 152 STATIC_ROOT = os.path.join(VAR_DIR, "mailman-web", "static")
 153 
 154 # URL prefix for static files.
 155 # Example: "http://example.com/static/", "http://static.example.com/"
 156 STATIC_URL = '/static/'
 157 
 158 # Additional locations of static files
 159 STATICFILES_DIRS = (
 160     # Put strings here, like "/home/html/static" or "C:/www/django/static".
 161     # Always use forward slashes, even on Windows.
 162     # Don't forget to use absolute paths, not relative paths.
 163 )
 164 
 165 # List of finder classes that know how to find static files in
 166 # various locations.
 167 STATICFILES_FINDERS = (
 168     'django.contrib.staticfiles.finders.FileSystemFinder',
 169     'django.contrib.staticfiles.finders.AppDirectoriesFinder',
 170 #    'django.contrib.staticfiles.finders.DefaultStorageFinder',
 171     'compressor.finders.CompressorFinder',
 172 )
 173 
 174 
 175 TEMPLATES = [
 176     {
 177         'BACKEND': 'django.template.backends.django.DjangoTemplates',
 178         'DIRS': [],
 179         'APP_DIRS': True,
 180         'OPTIONS': {
 181             'context_processors': [
 182                 'django.template.context_processors.debug',
 183                 'django.template.context_processors.i18n',
 184                 'django.template.context_processors.media',
 185                 'django.template.context_processors.static',
 186                 'django.template.context_processors.tz',
 187                 'django.template.context_processors.csrf',
 188                 'django.template.context_processors.request',
 189                 'django.contrib.auth.context_processors.auth',
 190                 'django.contrib.messages.context_processors.messages',
 191                 'django_mailman3.context_processors.common',
 192                 'hyperkitty.context_processors.common',
 193                 'postorius.context_processors.postorius',
 194             ],
 195         },
 196     },
 197 ]
 198 
 199 
 200 # Django 1.6+ defaults to a JSON serializer, but it won't work with django-openid, see
 201 # https://bugs.launchpad.net/django-openid-auth/+bug/1252826
 202 SESSION_SERIALIZER = 'django.contrib.sessions.serializers.PickleSerializer'
 203 
 204 
 205 LOGIN_URL = 'account_login'
 206 LOGIN_REDIRECT_URL = 'hk_root'
 207 LOGOUT_URL = 'account_logout'
 208 
 209 # Use the email username as identifier, but truncate it because
 210 # the User.username field is only 30 chars long.
 211 def username(email):
 212     return email.rsplit('@', 1)[0][:30]
 213 BROWSERID_USERNAME_ALGO = username
 214 BROWSERID_VERIFY_CLASS = "django_browserid.views.Verify"
 215 
 216 # Password validation
 217 # https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators
 218 
 219 AUTH_PASSWORD_VALIDATORS = [
 220     {
 221         'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
 222     },
 223     {
 224         'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
 225     },
 226     {
 227         'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
 228     },
 229     {
 230         'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
 231     },
 232 ]
 233 
 234 
 235 #
 236 # Social auth
 237 #
 238 
 239 AUTHENTICATION_BACKENDS = (
 240     'django.contrib.auth.backends.ModelBackend',
 241     'allauth.account.auth_backends.AuthenticationBackend',
 242 )
 243 
 244 # Django Allauth
 245 ACCOUNT_AUTHENTICATION_METHOD = "username_email"
 246 ACCOUNT_EMAIL_REQUIRED = True
 247 ACCOUNT_EMAIL_VERIFICATION = "mandatory"
 248 ACCOUNT_DEFAULT_HTTP_PROTOCOL = "https"
 249 ACCOUNT_UNIQUE_EMAIL  = True
 250 
 251 SOCIALACCOUNT_PROVIDERS = {
 252     'openid': {
 253         'SERVERS': [
 254             dict(id='yahoo',
 255                  name='Yahoo',
 256                  openid_url='http://me.yahoo.com'),
 257         ],
 258     },
 259     'google': {
 260         'SCOPE': ['profile', 'email'],
 261         'AUTH_PARAMS': {'access_type': 'online'},
 262     },
 263     'facebook': {
 264        'METHOD': 'oauth2',
 265        'SCOPE': ['email'],
 266        'FIELDS': [
 267            'email',
 268            'name',
 269            'first_name',
 270            'last_name',
 271            'locale',
 272            'timezone',
 273            ],
 274        'VERSION': 'v2.4',
 275     },
 276 }
 277 
 278 
 279 
 280 #
 281 # Gravatar
 282 # https://github.com/twaddington/django-gravatar
 283 #
 284 # Gravatar base url.
 285 #GRAVATAR_URL = 'http://cdn.libravatar.org/'
 286 # Gravatar base secure https url.
 287 #GRAVATAR_SECURE_URL = 'https://seccdn.libravatar.org/'
 288 # Gravatar size in pixels.
 289 #GRAVATAR_DEFAULT_SIZE = '80'
 290 # An image url or one of the following: 'mm', 'identicon', 'monsterid', 'wavatar', 'retro'.
 291 #GRAVATAR_DEFAULT_IMAGE = 'mm'
 292 # One of the following: 'g', 'pg', 'r', 'x'.
 293 #GRAVATAR_DEFAULT_RATING = 'g'
 294 # True to use https by default, False for plain http.
 295 #GRAVATAR_DEFAULT_SECURE = True
 296 
 297 #
 298 # django-compressor
 299 # https://pypi.python.org/pypi/django_compressor
 300 #
 301 COMPRESS_PRECOMPILERS = (
 302    ('text/less', 'lessc {infile} {outfile}'),
 303    ('text/x-scss', 'sass {infile} {outfile}'),
 304    ('text/x-sass', 'sass {infile} {outfile}'),
 305 )
 306 COMPRESS_OFFLINE = True
 307 # needed for debug mode
 308 #INTERNAL_IPS = ('127.0.0.1',)
 309 
 310 # Django Crispy Forms
 311 #CRISPY_TEMPLATE_PACK = 'bootstrap3'
 312 #CRISPY_FAIL_SILENTLY = not DEBUG
 313 
 314 # Compatibility with Bootstrap 3
 315 from django.contrib.messages import constants as messages
 316 MESSAGE_TAGS = {
 317     messages.ERROR: 'danger'
 318 }
 319 
 320 
 321 #
 322 # Full-text search engine
 323 #
 324 HAYSTACK_CONNECTIONS = {
 325     'default': {
 326         'ENGINE': 'haystack.backends.whoosh_backend.WhooshEngine',
 327         'PATH': os.path.join(VAR_DIR, "mailman-web", "fulltext_index"),
 328     },
 329 }
 330 
 331 
 332 # A sample logging configuration. The only tangible logging
 333 # performed by this configuration is to send an email to
 334 # the site admins on every HTTP 500 error when DEBUG=False.
 335 # See http://docs.djangoproject.com/en/dev/topics/logging for
 336 # more details on how to customize your logging configuration.
 337 LOGGING = {
 338     'version': 1,
 339     'disable_existing_loggers': False,
 340     'filters': {
 341         'require_debug_false': {
 342             '()': 'django.utils.log.RequireDebugFalse'
 343         }
 344     },
 345     'handlers': {
 346         'mail_admins': {
 347             'level': 'ERROR',
 348             'filters': ['require_debug_false'],
 349             'class': 'django.utils.log.AdminEmailHandler'
 350         },
 351         'file':{
 352             'level': 'INFO',
 353             #'class': 'logging.handlers.RotatingFileHandler',
 354             'class': 'logging.handlers.WatchedFileHandler',
 355             'filename': '/var/log/mailman-web/mailman-web.log',
 356             'formatter': 'verbose',
 357         },
 358     },
 359     'loggers': {
 360         #'django.request': {
 361         #    'handlers': ['mail_admins'],
 362         #    'level': 'ERROR',
 363         #    'propagate': True,
 364         #},
 365         'django.request': {
 366             'handlers': ['file'],
 367             'level': 'ERROR',
 368             'propagate': True,
 369         },
 370         'django': {
 371             'handlers': ['file'],
 372             'level': 'ERROR',
 373             'propagate': True,
 374         },
 375         'hyperkitty': {
 376             'handlers': ['file'],
 377             'level': 'INFO',
 378             'propagate': True,
 379         },
 380     },
 381     'formatters': {
 382         'verbose': {
 383             'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
 384         },
 385         'simple': {
 386             'format': '%(levelname)s %(message)s'
 387         },
 388     },
 389     'root': {
 390         'handlers': ['file'],
 391         'level': 'INFO',
 392     },
 393 }
 394 
 395 
 396 ## Cache: use the local memcached server
 397 #CACHES = {
 398 #    'default': {
 399 #        'BACKEND': 'django.core.cache.backends.memcached.PyLibMCCache',
 400 #        'LOCATION': '127.0.0.1:11211',
 401 #    }
 402 #}
 403 
 404 
 405 
 406 #
 407 # HyperKitty-specific
 408 #
 409 
 410 APP_NAME = 'Mailing-list archives'
 411 
 412 # Allow authentication with the internal user database?
 413 # By default, only a login through Persona or your email provider is allowed.
 414 USE_INTERNAL_AUTH = False
 415 
 416 # Use SSL when logged in. You need to enable the SSLRedirect middleware for
 417 # this feature to work.
 418 #USE_SSL = True
 419 
 420 # Only display mailing-lists from the same virtual host as the webserver
 421 FILTER_VHOST = False
 422 
 423 # This is for development purposes
 424 USE_MOCKUPS = False
 425 
 426 
 427 try:
 428     from settings_local import *
 429 except ImportError:
 430     pass

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2018-12-17 04:18:21, 0.7 KB) [[attachment:apache_gunicorn.txt]]
  • [get | view] (2018-06-01 21:24:22, 0.3 KB) [[attachment:build_script.txt]]
  • [get | view] (2018-10-19 22:51:40, 0.2 KB) [[attachment:django-admin.txt]]
  • [get | view] (2016-10-15 02:46:23, 0.6 KB) [[attachment:domain_admin_notice_new-list.txt]]
  • [get | view] (2016-07-03 23:19:17, 0.1 KB) [[attachment:footer-generic.txt]]
  • [get | view] (2018-10-19 22:40:37, 0.2 KB) [[attachment:gunicorn.conf]]
  • [get | view] (2018-10-19 22:51:59, 0.2 KB) [[attachment:gunicorn.txt]]
  • [get | view] (2018-12-14 23:21:42, 1.5 KB) [[attachment:init.d_mailman.txt]]
  • [get | view] (2016-10-15 02:47:55, 0.3 KB) [[attachment:list_admin_action_post.txt]]
  • [get | view] (2016-10-15 02:51:01, 0.4 KB) [[attachment:list_member_digest_masthead.txt]]
  • [get | view] (2016-10-15 02:51:47, 0.1 KB) [[attachment:list_member_generic_footer.txt]]
  • [get | view] (2016-10-15 02:52:45, 0.2 KB) [[attachment:list_user_notice_post.txt]]
  • [get | view] (2016-10-15 02:53:25, 0.8 KB) [[attachment:list_user_notice_probe.txt]]
  • [get | view] (2016-10-15 02:54:12, 0.6 KB) [[attachment:list_user_notice_welcome.txt]]
  • [get | view] (2016-07-03 21:45:21, 0.4 KB) [[attachment:lm3o_gunicorn.conf.txt]]
  • [get | view] (2016-07-03 21:41:27, 0.4 KB) [[attachment:lm3o_gunicorn.txt]]
  • [get | view] (2016-07-03 21:56:08, 0.4 KB) [[attachment:lm3o_hyperkitty.cfg.txt]]
  • [get | view] (2016-07-03 21:53:00, 1.0 KB) [[attachment:lm3o_mailman.cfg.txt]]
  • [get | view] (2020-07-27 00:26:27, 1.8 KB) [[attachment:lm3o_nginx.txt]]
  • [get | view] (2020-07-27 00:13:20, 1.8 KB) [[attachment:lm3o_nginx2.txt]]
  • [get | view] (2016-07-03 22:03:34, 0.3 KB) [[attachment:lm3o_postfix.txt]]
  • [get | view] (2016-07-03 21:49:52, 3.8 KB) [[attachment:lm3o_settings_local.txt]]
  • [get | view] (2017-04-01 16:24:00, 0.8 KB) [[attachment:lm3o_urls.txt]]
  • [get | view] (2018-10-19 22:30:14, 0.4 KB) [[attachment:mailman-hyperkitty.cfg]]
  • [get | view] (2018-10-19 23:08:37, 0.8 KB) [[attachment:mailman-post-update.txt]]
  • [get | view] (2018-10-19 22:27:27, 0.9 KB) [[attachment:mailman.cfg]]
  • [get | view] (2018-10-19 22:52:25, 0.1 KB) [[attachment:mailman.txt]]
  • [get | view] (2019-11-08 00:26:04, 0.6 KB) [[attachment:mailman_crontab.txt]]
  • [get | view] (2017-01-10 01:02:14, 1.4 KB) [[attachment:mailman_init.txt]]
  • [get | view] (2016-07-03 23:19:28, 0.4 KB) [[attachment:masthead.txt]]
  • [get | view] (2016-07-03 22:26:05, 0.6 KB) [[attachment:mpo_lmtp_patch.txt]]
  • [get | view] (2016-07-03 22:12:07, 0.1 KB) [[attachment:mpo_mailman.cfg.add.txt]]
  • [get | view] (2016-07-03 22:14:30, 0.4 KB) [[attachment:mpo_postfix.cfg.txt]]
  • [get | view] (2016-07-03 22:23:02, 0.6 KB) [[attachment:mpo_postfix_main.txt]]
  • [get | view] (2016-07-03 22:16:38, 0.7 KB) [[attachment:mpo_postmap.txt]]
  • [get | view] (2016-07-04 01:35:54, 0.6 KB) [[attachment:mpo_settings_diff.txt]]
  • [get | view] (2020-07-30 18:57:00, 1.1 KB) [[attachment:mpo_wsgi.txt]]
  • [get | view] (2016-07-03 23:19:40, 0.6 KB) [[attachment:newlist.txt]]
  • [get | view] (2016-07-03 23:31:41, 0.3 KB) [[attachment:postack.txt]]
  • [get | view] (2016-07-03 23:19:49, 0.8 KB) [[attachment:probe.txt]]
  • [get | view] (2016-10-15 03:31:25, 12.3 KB) [[attachment:production.py]]
  • [get | view] (2018-06-01 21:18:34, 0.1 KB) [[attachment:pull_script.txt]]
  • [get | view] (2019-11-07 04:24:21, 5.8 KB) [[attachment:settings_local.py]]
  • [get | view] (2018-12-14 23:02:50, 0.4 KB) [[attachment:systemd_gunicorn.txt]]
  • [get | view] (2018-12-14 23:04:48, 0.4 KB) [[attachment:systemd_mailman.txt]]
  • [get | view] (2018-12-14 23:06:17, 0.3 KB) [[attachment:systemd_qcluster.txt]]
  • [get | view] (2019-01-15 21:22:55, 0.2 KB) [[attachment:upstart_gunicorn.txt]]
  • [get | view] (2019-01-15 21:27:19, 0.2 KB) [[attachment:upstart_qcluster.txt]]
  • [get | view] (2019-01-16 20:40:43, 1.4 KB) [[attachment:urls.py]]
  • [get | view] (2016-07-03 23:19:57, 0.6 KB) [[attachment:welcome.txt]]
  • [get | view] (2018-10-19 22:34:33, 1.1 KB) [[attachment:wsgi.py]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.