From ebd87990bebd8ad3505072fb603ec9b3fe811602 Mon Sep 17 00:00:00 2001 From: Chris Croome <chris@webarchitects.co.uk> Date: Mon, 8 May 2017 12:51:28 +0100 Subject: [PATCH] Exim removal and README update for Postfix --- README.md | 35 +++++++++++--------- roles/api/tasks/main.yml | 2 +- roles/email/files/00_local | 1 - roles/email/files/30_exim4-config_discourse | 4 --- roles/email/files/450_exim4-config_discourse | 4 --- roles/email/templates/update-exim4.j2 | 32 ------------------ 6 files changed, 21 insertions(+), 57 deletions(-) delete mode 100644 roles/email/files/00_local delete mode 100644 roles/email/files/30_exim4-config_discourse delete mode 100644 roles/email/files/450_exim4-config_discourse delete mode 100644 roles/email/templates/update-exim4.j2 diff --git a/README.md b/README.md index 100782c..216f64a 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,19 @@ These Playbooks are designed to be used on Debian Stretch virtual servers. ## Discourse +Ansible Playbooks to install Discourse via Docker on a Debian Stretch virtual +server and to configure the virtual server to use Postfix for incoming and +outgoing emails (there is also a not-quite-working and, for now, abandoned +[exim branch](https://git.coop/cotech/ansible/tree/exim). + +The email setup is based on the [mail-reciever Docker +container](https://github.com/discourse/mail-receiver) plus [this pull +request](https://github.com/discourse/mail-receiver/pull/2) (which is now +merged) and the [Postfix notes for using the host for outgoing +email](https://meta.discourse.org/t/emails-with-local-smtp/23645/28), with an +additional [Ruby +script](https://git.coop/cotech/ansible/blob/master/roles/email/files/discourse-smtp-rcpt-acl). + Login to the virtual server console, install `python`, enable root ssh access using keys by adding your keys to `/root/.ssh/authorized_keys`, edit `/etc/sshd/sshd_config` to set `PermitRootLogin prohibit-password`, run @@ -53,11 +66,11 @@ the host for outgoing email, but then we switched it over to use Exim. Initial settings used for `community.coops.tech` when it was created: * title: Cooperative Technologists Community -* site description: The intersection of co-operation and technology, the CoTech community forum. -* contact email: community@coops.tech -* contact url: https://www.coops.tech/ -* notification email: discourse@community.coops.tech -* site contact username: system +* site description: The intersection of co-operation and digtal technology, the CoTech community forum. +* contact email: `community@coops.tech` +* contact url: `https://www.coops.tech/` +* notification email: `discourse@community.coops.tech` +* site contact username: `system` * logo url: https://wiki.coops.tech/wiki/File:Cotech-blue.png * logo small url: https://wiki.coops.tech/wiki/File:Cotech-blue-text.png * company short name: CoTech @@ -70,7 +83,7 @@ On the Email settings admin page: * reply by email enabled * reply by email address: `discourse+%{reply_key}@community.coops.tech` * manual polling enabled -* email prefix: cotech-community +* email prefix: `cotech-community` * email site title: CoTech Community On the Security page: @@ -87,14 +100,6 @@ On the User Preferences page: The first post text: -Welcome to the **Cooperative Technologists Community**, we are a network of technology focused cooperatives, [CoTech](https://www.coops.tech/), who are *"building a tech industry that's better for its workers and customers through co-operation, democracy and worker ownership."* This is our open community discussion forum, you don't have to be a member of a coop to join this community but you do need to support [the cooperative values and principles](http://ica.coop/en/whats-co-op/co-operative-identity-values-principles) and have an interest in technology, you can find out more [about us](https://www.coops.tech/about), read [our manifesto](https://www.coops.tech/manifesto), see who we are and who we have worked for and watch [a video made at our first gathering](https://vimeo.com/196080655) on [www.coops.tech](https://www.coops.tech/). We also have [a wiki](https://wiki.coops.tech/) and a decision making group on [Loomio](https://www.loomio.org/g/oVwtKDOn/digital-co-ops), [Slack channels](https://tech-coops.slack.com/) and (for now, we might close it and use Discourse) a public [email list](https://www.email-lists.org/mailman/listinfo/tech-coops). +Welcome to the **Cooperative Technologists Community**, we are a network of technology focused digital cooperatives, [CoTech](https://www.coops.tech/), who are *"building a tech industry that's better for its workers and customers through co-operation, democracy and worker ownership."* This is our open community discussion forum, you don't have to be a member of a coop to join this community but you do need to support [the cooperative values and principles](http://ica.coop/en/whats-co-op/co-operative-identity-values-principles) and have an interest in technology, you can find out more [about us](https://www.coops.tech/about), read [our manifesto](https://www.coops.tech/manifesto), see who we are and who we have worked for and watch [a video made at our first gathering](https://vimeo.com/196080655) on [www.coops.tech](https://www.coops.tech/). We also have [a wiki](https://wiki.coops.tech/) and a decision making group on [Loomio](https://www.loomio.org/g/oVwtKDOn/digital-co-ops), [Slack channels](https://tech-coops.slack.com/) and (for now, we might close it and use Discourse) a public [email list](https://www.email-lists.org/mailman/listinfo/tech-coops). *Please read [our community guidelines](https://community.coops.tech/guidelines) before signing up for an account here.* - - - - - - - - diff --git a/roles/api/tasks/main.yml b/roles/api/tasks/main.yml index 1efebcb..84edddf 100644 --- a/roles/api/tasks/main.yml +++ b/roles/api/tasks/main.yml @@ -11,7 +11,7 @@ src: templates/mail-receiver-environment.json.j2 dest: /etc/postfix/mail-receiver-environment.json mode: 0640 - group: Debian-exim + group: root owner: root when: mail_receiver_environment.stat.exists == False diff --git a/roles/email/files/00_local b/roles/email/files/00_local deleted file mode 100644 index 97ea365..0000000 --- a/roles/email/files/00_local +++ /dev/null @@ -1 +0,0 @@ -CHECK_RCPT_LOCAL_ACL_FILE = CONFDIR/check_rcpt_local_acl diff --git a/roles/email/files/30_exim4-config_discourse b/roles/email/files/30_exim4-config_discourse deleted file mode 100644 index 1c1635b..0000000 --- a/roles/email/files/30_exim4-config_discourse +++ /dev/null @@ -1,4 +0,0 @@ -discourse_transport: - driver = pipe - command = /usr/local/bin/receive-mail ${local_part}@${domain} - diff --git a/roles/email/files/450_exim4-config_discourse b/roles/email/files/450_exim4-config_discourse deleted file mode 100644 index 50d92b4..0000000 --- a/roles/email/files/450_exim4-config_discourse +++ /dev/null @@ -1,4 +0,0 @@ -discourse_router: - driver = accept - transport = discourse_transport - diff --git a/roles/email/templates/update-exim4.j2 b/roles/email/templates/update-exim4.j2 deleted file mode 100644 index 883a8ab..0000000 --- a/roles/email/templates/update-exim4.j2 +++ /dev/null @@ -1,32 +0,0 @@ -# /etc/exim4/update-exim4.conf.conf -# -# Edit this file and /etc/mailname by hand and execute update-exim4.conf -# yourself or use 'dpkg-reconfigure exim4-config' -# -# Please note that this is _not_ a dpkg-conffile and that automatic changes -# to this file might happen. The code handling this will honor your local -# changes, so this is usually fine, but will break local schemes that mess -# around with multiple versions of the file. -# -# update-exim4.conf uses this file to determine variable values to generate -# exim configuration macros for the configuration file. -# -# Most settings found in here do have corresponding questions in the -# Debconf configuration, but not all of them. -# -# This is a Debian specific file - -dc_eximconfig_configtype='internet' -dc_other_hostnames='{{ hostname }}' -dc_local_interfaces='' -dc_readhost='' -dc_relay_domains='' -dc_minimaldns='false' -dc_relay_nets='{{ app_ip_address.stdout }}/32' -dc_smarthost='' -CFILEMODE='644' -dc_use_split_config='true' -dc_hide_mailname='' -dc_mailname_in_oh='true' -dc_localdelivery='mail_spool' - -- GitLab