Commit c8bdab24 authored by Enrico Zini's avatar Enrico Zini
Browse files

Cleanup settings

parent c5eb3a49
......@@ -10,8 +10,8 @@ Debian NM Front Desk web application
### Configuration
mkdir data # required by default settings
ln -s settings.py.devel settings.py
edit settings.py as needed
ln -s local_settings.py.devel local_settings.py
edit local_settings.py as needed
### First setup
......
......@@ -9,9 +9,7 @@ from . import const
log = getLogger(__name__)
EMAIL_PUBLIC_ANNOUNCES = getattr(settings, "EMAIL_PUBLIC_ANNOUNCES", "debian-newmaint@lists.debian.org")
EMAIL_PRIVATE_ANNOUNCES = getattr(settings, "EMAIL_PRIVATE_ANNOUNCES", "nm@debian.org")
EMAIL_PERSONAL_DIVERT = getattr(settings, "EMAIL_PERSONAL_DIVERT", None)
def get_email_address(request):
"""
......@@ -26,24 +24,11 @@ def get_email_address(request):
email_address = request.person.email
return email_address
def announce_public(request, subject, text):
sender_addr = get_email_address(request)
fromaddr = email.utils.formataddr((request.person.fullname + " via nm", sender_addr))
send_mail(subject, text, fromaddr, [EMAIL_PUBLIC_ANNOUNCES])
def announce_private(request, subject, text):
sender_addr = get_email_address(request)
fromaddr = email.utils.formataddr((request.person.fullname + " via nm", sender_addr))
send_mail(subject, text, fromaddr, [EMAIL_PRIVATE_ANNOUNCES])
def personal_email(request, recipients, subject, text):
# TODO: Cc EMAIL_PRIVATE_ANNOUNCES?
# Details in https://docs.djangoproject.com/en/dev/topics/email/ but needs
# 1.3 for the cc parameter
fromaddr = email.utils.formataddr((request.person.fullname + " via nm", "nm@debian.org"))
# Divert to other recipients when testing, to avoid spamming people with
# test messages
if EMAIL_PERSONAL_DIVERT: recipients = EMAIL_PERSONAL_DIVERT
send_mail(subject, text, fromaddr, recipients)
def parse_recipient_list(s):
......
import os.path
PROJECT_DIR = os.path.abspath(os.path.dirname(__file__))
DATA_DIR = os.path.join(PROJECT_DIR, 'data')
DEBUG = True
TEMPLATE_DEBUG = True
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': '%s/db-used-for-development.sqlite' % DATA_DIR, # Or path to database file if using sqlite3.
'USER': '', # Not used with sqlite3.
'PASSWORD': '', # Not used with sqlite3.
'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
'PORT': '', # Set to empty string for default. Not used with sqlite3.
},
'projectb': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'projectb',
'USER': 'guest',
'HOST': 'localhost',
# ssh ries.debian.org -L15433:127.0.0.1:5433
'PORT': '15433', # Port forwarded
#'PORT': '5433', # Local
'TEST_MIRROR': 'default',
},
}
# Make this unique, and don't share it with anybody.
SECRET_KEY = 'thisisnotreallysecretweonlyuseitfortestingharrharr'
# FIXME What is correct format for TEST_USERNAME? Current format ("username")
# causes IndexError at backend/auth.py NMUserBackend:clean_username
# (expects TEST_USERNAME to be in format
# "something:something:something:username"
DACS_TEST_USERNAME = "enrico:enrico:enrico:enrico"
# Avoid sending emails
EMAIL_BACKEND = 'django.core.mail.backends.filebased.EmailBackend'
EMAIL_FILE_PATH = '/tmp/nm_notification_mails'
......@@ -169,22 +169,24 @@ LOGGING = {
}
}
# BACKUP_DIR = "/srv/nm.debian.org/backup"
BACKUP_DIR="."
#KEYRINGS = "/home/enrico/dev/deb/keyring.debian.org/keyrings"
KEYRINGS = os.path.join(DATA_DIR, "keyrings")
# LDAP server to use to access Debian's official LDAP information
LDAP_SERVER = "ldap://db.debian.org"
# Location of a keyring-maint mirror
KEYRINGS = os.path.join(DATA_DIR, "keyrings")
# Work paths used by minechangelogs (indexing cache and the index itself)
MINECHANGELOGS_CACHEDIR = os.path.join(DATA_DIR, "mc_cache")
MINECHANGELOGS_INDEXDIR = os.path.join(DATA_DIR, "mc_index")
EMAIL_PUBLIC_ANNOUNCES = "enrico@enricozini.org"
EMAIL_PRIVATE_ANNOUNCES = "enrico@enricozini.org"
EMAIL_PERSONAL_DIVERT = ["enrico@enricozini.org"]
EMAIL_BACKEND = 'django.core.mail.backends.filebased.EmailBackend'
EMAIL_FILE_PATH = '/tmp/nm_notification_mails'
# Directory where site backups are stored
BACKUP_DIR = os.path.join(DATA_DIR, "backups")
PROCESS_MAILBOX_DIR = os.path.abspath("./test-mboxes")
# Directory where applicant mailboxes are stored
PROCESS_MAILBOX_DIR = os.path.join(DATA_DIR, "applicant-mailboxes")
# Date where we imported DM information that had no timestamp.
# DMs created on this date are infact DMs created on an unknown date
DM_IMPORT_DATE = datetime.datetime(2012, 3, 14)
# The password for this account is available from: master.debian.org:/home/debian/misc/rt-password
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment