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