]> git.openstreetmap.org Git - chef.git/commitdiff
Remove old forum code. Add cert to discourse
authorGrant Slater <github@firefishy.com>
Wed, 8 Mar 2023 09:15:30 +0000 (09:15 +0000)
committerGrant Slater <github@firefishy.com>
Wed, 8 Mar 2023 09:15:30 +0000 (09:15 +0000)
15 files changed:
.github/workflows/test-kitchen.yml
.kitchen.yml
cookbooks/community/recipes/default.rb
cookbooks/exim/files/default/noreply/forum [deleted file]
cookbooks/forum/README.md [deleted file]
cookbooks/forum/attributes/default.rb [deleted file]
cookbooks/forum/metadata.rb [deleted file]
cookbooks/forum/recipes/default.rb [deleted file]
cookbooks/forum/templates/default/apache.erb [deleted file]
cookbooks/forum/templates/default/backup.cron.erb [deleted file]
cookbooks/forum/templates/default/config.php.erb [deleted file]
cookbooks/supybot/templates/default/git.conf.erb
roles/clifford.rb
roles/forum.rb [deleted file]
test/data_bags/accounts/forum.json [deleted file]

index 69995287de9084a4f1e05149e65a608248da81ab..1d3f1afb4c18b4aa40822c9fe88c982a8ba9875d 100644 (file)
@@ -38,7 +38,6 @@ jobs:
           - elasticsearch
           - exim
           - fail2ban
-          - forum
           - foundation-board
           - foundation-dwg
           - foundation-mwg
index b298b8f60869cf784ef89bf1bfbc33cc2b4be489..8f0c0fc41f7bbc4c8fc28e3e7866451f0c6dda2f 100644 (file)
@@ -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]
index 98dea48368516c0234eb7de6b5f86af78dba0908..76b8a97b62333c052d1f9c3b8bfcfc2ff472d5eb 100644 (file)
@@ -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 (file)
index c2f80aa..0000000
+++ /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 (file)
index 062e3f6..0000000
+++ /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 (file)
index 9f4114f..0000000
+++ /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 (file)
index 6721b1c..0000000
+++ /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 (file)
index ae32e4d..0000000
+++ /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 (file)
index 5235ee1..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-# DO NOT EDIT - This file is being maintained by Chef
-
-<VirtualHost *:80>
-       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/
-</VirtualHost>
-
-<VirtualHost *:443>
-       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/
-</VirtualHost>
-
-<VirtualHost *:443>
-       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
-
-       <FilesMatch ".+\.ph(ar|p|tml)$">
-               SetHandler "proxy:unix:/run/php/php-forum.openstreetmap.org-fpm.sock|fcgi://127.0.0.1"
-       </FilesMatch>
-</VirtualHost>
-
-<Directory /srv/forum.openstreetmap.org/html>
-       RewriteEngine on
-       RewriteRule ^config\.php$ - [F,L]
-
-       Options -Indexes
-
-       Require all granted
-</Directory>
-
-<Directory /srv/forum.openstreetmap.org/html/img>
-       <FilesMatch ".+\.ph(ar|p|tml)$">
-               SetHandler None
-       </FilesMatch>
-</Directory>
diff --git a/cookbooks/forum/templates/default/backup.cron.erb b/cookbooks/forum/templates/default/backup.cron.erb
deleted file mode 100644 (file)
index 517f716..0000000
+++ /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 (file)
index 91ca738..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-<?php
-
-$db_type = 'mysqli';
-$db_host = 'localhost';
-$db_name = 'forum';
-$db_username = 'forum';
-$db_password = '<%= @passwords["database"] %>';
-$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);
index 7ab082b38da1ac3ed5c531ca6c213cd320ecbeea..5d19c0095adc9ce3b4a006468b6ab48ead9c574d 100644 (file)
@@ -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
index 2471257396b027f3aafb55242c810179ae47d056..ffc4f32fce5bcad0e6e17700646abce3790b685c 100644 (file)
@@ -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 (file)
index 0eec150..0000000
+++ /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 (file)
index 12c9e38..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-{
-  "id": "forum",
-  "uid": "522",
-  "comment": "Forum",
-  "manage_home": false
-}