From 9a43da946a2d8ac228a78fc948182f917358a2f2 Mon Sep 17 00:00:00 2001 From: Grant Slater Date: Wed, 8 Mar 2023 09:15:30 +0000 Subject: [PATCH] Remove old forum code. Add cert to discourse --- .github/workflows/test-kitchen.yml | 1 - .kitchen.yml | 3 - cookbooks/community/recipes/default.rb | 2 +- cookbooks/exim/files/default/noreply/forum | 9 -- cookbooks/forum/README.md | 4 - cookbooks/forum/attributes/default.rb | 2 - cookbooks/forum/metadata.rb | 13 -- cookbooks/forum/recipes/default.rb | 124 ------------------ cookbooks/forum/templates/default/apache.erb | 60 --------- .../forum/templates/default/backup.cron.erb | 21 --- .../forum/templates/default/config.php.erb | 17 --- .../supybot/templates/default/git.conf.erb | 8 -- roles/clifford.rb | 12 +- roles/forum.rb | 20 --- test/data_bags/accounts/forum.json | 6 - 15 files changed, 2 insertions(+), 300 deletions(-) delete mode 100644 cookbooks/exim/files/default/noreply/forum delete mode 100644 cookbooks/forum/README.md delete mode 100644 cookbooks/forum/attributes/default.rb delete mode 100644 cookbooks/forum/metadata.rb delete mode 100644 cookbooks/forum/recipes/default.rb delete mode 100644 cookbooks/forum/templates/default/apache.erb delete mode 100644 cookbooks/forum/templates/default/backup.cron.erb delete mode 100644 cookbooks/forum/templates/default/config.php.erb delete mode 100644 roles/forum.rb delete mode 100644 test/data_bags/accounts/forum.json diff --git a/.github/workflows/test-kitchen.yml b/.github/workflows/test-kitchen.yml index 69995287d..1d3f1afb4 100644 --- a/.github/workflows/test-kitchen.yml +++ b/.github/workflows/test-kitchen.yml @@ -38,7 +38,6 @@ jobs: - elasticsearch - exim - fail2ban - - forum - foundation-board - foundation-dwg - foundation-mwg diff --git a/.kitchen.yml b/.kitchen.yml index b298b8f60..8f0c0fc41 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -124,9 +124,6 @@ suites: - name: fail2ban run_list: - recipe[fail2ban::default] - - name: forum - run_list: - - recipe[forum::default] - name: foundation-board run_list: - recipe[foundation::board] diff --git a/cookbooks/community/recipes/default.rb b/cookbooks/community/recipes/default.rb index 98dea4836..76b8a97b6 100644 --- a/cookbooks/community/recipes/default.rb +++ b/cookbooks/community/recipes/default.rb @@ -96,7 +96,7 @@ template "/srv/community.openstreetmap.org/docker/containers/mail-receiver.yml" end ssl_certificate "community.openstreetmap.org" do - domains ["community.openstreetmap.org", "community.osm.org", "communities.openstreetmap.org", "communities.osm.org", "c.openstreetmap.org", "c.osm.org"] + domains ["community.openstreetmap.org", "community.osm.org", "communities.openstreetmap.org", "communities.osm.org", "c.openstreetmap.org", "c.osm.org", "forum.openstreetmap.org", "forum.osm.org"] notifies :run, "notify_group[discourse_container_new_web_only]" notifies :run, "notify_group[discourse_container_new_mail_receiver]" end diff --git a/cookbooks/exim/files/default/noreply/forum b/cookbooks/exim/files/default/noreply/forum deleted file mode 100644 index c2f80aac6..000000000 --- a/cookbooks/exim/files/default/noreply/forum +++ /dev/null @@ -1,9 +0,0 @@ -This is an automated response to your email, which was sent to an -unattended address. - -If you are having technical problems with the forums then please -contact support@openstreetmap.org for assistance. - -Thank you, - -OpenStreetMap Administrators diff --git a/cookbooks/forum/README.md b/cookbooks/forum/README.md deleted file mode 100644 index 062e3f6a2..000000000 --- a/cookbooks/forum/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Forum Cookbook - -This cookbook installs and configures the fluxbb forums software used at -https://forum.openstreetmap.org diff --git a/cookbooks/forum/attributes/default.rb b/cookbooks/forum/attributes/default.rb deleted file mode 100644 index 9f4114f80..000000000 --- a/cookbooks/forum/attributes/default.rb +++ /dev/null @@ -1,2 +0,0 @@ -# Enable the "forum" role -default[:accounts][:users][:forum][:status] = :role diff --git a/cookbooks/forum/metadata.rb b/cookbooks/forum/metadata.rb deleted file mode 100644 index 6721b1ca1..000000000 --- a/cookbooks/forum/metadata.rb +++ /dev/null @@ -1,13 +0,0 @@ -name "forum" -maintainer "OpenStreetMap Administrators" -maintainer_email "admins@openstreetmap.org" -license "Apache-2.0" -description "Installs and configures a roundup server" - -version "1.0.0" -supports "ubuntu" -depends "accounts" -depends "apache" -depends "git" -depends "mysql" -depends "php" diff --git a/cookbooks/forum/recipes/default.rb b/cookbooks/forum/recipes/default.rb deleted file mode 100644 index ae32e4d01..000000000 --- a/cookbooks/forum/recipes/default.rb +++ /dev/null @@ -1,124 +0,0 @@ -# -# Cookbook:: forum -# Recipe:: default -# -# Copyright:: 2014, OpenStreetMap Foundation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -include_recipe "accounts" -include_recipe "apache" -include_recipe "git" -include_recipe "mysql" -include_recipe "php::fpm" - -cache_dir = Chef::Config[:file_cache_path] - -passwords = data_bag_item("forum", "passwords") - -package %w[ - php-cli - php-mysql - php-xml - php-apcu -] - -apache_module "env" -apache_module "rewrite" - -ssl_certificate "forum.openstreetmap.org" do - domains ["forum.openstreetmap.org", "forum.osm.org"] - notifies :reload, "service[apache2]" -end - -php_fpm "forum.openstreetmap.org" do - php_admin_values "open_basedir" => "/srv/forum.openstreetmap.org/html/:/usr/share/php/:/tmp/", - "disable_functions" => "exec,shell_exec,system,passthru,popen,proc_open" - prometheus_port 9253 -end - -apache_site "forum.openstreetmap.org" do - template "apache.erb" -end - -directory "/srv/forum.openstreetmap.org" do - owner "forum" - group "forum" - mode "755" -end - -git "/srv/forum.openstreetmap.org/html/" do - action :sync - repository "http://github.com/openstreetmap/openstreetmap-forum.git" - revision "openstreetmap-1.5.10" - depth 1 - user "forum" - group "forum" - notifies :reload, "service[apache2]" -end - -remote_file "#{cache_dir}/air3_v0.8.tar.gz" do - action :create_if_missing - source "https://github.com/natrius/air3/archive/refs/tags/v0.8.tar.gz" - owner "root" - group "root" - mode "644" - backup false -end - -archive_file "#{cache_dir}/air3_v0.8.tar.gz" do - action :nothing - destination "/srv/forum.openstreetmap.org/html/style" - strip_components 1 - overwrite true - owner "forum" - group "forum" - subscribes :extract, "remote_file[#{cache_dir}/air3_v0.8.tar.gz]", :immediately -end - -directory "/srv/forum.openstreetmap.org/html/cache/" do - owner "www-data" - group "www-data" - mode "755" -end - -directory "/srv/forum.openstreetmap.org/html/img/avatars/" do - owner "www-data" - group "www-data" - mode "755" -end - -template "/srv/forum.openstreetmap.org/html/config.php" do - source "config.php.erb" - owner "forum" - group "www-data" - mode "440" - variables :passwords => passwords -end - -mysql_user "forum@localhost" do - password passwords["database"] -end - -mysql_database "forum" do - permissions "forum@localhost" => :all -end - -template "/etc/cron.daily/forum-backup" do - source "backup.cron.erb" - owner "root" - group "root" - mode "750" - variables :passwords => passwords -end diff --git a/cookbooks/forum/templates/default/apache.erb b/cookbooks/forum/templates/default/apache.erb deleted file mode 100644 index 5235ee1f8..000000000 --- a/cookbooks/forum/templates/default/apache.erb +++ /dev/null @@ -1,60 +0,0 @@ -# DO NOT EDIT - This file is being maintained by Chef - - - ServerName forum.openstreetmap.org - ServerAlias forum.osm.org - ServerAdmin webmaster@openstreetmap.org - - CustomLog /var/log/apache2/forum.openstreetmap.org-access.log combined - ErrorLog /var/log/apache2/forum.openstreetmap.org-error.log - - RedirectPermanent /.well-known/acme-challenge/ http://acme.openstreetmap.org/.well-known/acme-challenge/ - RedirectPermanent / https://forum.openstreetmap.org/ - - - - ServerAlias forum.osm.org - ServerAdmin webmaster@openstreetmap.org - - SSLEngine on - SSLCertificateFile /etc/ssl/certs/forum.openstreetmap.org.pem - SSLCertificateKeyFile /etc/ssl/private/forum.openstreetmap.org.key - - CustomLog /var/log/apache2/forum.openstreetmap.org-access.log combined - ErrorLog /var/log/apache2/forum.openstreetmap.org-error.log - - RedirectPermanent / https://forum.openstreetmap.org/ - - - - ServerName forum.openstreetmap.org - ServerAdmin webmaster@openstreetmap.org - - SSLEngine on - SSLCertificateFile /etc/ssl/certs/forum.openstreetmap.org.pem - SSLCertificateKeyFile /etc/ssl/private/forum.openstreetmap.org.key - - CustomLog /var/log/apache2/forum.openstreetmap.org-access.log combined - ErrorLog /var/log/apache2/forum.openstreetmap.org-error.log - - DocumentRoot /srv/forum.openstreetmap.org/html - - - SetHandler "proxy:unix:/run/php/php-forum.openstreetmap.org-fpm.sock|fcgi://127.0.0.1" - - - - - RewriteEngine on - RewriteRule ^config\.php$ - [F,L] - - Options -Indexes - - Require all granted - - - - - SetHandler None - - diff --git a/cookbooks/forum/templates/default/backup.cron.erb b/cookbooks/forum/templates/default/backup.cron.erb deleted file mode 100644 index 517f71634..000000000 --- a/cookbooks/forum/templates/default/backup.cron.erb +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh - -# DO NOT EDIT - This file is being maintained by Chef - -T=$(mktemp -d -t -p /var/tmp forum.XXXXXXXXXX) -D=$(date +%Y-%m-%d) -B=forum-$D.tar.gz - -mkdir $T/forum-$D -echo '[mysqldump]' > $T/mysqldump.opts -echo 'user=forum' >> $T/mysqldump.opts -echo 'password=<%= @passwords["database"] %>' >> $T/mysqldump.opts -mysqldump --defaults-file=$T/mysqldump.opts --opt --no-tablespaces forum > $T/forum-$D/forum.sql -ln -s /srv/forum.openstreetmap.org $T/forum-$D/www - -export RSYNC_RSH="ssh -ax" - -nice tar --create --dereference --directory=$T forum-$D | nice gzip --rsyncable -9 > $T/$B -nice rsync --preallocate --fuzzy $T/$B backup::backup - -rm -rf $T diff --git a/cookbooks/forum/templates/default/config.php.erb b/cookbooks/forum/templates/default/config.php.erb deleted file mode 100644 index 91ca73803..000000000 --- a/cookbooks/forum/templates/default/config.php.erb +++ /dev/null @@ -1,17 +0,0 @@ -'; -$db_prefix = 'osm_'; -$p_connect = false; - -$cookie_name = 'forum_cookie'; -$cookie_domain = ''; -$cookie_path = '/'; -$cookie_secure = 1; -$cookie_seed = '<%= @passwords["cookie_seed"] %>'; - -define('PUN', 1); diff --git a/cookbooks/supybot/templates/default/git.conf.erb b/cookbooks/supybot/templates/default/git.conf.erb index 7ab082b38..5d19c0095 100644 --- a/cookbooks/supybot/templates/default/git.conf.erb +++ b/cookbooks/supybot/templates/default/git.conf.erb @@ -126,14 +126,6 @@ commit link = https://github.com/osmfoundation/osmf-server-info/commit/%c channels = #osm-dev commit message = [%s|%b|%a] %m %l -[osm-forum] -short name = osm-forum -url = https://github.com/openstreetmap/openstreetmap-forum.git -branch = openstreetmap-1.5.10 -commit link = https://github.com/openstreetmap/openstreetmap-forum/commit/%c -channels = #osm-dev -commit message = [%s|%b|%a] %m %l - [osm-osmosis] short name = osm-osmosis url = https://github.com/openstreetmap/osmosis.git diff --git a/roles/clifford.rb b/roles/clifford.rb index 247125739..ffc4f32fc 100644 --- a/roles/clifford.rb +++ b/roles/clifford.rb @@ -2,15 +2,6 @@ name "clifford" description "Master role applied to clifford" default_attributes( - :exim => { - :rewrites => [ - { - :pattern => "www-data@openstreetmap.org", - :replacement => "forum@noreply.openstreetmap.org", - :flags => "F" - } - ] - }, :networking => { :interfaces => { :internal_ipv4 => { @@ -31,6 +22,5 @@ default_attributes( run_list( "role[ucl]", - "role[hp-dl360-g6]", - "role[forum]" + "role[hp-dl360-g6]" ) diff --git a/roles/forum.rb b/roles/forum.rb deleted file mode 100644 index 0eec150b0..000000000 --- a/roles/forum.rb +++ /dev/null @@ -1,20 +0,0 @@ -name "forum" -description "Role applied to all forum servers" - -default_attributes( - :apache => { - :mpm => "event", - :timeout => 60, - :event => { - :server_limit => 18, - :max_request_workers => 450, - :min_spare_threads => 50, - :max_spare_threads => 150, - :listen_cores_buckets_ratio => 4 - } - } -) - -run_list( - "recipe[forum]" -) diff --git a/test/data_bags/accounts/forum.json b/test/data_bags/accounts/forum.json deleted file mode 100644 index 12c9e3837..000000000 --- a/test/data_bags/accounts/forum.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "id": "forum", - "uid": "522", - "comment": "Forum", - "manage_home": false -} -- 2.39.5