Commit 034f07e870b8c0c709d2f6be11ead771b386eb6e

Authored by Antonio Terceiro
1 parent ae35908e

Mailman web ui

config/roles/integration_server.rb
... ... @@ -3,4 +3,4 @@ description "Server that runs COLAB (user authentication, visual integration and
3 3  
4 4 # TODO colab and mailman-api should be able to run in separate hosts at some
5 5 # point in the future
6   -run_list 'recipe[mailman-api]', 'recipe[mailman]', 'recipe[colab]', 'recipe[basics::nginx]', 'recipe[colab::nginx]'
  6 +run_list 'recipe[mailman-api]', 'recipe[mailman]', 'recipe[mailman::webui]', 'recipe[colab]', 'recipe[basics::nginx]', 'recipe[colab::nginx]'
... ...
cookbooks/mailman/files/centos/mailman.repo 0 → 100644
... ... @@ -0,0 +1,7 @@
  1 +[isv_spb_mailman]
  2 +name=mailman (CentOS_7)
  3 +type=rpm-md
  4 +baseurl=http://download.opensuse.org/repositories/isv:/spb:/mailman/CentOS_7/
  5 +gpgcheck=1
  6 +gpgkey=file:///etc/yum.repos.d/softwarepublico.key
  7 +enabled=1
... ...
cookbooks/mailman/files/centos/spawn-fcgi 0 → 100644
... ... @@ -0,0 +1,2 @@
  1 +SOCKET=/var/run/fcgiwrap.socket
  2 +OPTIONS="-u nginx -g apache -s $SOCKET -S -M 0600 -C 32 -F 1 -P /var/run/spawn-fcgi.pid -- /usr/sbin/fcgiwrap"
... ...
cookbooks/mailman/recipes/webui.rb 0 → 100644
... ... @@ -0,0 +1,30 @@
  1 +if node['platform'] == 'centos'
  2 + cookbook_file '/etc/yum.repos.d/mailman.repo' do
  3 + owner 'root'
  4 + mode 0644
  5 + end
  6 +end
  7 +
  8 +package 'fcgiwrap'
  9 +package 'spawn-fcgi'
  10 +
  11 +hostname = node['config']['lists_hostname']
  12 +template "/etc/nginx/conf.d/#{hostname}.conf" do
  13 + source 'mailman.conf.erb'
  14 + owner 'root'
  15 + group 'root'
  16 + mode 0644
  17 + notifies :restart, 'service[nginx]'
  18 +end
  19 +
  20 +cookbook_file '/etc/sysconfig/spawn-fcgi' do
  21 + owner 'root'
  22 + group 'root'
  23 + mode 0644
  24 + notifies :restart, 'service[spawn-fcgi]'
  25 +end
  26 +
  27 +service 'spawn-fcgi' do
  28 + action [:enable, :start]
  29 + supports :restart => true
  30 +end
... ...
cookbooks/mailman/templates/centos/mailman.conf.erb 0 → 100644
... ... @@ -0,0 +1,30 @@
  1 +server {
  2 + server_name <%= node['config']['lists_hostname'] %>;
  3 + listen 80;
  4 +
  5 + location = / {
  6 + rewrite ^ /mailman/cgi-bin/listinfo permanent;
  7 + }
  8 +
  9 + location / {
  10 + rewrite ^ /mailman/cgi-bin$uri?$args;
  11 + }
  12 +
  13 + location /mailman/cgi-bin/ {
  14 + root /usr/lib/;
  15 + fastcgi_split_path_info (^/mailman/cgi-bin/[^/]*)(.*)$;
  16 + include /etc/nginx/fastcgi_params;
  17 + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  18 + fastcgi_param PATH_INFO $fastcgi_path_info;
  19 + fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
  20 + fastcgi_intercept_errors on;
  21 + fastcgi_pass unix:/var/run/fcgiwrap.socket;
  22 + }
  23 + location /icons {
  24 + alias /usr/lib/mailman/icons;
  25 + }
  26 + location /pipermail {
  27 + alias /var/lib/mailman/archives/public;
  28 + autoindex on;
  29 + }
  30 +}
... ...
cookbooks/mailman/templates/centos/mm_cfg.py.erb
... ... @@ -20,6 +20,7 @@ DEFAULT_URL_HOST = &#39;&lt;%= node[&#39;config&#39;][&#39;external_hostname&#39;] %&gt;&#39;
20 20 DEFAULT_EMAIL_HOST = '<%= node['config']['lists_hostname'] %>'
21 21 MTA = None
22 22 POSTFIX_STYLE_VIRTUAL_DOMAINS = ['<%= node['config']['lists_hostname']%>']
  23 +DEFAULT_URL_PATTERN = 'http://%s/mailman/cgi-bin/'
23 24  
24 25 ###############################################################
25 26 # copied from default mailman config file
... ...