Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mailman
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
infra
ansible
roles
mailman
Commits
b33fae4c
Unverified
Commit
b33fae4c
authored
6 months ago
by
Julian Rother
Browse files
Options
Downloads
Patches
Plain Diff
Make database settings configurable
parent
b1798cf3
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
defaults/main.yml
+12
-0
12 additions, 0 deletions
defaults/main.yml
templates/mailman-web.py.j2
+13
-10
13 additions, 10 deletions
templates/mailman-web.py.j2
templates/mailman.cfg.j2
+6
-4
6 additions, 4 deletions
templates/mailman.cfg.j2
with
31 additions
and
14 deletions
defaults/main.yml
+
12
−
0
View file @
b33fae4c
...
...
@@ -15,6 +15,18 @@ mailman:
change_pw
:
True
ldap
:
False
session_timeout
:
3600
db
:
ENGINE
:
django.db.backends.sqlite3
NAME
:
/var/lib/mailman3/web/mailman3web.db
USER
:
'
'
PASSWORD
:
'
'
HOST
:
'
'
PORT
:
'
'
OPTIONS
:
{}
db
:
class
:
mailman.database.sqlite.SQLiteDatabase
url
:
'
sqlite:///$DATA_DIR/mailman.db'
debug
:
'
no'
archiver
:
key
:
"
{{
lookup('password',
'/dev/null
length=128')
}}"
list_defaults
:
...
...
This diff is collapsed.
Click to expand it.
templates/mailman-web.py.j2
+
13
−
10
View file @
b33fae4c
...
...
@@ -40,7 +40,9 @@ MIDDLEWARE = (
{% if mailman.web.remote_user %}
'django.contrib.auth.middleware.PersistentRemoteUserMiddleware',
{% endif %}
{% if mailman.web.ldap %}
'postorius_ldap_membership_management.middleware.SessionTimeoutMiddleware',
{% endif %}
)
# Application definition
...
...
@@ -90,29 +92,30 @@ AUTHENTICATION_BACKENDS = (
# https://docs.djangoproject.com/en/1.8/ref/settings/#databases
DATABASES = {
'default': {
'default': {{ mailman.web.db|pprint|indent(15) }}
#{
# Use 'sqlite3', 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'ENGINE': 'django.db.backends.sqlite3',
#
'ENGINE': 'django.db.backends.sqlite3',
#'ENGINE': 'django.db.backends.postgresql_psycopg2',
#'ENGINE': 'django.db.backends.mysql',
# DB name or path to database file if using sqlite3.
'NAME': '/var/lib/mailman3/web/mailman3web.db',
#
'NAME': '/var/lib/mailman3/web/mailman3web.db',
# The following settings are not used with sqlite3:
'USER': '',
'PASSWORD': '',
#
'USER': '',
#
'PASSWORD': '',
# HOST: empty for localhost through domain sockets or '127.0.0.1' for
# localhost through TCP.
'HOST': '',
#
'HOST': '',
# PORT: set to empty string for default.
'PORT': '',
#
'PORT': '',
# OPTIONS: Extra parameters to use when connecting to the database.
'OPTIONS': {
#
'OPTIONS': {
# Set sql_mode to 'STRICT_TRANS_TABLES' for MySQL. See
# https://docs.djangoproject.com/en/1.11/ref/
# databases/#setting-sql-mode
#'init_command': "SET sql_mode='STRICT_TRANS_TABLES'",
},
}
#
},
#
}
}
...
...
This diff is collapsed.
Click to expand it.
templates/mailman.cfg.j2
+
6
−
4
View file @
b33fae4c
...
...
@@ -159,7 +159,7 @@ lock_file: $lock_dir/master.lck
[database]
# The class implementing the IDatabase.
class: mailman.database.sqlite.SQLiteDatabase
#
class: mailman.database.sqlite.SQLiteDatabase
#class: mailman.database.mysql.MySQLDatabase
#class: mailman.database.postgresql.PostgreSQLDatabase
...
...
@@ -168,12 +168,14 @@ class: mailman.database.sqlite.SQLiteDatabase
# will store their data in this database, although external rosters may access
# other databases in their own way. This string supports standard
# 'configuration' substitutions.
url: sqlite:///$DATA_DIR/mailman.db
#
url: sqlite:///$DATA_DIR/mailman.db
#url: mysql+pymysql://mailman3:mmpass@localhost/mailman3?charset=utf8&use_unicode=1
#url: postgres://mailman3:mmpass@localhost/mailman3
#debug: no
debug: no
{% for key, value in mailman.db.items() %}
{{ key }}: {{ value }}
{% endfor %}
[logging.debian]
# This defines various log settings. The options available are:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment