Merge pull request 'Initial commit to main' (#1) from muppdev into main
Reviewed-on: #1
This commit is contained in:
commit
f0016fbf4f
15 changed files with 690 additions and 9 deletions
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
.vagrant
|
||||
.vagrant/*
|
||||
*log
|
22
LICENSE
22
LICENSE
|
@ -1,9 +1,19 @@
|
|||
MIT License
|
||||
MIT License Copyright (c) 2021 "Stichting Disroot.org"
|
||||
|
||||
Copyright (c) <year> <copyright holders>
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is furnished
|
||||
to do so, subject to the following conditions:
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice (including the next
|
||||
paragraph) shall be included in all copies or substantial portions of the
|
||||
Software.
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
|
||||
OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
|
||||
OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
|
11
Playbooks/lacre.yml
Normal file
11
Playbooks/lacre.yml
Normal file
|
@ -0,0 +1,11 @@
|
|||
---
|
||||
|
||||
- hosts: lacre
|
||||
roles:
|
||||
- mariadb
|
||||
- nginx
|
||||
- gpg-lacre
|
||||
- php-fpm
|
||||
|
||||
vars_files:
|
||||
- ../defaults/main.yml
|
2
README.MD
Normal file
2
README.MD
Normal file
|
@ -0,0 +1,2 @@
|
|||
**WIP**
|
||||
Role that deploys, configures and upgrades GPG Lacre.
|
|
@ -1,3 +0,0 @@
|
|||
# lacre
|
||||
|
||||
Role that deploys lacre.io e2e mailbox encryption
|
18
Vagrantfile
vendored
Normal file
18
Vagrantfile
vendored
Normal file
|
@ -0,0 +1,18 @@
|
|||
# -*- mode: ruby -*-
|
||||
# vi: set ft=ruby :
|
||||
|
||||
# All Vagrant configuration is done below. The "2" in Vagrant.configure
|
||||
# configures the configuration version (we support older styles for
|
||||
# backwards compatibility). Please don't change it unless you know what
|
||||
# you're doing.
|
||||
Vagrant.configure("2") do |config|
|
||||
#config.ssh.insert_key = false
|
||||
config.vm.define "lacre" do |lacre|
|
||||
lacre.vm.box = "generic/debian11"
|
||||
lacre.vm.provider :libvirt do |libvirt|
|
||||
libvirt.memory = 256
|
||||
end
|
||||
lacre.vm.network "private_network", ip: "192.168.33.13"
|
||||
|
||||
end
|
||||
end
|
199
defaults/main.yml
Normal file
199
defaults/main.yml
Normal file
|
@ -0,0 +1,199 @@
|
|||
---
|
||||
lacre_pything_version: '3.9'
|
||||
lacre_repo: 'https://git.disroot.org/Disroot/gpg-lacre.git'
|
||||
lacre_version: 'php_update'
|
||||
lacre_app_dir: '/opt/gpg-lacre'
|
||||
lacre_username: 'lacre'
|
||||
lacre_group: 'lacre'
|
||||
lacre_homedir: '/var/gpgmailgate/'
|
||||
#lacre_
|
||||
lacre_apt:
|
||||
- 'python3-m2crypto'
|
||||
- 'git'
|
||||
- 'gnupg'
|
||||
lacre_set_content_filter: 'true'
|
||||
#config file
|
||||
lacre_add_header: 'yes'
|
||||
lacre_enc_keymap_only: 'no'
|
||||
lacre_dec_keymap_only: 'no'
|
||||
lacre_failsave_dec: 'yes'
|
||||
lacre_mime_conversion: 'yes'
|
||||
lacre_mail_case_insensitive: 'no'
|
||||
lacre_no_inline_dec: 'yes'
|
||||
lacre_dec_regex: 'None'
|
||||
lacre_keyhome: '/var/gpgmailgate/.gnupg'
|
||||
lacre_cert_path: '/var/gpgmailgate/smime'
|
||||
lacre_register_email: 'register@example.org'
|
||||
lacre_mail_templates: '/var/gpgmailgate/register_templates'
|
||||
lacre_webpanel_url: 'http://example.org'
|
||||
lacre_notification_email: 'gpg-mailgate@example.org'
|
||||
lacre_mail_templates: '/var/gpgmailgate/cron_templates'
|
||||
lacre_verbose: 'yes'
|
||||
lacre_relay: '127.0.0.1'
|
||||
lacre_port: '10028'
|
||||
lacre_enc_port: '25'
|
||||
lacre_starttls: 'no'
|
||||
lacre_db_enabled: 'no'
|
||||
lacre_db_name: 'gpgmw'
|
||||
lacre_db_host: 'localhost'
|
||||
lacre_db_username: 'user'
|
||||
lacre_db_password: 'password'
|
||||
|
||||
#lacre webgate
|
||||
lacre_cron: 'true'
|
||||
lacre_webgate_deploy: 'true'
|
||||
lacre_webgate_apt:
|
||||
- 'python3-markdown'
|
||||
- 'python3-mysqldb'
|
||||
lacre_webgate_webroot: '/var/www/'
|
||||
lacre_webgate_user: 'www-data'
|
||||
lacre_webgate_group: 'www-data'
|
||||
lacre_webgate_email_web: 'admin@example.com'
|
||||
lacre_webgate_email_from: 'gpg-mailgate-web@example.com'
|
||||
lacre_webgate_email_subject_requestpgp: 'Confirm your email address'
|
||||
lacre_webgate_site_url: 'http://example.com/gpgmw'
|
||||
lacre_webgate_site_title: 'PGP key management'
|
||||
lacre_webgate_language: 'english'
|
||||
lacre_webgate_debug: 'enable'
|
||||
lacre_webgate_mail_smtp: 'false'
|
||||
lacre_webgate_smtp_host: 'localhost'
|
||||
lacre_webgate_smtp_port: '25'
|
||||
lacre_webgate_smtp_username: 'gpgmw'
|
||||
lacre_webgate_smtp_password: ''
|
||||
lacre_webgate_pgpverify: 'false'
|
||||
lacre_webgate_pgpverify_tmpdir: '/tmp'
|
||||
lacre_webgate_pgpverify_allowblank: 'true'
|
||||
lacre_webgate_lock_time: '10'
|
||||
lacre_webgate_lock_retrycount: '3'
|
||||
lacre_webgate_lock_cooldown: '900'
|
||||
lacre_webgate_lock_reset: '300'
|
||||
lacre_webgate_locktime_max: '3600'
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#mailserver vars
|
||||
postfix_header_checks: 'false'
|
||||
postfix_body_checks: 'false'
|
||||
postfix_rbl_whitelist: 'false'
|
||||
postfix_postgrey_deploy: 'false'
|
||||
|
||||
#php
|
||||
install_php: 'true'
|
||||
php_version: '7.4'
|
||||
php_pkgs:
|
||||
- 'php{{ php_version }}-fpm'
|
||||
- 'php{{ php_version }}-mysql'
|
||||
nginx_vhosts:
|
||||
- name: 'example.org'
|
||||
template: 'basephp'
|
||||
proto: 'http'
|
||||
listen: '80'
|
||||
root: 'gpg-mailgate-web/public_html'
|
||||
index: 'index.php'
|
||||
use_access_log: 'true'
|
||||
use_error_log: 'true'
|
||||
nginx_error_log_level: 'warn'
|
||||
upstream_params:
|
||||
- 'fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;'
|
||||
- 'fastcgi_index index.php;'
|
||||
- 'include /etc/nginx/fastcgi_params;'
|
||||
- 'fastcgi_pass unix:{{ pool_listen }};'
|
||||
state: 'enable'
|
||||
letsencrypt: 'false'
|
||||
|
||||
nginx_default_vhost_ssl: 'example.org'
|
||||
nginx_default_vhost: 'example.org'
|
||||
|
||||
#mariadb
|
||||
# MARIADB CONFIG
|
||||
mariadb_root_password: 'changeme'
|
||||
mariadb_default_config:
|
||||
- name: 'client'
|
||||
config:
|
||||
- port = {{mariadb_client_port}}
|
||||
- socket = /var/run/mysqld/mysqld.sock
|
||||
- default-character-set = utf8mb4
|
||||
- name: 'mysqld_safe'
|
||||
config:
|
||||
- safe_socket = /var/run/mysqld/mysqld.sock
|
||||
- safe_nice = 0
|
||||
- name: 'mysqld'
|
||||
config:
|
||||
- user = mysql
|
||||
- pid_file = /var/run/mysqld/mysqld.pid
|
||||
- socket = /var/run/mysqld/mysqld.sock
|
||||
- port = 3306
|
||||
- basedir = /usr
|
||||
- datadir = "{{mariadb_datadir}}"
|
||||
- tmpdir = /tmp
|
||||
- init_connect ='SET collation_connection = utf8mb4_unicode_ci'
|
||||
- init_connect ='SET NAMES utf8mb4'
|
||||
- character-set-server = utf8mb4
|
||||
- collation-server = utf8mb4_unicode_ci
|
||||
- skip_external_locking = True
|
||||
- bind_address = {{ lacre_db_host }}
|
||||
- key_buffer = 16M
|
||||
- max_allowed_packet = 16M
|
||||
- thread_stack = 192K
|
||||
- thread_cache_size = 16
|
||||
- myisam_recover = BACKUP
|
||||
- max_connections = 1000
|
||||
- query_cache_limit = 1M
|
||||
- query_cache_size = 16M
|
||||
- general_log_file = /var/log/mysql/mysql.log
|
||||
- general_log = 0
|
||||
- slow_query_log = 1
|
||||
- slow_query_log_file = /var/log/mysql/mysql-slow.log
|
||||
- long_query_time = 1
|
||||
- log_queries_not_using_indexes = False
|
||||
- default_storage_engine = InnoDB
|
||||
- innodb_buffer_pool_size = 1024M
|
||||
- innodb_log_file_size = 128M
|
||||
- innodb_log_buffer_size = 8M
|
||||
- innodb_thread_concurrency = 64
|
||||
- innodb_read_io_threads = 16
|
||||
- innodb_write_io_threads = 16
|
||||
- innodb_file_per_table = 1
|
||||
- innodb_open_files = 400
|
||||
- innodb_io_capacity = 600
|
||||
- innodb_lock_wait_timeout = 60
|
||||
- innodb_flush_method = O_DIRECT
|
||||
- innodb_doublewrite = 0
|
||||
- innodb_use_native_aio = 0
|
||||
- innodb_large_prefix = on
|
||||
- server_id = 1
|
||||
- log_bin = /var/log/mysql/mysql-bin.log
|
||||
- expire_logs_days = 2
|
||||
- max_binlog_size = 10M
|
||||
- binlog_format = row
|
||||
- query_cache_type = 1
|
||||
- query_cache_limit = 256K
|
||||
- query_cache_min_res_unit = 2k
|
||||
- query_cache_size = 300M
|
||||
- tmp_table_size= 64M
|
||||
- max_heap_table_size= 64M
|
||||
|
||||
|
||||
- name: 'mysqldump'
|
||||
config:
|
||||
- quick
|
||||
#- quotes-names
|
||||
- max_allowed_packet = 16M
|
||||
- name: 'isamchk'
|
||||
config:
|
||||
- key_buffer = 16M
|
||||
|
||||
mariadb_databases:
|
||||
- name: '{{ lacre_db_name }}'
|
||||
collation: 'utf8mb4_unicode_ci'
|
||||
encoding: 'utf8mb4'
|
||||
|
||||
mariadb_users:
|
||||
- name: '{{ lacre_db_username }}'
|
||||
host: '{{ lacre_db_host }}'
|
||||
password: '{{ lacre_db_password }}'
|
||||
priv: '{{ lacre_db_name }}.*:ALL'
|
||||
|
36
tasks/configure.yml
Normal file
36
tasks/configure.yml
Normal file
|
@ -0,0 +1,36 @@
|
|||
---
|
||||
|
||||
- name: '[LACRE] - Configure lacre'
|
||||
template:
|
||||
src: 'etc/gpg-mailgate.conf.j2'
|
||||
dest: '/etc/gpg-mailgate.conf'
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
|
||||
- name: '[LACRE] - Add lacre config to postfix'
|
||||
blockinfile:
|
||||
dest: '/etc/postfix/master.cf'
|
||||
backup: yes
|
||||
marker: '# {mark} LACRE config block (Ansible)'
|
||||
block: |
|
||||
gpg-mailgate unix - n n - - pipe
|
||||
flags= user=lacre argv={{ lacre_app_dir }}/gpg-mailgate.py ${recipient}
|
||||
|
||||
127.0.0.1:10028 inet n - n - 10 smtpd
|
||||
-o content_filter=
|
||||
-o receive_override_options=no_unknown_recipient_checks,no_header_body_checks
|
||||
-o smtpd_helo_restrictions=
|
||||
-o smtpd_client_restrictions=
|
||||
-o smtpd_sender_restrictions=
|
||||
-o smtpd_recipient_restrictions=permit_mynetworks,reject
|
||||
-o mynetworks=127.0.0.0/8
|
||||
-o smtpd_authorized_xforward_hosts=127.0.0.0/8
|
||||
|
||||
- name: '[LACRE] - Replace content_filter setting in postfix'
|
||||
replace:
|
||||
path: '/etc/postfix/main.cf'
|
||||
regexp: 'content_filter = .*'
|
||||
replace: 'content_filter = gpg-mailgate'
|
||||
when: lacre_set_content_filter == 'true'
|
||||
|
66
tasks/frontend.yml
Normal file
66
tasks/frontend.yml
Normal file
|
@ -0,0 +1,66 @@
|
|||
---
|
||||
|
||||
- name: '[Webgate] - Install dependencies'
|
||||
apt:
|
||||
name: "{{ lacre_webgate_apt }}"
|
||||
|
||||
- name: '[Webgate] - Copy files to webdir'
|
||||
copy:
|
||||
remote_src: true
|
||||
src: "{{ lacre_app_dir }}/gpg-mailgate-web/public_html"
|
||||
dest: "{{ lacre_webgate_webroot }}/gpg-mailgate-web"
|
||||
owner: "{{ lacre_webgate_user }}"
|
||||
group: "{{ lacre_webgate_group }}"
|
||||
|
||||
- name: '[Webgate] - Import sql schema'
|
||||
mysql_db:
|
||||
state: import
|
||||
name: "{{ lacre_db_name }}"
|
||||
login_host: "{{ lacre_db_host }}"
|
||||
login_user: "{{ lacre_db_username }}"
|
||||
login_password: "{{ lacre_db_password }}"
|
||||
target: "{{ lacre_app_dir }}/gpg-mailgate-web/schema.sql"
|
||||
|
||||
- name: 'Webgate] - Deploy config'
|
||||
template:
|
||||
src: 'config.php.j2'
|
||||
dest: "{{ lacre_webgate_webroot }}/gpg-mailgate-web/public_html/config.php"
|
||||
owner: "{{ lacre_webgate_user }}"
|
||||
group: "{{ lacre_webgate_group }}"
|
||||
|
||||
- name: '[Webgate] - Create email template dir'
|
||||
file:
|
||||
path: "{{ lacre_homedir }}/cron-templates"
|
||||
state: directory
|
||||
owner: "{{ lacre_username }}"
|
||||
group: "{{ lacre_group }}"
|
||||
|
||||
- name: '[Webgate] - Copy templates to template dir'
|
||||
copy:
|
||||
remote_src: true
|
||||
src: "{{ lacre_app_dir }}/cron_templates"
|
||||
dest: "{{ lacre_homedir }}/cron-templates"
|
||||
owner: "{{ lacre_username }}"
|
||||
group: "{{ lacre_group }}"
|
||||
|
||||
- name: '[Webgate] - Deploy cron.py'
|
||||
copy:
|
||||
remote_src: true
|
||||
src: "{{ lacre_app_dir }}/gpg-mailgate-web/cron.py"
|
||||
dest: '/usr/local/bin/gpgmw-cron.py'
|
||||
owner: "{{ lacre_username }}"
|
||||
group: "{{ lacre_group }}"
|
||||
mode: a+x
|
||||
|
||||
- name: '[Webgate] - Set cron'
|
||||
cron:
|
||||
name: "Webgate cronjob"
|
||||
state: present
|
||||
minute: "*/3"
|
||||
hour: "*"
|
||||
day: "*"
|
||||
month: "*"
|
||||
weekday: "*"
|
||||
user: "{{ lacre_username }}"
|
||||
job: '/usr/local/bin/gpgmw-cron.py > /dev/null'
|
||||
when: lacre_cron == 'true'
|
10
tasks/git.yml
Normal file
10
tasks/git.yml
Normal file
|
@ -0,0 +1,10 @@
|
|||
---
|
||||
|
||||
- name: '[GIT] - Clone lacre to /opt'
|
||||
git:
|
||||
repo: '{{ lacre_repo }}'
|
||||
dest: '{{ lacre_app_dir }}'
|
||||
force: yes
|
||||
update: yes
|
||||
version: "{{ lacre_version }}"
|
||||
|
34
tasks/install.yml
Normal file
34
tasks/install.yml
Normal file
|
@ -0,0 +1,34 @@
|
|||
---
|
||||
|
||||
- name: '[APT] - Install dependencies'
|
||||
apt:
|
||||
name: "{{ lacre_apt }}"
|
||||
update_cache: yes
|
||||
|
||||
- name: '[Install] - Make sure gpgmailgate home exists'
|
||||
file:
|
||||
path: '{{ lacre_homedir }}'
|
||||
state: directory
|
||||
owner: '{{ lacre_username }}'
|
||||
group: '{{ lacre_group }}'
|
||||
|
||||
- name: '[Install] - Make sure gpgmailgate .gnupg dir exists'
|
||||
file:
|
||||
path: '{{ lacre_homedir }}/.gnupg'
|
||||
state: directory
|
||||
owner: '{{ lacre_username }}'
|
||||
group: '{{ lacre_group }}'
|
||||
|
||||
- name: '[Install] - Make sure gpgmailgate smime dir exists'
|
||||
file:
|
||||
path: '{{ lacre_homedir }}/smime'
|
||||
state: directory
|
||||
owner: '{{ lacre_username }}'
|
||||
group: '{{ lacre_group }}'
|
||||
|
||||
- name: '[Install] - Link GnuPG direcotry to global python modules'
|
||||
file:
|
||||
src: '{{ lacre_app_dir }}/GnuPG'
|
||||
dest: '/usr/local/lib/python{{ lacre_pything_version }}/dist-packages/GnuPG'
|
||||
state: link
|
||||
|
17
tasks/main.yml
Normal file
17
tasks/main.yml
Normal file
|
@ -0,0 +1,17 @@
|
|||
---
|
||||
|
||||
- name: 'Clone / Update repository'
|
||||
include: git.yml
|
||||
|
||||
- name: 'Create user'
|
||||
include: user.yml
|
||||
|
||||
- name: 'Install Lacre'
|
||||
include: install.yml
|
||||
|
||||
- name: 'Configure Lacre'
|
||||
include: configure.yml
|
||||
|
||||
- name: 'Deploy frontend'
|
||||
include: frontend.yml
|
||||
|
21
tasks/user.yml
Normal file
21
tasks/user.yml
Normal file
|
@ -0,0 +1,21 @@
|
|||
---
|
||||
|
||||
- name: '[USER] - Add group'
|
||||
group:
|
||||
name: '{{ lacre_group }}'
|
||||
state: present
|
||||
|
||||
- name: '[USER] - Add user'
|
||||
user:
|
||||
name: '{{ lacre_username }}'
|
||||
shell: '/sbin/nologin'
|
||||
group: '{{ lacre_group }}'
|
||||
state: present
|
||||
|
||||
- name: '[USER] - Change ownership to etherpad user'
|
||||
file:
|
||||
path: '{{ lacre_app_dir }}'
|
||||
owner: '{{ lacre_username }}'
|
||||
group: '{{ lacre_group }}'
|
||||
state: directory
|
||||
recurse: yes
|
121
templates/config.php.j2
Normal file
121
templates/config.php.j2
Normal file
|
@ -0,0 +1,121 @@
|
|||
<?php
|
||||
/*
|
||||
|
||||
gpg-mailgate
|
||||
|
||||
This file is part of the gpg-mailgate source code.
|
||||
|
||||
gpg-mailgate is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
gpg-mailgate source code is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with gpg-mailgate source code. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
*/
|
||||
|
||||
//
|
||||
// GENERAL SITE SETTINGS
|
||||
//
|
||||
|
||||
//web team contact
|
||||
// this email address will be displayed if there is a database error
|
||||
$config['email_web'] = '{{ lacre_webgate_email_web }}';
|
||||
|
||||
//address to send emails from
|
||||
$config['email_from'] = '{{ lacre_webgate_email_from }}';
|
||||
|
||||
//this will be used as the subject when a user requests to add a PGP key
|
||||
$config['email_subject_requestpgp'] = '{{ lacre_webgate_email_subject_requestpgp }}';
|
||||
|
||||
//site URL, without trailing slash
|
||||
$config['site_url'] = '{{ lacre_webgate_site_url }}';
|
||||
|
||||
|
||||
//title of the website (displayed on home page)
|
||||
$config['site_title'] = '{{ lacre_webgate_site_title }}';
|
||||
|
||||
//language file to use (see language subdirectory)
|
||||
$config['language'] = '{{ lacre_webgate_language }}';
|
||||
|
||||
//whether debug mode should be enabled
|
||||
$config['debug'] = {{ lacre_webgate_debug }};
|
||||
|
||||
//
|
||||
// MAIL SETTINGS
|
||||
//
|
||||
|
||||
//whether to send mail through SMTP (instead of PHP mail function)
|
||||
$config['mail_smtp'] = {{ lacre_webgate_mail_smtp }};
|
||||
|
||||
//SMTP settings, if mail_smtp is enabled
|
||||
//this requires Net_SMTP from http://pear.php.net/package/Net_SMTP/ to be installed
|
||||
$config['mail_smtp_host'] = '{{ lacre_webgate_smtp_host }}';
|
||||
$config['mail_smtp_port'] = {{ lacre_webgate_smtp_port }};
|
||||
$config['mail_smtp_username'] = '{{ lacre_webgate_smtp_username }}';
|
||||
$config['mail_smtp_password'] = '{{ lacre_webgate_smtp_password }}';
|
||||
|
||||
//
|
||||
// DATABASE SETTINGS
|
||||
//
|
||||
|
||||
//database name (MySQL only); or see include/dbconnect.php
|
||||
$config['db_name'] = '{{ lacre_db_name }}';
|
||||
|
||||
//database host
|
||||
$config['db_host'] = '{{ lacre_db_host }}';
|
||||
|
||||
//database username
|
||||
$config['db_username'] = '{{ lacre_db_username }}';
|
||||
|
||||
//database password
|
||||
$config['db_password'] = '{{ lacre_db_password }}';
|
||||
|
||||
//
|
||||
// PGP VERIFICATION SETTINGS
|
||||
//
|
||||
|
||||
//whether to enable immediate verification of PGP keys
|
||||
// keys will always be verified with the email address in our cron job
|
||||
// but this will enable verification from the web interface before email confirmation
|
||||
//for this to work, Crypt_GPG from http://pear.php.net/Crypt_GPG must be installed
|
||||
// (as well as any of its dependencies), and pgpverify_tmpdir must be set
|
||||
$config['pgpverify_enable'] = {{ lacre_webgate_pgpverify }};
|
||||
|
||||
//a temporary directory to use for PGP verification, without trailing slash
|
||||
// gpgmw will create subdirectories from here to use as temporary gpg home directories
|
||||
// these directories will (should) be deleted immediately after use
|
||||
$config['pgpverify_tmpdir'] = '{{ lacre_webgate_pgpverify_tmpdir }}';
|
||||
|
||||
//whether to allow blank "keys"
|
||||
// this is useful to allow users to delete their key from the keystore
|
||||
// if they no longer want encryption
|
||||
$config['pgpverify_allowblank'] = {{ lacre_webgate_pgpverify_allowblank }};
|
||||
|
||||
//
|
||||
// LOCK SETTINGS
|
||||
//
|
||||
|
||||
//the time in seconds a user must wait before trying again; otherwise they get locked out (count not increased)
|
||||
$config['lock_time_initial'] = array('requestpgp' => {{ lacre_webgate_lock_time }});
|
||||
|
||||
//the number of tries a user has (that passes the lock_time_initial test) before being locked by overload (extended duration)
|
||||
$config['lock_count_overload'] = array('requestpgp' => {{ lacre_webgate_lock_retrycount }});
|
||||
|
||||
//the time that overloads last
|
||||
$config['lock_time_overload'] = array('requestpgp' => {{ lacre_webgate_lock_time }});
|
||||
|
||||
//time after which locks no longer apply, assuming the lock isn't active
|
||||
$config['lock_time_reset'] = {{ lacre_webgate_lock_reset }};
|
||||
|
||||
//max time to store locks in the database; this way we can clear old locks with one function
|
||||
$config['lock_time_max'] = {{ lacre_webgate_locktime_max }};
|
||||
|
||||
?>
|
||||
|
136
templates/etc/gpg-mailgate.conf.j2
Normal file
136
templates/etc/gpg-mailgate.conf.j2
Normal file
|
@ -0,0 +1,136 @@
|
|||
[default]
|
||||
# Whether gpg-mailgate should add a header after it has processed an email
|
||||
# This may be useful for debugging purposes
|
||||
add_header = {{ lacre_add_header }}
|
||||
|
||||
# Whether we should only encrypt emails if they are explicitly defined in
|
||||
# the key mappings below ([enc_keymap] section)
|
||||
# This means gpg-mailgate won't automatically detect PGP recipients for encrypting
|
||||
enc_keymap_only = {{ lacre_enc_keymap_only }}
|
||||
|
||||
# Whether we should only decrypt emails if they are explicitly defined in
|
||||
# the key mappings below ([dec_keymap] section)
|
||||
# This means gpg-mailgate won't automatically detect PGP recipients for decrypting
|
||||
dec_keymap_only = {{ lacre_dec_keymap_only }}
|
||||
|
||||
# If dec_keymap_only is set to yes and recipients have private keys present for decrypting
|
||||
# but are not on in the keymap, this can cause that mails for them will be
|
||||
# encrypted. Set this to no if you want this behaviour.
|
||||
failsave_dec = {{ lacre_failsave_dec }}
|
||||
|
||||
# Convert encrypted text/plain email to MIME-attached encrypt style.
|
||||
# (Default is to use older inline-style PGP encoding.)
|
||||
mime_conversion = {{ lacre_mime_conversion }}
|
||||
|
||||
# RFC 2821 defines that the user part (User@domain.tld) of a mail address should be treated case sensitive.
|
||||
# However, in the real world this is ignored very often. This option disables the RFC 2821
|
||||
# compatibility so both the user part and the domain part are treated case insensitive.
|
||||
# Disabling the compatibility is more convenient to users. So if you know that your
|
||||
# recipients all ignore the RFC you could this to yes.
|
||||
mail_case_insensitive = {{ lacre_mail_case_insensitive }}
|
||||
|
||||
# This setting disables PGP/INLINE decryption completely. However,
|
||||
# PGP/MIME encrypted mails will still be decrypted if possible. PGP/INLINE
|
||||
# decryption has to be seen as experimental and could have some negative
|
||||
# side effects. So if you want to take the risk set this to no.
|
||||
no_inline_dec = {{ lacre_no_inline_dec }}
|
||||
|
||||
# Here you can define a regex for which the gateway should try to decrypt mails.
|
||||
# It could be used to define that decryption should be used for a wider range of
|
||||
# mail addresses e.g. a whole domain. No key is needed here. It is even active if
|
||||
# dec_keymap is set to yes. If this feature should be disabled, don't leave it blank.
|
||||
# Set it to None. For further regex information please have a look at
|
||||
# https://docs.python.org/2/library/re.html
|
||||
dec_regex = {{ lacre_dec_regex }}
|
||||
|
||||
[gpg]
|
||||
# the directory where gpg-mailgate public keys are stored
|
||||
# (see INSTALL for details)
|
||||
keyhome = {{ lacre_keyhome }}
|
||||
|
||||
[smime]
|
||||
# the directory for the S/MIME certificate files
|
||||
cert_path = {{ lacre_cert_path }}
|
||||
|
||||
[mailregister]
|
||||
# settings for the register-handler
|
||||
register_email = {{ lacre_register_email }}
|
||||
mail_templates = {{ lacre_mail_templates }}
|
||||
# URL to webpanel. The server should be able to reach it
|
||||
webpanel_url = {{ lacre_webpanel_url }}
|
||||
|
||||
[cron]
|
||||
# settings for the gpgmw cron job
|
||||
send_email = yes
|
||||
notification_email = {{ lacre_notification_email }}
|
||||
mail_templates = {{ lacre_mail_templates }}
|
||||
|
||||
[logging]
|
||||
# For logging to syslog. 'file = syslog', otherwise use path to the file.
|
||||
file = syslog
|
||||
verbose = {{ lacre_verbose }}
|
||||
|
||||
[relay]
|
||||
# the relay settings to use for Postfix
|
||||
# gpg-mailgate will submit email to this relay after it is done processing
|
||||
# unless you alter the default Postfix configuration, you won't have to modify this
|
||||
host = {{ lacre_relay }}
|
||||
port = {{ lacre_port }}
|
||||
# This is the default port of postfix. It is used to send some
|
||||
# mails through the GPG-Mailgate so they are encrypted
|
||||
enc_port = {{ lacre_enc_port }}
|
||||
|
||||
# Set this option to yes to use TLS for SMTP Servers which require TLS.
|
||||
starttls = {{ lacre_starttls }}
|
||||
|
||||
[database]
|
||||
# uncomment the settings below if you want
|
||||
# to read keys from a gpg-mailgate-web database
|
||||
enabled = {{ lacre_db_enabled }}
|
||||
name = {{ lacre_db_name }}
|
||||
host = {{ lacre_db_host }}
|
||||
username = {{ lacre_db_username }}
|
||||
password = {{ lacre_db_password }}
|
||||
|
||||
[enc_keymap]
|
||||
# You can find these by running the following command:
|
||||
# gpg --list-keys --keyid-format long user@example.com
|
||||
# Which will return output similar to:
|
||||
# pub 1024D/AAAAAAAAAAAAAAAA 2007-10-22
|
||||
# uid Joe User <user@example.com>
|
||||
# sub 2048g/BBBBBBBBBBBBBBBB 2007-10-22
|
||||
# You want the AAAAAAAAAAAAAAAA not BBBBBBBBBBBBBBBB.
|
||||
#you@domain.tld = 12345678
|
||||
|
||||
[enc_domain_keymap]
|
||||
# This seems to be similar to the [enc_keymap] section. However, you
|
||||
# can define default keys for a domain here. Entries in the enc_keymap
|
||||
# and individual keys stored on the system have a higher priority than
|
||||
# the default keys specified here.
|
||||
#
|
||||
#
|
||||
# You can find these by running the following command:
|
||||
# gpg --list-keys --keyid-format long user@example.com
|
||||
# Which will return output similar to:
|
||||
# pub 1024D/AAAAAAAAAAAAAAAA 2007-10-22
|
||||
# uid Joe User <user@example.com>
|
||||
# sub 2048g/BBBBBBBBBBBBBBBB 2007-10-22
|
||||
# You want the AAAAAAAAAAAAAAAA not BBBBBBBBBBBBBBBB.
|
||||
#domain.tld = 12345678
|
||||
|
||||
[dec_keymap]
|
||||
# You can find these by running the following command:
|
||||
# gpg --list-secret-keys --keyid-format long user@example.com
|
||||
# Which will return output similar to:
|
||||
# sec 1024D/AAAAAAAAAAAAAAAA 2007-10-22
|
||||
# uid Joe User <user@example.com>
|
||||
# ssb 2048g/BBBBBBBBBBBBBBBB 2007-10-22
|
||||
# You want the AAAAAAAAAAAAAAAA not BBBBBBBBBBBBBBBB.
|
||||
#you@domain.tld = 12345678
|
||||
|
||||
[pgp_style]
|
||||
# Here a PGP style (inline or PGP/MIME) could be defined for recipients.
|
||||
# This overwrites the setting mime_conversion for the defined recipients.
|
||||
# Valid entries are inline and mime
|
||||
# If an entry is not valid, the setting mime_conversion is used as fallback.
|
||||
#you@domian.tld = mime
|
Loading…
Reference in a new issue