Actually bind flask-admin to the mail servers

This commit is contained in:
Pierre Jaury
2016-02-20 20:11:59 +01:00
parent 61c99c7014
commit 48fbf737ce
13 changed files with 98 additions and 27 deletions

View File

@@ -4,13 +4,13 @@ connect = /data/freeposte.db
# Return the user hashed password
password_query = \
SELECT password \
FROM users INNER JOIN domains ON users.domain_id = domains.id \
WHERE domains.name = '%d' \
AND users.username = '%n'
FROM user INNER JOIN domain ON user.domain_id = domains.id \
WHERE domain.name = '%d' \
AND user.username = '%n'
# Mostly get the user quota
user_query = \
SELECT '*:bytes=' || users.quota_bytes AS quota_rule \
FROM users INNER JOIN domains ON users.domain_id = domains.id \
WHERE domains.name = '%d' \
AND users.username = '%n'
SELECT '*:bytes=' || user.quota_bytes AS quota_rule \
FROM user INNER JOIN domain ON user.domain_id = domain.id \
WHERE domain.name = '%d' \
AND user.username = '%n'

28
config/nginx/nginx.conf Normal file
View File

@@ -0,0 +1,28 @@
user www-data;
worker_processes 1;
error_log /var/log/nginx/error.log info;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /var/log/nginx/access.log;
sendfile on;
keepalive_timeout 65;
server_tokens off;
server {
listen 80;
location /admin {
include uwsgi_params;
uwsgi_modifier1 30;
uwsgi_pass unix:/var/run/freeposte.sock;
}
}
}

View File

@@ -8,6 +8,8 @@ mynetworks = /data/relaynets
alias_maps = hash:/etc/aliases
# SQLite configuration
sql = sqlite:${config_directory}/
# Only accept virtual emails
mydestination =
###############
# TLS

View File

@@ -1,6 +1,6 @@
dbpath = /data/freeposte.db
query = \
SELECT destination \
FROM aliases INNER JOIN domains ON aliases.domain_id = domains.id \
WHERE domains.name = '%d' \
AND aliases.localpart = '%n'
query =
SELECT destination
FROM alias INNER JOIN domain ON alias.domain_id = domain.id
WHERE domain.name = '%d'
AND alias.localpart = '%u'

View File

@@ -1,2 +1,2 @@
dbpath = /data/freeposte.db
query = SELECT name FROM domains WHERE domain='%s'
query = SELECT name FROM domain WHERE name='%s'

View File

@@ -1,5 +1,6 @@
[supervisord]
nodaemon = true
logfile = /var/log/supervisor/supervisord.log
[program:postfix]
command = /usr/lib/postfix/master -d
@@ -12,3 +13,9 @@ command = /usr/sbin/spamd
[program:rsyslog]
command = rsyslogd -n
[program:admin]
command = uwsgi --yaml /etc/uwsgi/apps-enabled/freeposte.yml
[program:nginx]
command = nginx -g 'daemon off;'

View File

@@ -0,0 +1,16 @@
uwsgi:
socket: /var/run/freeposte.sock
chown-socket: www-data:www-data
pidfile: /var/run/freeposte.pid
master: true
workers: 2
vacuum: true
plugins: python
wsgi-file: /admin/run.py
callable: app
processes: 1
pythonpath: /usr/lib/python2.7/site-packages
pythonpath: /admin
catch-exceptions: true
post-buffering: 8192