]> git.openstreetmap.org Git - chef.git/commitdiff
Merge remote-tracking branch 'github/pull/528'
authorTom Hughes <tom@compton.nu>
Sat, 10 Dec 2022 11:35:46 +0000 (11:35 +0000)
committerTom Hughes <tom@compton.nu>
Sat, 10 Dec 2022 11:35:46 +0000 (11:35 +0000)
286 files changed:
.github/workflows/cookstyle.yml
.github/workflows/test-kitchen.yml
.kitchen.yml
.rubocop.yml
.ruby-version
Dockerfile
Gemfile.lock
cookbooks/accounts/files/default/grant/.selected_editor [new file with mode: 0644]
cookbooks/accounts/files/default/jeslop/.ssh/authorized_keys [new file with mode: 0644]
cookbooks/accounts/files/default/milliams/.ssh/authorized_keys [new file with mode: 0644]
cookbooks/accounts/files/default/pnorman/.ssh/authorized_keys [new file with mode: 0644]
cookbooks/apache/recipes/default.rb
cookbooks/apache/templates/default/brotli.conf.erb
cookbooks/apache/templates/default/deflate.conf.erb
cookbooks/apt/attributes/default.rb
cookbooks/apt/recipes/default.rb
cookbooks/apt/recipes/docker.rb [new file with mode: 0644]
cookbooks/apt/recipes/elasticsearch6.rb [new file with mode: 0644]
cookbooks/apt/recipes/elasticsearch8.rb [new file with mode: 0644]
cookbooks/apt/recipes/git-core.rb [new file with mode: 0644]
cookbooks/apt/recipes/grafana.rb [new file with mode: 0644]
cookbooks/apt/recipes/hwraid.rb [new file with mode: 0644]
cookbooks/apt/recipes/management-component-pack.rb [new file with mode: 0644]
cookbooks/apt/recipes/maxmind.rb [new file with mode: 0644]
cookbooks/apt/recipes/nginx.rb [new file with mode: 0644]
cookbooks/apt/recipes/nodesource.rb [new file with mode: 0644]
cookbooks/apt/recipes/passenger.rb [new file with mode: 0644]
cookbooks/apt/recipes/postgresql.rb [new file with mode: 0644]
cookbooks/apt/recipes/timescaledb.rb [new file with mode: 0644]
cookbooks/apt/recipes/ubuntugis-stable.rb [new file with mode: 0644]
cookbooks/apt/recipes/ubuntugis-unstable.rb [new file with mode: 0644]
cookbooks/apt/recipes/yarn.rb [new file with mode: 0644]
cookbooks/apt/templates/default/sources.list.erb
cookbooks/backup/files/default/expire-backups
cookbooks/bind/templates/default/db.10.erb
cookbooks/blog/recipes/default.rb
cookbooks/blogs/metadata.rb
cookbooks/blogs/recipes/default.rb
cookbooks/chef/attributes/default.rb
cookbooks/chef/libraries/cpu.rb [new file with mode: 0644]
cookbooks/chef/libraries/edit_file.rb
cookbooks/chef/libraries/persistent_token.rb
cookbooks/chef/libraries/random_password.rb [deleted file]
cookbooks/chef/metadata.rb
cookbooks/chef/recipes/default.rb
cookbooks/chef/recipes/server.rb
cookbooks/civicrm/recipes/default.rb
cookbooks/clamav/metadata.rb
cookbooks/clamav/recipes/default.rb
cookbooks/community/metadata.rb
cookbooks/community/recipes/default.rb
cookbooks/community/templates/default/web_only.yml.erb
cookbooks/db/metadata.rb
cookbooks/db/recipes/backup.rb
cookbooks/db/recipes/base.rb
cookbooks/db/recipes/master.rb
cookbooks/dev/recipes/default.rb
cookbooks/dev/templates/default/apache.phppgadmin.erb
cookbooks/dev/templates/default/apache.user.erb
cookbooks/dev/templates/default/dev.html.erb
cookbooks/dhcpd/templates/default/dhcpd.conf.erb
cookbooks/dmca/templates/default/apache.erb
cookbooks/dns/metadata.rb
cookbooks/dns/recipes/default.rb
cookbooks/dns/templates/default/creds.json.erb
cookbooks/dns/templates/default/dns-update.erb
cookbooks/docker/attributes/default.rb [deleted file]
cookbooks/docker/metadata.rb
cookbooks/docker/recipes/default.rb
cookbooks/donate/metadata.rb
cookbooks/donate/recipes/default.rb
cookbooks/donate/templates/default/apache.erb
cookbooks/elasticsearch/attributes/default.rb
cookbooks/elasticsearch/recipes/default.rb
cookbooks/exim/recipes/default.rb
cookbooks/exim/templates/default/mail.rc.erb [new file with mode: 0644]
cookbooks/fail2ban/recipes/default.rb
cookbooks/forum/templates/default/apache.erb
cookbooks/foundation/recipes/board.rb
cookbooks/foundation/recipes/dwg.rb
cookbooks/foundation/recipes/mwg.rb
cookbooks/foundation/recipes/wiki.rb
cookbooks/foundation/templates/default/robots.txt.erb [new file with mode: 0644]
cookbooks/geodns/recipes/default.rb
cookbooks/geoipupdate/attributes/default.rb
cookbooks/geoipupdate/recipes/default.rb
cookbooks/git/attributes/default.rb
cookbooks/git/recipes/default.rb
cookbooks/git/recipes/web.rb
cookbooks/gps-tile/recipes/default.rb
cookbooks/hardware/attributes/default.rb
cookbooks/hardware/recipes/default.rb
cookbooks/hardware/templates/default/mcelog-trigger.erb [deleted file]
cookbooks/hardware/templates/default/ohai.rb.erb
cookbooks/hardware/templates/default/smart.devices.erb
cookbooks/ideditor/metadata.rb [new file with mode: 0644]
cookbooks/ideditor/recipes/default.rb [new file with mode: 0644]
cookbooks/ideditor/templates/default/apache.erb [new file with mode: 0644]
cookbooks/imagery/recipes/default.rb
cookbooks/imagery/recipes/gb_os_sv.rb
cookbooks/imagery/resources/site.rb
cookbooks/imagery/templates/default/mapserver.map.erb
cookbooks/imagery/templates/default/nginx_imagery_layer_fragment.conf.erb
cookbooks/letsencrypt/recipes/default.rb
cookbooks/logstash/recipes/forwarder.rb
cookbooks/matomo/attributes/default.rb
cookbooks/matomo/metadata.rb
cookbooks/matomo/recipes/default.rb
cookbooks/matomo/templates/default/apache.erb
cookbooks/mediawiki/metadata.rb
cookbooks/mediawiki/recipes/default.rb
cookbooks/mediawiki/resources/site.rb
cookbooks/mediawiki/templates/default/LocalSettings.php.erb
cookbooks/mediawiki/templates/default/apache.erb
cookbooks/munin/recipes/plugins.rb
cookbooks/munin/templates/default/munin.conf.erb
cookbooks/networking/recipes/default.rb
cookbooks/networking/templates/default/shorewall.conf.erb
cookbooks/nginx/attributes/default.rb
cookbooks/nginx/metadata.rb
cookbooks/nginx/recipes/default.rb
cookbooks/nginx/templates/default/nginx-old-cache-cleanup.erb [deleted file]
cookbooks/nodejs/metadata.rb
cookbooks/nodejs/recipes/default.rb
cookbooks/nodejs/templates/default/yarn.erb [deleted file]
cookbooks/nominatim/attributes/default.rb
cookbooks/nominatim/recipes/default.rb
cookbooks/nominatim/templates/default/nginx.erb
cookbooks/nominatim/templates/default/nominatim.env.erb
cookbooks/ntp/templates/default/chrony.conf.erb
cookbooks/openssh/templates/default/ssh_known_hosts.erb
cookbooks/otrs/recipes/default.rb
cookbooks/overpass/attributes/default.rb
cookbooks/overpass/metadata.rb
cookbooks/overpass/recipes/default.rb
cookbooks/overpass/templates/default/apache.erb
cookbooks/overpass/templates/default/overpass-update-db.erb
cookbooks/overpass/templates/default/totp-filter.erb
cookbooks/oxidized/README.md [new file with mode: 0644]
cookbooks/oxidized/attributes/default.rb [new file with mode: 0644]
cookbooks/oxidized/metadata.rb [new file with mode: 0644]
cookbooks/oxidized/recipes/default.rb [new file with mode: 0644]
cookbooks/oxidized/templates/default/config.erb [new file with mode: 0644]
cookbooks/oxidized/templates/default/logrotate.erb [new file with mode: 0644]
cookbooks/oxidized/templates/default/routers.db.erb [new file with mode: 0644]
cookbooks/passenger/attributes/default.rb
cookbooks/passenger/recipes/default.rb
cookbooks/php/resources/fpm.rb
cookbooks/php/templates/default/pool.conf.erb
cookbooks/planet/attributes/default.rb
cookbooks/planet/files/default/ccbysa_cgi/HEADER.cgi [new file with mode: 0644]
cookbooks/planet/recipes/current.rb
cookbooks/planet/recipes/default.rb
cookbooks/planet/recipes/dump.rb
cookbooks/planet/recipes/notes.rb
cookbooks/planet/recipes/replication.rb
cookbooks/planet/templates/default/planet-file-cleanup.erb [moved from cookbooks/planet/templates/default/old-planet-file-cleanup.erb with 100% similarity]
cookbooks/planet/templates/default/planet-notes-cleanup.erb [new file with mode: 0644]
cookbooks/planet/templates/default/planet-update-file.erb [deleted file]
cookbooks/planet/templates/default/planet-update.erb
cookbooks/planet/templates/default/planet-update.logrotate.erb [deleted file]
cookbooks/planet/templates/default/planetdump.erb
cookbooks/postgresql/attributes/default.rb
cookbooks/postgresql/recipes/default.rb
cookbooks/postgresql/templates/default/postgres_queries.yml.erb
cookbooks/prometheus/attributes/default.rb
cookbooks/prometheus/recipes/default.rb
cookbooks/prometheus/recipes/server.rb
cookbooks/prometheus/resources/collector.rb
cookbooks/prometheus/resources/exporter.rb
cookbooks/prometheus/templates/default/alert_rules.yml.erb
cookbooks/prometheus/templates/default/grafana.ini.erb
cookbooks/prometheus/templates/default/prometheus.yml.erb
cookbooks/rsyncd/recipes/default.rb
cookbooks/serverinfo/recipes/default.rb
cookbooks/ssl/attributes/default.rb
cookbooks/stateofthemap/metadata.rb
cookbooks/stateofthemap/recipes/default.rb
cookbooks/stateofthemap/recipes/jekyll.rb [new file with mode: 0644]
cookbooks/stateofthemap/recipes/static.rb [new file with mode: 0644]
cookbooks/stateofthemap/recipes/wordpress.rb [new file with mode: 0644]
cookbooks/subversion/templates/default/apache.erb
cookbooks/supybot/recipes/default.rb
cookbooks/supybot/templates/default/git.conf.erb
cookbooks/systemd/resources/service.rb
cookbooks/systemd/templates/default/service.erb
cookbooks/taginfo/metadata.rb
cookbooks/taginfo/recipes/default.rb
cookbooks/taginfo/templates/default/taginfo-update.erb [deleted file]
cookbooks/taginfo/templates/default/update.erb
cookbooks/tile/recipes/default.rb
cookbooks/tile/templates/default/export.cron.erb [deleted file]
cookbooks/tile/templates/default/logrotate.apache.erb
cookbooks/tile/templates/default/render-lowzoom.erb
cookbooks/tile/templates/default/renderd.conf.erb
cookbooks/tile/templates/default/update-lowzoom.erb
cookbooks/tilelog/recipes/default.rb
cookbooks/timescaledb/attributes/default.rb
cookbooks/timescaledb/recipes/default.rb
cookbooks/tools/recipes/default.rb
cookbooks/web/recipes/frontend.rb
cookbooks/web/recipes/rails.rb
cookbooks/web/recipes/statistics.rb
cookbooks/web/resources/rails_port.rb
cookbooks/web/templates/default/apache.frontend.erb
cookbooks/web/templates/default/passenger.cron.erb [deleted file]
cookbooks/wiki/metadata.rb
cookbooks/wiki/recipes/default.rb
cookbooks/wiki/templates/default/mw-ext-Wikibase.inc.php.erb
cookbooks/wordpress/resources/site.rb
cookbooks/wordpress/templates/default/apache.erb
roles/aws-us-east-2.rb [new file with mode: 0644]
roles/aws.rb [new file with mode: 0644]
roles/base.rb
roles/blogs.rb [new file with mode: 0644]
roles/community.rb
roles/dev.rb
roles/dulcy.rb
roles/errol.rb [deleted file]
roles/faffy.rb [moved from roles/lockheed.rb with 59% similarity]
roles/fafnir.rb
roles/foundation.rb
roles/geodns.rb
roles/git.rb
roles/idris.rb
roles/ironbelly.rb
roles/karm.rb
roles/logstash-forwarder.rb
roles/longma.rb
roles/matomo.rb
roles/naga.rb
roles/norbert.rb
roles/odin.rb
roles/otrs.rb
roles/overpass-query.rb
roles/oxidized.rb [new file with mode: 0644]
roles/palulukon.rb [new file with mode: 0644]
roles/planet-current.rb [deleted file]
roles/planet.rb
roles/pummelzacken.rb
roles/ridley.rb
roles/sarel.rb
roles/scorch.rb
roles/shenron.rb
roles/snap-01.rb
roles/spike-04.rb [deleted file]
roles/spike-05.rb [deleted file]
roles/spike-06.rb
roles/spike-07.rb
roles/spike-08.rb
roles/stateofthemap.rb
roles/supermicro-x8dtt-h.rb [deleted file]
roles/tabaluga.rb
roles/taginfo.rb
roles/thorn-02.rb [deleted file]
roles/thorn-03.rb [deleted file]
roles/thorn-04.rb [deleted file]
roles/thorn-05.rb [deleted file]
roles/tiamat-00.rb [deleted file]
roles/tiamat-01.rb [deleted file]
roles/tiamat-02.rb [deleted file]
roles/tiamat-03.rb [deleted file]
roles/tiamat-10.rb [deleted file]
roles/tiamat-11.rb [deleted file]
roles/tiamat-12.rb [deleted file]
roles/tiamat-13.rb [deleted file]
roles/tiamat-20.rb [deleted file]
roles/tiamat-21.rb [deleted file]
roles/tiamat-22.rb [deleted file]
roles/tiamat-23.rb [deleted file]
roles/tile.rb
roles/urmel.rb [deleted file]
roles/wiki.rb
test/integration/community/serverspec/docker_spec.rb
test/integration/db-backup/serverspec/backup_spec.rb [new file with mode: 0644]
test/integration/db-base/serverspec/postgresql_spec.rb [new file with mode: 0644]
test/integration/db-master/serverspec/postgresql_spec.rb [new file with mode: 0644]
test/integration/db-slave/serverspec/postgresql_spec.rb [new file with mode: 0644]
test/integration/dns/serverspec/dnscontrol_spec.rb [new file with mode: 0644]
test/integration/nodejs/serverspec/nodejs_spec.rb
test/integration/planet-dump/serverspec/planetdump_spec.rb
test/integration/planet-notes/serverspec/planetdump_spec.rb
test/integration/stateofthemap-jekyll/serverspec/apache_spec.rb [moved from test/integration/stateofhemap/serverspec/apache_spec.rb with 100% similarity]
test/integration/stateofthemap-static/serverspec/apache_spec.rb [new file with mode: 0644]
test/integration/stateofthemap-wordpress/serverspec/apache_spec.rb [new file with mode: 0644]
test/integration/stateofthemap/serverspec/apache_spec.rb [new file with mode: 0644]

index 62d14b8aff4111424c078299c947a36206e25f0a..43494fc14d9dd6f4e8ae5ef4af5e2727a26436cb 100644 (file)
@@ -5,7 +5,7 @@ on:
   - pull_request
 
 concurrency:
-  group: ${{ github.workflow }}-{{ github.head_ref || github.ref }}
+  group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
   cancel-in-progress: true
 
 jobs:
index 5c622df16ba003f872fc58a35e74c9f6a71bcb9b..76305aaa2cde46bbe78618c85727a874bad8b7b3 100644 (file)
@@ -5,13 +5,13 @@ on:
   - pull_request
 
 concurrency:
-  group: ${{ github.workflow }}-{{ github.head_ref || github.ref }}
+  group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
   cancel-in-progress: true
 
 jobs:
   kitchen:
     name: Test Kitchen
-    runs-on: ubuntu-latest
+    runs-on: ubuntu-22.04
     strategy:
       matrix:
         suite:
@@ -91,6 +91,9 @@ jobs:
           - spamassassin
           - ssl
           - stateofthemap
+          - stateofthemap-jekyll
+          - stateofthemap-static
+          - stateofthemap-wordpress
           - subversion
           - supybot
           - switch2osm
@@ -107,7 +110,17 @@ jobs:
           - wordpress
           - wiki
         os:
-          - ubuntu-2004
+          - ubuntu-2204
+        include:
+          - os: ubuntu-2004
+            suite: mailman
+          - os: ubuntu-2004
+            suite: osqa
+        exclude:
+          - suite: mailman
+            os: ubuntu-2204
+          - suite: osqa
+            os: ubuntu-2204
       fail-fast: false
     steps:
     - name: Check out code
@@ -115,6 +128,7 @@ jobs:
     - name: Setup ruby
       uses: ruby/setup-ruby@v1
       with:
+        ruby-version: 3.1
         bundler-cache: true
     - name: Run kitchen test ${{ matrix.suite }}-${{ matrix.os }}
       run: bundle exec kitchen test ${{ matrix.suite }}-${{ matrix.os }}
index 84a501546457fc32f8534d7e2d63a82c28823be4..830cc04c5fec876a7ace08a9f9918dab986c28f6 100644 (file)
@@ -1,7 +1,7 @@
 ---
 driver:
   name: dokken
-  chef_version: 17
+  chef_version: 18
   volumes:
     - /var/lib/docker
   env:
@@ -14,6 +14,7 @@ provisioner:
   name: dokken
   chef_license: accept
   data_bags_path: test/data_bags
+  slow_resource_report: true
 
 verifier:
   root_path: /opt/verifier
@@ -27,6 +28,13 @@ platforms:
       pid_one_command: /bin/systemd
       intermediate_instructions:
         - RUN /usr/bin/apt-get update -y
+  - name: ubuntu-22.04
+    driver:
+      image: dokken/ubuntu-22.04
+      privileged: true
+      pid_one_command: /bin/systemd
+      intermediate_instructions:
+        - RUN /usr/bin/apt-get update -y
 
 suites:
   - name: accounts
@@ -164,10 +172,6 @@ suites:
   - name: letsencrypt
     run_list:
       - recipe[letsencrypt::default]
-    attributes:
-      apt:
-        sources:
-          - openstreetmap
   - name: logstash
     run_list:
       - recipe[logstash::default]
@@ -318,6 +322,15 @@ suites:
   - name: stateofthemap
     run_list:
       - recipe[stateofthemap::default]
+  - name: stateofthemap-static
+    run_list:
+      - recipe[stateofthemap::static]
+  - name: stateofthemap-jekyll
+    run_list:
+      - recipe[stateofthemap::jekyll]
+  - name: stateofthemap-wordpress
+    run_list:
+      - recipe[stateofthemap::wordpress]
   - name: subversion
     run_list:
       - recipe[subversion::default]
index 75bc2d9d8472675959475261618e83c012736bcf..c4b812d920a1cb17d54f9bf64eecb74863d9d4ed 100644 (file)
@@ -1,7 +1,7 @@
 inherit_from: .rubocop_todo.yml
 
 AllCops:
-  TargetRubyVersion: 3.0
+  TargetRubyVersion: 3.1
 
 ChefModernize/IncludingAptDefaultRecipe:
   Enabled: false
index b0f2dcb32fc28c7f80c4d430beab94c89c787578..ef538c2810938c03ced86f0380977b308a55b37b 100644 (file)
@@ -1 +1 @@
-3.0.4
+3.1.2
index 620c6a2bad8a79c385dd2b5030b1fe22744a09ff..fa0ad5960af0f072b55c489cdb7713e6a8629096 100644 (file)
@@ -1,6 +1,6 @@
 # Basic Dockerfile to run cookstyle linting
 # run: docker build -t chef-test .
-FROM ruby:2.7-alpine as build
+FROM ruby:3.1-alpine as build
 
 # Add Gem build requirements
 RUN apk add --no-cache build-base
index cfcfec3dafcddc0ee2b1e15bbc564ea53987b174..7e0b580503200558628dac89941f082d9c0e16d6 100644 (file)
@@ -4,7 +4,7 @@ GEM
     ast (2.4.2)
     bcrypt_pbkdf (1.1.0)
     builder (3.2.4)
-    chef-utils (17.10.0)
+    chef-utils (18.0.161)
       concurrent-ruby
     concurrent-ruby (1.1.10)
     cookstyle (7.32.1)
@@ -15,7 +15,7 @@ GEM
       multi_json
     ed25519 (1.3.0)
     erubi (1.11.0)
-    excon (0.92.4)
+    excon (0.93.1)
     ffi (1.15.5)
     gssapi (1.3.1)
       ffi (>= 1.0.1)
@@ -37,7 +37,7 @@ GEM
     logging (2.3.1)
       little-plugger (~> 1.1)
       multi_json (~> 1.14)
-    mixlib-install (3.12.19)
+    mixlib-install (3.12.20)
       mixlib-shellout
       mixlib-versioning
       thor
@@ -45,37 +45,37 @@ GEM
       chef-utils
     mixlib-versioning (1.2.12)
     multi_json (1.15.0)
-    net-scp (3.0.0)
-      net-ssh (>= 2.6.5, < 7.0.0)
-    net-ssh (6.1.0)
+    net-scp (4.0.0)
+      net-ssh (>= 2.6.5, < 8.0.0)
+    net-ssh (7.0.1)
     net-ssh-gateway (2.0.0)
       net-ssh (>= 4.0.0)
     net-telnet (0.1.1)
     nori (2.6.0)
-    parallel (1.21.0)
-    parser (3.1.1.0)
+    parallel (1.22.1)
+    parser (3.1.2.1)
       ast (~> 2.4.1)
     pastel (0.8.0)
       tty-color (~> 0.5)
     rainbow (3.1.1)
-    regexp_parser (2.2.1)
+    regexp_parser (2.6.0)
     rexml (3.2.5)
-    rspec (3.10.0)
-      rspec-core (~> 3.10.0)
-      rspec-expectations (~> 3.10.0)
-      rspec-mocks (~> 3.10.0)
-    rspec-core (3.10.2)
-      rspec-support (~> 3.10.0)
-    rspec-expectations (3.10.2)
+    rspec (3.11.0)
+      rspec-core (~> 3.11.0)
+      rspec-expectations (~> 3.11.0)
+      rspec-mocks (~> 3.11.0)
+    rspec-core (3.11.0)
+      rspec-support (~> 3.11.0)
+    rspec-expectations (3.11.1)
       diff-lcs (>= 1.2.0, < 2.0)
-      rspec-support (~> 3.10.0)
+      rspec-support (~> 3.11.0)
     rspec-its (1.3.0)
       rspec-core (>= 3.0.0)
       rspec-expectations (>= 3.0.0)
-    rspec-mocks (3.10.3)
+    rspec-mocks (3.11.1)
       diff-lcs (>= 1.2.0, < 2.0)
-      rspec-support (~> 3.10.0)
-    rspec-support (3.10.3)
+      rspec-support (~> 3.11.0)
+    rspec-support (3.11.1)
     rubocop (1.25.1)
       parallel (~> 1.10)
       parser (>= 3.1.0.0)
@@ -85,7 +85,7 @@ GEM
       rubocop-ast (>= 1.15.1, < 2.0)
       ruby-progressbar (~> 1.7)
       unicode-display_width (>= 1.4.0, < 3.0)
-    rubocop-ast (1.16.0)
+    rubocop-ast (1.22.0)
       parser (>= 3.1.1.0)
     ruby-progressbar (1.11.0)
     rubyntlm (0.6.3)
@@ -96,7 +96,7 @@ GEM
       rspec-its
       specinfra (~> 2.72)
     sfl (2.3)
-    specinfra (2.83.1)
+    specinfra (2.83.3)
       net-scp
       net-ssh (>= 2.7)
       net-telnet (= 0.1.1)
@@ -106,15 +106,15 @@ GEM
       unicode-display_width (>= 1.5, < 3.0)
       unicode_utils (~> 1.4)
     strings-ansi (0.2.0)
-    test-kitchen (3.3.2)
+    test-kitchen (3.4.0)
       bcrypt_pbkdf (~> 1.0)
       chef-utils (>= 16.4.35)
       ed25519 (~> 1.2)
       license-acceptance (>= 1.0.11, < 3.0)
       mixlib-install (~> 3.6)
       mixlib-shellout (>= 1.2, < 4.0)
-      net-scp (>= 1.1, < 4.0)
-      net-ssh (>= 2.9, < 7.0)
+      net-scp (>= 1.1, < 5.0)
+      net-ssh (>= 2.9, < 8.0)
       net-ssh-gateway (>= 1.2, < 3.0)
       thor (>= 0.19, < 2.0)
       winrm (~> 2.0)
@@ -136,7 +136,7 @@ GEM
       tty-screen (~> 0.8)
       wisper (~> 2.0)
     tty-screen (0.8.1)
-    unicode-display_width (2.2.0)
+    unicode-display_width (2.3.0)
     unicode_utils (1.4.0)
     winrm (2.3.6)
       builder (>= 2.1.2)
diff --git a/cookbooks/accounts/files/default/grant/.selected_editor b/cookbooks/accounts/files/default/grant/.selected_editor
new file mode 100644 (file)
index 0000000..c85d073
--- /dev/null
@@ -0,0 +1,2 @@
+# Generated by /usr/bin/select-editor
+SELECTED_EDITOR="/usr/bin/vim.basic"
diff --git a/cookbooks/accounts/files/default/jeslop/.ssh/authorized_keys b/cookbooks/accounts/files/default/jeslop/.ssh/authorized_keys
new file mode 100644 (file)
index 0000000..379ff19
--- /dev/null
@@ -0,0 +1,2 @@
+# DO NOT EDIT - This file is being maintained by Chef - use authorized_keys2 instead
+ecdsa-sha2-nistp521 AAAAE2VjZHNhLXNoYTItbmlzdHA1MjEAAAAIbmlzdHA1MjEAAACFBAB9jIwQu1TmXcQH6FXEz53fkTX3abCgjflwdESnaR5qKw6hUcvAIjPXiGLFGdl+nR56aCbQrbXQVF3Hug2+057xcAEAhFj0aIOoDhgEkZ0uK4GIElZjCUugYLt3AbQXTRpEXtXaL1wzyBmFqbTMOxDOzaif+PYWwDHC1yo1C5jhSlRmRg== jesus@Mac-mini-de-Jesus.local
diff --git a/cookbooks/accounts/files/default/milliams/.ssh/authorized_keys b/cookbooks/accounts/files/default/milliams/.ssh/authorized_keys
new file mode 100644 (file)
index 0000000..a1fa1cf
--- /dev/null
@@ -0,0 +1 @@
+ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEVkoOPte6R6jN5w7yny+YLtoZGl/XLQL2aSjhgyNHrh matt@HEX
diff --git a/cookbooks/accounts/files/default/pnorman/.ssh/authorized_keys b/cookbooks/accounts/files/default/pnorman/.ssh/authorized_keys
new file mode 100644 (file)
index 0000000..31eafc8
--- /dev/null
@@ -0,0 +1 @@
+ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCYxvvG3WcrofBviPhEhKuEBiej3WcLMEhYloJB0pOGF1DaK8kD6QRlH4mZaNmm4mZCQIUv2KfgxDyPmp8byGZniVQzx74dlFDozFY+q9beokQA/f5RjtWs2G8gO+V4UdNXxo9q3cvfjiK9eXtjLjYyMkwb8n6Y3jrpt7CDflb7Pa+yJF9C1ugPooa739YNw5M8qPWdP1QVK8M7zZTeUbGh1xWReGCwcKFNDtoOSyj1XXkKSvfGd+spKqfwKOHOqVXQYNtSm+nnIuGilLp8caFa3lOvcGnlXgSKExeiMq/zG7vlvierkuwz00yOxF6h6BgjLztLCsknt3mD92vhUqQz
index c927b87b5015c539583bc19dde39c1162f542421..b1e80892908bbed6ab8a9222bc0784afd55c1f67 100644 (file)
@@ -79,16 +79,6 @@ apache_module "deflate" do
   conf "deflate.conf.erb"
 end
 
-if node[:apache][:reqtimeout]
-  apache_module "reqtimeout" do
-    action [:enable]
-  end
-else
-  apache_module "reqtimeout" do
-    action [:disable]
-  end
-end
-
 apache_module "headers"
 apache_module "ssl"
 
index 7000e590e6c4cbe4a3657cb1d581a06406e09f05..3bf3dfcd2e76b601fd37e69df0fe19a9bb7cf12d 100644 (file)
@@ -1,12 +1,14 @@
 # DO NOT EDIT - This file is being maintained by Chef
 
-<IfModule mod_deflate.c>
-        <IfModule mod_filter.c>
-                AddOutputFilterByType BROTLI_COMPRESS text/html text/plain text/xml
-                AddOutputFilterByType BROTLI_COMPRESS text/css
-                AddOutputFilterByType BROTLI_COMPRESS application/x-javascript application/javascript application/ecmascript
-                AddOutputFilterByType BROTLI_COMPRESS application/rss+xml
-                AddOutputFilterByType BROTLI_COMPRESS application/xml
-                AddOutputFilterByType BROTLI_COMPRESS image/svg+xml
-        </IfModule>
+<IfModule mod_brotli.c>
+       <IfModule mod_filter.c>
+               AddOutputFilterByType BROTLI_COMPRESS text/html text/plain text/xml text/css text/javascript
+               AddOutputFilterByType BROTLI_COMPRESS application/x-javascript application/javascript application/ecmascript
+               AddOutputFilterByType BROTLI_COMPRESS application/rss+xml
+               AddOutputFilterByType BROTLI_COMPRESS application/wasm
+               AddOutputFilterByType BROTLI_COMPRESS application/xml
+               AddOutputFilterByType BROTLI_COMPRESS image/svg+xml
+       </IfModule>
 </IfModule>
+
+# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
index a418736e71cad7b34f38dcaf1a9ad96d411e0d86..9f9bda5f9aabde23551f341edbbe6bef8e58a99e 100644 (file)
@@ -1,15 +1,14 @@
 # DO NOT EDIT - This file is being maintained by Chef
 
 <IfModule mod_deflate.c>
-        <IfModule mod_filter.c>
-                # these are known to be safe with MSIE 6
-                AddOutputFilterByType DEFLATE text/html text/plain text/xml
-
-                # everything else may cause problems with MSIE 6
-                AddOutputFilterByType DEFLATE text/css
-                AddOutputFilterByType DEFLATE application/x-javascript application/javascript application/ecmascript
-                AddOutputFilterByType DEFLATE application/rss+xml
-                AddOutputFilterByType DEFLATE application/xml
-                AddOutputFilterByType DEFLATE image/svg+xml
-        </IfModule>
+       <IfModule mod_filter.c>
+               AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript
+               AddOutputFilterByType DEFLATE application/x-javascript application/javascript application/ecmascript
+               AddOutputFilterByType DEFLATE application/rss+xml
+               AddOutputFilterByType DEFLATE application/wasm
+               AddOutputFilterByType DEFLATE application/xml
+               AddOutputFilterByType DEFLATE image/svg+xml
+       </IfModule>
 </IfModule>
+
+# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
index a949a1c0251300c0cac336057158cb5fffb76814..6ec384b5d7e90c2a42f12f2516794325d4dd4e8a 100644 (file)
@@ -1,3 +1,2 @@
-default[:apt][:sources] = [ "openstreetmap" ]
 default[:apt][:unattended_upgrades][:enable] = true
 default[:apt][:unattended_upgrades][:remove_unused_dependencies] = true
index 7619d0a9c4cc018545f5ae460f9a2f37e6fc4151..1d73a4d9bb17812afe933897cd6e2ec7cae8279d 100644 (file)
@@ -39,128 +39,33 @@ apt_update "/etc/apt/sources.list" do
   action :nothing
 end
 
-archive_host = if node[:country]
-                 "#{node[:country]}.archive.ubuntu.com"
-               else
-                 "archive.ubuntu.com"
-               end
+if intel?
+  archive_host = if node[:country]
+                   "#{node[:country]}.archive.ubuntu.com"
+                 else
+                   "archive.ubuntu.com"
+                 end
+  archive_security_host = "security.ubuntu.com"
+  archive_distro = "ubuntu"
+else
+  archive_host = "ports.ubuntu.com"
+  archive_security_host = archive_host
+  archive_distro = "ubuntu-ports"
+end
 
 template "/etc/apt/sources.list" do
   source "sources.list.erb"
   owner "root"
   group "root"
   mode "644"
-  variables :archive_host => archive_host, :codename => node[:lsb][:codename]
+  variables :archive_host => archive_host, :archive_security_host => archive_security_host, :archive_distro => archive_distro, :codename => node[:lsb][:codename]
   notifies :update, "apt_update[/etc/apt/sources.list]", :immediately
 end
 
-repository_actions = Hash.new do |_, repository|
-  node[:apt][:sources].include?(repository) ? :add : :remove
-end
-
-apt_repository "ubuntugis-stable" do
-  action repository_actions["ubuntugis-stable"]
-  uri "ppa:ubuntugis/ppa"
-end
-
-apt_repository "ubuntugis-unstable" do
-  action repository_actions["ubuntugis-unstable"]
-  uri "ppa:ubuntugis/ubuntugis-unstable"
-end
-
-apt_repository "git-core" do
-  action repository_actions["git-core"]
-  uri "ppa:git-core/ppa"
-end
-
-apt_repository "maxmind" do
-  action repository_actions["maxmind"]
-  uri "ppa:maxmind/ppa"
-end
-
 apt_repository "openstreetmap" do
-  action repository_actions["openstreetmap"]
   uri "ppa:osmadmins/ppa"
 end
 
-apt_repository "management-component-pack" do
-  action repository_actions["management-component-pack"]
-  uri "https://downloads.linux.hpe.com/SDR/repo/mcp"
-  distribution "bionic/current-gen9"
-  components ["non-free"]
-  key "C208ADDE26C2B797"
-end
-
-apt_repository "hwraid" do
-  action repository_actions["hwraid"]
-  uri "https://hwraid.le-vert.net/ubuntu"
-  distribution "precise"
-  components ["main"]
-  key "6005210E23B3D3B4"
-end
-
-apt_repository "nginx" do
-  action repository_actions["nginx"]
-  arch "amd64"
-  uri "https://nginx.org/packages/ubuntu"
-  components ["nginx"]
-  key "ABF5BD827BD9BF62"
-end
-
-apt_repository "elasticsearch6.x" do
-  action repository_actions["elasticsearch6.x"]
-  uri "https://artifacts.elastic.co/packages/6.x/apt"
-  distribution "stable"
-  components ["main"]
-  key "D27D666CD88E42B4"
-end
-
-apt_repository "elasticsearch8.x" do
-  action repository_actions["elasticsearch8.x"]
-  uri "https://artifacts.elastic.co/packages/8.x/apt"
-  distribution "stable"
-  components ["main"]
-  key "D27D666CD88E42B4"
-end
-
-apt_repository "passenger" do
-  action repository_actions["passenger"]
-  uri "https://oss-binaries.phusionpassenger.com/apt/passenger"
-  components ["main"]
-  key "561F9B9CAC40B2F7"
-end
-
-apt_repository "postgresql" do
-  action repository_actions["postgresql"]
-  uri "https://apt.postgresql.org/pub/repos/apt"
-  distribution "#{node[:lsb][:codename]}-pgdg"
-  components ["main"]
-  key "7FCC7D46ACCC4CF8"
-end
-
-apt_repository "docker" do
-  action repository_actions["docker"]
-  uri "https://download.docker.com/linux/ubuntu"
-  arch "amd64"
-  components ["stable"]
-  key "https://download.docker.com/linux/ubuntu/gpg"
-end
-
-apt_repository "grafana" do
-  action repository_actions["grafana"]
-  uri "https://packages.grafana.com/enterprise/deb"
-  distribution "stable"
-  components ["main"]
-  key "https://packages.grafana.com/gpg.key"
-end
-
-apt_repository "timescaledb" do
-  action repository_actions["timescaledb"]
-  uri "https://packagecloud.io/timescale/timescaledb/ubuntu"
-  components ["main"]
-  key "https://packagecloud.io/timescale/timescaledb/gpgkey"
-end
-
 package "unattended-upgrades"
 
 if Dir.exist?("/usr/share/unattended-upgrades")
diff --git a/cookbooks/apt/recipes/docker.rb b/cookbooks/apt/recipes/docker.rb
new file mode 100644 (file)
index 0000000..7c87807
--- /dev/null
@@ -0,0 +1,33 @@
+#
+# Cookbook:: apt
+# Recipe:: docker
+#
+# Copyright:: 2022, Tom Hughes
+#
+# 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 "apt"
+
+docker_arch = if arm?
+                "arm64"
+              else
+                "amd64"
+              end
+
+apt_repository "docker" do
+  uri "https://download.docker.com/linux/ubuntu"
+  arch docker_arch
+  components ["stable"]
+  key "https://download.docker.com/linux/ubuntu/gpg"
+end
diff --git a/cookbooks/apt/recipes/elasticsearch6.rb b/cookbooks/apt/recipes/elasticsearch6.rb
new file mode 100644 (file)
index 0000000..74c02a3
--- /dev/null
@@ -0,0 +1,27 @@
+#
+# Cookbook:: apt
+# Recipe:: elasticsearch6
+#
+# Copyright:: 2022, Tom Hughes
+#
+# 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 "apt"
+
+apt_repository "elasticsearch6.x" do
+  uri "https://artifacts.elastic.co/packages/6.x/apt"
+  distribution "stable"
+  components ["main"]
+  key "D27D666CD88E42B4"
+end
diff --git a/cookbooks/apt/recipes/elasticsearch8.rb b/cookbooks/apt/recipes/elasticsearch8.rb
new file mode 100644 (file)
index 0000000..61a94f7
--- /dev/null
@@ -0,0 +1,27 @@
+#
+# Cookbook:: apt
+# Recipe:: elasticsearch8
+#
+# Copyright:: 2022, Tom Hughes
+#
+# 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 "apt"
+
+apt_repository "elasticsearch8.x" do
+  uri "https://artifacts.elastic.co/packages/8.x/apt"
+  distribution "stable"
+  components ["main"]
+  key "D27D666CD88E42B4"
+end
diff --git a/cookbooks/apt/recipes/git-core.rb b/cookbooks/apt/recipes/git-core.rb
new file mode 100644 (file)
index 0000000..79266ab
--- /dev/null
@@ -0,0 +1,24 @@
+#
+# Cookbook:: apt
+# Recipe:: git-core
+#
+# Copyright:: 2022, Tom Hughes
+#
+# 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 "apt"
+
+apt_repository "git-core" do
+  uri "ppa:git-core/ppa"
+end
diff --git a/cookbooks/apt/recipes/grafana.rb b/cookbooks/apt/recipes/grafana.rb
new file mode 100644 (file)
index 0000000..5738c23
--- /dev/null
@@ -0,0 +1,27 @@
+#
+# Cookbook:: apt
+# Recipe:: grafana
+#
+# Copyright:: 2022, Tom Hughes
+#
+# 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 "apt"
+
+apt_repository "grafana" do
+  uri "https://packages.grafana.com/enterprise/deb"
+  distribution "stable"
+  components ["main"]
+  key "https://packages.grafana.com/gpg.key"
+end
diff --git a/cookbooks/apt/recipes/hwraid.rb b/cookbooks/apt/recipes/hwraid.rb
new file mode 100644 (file)
index 0000000..aa5a7fb
--- /dev/null
@@ -0,0 +1,27 @@
+#
+# Cookbook:: apt
+# Recipe:: hwraid
+#
+# Copyright:: 2022, Tom Hughes
+#
+# 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 "apt"
+
+apt_repository "hwraid" do
+  uri "https://hwraid.le-vert.net/ubuntu"
+  distribution "precise"
+  components ["main"]
+  key "6005210E23B3D3B4"
+end
diff --git a/cookbooks/apt/recipes/management-component-pack.rb b/cookbooks/apt/recipes/management-component-pack.rb
new file mode 100644 (file)
index 0000000..09b982d
--- /dev/null
@@ -0,0 +1,47 @@
+#
+# Cookbook:: apt
+# Recipe:: management-component-pack
+#
+# Copyright:: 2022, Tom Hughes
+#
+# 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 "apt"
+
+apt_repository "management-component-pack" do
+  action :remove
+end
+
+if node[:dmi][:system][:product_name].end_with?("Gen10")
+  apt_repository "mcp-jammy" do
+    uri "https://downloads.linux.hpe.com/SDR/repo/mcp"
+    distribution "jammy/current"
+    components ["non-free"]
+    key "C208ADDE26C2B797"
+  end
+
+  apt_repository "mcp-focal-gen10" do
+    uri "https://downloads.linux.hpe.com/SDR/repo/mcp"
+    distribution "focal/current-gen10"
+    components ["non-free"]
+    key "C208ADDE26C2B797"
+  end
+else
+  apt_repository "mcp-bionic-gen9" do
+    uri "https://downloads.linux.hpe.com/SDR/repo/mcp"
+    distribution "bionic/current-gen9"
+    components ["non-free"]
+    key "C208ADDE26C2B797"
+  end
+end
diff --git a/cookbooks/apt/recipes/maxmind.rb b/cookbooks/apt/recipes/maxmind.rb
new file mode 100644 (file)
index 0000000..a0029aa
--- /dev/null
@@ -0,0 +1,24 @@
+#
+# Cookbook:: apt
+# Recipe:: maxmind
+#
+# Copyright:: 2022, Tom Hughes
+#
+# 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 "apt"
+
+apt_repository "maxmind" do
+  uri "ppa:maxmind/ppa"
+end
diff --git a/cookbooks/apt/recipes/nginx.rb b/cookbooks/apt/recipes/nginx.rb
new file mode 100644 (file)
index 0000000..63fad62
--- /dev/null
@@ -0,0 +1,27 @@
+#
+# Cookbook:: apt
+# Recipe:: nginx
+#
+# Copyright:: 2022, Tom Hughes
+#
+# 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 "apt"
+
+apt_repository "nginx" do
+  arch "amd64"
+  uri "https://nginx.org/packages/ubuntu"
+  components ["nginx"]
+  key "ABF5BD827BD9BF62"
+end
diff --git a/cookbooks/apt/recipes/nodesource.rb b/cookbooks/apt/recipes/nodesource.rb
new file mode 100644 (file)
index 0000000..51bfa3c
--- /dev/null
@@ -0,0 +1,26 @@
+#
+# Cookbook:: apt
+# Recipe:: nodesource
+#
+# Copyright:: 2022, Tom Hughes
+#
+# 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 "apt"
+
+apt_repository "nodesource" do
+  uri "https://deb.nodesource.com/node_18.x"
+  components ["main"]
+  key "1655A0AB68576280"
+end
diff --git a/cookbooks/apt/recipes/passenger.rb b/cookbooks/apt/recipes/passenger.rb
new file mode 100644 (file)
index 0000000..136175b
--- /dev/null
@@ -0,0 +1,26 @@
+#
+# Cookbook:: apt
+# Recipe:: passenger
+#
+# Copyright:: 2022, Tom Hughes
+#
+# 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 "apt"
+
+apt_repository "passenger" do
+  uri "https://oss-binaries.phusionpassenger.com/apt/passenger"
+  components ["main"]
+  key "561F9B9CAC40B2F7"
+end
diff --git a/cookbooks/apt/recipes/postgresql.rb b/cookbooks/apt/recipes/postgresql.rb
new file mode 100644 (file)
index 0000000..66e4c1c
--- /dev/null
@@ -0,0 +1,27 @@
+#
+# Cookbook:: apt
+# Recipe:: postgresql
+#
+# Copyright:: 2022, Tom Hughes
+#
+# 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 "apt"
+
+apt_repository "postgresql" do
+  uri "https://apt.postgresql.org/pub/repos/apt"
+  distribution "#{node[:lsb][:codename]}-pgdg"
+  components ["main"]
+  key "7FCC7D46ACCC4CF8"
+end
diff --git a/cookbooks/apt/recipes/timescaledb.rb b/cookbooks/apt/recipes/timescaledb.rb
new file mode 100644 (file)
index 0000000..57cccf2
--- /dev/null
@@ -0,0 +1,27 @@
+#
+# Cookbook:: apt
+# Recipe:: timescaledb
+#
+# Copyright:: 2022, Tom Hughes
+#
+# 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 "apt"
+include_recipe "apt::postgresql"
+
+apt_repository "timescaledb" do
+  uri "https://packagecloud.io/timescale/timescaledb/ubuntu"
+  components ["main"]
+  key "https://packagecloud.io/timescale/timescaledb/gpgkey"
+end
diff --git a/cookbooks/apt/recipes/ubuntugis-stable.rb b/cookbooks/apt/recipes/ubuntugis-stable.rb
new file mode 100644 (file)
index 0000000..71ce209
--- /dev/null
@@ -0,0 +1,24 @@
+#
+# Cookbook:: apt
+# Recipe:: ubuntugis-stable
+#
+# Copyright:: 2022, Tom Hughes
+#
+# 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 "apt"
+
+apt_repository "ubuntugis-stable" do
+  uri "ppa:ubuntugis/ppa"
+end
diff --git a/cookbooks/apt/recipes/ubuntugis-unstable.rb b/cookbooks/apt/recipes/ubuntugis-unstable.rb
new file mode 100644 (file)
index 0000000..3ab472b
--- /dev/null
@@ -0,0 +1,24 @@
+#
+# Cookbook:: apt
+# Recipe:: ubuntugis-unstable
+#
+# Copyright:: 2022, Tom Hughes
+#
+# 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 "apt"
+
+apt_repository "ubuntugis-unstable" do
+  uri "ppa:ubuntugis/ubuntugis-unstable"
+end
diff --git a/cookbooks/apt/recipes/yarn.rb b/cookbooks/apt/recipes/yarn.rb
new file mode 100644 (file)
index 0000000..ecb1c10
--- /dev/null
@@ -0,0 +1,27 @@
+#
+# Cookbook:: apt
+# Recipe:: yarn
+#
+# Copyright:: 2022, Tom Hughes
+#
+# 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 "apt"
+
+apt_repository "yarn" do
+  uri "https://dl.yarnpkg.com/debian"
+  distribution "stable"
+  components ["main"]
+  key "23E7166788B63E1E"
+end
index d3d52ef7b6330be861e83c5334c2a35ed8f43019..db8501e18069f273d8e0e0c3d8eae6b1f8b38647 100644 (file)
@@ -1,49 +1,42 @@
 # DO NOT EDIT - This file is being maintained by Chef
 
-deb http://<%= @archive_host %>/ubuntu/ <%= @codename %> main restricted
-# deb-src http://<%= @archive_host %>/ubuntu/ <%= @codename %> main restricted
+deb http://<%= @archive_host %>/<%= @archive_distro %>/ <%= @codename %> main restricted
+# deb-src http://<%= @archive_host %>/<%= @archive_distro %>/ <%= @codename %> main restricted
 
 ## Major bug fix updates produced after the final release of the
 ## distribution.
-deb http://<%= @archive_host %>/ubuntu/ <%= @codename %>-updates main restricted
-# deb-src http://<%= @archive_host %>/ubuntu/ <%= @codename %>-updates main restricted
+deb http://<%= @archive_host %>/<%= @archive_distro %>/ <%= @codename %>-updates main restricted
+# deb-src http://<%= @archive_host %>/<%= @archive_distro %>/ <%= @codename %>-updates main restricted
 
 ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
 ## team. Also, please note that software in universe WILL NOT receive any
 ## review or updates from the Ubuntu security team.
-deb http://<%= @archive_host %>/ubuntu/ <%= @codename %> universe
-# deb-src http://<%= @archive_host %>/ubuntu/ <%= @codename %> universe
-deb http://<%= @archive_host %>/ubuntu/ <%= @codename %>-updates universe
-# deb-src http://<%= @archive_host %>/ubuntu/ <%= @codename %>-updates universe
+deb http://<%= @archive_host %>/<%= @archive_distro %>/ <%= @codename %> universe
+# deb-src http://<%= @archive_host %>/<%= @archive_distro %>/ <%= @codename %> universe
+deb http://<%= @archive_host %>/<%= @archive_distro %>/ <%= @codename %>-updates universe
+# deb-src http://<%= @archive_host %>/<%= @archive_distro %>/ <%= @codename %>-updates universe
 
 ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
 ## team, and may not be under a free licence. Please satisfy yourself as to
 ## your rights to use the software. Also, please note that software in
 ## multiverse WILL NOT receive any review or updates from the Ubuntu
 ## security team.
-deb http://<%= @archive_host %>/ubuntu/ <%= @codename %> multiverse
-# deb-src http://<%= @archive_host %>/ubuntu/ <%= @codename %> multiverse
-deb http://<%= @archive_host %>/ubuntu/ <%= @codename %>-updates multiverse
-# deb-src http://<%= @archive_host %>/ubuntu/ <%= @codename %>-updates multiverse
+deb http://<%= @archive_host %>/<%= @archive_distro %>/ <%= @codename %> multiverse
+# deb-src http://<%= @archive_host %>/<%= @archive_distro %>/ <%= @codename %> multiverse
+deb http://<%= @archive_host %>/<%= @archive_distro %>/ <%= @codename %>-updates multiverse
+# deb-src http://<%= @archive_host %>/<%= @archive_distro %>/ <%= @codename %>-updates multiverse
 
 ## N.B. software from this repository may not have been tested as
 ## extensively as that contained in the main release, although it includes
 ## newer versions of some applications which may provide useful features.
 ## Also, please note that software in backports WILL NOT receive any review
 ## or updates from the Ubuntu security team.
-deb http://<%= @archive_host %>/ubuntu/ <%= @codename %>-backports main restricted universe multiverse
-# deb-src http://<%= @archive_host %>/ubuntu/ <%= @codename %>-backports main restricted universe multiverse
+deb http://<%= @archive_host %>/<%= @archive_distro %>/ <%= @codename %>-backports main restricted universe multiverse
+# deb-src http://<%= @archive_host %>/<%= @archive_distro %>/ <%= @codename %>-backports main restricted universe multiverse
 
-## Uncomment the following two lines to add software from Canonical's
-## 'partner' repository.
-## This software is not part of Ubuntu, but is offered by Canonical and the
-## respective vendors as a service to Ubuntu users.
-# deb http://archive.canonical.com/ubuntu <%= @codename %> partner
-# deb-src http://archive.canonical.com/ubuntu <%= @codename %> partner
-
-deb http://security.ubuntu.com/ubuntu/ <%= @codename %>-security main restricted
-# deb-src http://security.ubuntu.com/ubuntu/ <%= @codename %>-security main restricted
-deb http://security.ubuntu.com/ubuntu/ <%= @codename %>-security universe
-# deb-src http://security.ubuntu.com/ubuntu/ <%= @codename %>-security universe
-deb http://security.ubuntu.com/ubuntu/ <%= @codename %>-security multiverse
-# deb-src http://security.ubuntu.com/ubuntu/ <%= @codename %>-security multiverse
+deb http://<%= @archive_security_host %>/<%= @archive_distro %>/ <%= @codename %>-security main restricted
+# deb-src http://<%= @archive_security_host %>/<%= @archive_distro %>/ <%= @codename %>-security main restricted
+deb http://<%= @archive_security_host %>/<%= @archive_distro %>/ <%= @codename %>-security universe
+# deb-src http://<%= @archive_security_host %>/<%= @archive_distro %>/ <%= @codename %>-security universe
+deb http://<%= @archive_security_host %>/<%= @archive_distro %>/ <%= @codename %>-security multiverse
+# deb-src http://<%= @archive_security_host %>/<%= @archive_distro %>/ <%= @codename %>-security multiverse
index 81834d43711197c1a129044b68b25f379d98ef96..9d82c384a620c656115fd75d2c749a62e265c1e7 100644 (file)
@@ -43,12 +43,12 @@ for my $month (0 .. $months - 1)
 }
 
 my $dates = join("|", @dates);
-my $match = qr/^${prefix}\d{4}-\d{2}-\d{2}\./;
-my $keep = qr/^${prefix}(?:${dates})\./;
+my $match = qr/^\Q${prefix}\E\d{4}-\d{2}-\d{2}\./;
+my $keep = qr/^\Q${prefix}\E(?:${dates})\./;
 
 opendir(DIR, "$dir") || die "Can't open ${dir}: $!";
 
-my @files = sort(grep($match, readdir(DIR)));
+my @files = sort(grep(/$match/, readdir(DIR)));
 
 closedir(DIR);
 
index 55c99e6f68d9c62649eba9ed8e797cc051405290..395b0b482e4142a62853bfbdd6ca14ec4bcae4f3 100644 (file)
@@ -12,78 +12,39 @@ $TTL        604800
 
 3.0.0          IN      PTR     ridley.ucl.openstreetmap.org.
 4.0.0          IN      PTR     snap-02.ucl.openstreetmap.org.
-5.0.0          IN      PTR     norbert.ucl.openstreetmap.org.
-6.0.0          IN      PTR     urmel.ucl.openstreetmap.org.
-7.0.0          IN      PTR     faffy.ucl.openstreetmap.org.
-8.0.0          IN      PTR     zark.ucl.openstreetmap.org.
 9.0.0          IN      PTR     eustace.ucl.openstreetmap.org.
 10.0.0         IN      PTR     eddie.ucl.openstreetmap.org.
 11.0.0         IN      PTR     draco.ucl.openstreetmap.org.
 12.0.0         IN      PTR     sarel.ucl.openstreetmap.org.
 13.0.0         IN      PTR     noquiklos.ucl.openstreetmap.org.
-14.0.0         IN      PTR     errol.ucl.openstreetmap.org.
 15.0.0         IN      PTR     ysera.ucl.openstreetmap.org.
 17.0.0         IN      PTR     clifford.ucl.openstreetmap.org.
 19.0.0         IN      PTR     grindtooth.ucl.openstreetmap.org.
 20.0.0         IN      PTR     pummelzacken.ucl.openstreetmap.org.
-40.0.0         IN      PTR     tiamat-00.ucl.openstreetmap.org.
-41.0.0         IN      PTR     tiamat-01.ucl.openstreetmap.org.
-42.0.0         IN      PTR     tiamat-02.ucl.openstreetmap.org.
-43.0.0         IN      PTR     tiamat-03.ucl.openstreetmap.org.
-44.0.0         IN      PTR     tiamat-10.ucl.openstreetmap.org.
-45.0.0         IN      PTR     tiamat-11.ucl.openstreetmap.org.
-46.0.0         IN      PTR     tiamat-12.ucl.openstreetmap.org.
-47.0.0         IN      PTR     tiamat-13.ucl.openstreetmap.org.
-48.0.0         IN      PTR     tiamat-20.ucl.openstreetmap.org.
-49.0.0         IN      PTR     tiamat-21.ucl.openstreetmap.org.
-50.0.0         IN      PTR     tiamat-22.ucl.openstreetmap.org.
-51.0.0         IN      PTR     tiamat-23.ucl.openstreetmap.org.
 
 3.1.0          IN      PTR     ridley.oob.openstreetmap.org.
 4.1.0          IN      PTR     snap-02.oob.openstreetmap.org.
-5.1.0          IN      PTR     norbert.oob.openstreetmap.org.
-6.1.0          IN      PTR     urmel.oob.openstreetmap.org.
-8.1.0          IN      PTR     zark.oob.openstreetmap.org.
 9.1.0          IN      PTR     eustace.oob.openstreetmap.org.
 10.1.0         IN      PTR     eddie.oob.openstreetmap.org.
 11.1.0         IN      PTR     draco.oob.openstreetmap.org.
 12.1.0         IN      PTR     sarel.oob.openstreetmap.org.
 13.1.0         IN      PTR     noquiklos.oob.openstreetmap.org.
-14.1.0         IN      PTR     errol.oob.openstreetmap.org.
 15.1.0         IN      PTR     ysera.oob.openstreetmap.org.
 17.1.0         IN      PTR     clifford.oob.openstreetmap.org.
 19.1.0         IN      PTR     grindtooth.oob.openstreetmap.org.
 20.1.0         IN      PTR     pummelzacken.oob.openstreetmap.org.
-40.1.0         IN      PTR     tiamat-00.oob.openstreetmap.org.
-41.1.0         IN      PTR     tiamat-01.oob.openstreetmap.org.
-42.1.0         IN      PTR     tiamat-02.oob.openstreetmap.org.
-43.1.0         IN      PTR     tiamat-03.oob.openstreetmap.org.
-44.1.0         IN      PTR     tiamat-10.oob.openstreetmap.org.
-45.1.0         IN      PTR     tiamat-11.oob.openstreetmap.org.
-46.1.0         IN      PTR     tiamat-12.oob.openstreetmap.org.
-47.1.0         IN      PTR     tiamat-13.oob.openstreetmap.org.
-48.1.0         IN      PTR     tiamat-20.oob.openstreetmap.org.
-49.1.0         IN      PTR     tiamat-21.oob.openstreetmap.org.
-50.1.0         IN      PTR     tiamat-22.oob.openstreetmap.org.
-51.1.0         IN      PTR     tiamat-23.oob.openstreetmap.org.
-
-2.16.0         IN      PTR     orm.bm.openstreetmap.org.
-3.16.0         IN      PTR     shenron.bm.openstreetmap.org.
 
 20.32.0                IN      PTR     grisu.bm.openstreetmap.org.
 21.32.0                IN      PTR     spike-04.bm.openstreetmap.org.
 22.32.0                IN      PTR     spike-05.bm.openstreetmap.org.
 40.32.0                IN      PTR     katla.bm.openstreetmap.org.
-41.32.0                IN      PTR     thorn-04.bm.openstreetmap.org.
-42.32.0                IN      PTR     thorn-05.bm.openstreetmap.org.
 
 20.33.0                IN      PTR     grisu.oob.openstreetmap.org.
 21.33.0                IN      PTR     spike-04.oob.openstreetmap.org.
 22.33.0                IN      PTR     spike-05.oob.openstreetmap.org.
 40.33.0                IN      PTR     katla.oob.openstreetmap.org.
-41.33.0                IN      PTR     thorn-04.oob.openstreetmap.org.
-42.33.0                IN      PTR     thorn-05.oob.openstreetmap.org.
 
+3.48.0         IN      PTR     faffy.ams.openstreetmap.org.
 9.48.0         IN      PTR     dulcy.ams.openstreetmap.org.
 10.48.0                IN      PTR     ironbelly.ams.openstreetmap.org.
 11.48.0                IN      PTR     spike-06.ams.openstreetmap.org.
@@ -91,7 +52,7 @@ $TTL  604800
 13.48.0                IN      PTR     spike-08.ams.openstreetmap.org.
 14.48.0                IN      PTR     tabaluga.ams.openstreetmap.org.
 15.48.0                IN      PTR     odin.ams.openstreetmap.org.
-16.48.0                IN      PTR     lockheed.ams.openstreetmap.org.
+17.48.0                IN      PTR     norbert.ams.openstreetmap.org.
 49.48.0                IN      PTR     snap-01.ams.openstreetmap.org.
 50.48.0                IN      PTR     karm.ams.openstreetmap.org.
 52.48.0                IN      PTR     thorn-02.ams.openstreetmap.org.
@@ -100,6 +61,7 @@ $TTL 604800
 101.48.0       IN      PTR     pdu2.ams.openstreetmap.org.
 102.48.0       IN      PTR     oob1.ams.openstreetmap.org.
 
+3.49.0         IN      PTR     faffy.oob.openstreetmap.org.
 9.49.0         IN      PTR     dulcy.oob.openstreetmap.org.
 10.49.0                IN      PTR     ironbelly.oob.openstreetmap.org.
 11.49.0                IN      PTR     spike-06.oob.openstreetmap.org.
@@ -107,7 +69,7 @@ $TTL 604800
 13.49.0                IN      PTR     spike-08.oob.openstreetmap.org.
 14.49.0                IN      PTR     tabaluga.oob.openstreetmap.org.
 15.49.0                IN      PTR     odin.oob.openstreetmap.org.
-16.49.0                IN      PTR     lockheed.oob.openstreetmap.org.
+17.49.0                IN      PTR     norbert.oob.openstreetmap.org.
 49.49.0                IN      PTR     snap-01.oob.openstreetmap.org.
 50.49.0                IN      PTR     karm.oob.openstreetmap.org.
 52.49.0                IN      PTR     thorn-02.oob.openstreetmap.org.
index 820731a497b44dba6d9e641f1a5b17597f7fc408..46b6902ad57f5db1d5320c381670998dbe7a2ff9 100644 (file)
@@ -44,10 +44,11 @@ end
 wordpress_theme "blog.openstreetmap.org-osmblog-wp-theme" do
   theme "osmblog-wp-theme"
   site "blog.openstreetmap.org"
-  repository "https://github.com/harry-wood/osmblog-wp-theme.git"
+  repository "https://github.com/osmfoundation/osmblog-wp-theme.git"
 end
 
 wordpress_plugin "blog.openstreetmap.org-google-analytics-for-wordpress" do
+  action :delete
   plugin "google-analytics-for-wordpress"
   site "blog.openstreetmap.org"
 end
@@ -64,10 +65,16 @@ end
 # end
 
 wordpress_plugin "blog.openstreetmap.org-shareadraft" do
+  action :delete
   plugin "shareadraft"
   site "blog.openstreetmap.org"
 end
 
+wordpress_plugin "blog.openstreetmap.org-public-post-preview" do
+  plugin "public-post-preview"
+  site "blog.openstreetmap.org"
+end
+
 wordpress_plugin "blog.openstreetmap.org-sitepress-multilingual-cms" do
   plugin "sitepress-multilingual-cms"
   site "blog.openstreetmap.org"
@@ -77,6 +84,7 @@ wordpress_plugin "blog.openstreetmap.org-sitepress-multilingual-cms" do
 end
 
 wordpress_plugin "blog.openstreetmap.org-wordpress-importer" do
+  action :delete
   plugin "wordpress-importer"
   site "blog.openstreetmap.org"
 end
index e63df4125a3d0be55db033d4f72203d0bb620fa7..0e797074db621b2d12016ac6c2490663976b8c00 100644 (file)
@@ -10,3 +10,4 @@ depends           "accounts"
 depends           "apache"
 depends           "git"
 depends           "ruby"
+depends           "systemd"
index 51e6b62f41f9634f4452a9bb4bfa0b6e44df263c..6b181f2090714e70b1d461e4f45d2e61cf24dc20 100644 (file)
@@ -78,11 +78,22 @@ template "/usr/local/bin/blogs-update" do
   mode "0755"
 end
 
-cron_d "blogs" do
-  minute "*/30"
+systemd_service "blogs-update" do
+  description "Update blog aggregator"
+  exec_start "/usr/local/bin/blogs-update"
   user "blogs"
-  command "/usr/local/bin/blogs-update"
-  mailto "admins@openstreetmap.org"
+  sandbox :enable_network => true
+  read_write_paths "/srv/blogs.openstreetmap.org"
+end
+
+systemd_timer "blogs-update" do
+  description "Update blog aggregator"
+  on_boot_sec "15m"
+  on_unit_inactive_sec "30m"
+end
+
+service "blogs-update.timer" do
+  action [:enable, :start]
 end
 
 template "/etc/cron.daily/blogs-backup" do
index 00c241a9633ed77148997d9114f2cefbdea0c200..50d72309972d693e5ebecf09b893b6f38c203dd9 100644 (file)
@@ -1,8 +1,5 @@
-# Add the opscode APT source for chef
-default[:apt][:sources] = node[:apt][:sources] | ["opscode"]
-
 # Set the default server version
-default[:chef][:server][:version] = "12.17.33"
+default[:chef][:server][:version] = "15.1.7"
 
 # Set the default client version
-default[:chef][:client][:version] = "17.10.3"
+default[:chef][:client][:version] = "18.0.169"
diff --git a/cookbooks/chef/libraries/cpu.rb b/cookbooks/chef/libraries/cpu.rb
new file mode 100644 (file)
index 0000000..1e2d844
--- /dev/null
@@ -0,0 +1,11 @@
+module OpenStreetMap
+  module Mixin
+    module CPU
+      def cpu_cores
+        [dig("cpu", "total").to_i, dig("cpu", "cores").to_i, 4].max
+      end
+    end
+  end
+end
+
+Chef::Node.include(OpenStreetMap::Mixin::CPU)
index bfbec455cebc82d00acc90725b70b627c9e3f36a..7de56267f3628b62f639ce6afdc1d6b267accb0a 100644 (file)
@@ -1,4 +1,4 @@
-class Chef
+module OpenStreetMap
   module Mixin
     module EditFile
       def edit_file(file, &_block)
@@ -10,8 +10,6 @@ class Chef
       end
     end
   end
-
-  class Recipe
-    include Chef::Mixin::EditFile
-  end
 end
+
+Chef::DSL::Recipe.include(OpenStreetMap::Mixin::EditFile)
index 8299e8550716ec89cd2c6b4e8c1ffd118dd52f39..944f19363e8e8e4db618c46245768440ab5cf7b9 100644 (file)
@@ -1,6 +1,6 @@
 require "digest"
 
-class Chef
+module OpenStreetMap
   module Mixin
     module PersistentToken
       def persistent_token(*args)
@@ -13,8 +13,6 @@ class Chef
       end
     end
   end
-
-  class Recipe
-    include Chef::Mixin::PersistentToken
-  end
 end
+
+Chef::DSL::Recipe.include(OpenStreetMap::Mixin::PersistentToken)
diff --git a/cookbooks/chef/libraries/random_password.rb b/cookbooks/chef/libraries/random_password.rb
deleted file mode 100644 (file)
index 71d8bcf..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-class Chef
-  class Recipe
-    def random_password(length)
-      Array.new(length) do
-        "!\#$%&()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~"[rand(91)].chr
-      end.join
-    end
-  end
-end
index 69f344996ce045fd129812ab518e2f3f4965652d..569c8701c328ca72cb21267495e1752e0c590701 100644 (file)
@@ -12,4 +12,4 @@ depends           "git"
 depends           "ohai"
 depends           "munin"
 depends           "systemd"
-gem               "mail"
+gem               "mail", "= 2.7.1"
index bd22671a73ced1934610183924c600f1cde64175..9f377f502de0f22ce3f63c8874a92cf7efd340e7 100644 (file)
@@ -36,11 +36,7 @@ Dir.glob("#{cache_dir}/chef_*.deb").each do |deb|
   end
 end
 
-ubuntu_release = if node[:lsb][:release].to_f < 22.04
-                   node[:lsb][:release]
-                 else
-                   "20.04"
-                 end
+ubuntu_release = node[:lsb][:release]
 
 remote_file "#{cache_dir}/#{chef_package}" do
   source "https://packages.chef.io/files/stable/chef/#{chef_version}/ubuntu/#{ubuntu_release}/#{chef_package}"
@@ -117,6 +113,7 @@ end
 systemd_service "chef-client" do
   description "Chef client"
   exec_start "/usr/bin/chef-client"
+  nice 10
 end
 
 systemd_timer "chef-client" do
index cd54cf4260e411978c0b6268c7b643a13e2674cb..48fbfd7479ac091636b1e8ea632b20b1488f1ae0 100644 (file)
@@ -36,7 +36,7 @@ include_recipe "munin"
 # end
 #
 # remote_file "#{cache_dir}/#{chef_package}" do
-#   source "https://packages.chef.io/files/stable/chef-server/#{chef_version}/ubuntu/16.04/#{chef_package}"
+#   source "https://packages.chef.io/files/stable/chef-server/#{chef_version}/ubuntu/20.04/chef-server-core_#{chef_version}-1_amd64.deb"
 #   owner "root"
 #   group "root"
 #   mode 0644
index a6c4494346f2ef7048660a1f5a83433f48742bf6..5d0736e8b9e24f8cf64b5a86416029de1c49978d 100644 (file)
@@ -54,7 +54,7 @@ end
 
 wordpress_theme "osmblog-wp-theme" do
   site "join.osmfoundation.org"
-  repository "https://github.com/harry-wood/osmblog-wp-theme.git"
+  repository "https://github.com/osmfoundation/osmblog-wp-theme.git"
 end
 
 wordpress_plugin "registration-honeypot" do
@@ -173,11 +173,24 @@ file "#{civicrm_directory}/civicrm.settings.php" do
   content settings
 end
 
-cron_d "osmf-crm" do
-  minute "*/15"
+systemd_service "osmf-crm-jobs" do
+  description "Run CRM jobs"
+  exec_start "/usr/bin/php #{civicrm_directory}/civicrm/bin/cli.php -s join.osmfoundation.org -u batch -p \"#{passwords['batch']}\" -e Job -a execute"
   user "www-data"
-  command "php #{civicrm_directory}/civicrm/bin/cli.php -s join.osmfoundation.org -u batch -p \"#{passwords['batch']}\" -e Job -a execute 2>&1 | egrep -v '^PHP (Deprecated|Warning):'"
-  mailto "admins@openstreetmap.org"
+  sandbox :enable_network => true
+  memory_deny_write_execute false
+  restrict_address_families "AF_UNIX"
+  read_write_paths "/srv/join.osmfoundation.org/wp-content/uploads/civicrm"
+end
+
+systemd_timer "osmf-crm-jobs" do
+  description "Run CRM jobs"
+  on_boot_sec "15m"
+  on_unit_inactive_sec "15m"
+end
+
+service "osmf-crm-jobs.timer" do
+  action [:enable, :start]
 end
 
 template "/etc/cron.daily/osmf-crm-backup" do
index 32a05964e9fc346d59bdc77bb1777abd34122fbf..8ef95c90672f5621a9723b6337851dc0b87714d5 100644 (file)
@@ -6,3 +6,4 @@ description       "Installs and configures clamav"
 
 version           "1.0.0"
 supports          "ubuntu"
+depends           "accounts"
index f6dd24a5c8af5b5634eee0aba5c23f800dbee1a9..938b2f5aba0c1caa72e448623ba894b8b494162d 100644 (file)
@@ -17,6 +17,8 @@
 # limitations under the License.
 #
 
+include_recipe "accounts"
+
 package %w[
   clamav-daemon
   clamav-freshclam
index 4d159c4ad600ded182bd7a24074758c09b343cd8..f2eaaaa03f4472c5ecd268b628e9a6f7d5f31807 100644 (file)
@@ -8,6 +8,7 @@ version           "1.0.0"
 supports          "ubuntu"
 depends           "accounts"
 depends           "docker"
+depends           "exim"
 depends           "geoipupdate"
 depends           "git"
 depends           "ssl"
index 89743de31c0fb7a7de419922633b6bd61b2ed693..f3888c61a43324edc29491c0409fc6bfc7a409fe 100644 (file)
 
 include_recipe "accounts"
 include_recipe "docker"
-include_recipe "geoipupdate"
 include_recipe "git"
 include_recipe "ssl"
 
 passwords = data_bag_item("community", "passwords")
 license_keys = data_bag_item("geoipupdate", "license-keys") unless kitchen?
 
+# Disable any default installed apache2 service. Web server is embedded within the discourse docker container
+service "apache2" do
+  action [:disable, :stop]
+end
+
 directory "/srv/community.openstreetmap.org" do
   owner "root"
   group "root"
index 5794e498d84e0ebf4af1b0453b5a2042880ccf2d..4407553c98c8495676ab75da70058549ae04d3c6 100644 (file)
@@ -21,7 +21,7 @@ links:
 
 # Workaround bug: https://github.com/discourse/discourse_docker/pull/505
 # params:
-#  version: v2.8.7
+#  version: v2.8.13 - NOT USED HERE. UPDATE THE EXEC GIT ACTIONS BELOW WITH VERSION
 
 env:
   LC_ALL: en_US.UTF-8
@@ -32,10 +32,11 @@ env:
 
   ## How many concurrent web requests are supported? Depends on memory and CPU cores.
   ## will be set automatically by bootstrap based on detected CPUs, or you can override
-  UNICORN_WORKERS: 8
+  UNICORN_WORKERS: <%= node.cpu_cores %>
 
   ## TODO: The domain name this Discourse instance will respond to
   DISCOURSE_HOSTNAME: community.openstreetmap.org
+  DISCOURSE_CDN_URL: https://community-cdn.openstreetmap.org
 
   ## Uncomment if you want the container to be started with the same
   ## hostname (-h option) as specified above (default "$hostname-$config")
@@ -45,14 +46,11 @@ env:
   ## on initial signup example 'user1@example.com,user2@example.com'
   DISCOURSE_DEVELOPER_EMAILS: 'operations@openstreetmap.org'
 
-  ## TODO: The SMTP mail server used to validate new accounts and send notifications
-  # SMTP ADDRESS, username, and password are required
-  # WARNING the char '#' in SMTP password can cause problems!
-  DISCOURSE_SMTP_ADDRESS: mail.openstreetmap.org
-  DISCOURSE_SMTP_PORT: 26
+  DISCOURSE_SMTP_ADDRESS: <%= node[:exim][:smarthost_via].split(":", 2)[0] %>
+  DISCOURSE_SMTP_PORT: <%= node[:exim][:smarthost_via].split(":", 2)[1] || "25" %>
+  DISCOURSE_SMTP_OPENSSL_VERIFY_MODE: none
   DISCOURSE_SMTP_USER_NAME:
   DISCOURSE_SMTP_PASSWORD:
-  # DISCOURSE_SMTP_ENABLE_START_TLS: true           # (optional, default true)
   DISCOURSE_SMTP_DOMAIN: community.openstreetmap.org
   DISCOURSE_NOTIFICATION_EMAIL: community@noreply.openstreetmap.org
 
@@ -99,8 +97,8 @@ hooks:
     - exec:
         cd: $home
         cmd:
-          - git fetch --depth=1 origin tag v2.8.7 --no-tags
-          - git checkout v2.8.7
+          - git fetch --depth=1 origin tag v2.8.13 --no-tags
+          - git checkout v2.8.13
   after_ssl:
     - replace:
         filename: "/etc/nginx/conf.d/discourse.conf"
index d52927a7586ae52f5a8b96533d6b56363deef144..c81fffe5b35650c04ee818711ab58d14c1efeae5 100644 (file)
@@ -11,4 +11,5 @@ depends           "git"
 depends           "postgresql"
 depends           "python"
 depends           "ruby"
+depends           "systemd"
 depends           "web"
index 0fe004d20f823fd4ef848f55322a594d14d611f4..39d6d573d4885a4844ee9bebe4bb4f6f39da8a50 100644 (file)
@@ -24,11 +24,20 @@ template "/usr/local/bin/backup-db" do
   mode "755"
 end
 
-cron_d "backup-db" do
-  minute "00"
-  hour "02"
-  weekday "1"
+systemd_service "backup-db" do
+  description "Database backup"
+  exec_start "/usr/local/bin/backup-db"
   user "osmbackup"
-  command "/usr/local/bin/backup-db"
-  mailto "admins@openstreetmap.org"
+  sandbox :enable_network => true
+  restrict_address_families "AF_UNIX"
+  read_write_paths "/store/backup"
+end
+
+systemd_timer "backup-db" do
+  description "Database backup"
+  on_calendar "Mon 02:00 #{node[:timezone]}"
+end
+
+service "backup-db.timer" do
+  action [:enable, :start]
 end
index 520fbe2e86ab1c84a547a3fd209bcc147cf67b15..bf414737c1a2cf52bba763b13683452d0d54da6d 100644 (file)
@@ -72,31 +72,6 @@ git "/opt/osmdbt" do
 end
 
 node[:postgresql][:versions].each do |db_version|
-  pg_config = "/usr/lib/postgresql/#{db_version}/bin/pg_config"
-  function_directory = "/srv/www.openstreetmap.org/rails/db/functions/#{db_version}"
-
-  directory function_directory do
-    owner "rails"
-    group "rails"
-    mode "755"
-  end
-
-  execute function_directory do
-    action :nothing
-    command "make BUNDLE=#{node[:ruby][:bundle]} PG_CONFIG=#{pg_config} DESTDIR=#{function_directory}"
-    cwd "/srv/www.openstreetmap.org/rails/db/functions"
-    user "rails"
-    group "rails"
-    subscribes :run, "directory[#{function_directory}]"
-    subscribes :run, "git[/srv/www.openstreetmap.org/rails]"
-  end
-
-  link "/usr/lib/postgresql/#{db_version}/lib/libpgosm.so" do
-    to "#{function_directory}/libpgosm.so"
-    owner "root"
-    group "root"
-  end
-
   directory "/opt/osmdbt/build-#{db_version}" do
     owner "root"
     group "root"
index f6641fd18fe85ba677d12d571c14024ac9780ab2..fe9c4cacf403471a3d0857255b5361267535b9aa 100644 (file)
@@ -83,7 +83,3 @@ postgresql_extension "btree_gist" do
   database "openstreetmap"
   only_if { node[:postgresql][:clusters][node[:db][:cluster]] && node[:postgresql][:clusters][node[:db][:cluster]][:version] >= 9.0 }
 end
-
-file "/etc/cron.daily/rails-db" do
-  action :delete
-end
index d2477273d57e64c982b7a222ed110bac68c8440b..a9e85008ef13eed4b99f5d905d768c729eb3f836 100644 (file)
@@ -34,24 +34,47 @@ include_recipe "python"
 include_recipe "ruby"
 
 package %w[
+  ant
+  default-jdk-headless
+  default-jre-headless
+  golang
+  composer
+  php-apcu
   php-cgi
   php-cli
   php-curl
   php-db
+  php-gd
+  php-igbinary
   php-imagick
+  php-intl
+  php-mbstring
+  php-memcache
   php-mysql
   php-pear
   php-pgsql
   php-sqlite3
+  php-xml
   pngcrush
   pngquant
+  python-is-python3
   python3
+  python3-brotli
   python3-bs4
   python3-cheetah
   python3-dateutil
+  python3-dev
+  python3-dotenv
+  python3-lxml
+  python3-lz4
   python3-magic
+  python3-pil
   python3-psycopg2
+  python3-venv
+  python3-pyproj
   python3-gdal
+  gdal-bin
+  proj-bin
   g++
   gcc
   make
@@ -62,6 +85,7 @@ package %w[
   libfcgi-dev
   libxml2-dev
   libmemcached-dev
+  libboost-dev
   libboost-regex-dev
   libboost-system-dev
   libboost-program-options-dev
@@ -75,8 +99,44 @@ package %w[
   zlib1g-dev
   nano
   osm2pgsql
+  osmosis
+  at
+  awscli
+  mailutils
+  lua-any
+  luajit
+  fonts-dejavu
+  fonts-dejavu-core
+  fonts-dejavu-extra
+  fonts-droid-fallback
+  fonts-liberation
+  fonts-noto-mono
+  gnuplot-nox
+  graphviz
+  irssi
+  jq
+  lz4
+  lzip
+  lzop
+  pbzip2
+  pigz
+  unrar
+  unzip
+  zip
+  netcat
+  tmux
+  whois
+  redis
+  r-base
+  pandoc
 ]
 
+# Add uk_os_OSTN15_NTv2_OSGBtoETRS.tif used for reprojecting OS data
+execute "uk_os_OSTN15_NTv2_OSGBtoETRS.tif" do
+  command "projsync --file uk_os_OSTN15_NTv2_OSGBtoETRS.tif --system-directory"
+  not_if { ::File.exist?("/usr/share/proj/uk_os_OSTN15_NTv2_OSGBtoETRS.tif") }
+end
+
 nodejs_package "svgo"
 
 python_package "geojson" do
@@ -181,7 +241,7 @@ search(:accounts, "*:*").each do |account|
                "memory_limit" => "128M",
                "post_max_size" => "32M",
                "upload_max_filesize" => "32M"
-    php_admin_values "sendmail_path" => "/usr/sbin/sendmail -t -i -f #{name}@errol.openstreetmap.org",
+    php_admin_values "sendmail_path" => "/usr/sbin/sendmail -t -i -f #{name}@dev.openstreetmap.org",
                      "open_basedir" => "/home/#{name}/:/tmp/:/usr/share/php/"
     php_flags "display_errors" => "on"
   end
@@ -206,6 +266,10 @@ search(:accounts, "*:*").each do |account|
   end
 end
 
+node[:postgresql][:versions].each do |version|
+  package "postgresql-#{version}-postgis-3"
+end
+
 if node[:postgresql][:clusters][:"14/main"]
   postgresql_user "apis" do
     cluster "14/main"
@@ -222,15 +286,16 @@ if node[:postgresql][:clusters][:"14/main"]
   systemd_service "rails-jobs@" do
     description "Rails job queue runner"
     type "simple"
+    environment "RAILS_ENV" => "production", "SLEEP_DELAY" => "60"
     user "apis"
     working_directory "/srv/%i.apis.dev.openstreetmap.org/rails"
     exec_start "#{node[:ruby][:bundle]} exec rails jobs:work"
     restart "on-failure"
-    private_tmp true
-    private_devices true
-    protect_system "full"
-    protect_home true
-    no_new_privileges true
+    nice 10
+    sandbox :enable_network => true
+    restrict_address_families "AF_UNIX"
+    memory_deny_write_execute false
+    read_write_paths "/srv/%i.apis.dev.openstreetmap.org/logs"
   end
 
   systemd_service "cgimap@" do
@@ -240,11 +305,9 @@ if node[:postgresql][:clusters][:"14/main"]
     user "apis"
     exec_start "/srv/%i.apis.dev.openstreetmap.org/cgimap/openstreetmap-cgimap --daemon --port $CGIMAP_PORT --instances 5"
     exec_reload "/bin/kill -HUP $MAINPID"
-    private_tmp true
-    private_devices true
-    protect_system "full"
-    protect_home true
-    no_new_privileges true
+    sandbox :enable_network => true
+    restrict_address_families "AF_UNIX"
+    read_write_paths ["/srv/%i.apis.dev.openstreetmap.org/logs", "/srv/%i.apis.dev.openstreetmap.org/rails/tmp"]
     restart "on-failure"
   end
 
@@ -339,7 +402,7 @@ if node[:postgresql][:clusters][:"14/main"]
         action [:enable, :start]
         supports :restart => true
         subscribes :restart, "rails_port[#{site_name}]"
-        subscribes :restart, "systemd_service[#{name}]"
+        subscribes :restart, "systemd_service[rails-jobs@]"
         only_if "fgrep -q delayed_job #{rails_directory}/Gemfile.lock"
       end
 
@@ -377,7 +440,6 @@ if node[:postgresql][:clusters][:"14/main"]
           user "apis"
           group "apis"
           subscribes :run, "execute[#{cgimap_directory}/configure]", :immediately
-          notifies :restart, "service[cgimap@#{name}]"
         end
 
         template "/etc/default/cgimap-#{name}" do
@@ -389,11 +451,13 @@ if node[:postgresql][:clusters][:"14/main"]
                     :database_port => node[:postgresql][:clusters][:"14/main"][:port],
                     :database_name => database_name,
                     :log_directory => log_directory
-          notifies :restart, "service[cgimap@#{name}]"
         end
 
         service "cgimap@#{name}" do
           action [:start, :enable]
+          subscribes :restart, "execute[#{cgimap_directory}/Makefile]"
+          subscribes :restart, "template[/etc/default/cgimap-#{name}]"
+          subscribes :restart, "systemd_service[cgimap@]"
         end
       end
 
index 2965946e2ad92e8ce5d2cf7b865ae39b3fb1090d..fba25578118e04fdb318f9d23370bcc13f8b40dd 100644 (file)
@@ -16,9 +16,9 @@
        # Remove Proxy request header to mitigate https://httpoxy.org/
        RequestHeader unset Proxy early
 
-       ProxyPassMatch ^/(.*\.php(/.*)?)$ unix:/run/php/default.sock|fcgi://127.0.0.1
-       ProxyPassMatch ^/(.*\.phpx(/.*)?)$ unix:/run/php/default.sock|fcgi://127.0.0.1
-       ProxyPassMatch ^/(.*\.phpj(/.*)?)$ unix:/run/php/default.sock|fcgi://127.0.0.1
+       ProxyPassMatch ^/(.*\.php(/.*)?)$ unix:/run/php/php-default-fpm.sock|fcgi://127.0.0.1
+       ProxyPassMatch ^/(.*\.phpx(/.*)?)$ unix:/run/php/php-default-fpm.sock|fcgi://127.0.0.1
+       ProxyPassMatch ^/(.*\.phpj(/.*)?)$ unix:/run/php/php-default-fpm.sock|fcgi://127.0.0.1
 </VirtualHost>
 
 <VirtualHost *:80>
index 258f120d3381e8813aa88182d13b341a53926ac1..fb03b648705d1b02cb69a7fefd1f7e2b05056be3 100644 (file)
@@ -30,7 +30,7 @@ WSGIDaemonProcess <%= @user %>.dev.openstreetmap.org user=<%= @user %> processes
        RewriteRule ^/cgi-bin/(.*)$ /~<%= @user %>/cgi-bin/$1 [PT,L]
 
        <FilesMatch ".+\.ph(p|ps|p3|tml)$">
-               SetHandler "proxy:unix:/run/php/<%= @user %>.sock|fcgi://127.0.0.1"
+               SetHandler "proxy:unix:/run/php/php-<%= @user %>-fpm.sock|fcgi://127.0.0.1"
        </FilesMatch>
 </VirtualHost>
 
index f1ec142485c69cd1266fa0f9471d6be256f72c58..c259f0013d9e8d13d6b509d0d22ac4e7fc8cba93 100644 (file)
@@ -1,10 +1,28 @@
 <html>
-<body>
-You've reached errol, the OpenStreetMap dev server. <br />
-<dl>
-<dt>If you are a user...</dt>
-<dd>You probably want <a href="https://www.openstreetmap.org/">OpenStreetMap</a> itself.</dd>
-<dt>If you are a developer...</dt>
-<dd>You might be interested in <a href="https://apis.dev.openstreetmap.org/">live instances</a> of various <a href="https://github.com/openstreetmap/openstreetmap-website#readme">Rails Port</a> code branches for testing clients against.</dd>
-</body>
+  <body>
+    <h4>
+      You've reached <a href="https://hardware.openstreetmap.org/servers/faffy.openstreetmap.org/">faffy</a>, the OpenStreetMap dev server.
+    </h4>
+    <dl>
+      <dt>If you are a user...</dt>
+      <dd>
+        You probably want
+        <a href="https://www.openstreetmap.org/">OpenStreetMap</a> itself.
+      </dd>
+      <dt>If you are a developer...</dt>
+      <dd>
+        You might be interested in
+        <a href="https://apis.dev.openstreetmap.org/">live instances</a> of
+        various
+        <a href="https://github.com/openstreetmap/openstreetmap-website#readme">Rails Port</a>
+        code branches for testing clients against.
+      </dd>
+      <dt>Request an account</dt>
+      <dd>
+        Anyone who wants to work on OpenStreetMap-related projects can
+        <a href="https://github.com/openstreetmap/operations/issues/new?assignees=Firefishy&labels=faffy%2Cuser+request&template=ACCOUNT-REQUEST.yml&title=%5BAccount+request%5D%3A+">request an account</a>
+        on the dev server.
+      </dd>
+    </dl>
+  </body>
 </html>
index b5c8dae33cd7efd88acb338b37465d4eaa492226..37d9226c1063e2ec816604743a64f8ebba111d43 100644 (file)
@@ -1,6 +1,9 @@
 # DO NOT EDIT - This file is being maintained by Chef
 
-option architecture-type code 93 = unsigned integer 16;
+option arch code 93 = unsigned integer 16;
+# ilo5 expects TZ data per rfc4833
+option PCode code 100 = text;
+option TCode code 101 = text;
 
 default-lease-time 600;
 max-lease-time 7200;
@@ -13,17 +16,24 @@ subnet <%= interface[:network] %> netmask <%= interface[:netmask] %> {
   option routers <%= interface[:gateway] %>;
   option domain-name "<%= @domain %>";
   option domain-name-servers <%= interface[:gateway] %>;
-  option ntp-servers <%= node[:ntp][:servers].first %>;
-
-  class "pxeclients" {
-    match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";
-    next-server <%= interface[:gateway] %>;
-
-    if option architecture-type = 00:07 {
-      filename "netboot.xyz.efi";
-    } else {
-      filename "netboot.xyz.kpxe";
-    }
+  option ntp-servers <%= node[:ntp][:servers].join(", ") %>;
+
+  option time-offset 0;
+  option PCode "UTC0";
+  option TCode "Etc/UTC";
+
+  next-server <%= interface[:gateway] %>;
+
+  # See https://netboot.xyz/docs/docker/#dhcp-configurations
+  if exists user-class and ( option user-class = "iPXE" ) {
+    filename "http://boot.netboot.xyz/menu.ipxe";
+  } elsif option arch = encode-int ( 16, 16 ) {
+    filename "http://boot.netboot.xyz/ipxe/netboot.xyz.efi";
+    option vendor-class-identifier "HTTPClient";
+  } elsif option arch = 00:07 {
+    filename "netboot.xyz.efi";
+  } else {
+    filename "netboot.xyz.kpxe";
   }
 }
 <% end -%>
@@ -94,18 +104,18 @@ host eddie.oob.openstreetmap.org {
   fixed-address eddie.oob.openstreetmap.org;
 }
 
-host errol.oob.openstreetmap.org {
-  hardware ethernet 00:e0:81:c0:8d:01;
-  server-name "errol.oob.openstreetmap.org";
-  fixed-address errol.oob.openstreetmap.org;
-}
-
 host eustace.oob.openstreetmap.org {
   hardware ethernet 1c:c1:de:71:4d:2e;
   server-name "eustace.oob.openstreetmap.org";
   fixed-address eustace.oob.openstreetmap.org;
 }
 
+host faffy.oob.openstreetmap.org {
+  hardware ethernet 98:f2:b3:21:f6:e2;
+  server-name "faffy.oob.openstreetmap.org";
+  fixed-address faffy.oob.openstreetmap.org;
+}
+
 host fafnir.oob.openstreetmap.org {
   hardware ethernet 38:63:bb:39:f0:96;
   server-name "fafnir.oob.openstreetmap.org";
@@ -160,12 +170,6 @@ host konqi.oob.openstreetmap.org {
   fixed-address konqi.oob.openstreetmap.org;
 }
 
-host lockheed.oob.openstreetmap.org {
-  hardware ethernet 44:1e:a1:57:8f:fe;
-  server-name "lockheed.oob.openstreetmap.org";
-  fixed-address lockheed.oob.openstreetmap.org;
-}
-
 host longma.oob.openstreetmap.org {
   hardware ethernet 3c:ec:ef:2f:6d:4e;
   server-name "longma.oob.openstreetmap.org";
@@ -352,12 +356,6 @@ host thorn-03.oob.openstreetmap.org {
   fixed-address thorn-03.oob.openstreetmap.org;
 }
 
-host urmel.oob.openstreetmap.org {
-  hardware ethernet 1c:c1:de:e7:4d:b2;
-  server-name "urmel.oob.openstreetmap.org";
-  fixed-address urmel.oob.openstreetmap.org;
-}
-
 host ysera.oob.openstreetmap.org {
   hardware ethernet ac:1f:6b:c1:40:2a;
   server-name "ysera.oob.openstreetmap.org";
index 41d06aa1cd3c1af1df95c62b7f617756abde24a9..5b2e320d693d5720008ec86654da3bdd259c045d 100644 (file)
@@ -53,6 +53,6 @@
   Require all granted
 
   <FilesMatch ".+\.ph(ar|p|tml)$">
-    SetHandler "proxy:unix:/run/php/<%= @name %>.sock|fcgi://127.0.0.1"
+    SetHandler "proxy:unix:/run/php/php-<%= @name %>-fpm.sock|fcgi://127.0.0.1"
   </FilesMatch>
 </Directory>
index fb112068119ccb5be9e87dd923fc7e5f45cf04f8..521b387183ea9150792bdb9d9475edc9653abbe9 100644 (file)
@@ -9,3 +9,4 @@ supports          "ubuntu"
 depends           "accounts"
 depends           "apache"
 depends           "git"
+depends           "systemd"
index 98005c41ea00c621a8d7a41c9b169ee77870db6f..655eb27ac642a4b5ea9d7e2887de12b2614127cd 100644 (file)
@@ -35,16 +35,33 @@ package %w[
   libwww-perl
   libxml-treebuilder-perl
   libxml-writer-perl
+  libyaml-perl
   libyaml-libyaml-perl
   lockfile-progs
 ]
 
-remote_file "/usr/local/bin/dnscontrol" do
-  action :create
-  source "https://github.com/StackExchange/dnscontrol/releases/download/v3.12.0/dnscontrol-Linux"
+cache_dir = Chef::Config[:file_cache_path]
+
+dnscontrol_version = "3.23.0"
+
+dnscontrol_arch = if arm?
+                    "arm64"
+                  else
+                    "amd64"
+                  end
+
+remote_file "#{cache_dir}/dnscontrol-#{dnscontrol_version}.deb" do
+  source "https://github.com/StackExchange/dnscontrol/releases/download/v#{dnscontrol_version}/dnscontrol-#{dnscontrol_version}.#{dnscontrol_arch}.deb"
   owner "root"
   group "root"
-  mode "755"
+  mode "644"
+  backup false
+end
+
+dpkg_package "dnscontrol" do
+  action :nothing
+  source "#{cache_dir}/dnscontrol-#{dnscontrol_version}.deb"
+  subscribes :install, "remote_file[#{cache_dir}/dnscontrol-#{dnscontrol_version}.deb]"
 end
 
 directory "/srv/dns.openstreetmap.org" do
@@ -153,9 +170,21 @@ template "/usr/local/bin/dns-check" do
   variables :passwords => passwords, :geoservers => geoservers
 end
 
-cron_d "dns" do
-  minute "*/3"
+systemd_service "dns-check" do
+  description "Rebuild DNS zones with GeoDNS changes"
+  exec_start "/usr/local/bin/dns-check"
   user "git"
-  command "/usr/local/bin/dns-check"
-  mailto "admins@openstreetmap.org"
+  sandbox :enable_network => true
+  proc_subset "all"
+  read_write_paths "/var/lib/dns"
+end
+
+systemd_timer "dns-check" do
+  description "Rebuild DNS zones with GeoDNS changes"
+  on_boot_sec "3m"
+  on_unit_active_sec "3m"
+end
+
+service "dns-check.timer" do
+  action [:enable, :start]
 end
index 980c0fb3829c2089b8f130ed2adef71aa1fe58cb..0317436736c3b5b565b9b1b6b8cf6ac04ba22255 100644 (file)
@@ -1,9 +1,11 @@
 {
   "gandi_v5": {
+    "TYPE": "GANDI_V5",
     "apikey": "<%= @passwords["gandi"] %>",
     "sharing_id": "7028b616-ba65-11e7-8343-00163ec31f40"
   },
   "cloudflare": {
+    "TYPE": "CLOUDFLAREAPI",
     "accountid": "049c95aba02c95fc1e78a9d255282e0f",
     "accountname": "OpenStreetMap",
     "apitoken": "<%= @passwords["cloudflare"] %>"
index 5353d69d42daa35841e7f0c3deb7a516af662250..a16016b56887284449c23a01089ca1ddf672ca28 100755 (executable)
@@ -20,6 +20,6 @@ fi
 
 git pull -q
 
-make --jobs update
+make --jobs check update
 
 lockfile-remove update
diff --git a/cookbooks/docker/attributes/default.rb b/cookbooks/docker/attributes/default.rb
deleted file mode 100644 (file)
index f71e326..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-# Add the docker APT source
-default[:apt][:sources] = node[:apt][:sources] | ["docker"]
index 110cc32020e69ef10fb2927dfcb21b89a6d5f5b3..0ed59aa0b4580ac400d08a095cd6e9f194bf83fe 100644 (file)
@@ -7,3 +7,4 @@ description       "Installs and configures the docker daemon"
 version           "1.0.0"
 supports          "ubuntu"
 depends           "apt"
+depends           "systemd"
index 1dfe9adde7be0a60964551186b867a7e1aa30735..6e98de4da64b68718a8ea2906031c6c4acd11e35 100644 (file)
@@ -17,7 +17,7 @@
 # limitations under the License.
 #
 
-include_recipe "apt"
+include_recipe "apt::docker"
 
 package %w[
   docker-ce
@@ -42,3 +42,25 @@ service "docker" do
   action [:enable, :start]
   subscribes :restart, "template[/etc/docker/daemon.json]"
 end
+
+systemd_service "docker-system-prune" do
+  description "Cleanup up unused docker images and containers"
+  after ["docker.service"]
+  wants ["docker.service"]
+  user "root"
+  exec_start "/usr/bin/docker system prune --all --force"
+  sandbox :enable_network => true
+  memory_deny_write_execute false
+  restrict_address_families "AF_UNIX"
+end
+
+systemd_timer "docker-system-prune" do
+  description "Cleanup up unused docker images and containers"
+  on_boot_sec "2h"
+  on_unit_active_sec "7d"
+  randomized_delay_sec "4h"
+end
+
+service "docker-system-prune.timer" do
+  action [:enable, :start]
+end
index 4c4649b1a065a93c72365c35e75aab9fe109b70f..b5a2967ff44b6ed8ea37828f1d6cc50cd1316cd6 100644 (file)
@@ -11,3 +11,4 @@ depends           "apache"
 depends           "git"
 depends           "mysql"
 depends           "php"
+depends           "systemd"
index 7389db3cf7297af4a8f78a7c320d2712b7fc8646..e03973340433979d0c6e27dc793cb7d38f4287f2 100644 (file)
@@ -90,10 +90,25 @@ apache_site "donate.openstreetmap.org" do
   template "apache.erb"
 end
 
-cron_d "osmf-donate" do
-  minute "*/2"
+systemd_service "osmf-donate" do
+  description "Update donation list"
+  exec_start "/usr/bin/php /srv/donate.openstreetmap.org/scripts/update_csv_donate2016.php"
+  working_directory "/srv/donate.openstreetmap.org/scripts"
   user "donate"
-  command "cd /srv/donate.openstreetmap.org/scripts/; /usr/bin/php /srv/donate.openstreetmap.org/scripts/update_csv_donate2016.php"
+  sandbox true
+  memory_deny_write_execute true
+  restrict_address_families "AF_UNIX"
+  read_write_paths "/srv/donate.openstreetmap.org/data"
+end
+
+systemd_timer "osmf-donate" do
+  description "Update donation list"
+  on_boot_sec "2m"
+  on_unit_inactive_sec "2m"
+end
+
+service "osmf-donate.timer" do
+  action [:enable, :start]
 end
 
 template "/etc/cron.daily/osmf-donate-backup" do
index 329dc12bddbfb6e8cffd9aa8a1ba3872e4a0cb37..8bf3dad45051a6dfd416f0b51c68e8454ff92582 100644 (file)
@@ -42,7 +42,7 @@
     Require all granted
 
     <FilesMatch ".+\.ph(ar|p|tml)$">
-      SetHandler "proxy:unix:/run/php/donate.openstreetmap.org.sock|fcgi://127.0.0.1"
+      SetHandler "proxy:unix:/run/php/php-donate.openstreetmap.org-fpm.sock|fcgi://127.0.0.1"
     </FilesMatch>
   </Directory>
 
index 1de57c968b7eb6c4148fc96ddd9279dd256237df..52f6b95990150821ebc0d5680225e4de0c7b2af2 100644 (file)
@@ -4,5 +4,3 @@ default[:elasticsearch][:cluster][:routing][:allocation][:disk][:watermark][:low
 default[:elasticsearch][:cluster][:routing][:allocation][:disk][:watermark][:high] = "90%"
 default[:elasticsearch][:cluster][:routing][:allocation][:disk][:watermark][:flood_stage] = "95%"
 default[:elasticsearch][:path][:data] = "/var/lib/elasticsearch"
-
-default[:apt][:sources] |= ["elasticsearch#{node[:elasticsearch][:version]}"]
index cd7e8ff0165cea04d206aed537d2e43535bedbe3..05c6c27d5c24618f26029d9e064ad4bb87b9ed2b 100644 (file)
 # limitations under the License.
 #
 
-include_recipe "apt"
+case node[:elasticsearch][:version]
+when "6.x" then include_recipe "apt::elasticsearch6"
+when "8.x" then include_recipe "apt::elasticsearch8"
+end
 
 package "default-jre-headless"
 package "elasticsearch"
index 8a1fd5efb562c22d0b7924ca975d191a3dd7eeaf..30617cc8e3da18a4877fba292dae0353ef52dd19 100644 (file)
@@ -25,12 +25,20 @@ package %w[
   exim4
   openssl
   ssl-cert
+  mailutils
 ]
 
 package "exim4-daemon-heavy" do
   only_if { ::File.exist?("/var/run/clamav/clamd.ctl") }
 end
 
+group "Debian-exim" do
+  action :modify
+  members "clamav"
+  append true
+  only_if { ::File.exist?("/var/run/clamav/clamd.ctl") }
+end
+
 group "ssl-cert" do
   action :modify
   members "Debian-exim"
@@ -77,18 +85,6 @@ end
 relay_from_hosts = node[:exim][:relay_from_hosts]
 
 if node[:exim][:smarthost_name]
-  search(:node, "roles:gateway") do |gateway|
-    allowed_ips = gateway.interfaces(:role => :internal).map do |interface|
-      "#{interface[:network]}/#{interface[:prefix]}"
-    end
-
-    node.default[:networking][:wireguard][:peers] << {
-      :public_key => gateway[:networking][:wireguard][:public_key],
-      :allowed_ips => allowed_ips,
-      :endpoint => "#{gateway.name}:51820"
-    }
-  end
-
   search(:node, "exim_smarthost_via:#{node[:exim][:smarthost_name]}\\:*").each do |host|
     relay_from_hosts |= host.ipaddresses(:role => :external)
   end
@@ -216,11 +212,20 @@ remote_directory "/etc/exim4/noreply" do
   purge true
 end
 
+template "/etc/mail.rc" do
+  source "mail.rc.erb"
+  owner "root"
+  group "root"
+  mode "644"
+end
+
 munin_plugin "exim_mailqueue"
 munin_plugin "exim_mailstats"
 
 prometheus_exporter "exim" do
   port 9636
+  user "Debian-exim"
+  protect_proc "default"
 end
 
 if node[:exim][:smarthost_name]
diff --git a/cookbooks/exim/templates/default/mail.rc.erb b/cookbooks/exim/templates/default/mail.rc.erb
new file mode 100644 (file)
index 0000000..253cebb
--- /dev/null
@@ -0,0 +1,3 @@
+# DO NOT EDIT - This file is being maintained by Chef
+
+set sendmail="smtp://localhost"
index ca03d37d688ee97e734d6a7ed1cac876ce2b06fa..0a4c479f469537a5d88b92b8d54c9ba2ce3f4ae8 100644 (file)
@@ -49,4 +49,6 @@ munin_plugin "fail2ban"
 
 prometheus_exporter "fail2ban" do
   port 9635
+  user "root"
+  restrict_address_families "AF_UNIX"
 end
index d51786b26b707487bff0f29661dff8d3c396e84f..5235ee1f8378ed57298626f62c8be9c26e4b541e 100644 (file)
@@ -40,7 +40,7 @@
        DocumentRoot /srv/forum.openstreetmap.org/html
 
        <FilesMatch ".+\.ph(ar|p|tml)$">
-               SetHandler "proxy:unix:/run/php/forum.openstreetmap.org.sock|fcgi://127.0.0.1"
+               SetHandler "proxy:unix:/run/php/php-forum.openstreetmap.org-fpm.sock|fcgi://127.0.0.1"
        </FilesMatch>
 </VirtualHost>
 
index 82b2eb8ff5002336323c4eff5daee405f8508f54..5d47c0c5198a8b6e0e32cd1841b4da21f55fdfc4 100644 (file)
@@ -35,7 +35,7 @@ mediawiki_site "board.osmfoundation.org" do
   email_sender "webmaster@openstreetmap.org"
   email_sender_name "OSMF Board Wiki"
   private_site true
-  version "1.37"
+  version "1.38"
 end
 
 cookbook_file "/srv/board.osmfoundation.org/Wiki.png" do
index f939fb420aae619e1a1acab7dc057676dc32e6a9..83e8846ba2abbda7972788d7b3f344ab8ff06228 100644 (file)
@@ -35,7 +35,7 @@ mediawiki_site "dwg.osmfoundation.org" do
   email_sender "webmaster@openstreetmap.org"
   email_sender_name "OSMF Board Wiki"
   private_site true
-  version "1.37"
+  version "1.38"
 end
 
 cookbook_file "/srv/dwg.osmfoundation.org/Wiki.png" do
index dd0bdab5289de651571b878760c4ae5518f9318e..90791606dd2da41c27eda0d2564a0629b78c7c1e 100644 (file)
@@ -35,7 +35,7 @@ mediawiki_site "mwg.osmfoundation.org" do
   email_sender "webmaster@openstreetmap.org"
   email_sender_name "OSMF Board Wiki"
   private_site true
-  version "1.37"
+  version "1.38"
 end
 
 cookbook_file "/srv/mwg.osmfoundation.org/Wiki.png" do
index 199389d0ed5d934e1460b38ba1e31a39618a474f..9764a0934221370f83ce6aa803a0bdc979492015 100644 (file)
@@ -42,7 +42,7 @@ mediawiki_site "wiki.osmfoundation.org" do
   email_sender_name "OSMF Wiki"
   private_accounts true
   extra_file_extensions ["mp3"]
-  version "1.37"
+  version "1.38"
 end
 
 mediawiki_skin "osmf" do
@@ -63,3 +63,10 @@ cookbook_file "/srv/wiki.osmfoundation.org/Wiki.png" do
   group node[:mediawiki][:group]
   mode "644"
 end
+
+template "/srv/wiki.osmfoundation.org/robots.txt" do
+  owner node[:mediawiki][:user]
+  group node[:mediawiki][:group]
+  mode "644"
+  source "robots.txt.erb"
+end
diff --git a/cookbooks/foundation/templates/default/robots.txt.erb b/cookbooks/foundation/templates/default/robots.txt.erb
new file mode 100644 (file)
index 0000000..bea20e8
--- /dev/null
@@ -0,0 +1,21 @@
+User-agent: ia_archiver
+Allow: /
+
+User-agent: 008
+Disallow: /
+
+User-agent: *
+Disallow: /index.php/
+Disallow: /wiki/Spam
+Disallow: /wiki/Donate/International_Bank_Transfers
+Allow: /w/load.php
+Allow: /w/images/
+Allow: /w/skins/
+Disallow: /w/
+Disallow: /wiki/Special:Collection
+Disallow: /wiki/Special:Random
+Disallow: /wiki/Special%3ARandom
+Disallow: /wiki/Special:Search
+
+User-agent: Exabot
+Crawl-delay: 60
index c006ff9dcff4827a40a3322152ce19adf9589c24..8afa85cc550e909e8b9372686b39640c56f38bf5 100644 (file)
@@ -74,11 +74,8 @@ systemd_service "gdnsd-reload" do
   user "root"
   exec_start "/bin/systemctl reload-or-restart gdnsd"
   standard_output "null"
-  private_tmp true
-  private_devices true
-  protect_system "full"
-  protect_home true
-  no_new_privileges true
+  sandbox true
+  restrict_address_families "AF_UNIX"
 end
 
 systemd_path "gdnsd-reload" do
index 90476814c2cb80206d9ba1dc2bf6161987c7dc5d..878d4fbb5ecfe3466eac914f55fd1bb2b2f9b83b 100644 (file)
@@ -1,5 +1,3 @@
 default[:geoipupdate][:account] = "149244"
 default[:geoipupdate][:editions] = %w[GeoLite2-ASN GeoLite2-City GeoLite2-Country]
 default[:geoipupdate][:directory] = "/usr/share/GeoIP"
-
-default[:apt][:sources] |= ["maxmind"]
index 036c27881c06262bbfd00589a284dada2b992bdc..17fcc0850df25501496635a42046430b85a8711f 100644 (file)
@@ -17,7 +17,7 @@
 # limitations under the License.
 #
 
-include_recipe "apt"
+include_recipe "apt::maxmind"
 
 license_keys = data_bag_item("geoipupdate", "license-keys")
 
@@ -42,10 +42,7 @@ systemd_service "geoipupdate" do
   description "Update GeoIP databases"
   user "root"
   exec_start "/usr/bin/geoipupdate"
-  private_tmp true
-  private_devices true
-  protect_system "strict"
-  protect_home true
+  sandbox :enable_network => true
   read_write_paths node[:geoipupdate][:directory]
 end
 
index 7a4209f5d007809dec252284416562da0d31f01f..fd641f37a5b3472ec441a8acdde217a552883f14 100644 (file)
@@ -5,5 +5,3 @@ default[:git][:public_group] = "git"
 default[:git][:private_user] = "git"
 default[:git][:private_group] = "git"
 default[:git][:private_nodes] = "fqdn:*"
-
-default[:apt][:sources] |= ["git-core"]
index 49d43ae8225b62b2168fbd502cf4bf3ec34ea6c3..5db1fbe98f2cee2cba2fe2dbce6f82d56814d6dc 100644 (file)
@@ -17,6 +17,6 @@
 # limitations under the License.
 #
 
-include_recipe "apt"
+include_recipe "apt::git-core"
 
 package "git"
index 4bdd501604aab4bd75e45d8a51996847c5a6349b..bb99e482cd4257d2a999bc6ee90695dec295ec01 100644 (file)
@@ -21,6 +21,7 @@ include_recipe "apache"
 
 package "gitweb"
 
+apache_module "cgid"
 apache_module "rewrite"
 
 git_site = node[:git][:host]
index c3fb07796be31118ddff8e5278277074cb77583f..d71d04ade74c74d8c7eb9fc19ca5e777e3b22db7 100644 (file)
@@ -93,11 +93,9 @@ systemd_service "gps-update" do
   user "gpstile"
   working_directory "/srv/gps-tile.openstreetmap.org"
   exec_start "/srv/gps-tile.openstreetmap.org/updater/update"
-  private_tmp true
-  private_devices true
-  protect_system "full"
-  protect_home true
-  no_new_privileges true
+  nice 10
+  sandbox :enable_network => true
+  read_write_paths "/srv/gps-tile.openstreetmap.org"
   restart "on-failure"
 end
 
index d2c1b36bd22c90d244dd9876ea7a934da104b035..c9d003e5745b2ce1a4a698ae4c48a2f96914aa10 100644 (file)
@@ -9,8 +9,6 @@ default[:hardware][:ipmi][:custom_args] = []
 if node[:dmi] && node[:dmi][:system]
   case node[:dmi][:system][:manufacturer]
   when "HP"
-    default[:apt][:sources] |= ["management-component-pack"]
-
     case node[:dmi][:system][:product_name]
     when "ProLiant DL360 G6", "ProLiant DL360 G7", "ProLiant SE326M1R2"
       default[:hardware][:sensors][:"power_meter-*"][:power][:power1] = { :ignore => true }
@@ -31,12 +29,6 @@ if Chef::Util.compare_versions(node[:kernel][:release], [3, 3]).negative?
   end
 end
 
-if node[:kernel] && node[:kernel][:modules]
-  raidmods = node[:kernel][:modules].keys & %w[cciss hpsa mptsas mpt2sas mpt3sas megaraid_mm megaraid_sas aacraid]
-
-  default[:apt][:sources] |= ["hwraid"] unless raidmods.empty?
-end
-
 if node[:kernel][:modules].include?("ipmi_si")
   default[:hardware][:modules] |= ["ipmi_devintf"]
 
index dd4448180e287a900e58773495124dc3fee9e7f8..48e8f28889d3286069cada8c68ce92bd47a7e213 100644 (file)
@@ -17,7 +17,6 @@
 # limitations under the License.
 #
 
-include_recipe "apt"
 include_recipe "git"
 include_recipe "munin"
 include_recipe "prometheus"
@@ -56,12 +55,15 @@ if node[:roles].include?("bytemark") || node[:roles].include?("exonetric") || no
 end
 
 case manufacturer
-when "HP"
+when "HP", "HPE"
+  include_recipe "apt::management-component-pack"
+
   package "hponcfg"
 
   execute "update-ilo" do
     action :nothing
     command "/usr/sbin/hponcfg -f /etc/ilo-defaults.xml"
+    not_if { kitchen? }
   end
 
   template "/etc/ilo-defaults.xml" do
@@ -94,9 +96,23 @@ when "HP"
       action [:enable, :start]
       supports :status => true, :restart => true
     end
+  elsif product.end_with?("Gen10")
+    package "amsd" do
+      action :install
+      notifies :restart, "service[amsd]"
+    end
+
+    service "amsd" do
+      action [:enable, :start]
+      supports :status => true, :restart => true
+    end
   end
 
-  units << "1"
+  units << if product.end_with?("Gen10")
+             "0"
+           else
+             "1"
+           end
 when "TYAN"
   units << "0"
 when "TYAN Computer Corporation"
@@ -130,6 +146,7 @@ end
 units.sort.uniq.each do |unit|
   service "serial-getty@ttyS#{unit}" do
     action [:enable, :start]
+    not_if { kitchen? }
   end
 end
 
@@ -169,6 +186,8 @@ if File.exist?("/etc/default/grub")
   end
 end
 
+package "initramfs-tools"
+
 execute "update-initramfs" do
   action :nothing
   command "update-initramfs -u -k all"
@@ -202,6 +221,10 @@ if node[:kernel][:modules].include?("ipmi_si")
 
   prometheus_exporter "ipmi" do
     port 9290
+    user "root"
+    private_devices false
+    protect_clock false
+    system_call_filter ["@system-service", "@raw-io"]
     options "--config.file=/etc/prometheus/ipmi_local.yml"
     subscribes :restart, "template[/etc/prometheus/ipmi_local.yml]"
   end
@@ -225,6 +248,20 @@ ohai_plugin "lldp" do
   template "lldp.rb.erb"
 end
 
+package %w[
+  rasdaemon
+  ruby-sqlite3
+]
+
+service "rasdaemon" do
+  action [:enable, :start]
+end
+
+prometheus_exporter "rasdaemon" do
+  port 9797
+  user "root"
+end
+
 tools_packages = []
 status_packages = {}
 
@@ -299,6 +336,8 @@ else
   end
 end
 
+include_recipe "apt::hwraid" unless status_packages.empty?
+
 if status_packages.include?("cciss-vol-status")
   template "/usr/local/bin/cciss-vol-statusd" do
     source "cciss-vol-statusd.erb"
@@ -311,6 +350,7 @@ if status_packages.include?("cciss-vol-status")
   systemd_service "cciss-vol-statusd" do
     description "Check cciss_vol_status values in the background"
     exec_start "/usr/local/bin/cciss-vol-statusd"
+    nice 10
     private_tmp true
     protect_system "full"
     protect_home true
@@ -378,27 +418,27 @@ intel_nvmes = nvmes.select { |pci| pci[:vendor_name] == "Intel Corporation" }
 if !intel_ssds.empty? || !intel_nvmes.empty?
   package "unzip"
 
-  intel_mas_tool_version = "1.10"
-  intel_mas_package_version = "#{intel_mas_tool_version}.155-0"
+  sst_tool_version = "1.3"
+  sst_package_version = "#{sst_tool_version}.208-0"
 
-  remote_file "#{Chef::Config[:file_cache_path]}/Intel_MAS_CLI_Tool_#{intel_mas_tool_version}_Linux.zip" do
-    source "https://downloadmirror.intel.com/646992/Intel_MAS_CLI_Tool_Linux_#{intel_mas_tool_version}-v2.zip"
-  end
+  # remote_file "#{Chef::Config[:file_cache_path]}/SST_CLI_Linux_#{sst_tool_version}.zip" do
+  #   source "https://downloadmirror.intel.com/743764/SST_CLI_Linux_#{sst_tool_version}.zip"
+  end
 
-  execute "#{Chef::Config[:file_cache_path]}/Intel_MAS_CLI_Tool_#{intel_mas_tool_version}_Linux.zip" do
-    command "unzip Intel_MAS_CLI_Tool_#{intel_mas_tool_version}_Linux.zip intelmas_#{intel_mas_package_version}_amd64.deb"
+  execute "#{Chef::Config[:file_cache_path]}/SST_CLI_Linux_#{sst_tool_version}.zip" do
+    command "unzip SST_CLI_Linux_#{sst_tool_version}.zip sst_#{sst_package_version}_amd64.deb"
     cwd Chef::Config[:file_cache_path]
     user "root"
     group "root"
-    not_if { ::File.exist?("#{Chef::Config[:file_cache_path]}/intelmas_#{intel_mas_package_version}_amd64.deb") }
+    not_if { ::File.exist?("#{Chef::Config[:file_cache_path]}/sst_#{sst_package_version}_amd64.deb") }
   end
 
-  dpkg_package "intelmas" do
-    version "#{intel_mas_package_version}"
-    source "#{Chef::Config[:file_cache_path]}/intelmas_#{intel_mas_package_version}_amd64.deb"
+  dpkg_package "sst" do
+    version "#{sst_package_version}"
+    source "#{Chef::Config[:file_cache_path]}/sst_#{sst_package_version}_amd64.deb"
   end
 
-  dpkg_package "isdct" do
+  dpkg_package "intelmas" do
     action :purge
   end
 end
@@ -497,6 +537,11 @@ if disks.count.positive?
 
   prometheus_collector "smart" do
     interval "15m"
+    user "root"
+    capability_bounding_set %w[CAP_DAC_OVERRIDE CAP_SYS_ADMIN CAP_SYS_RAWIO]
+    private_devices false
+    private_users false
+    protect_clock false
   end
 
   # Don't try and do munin monitoring of disks behind
@@ -554,7 +599,7 @@ if File.exist?("/etc/mdadm/mdadm.conf")
     content mdadm_conf
   end
 
-  service "mdadm" do
+  service "mdmonitor" do
     action :nothing
     subscribes :restart, "file[/etc/mdadm/mdadm.conf]"
   end
@@ -655,4 +700,11 @@ end
 
 prometheus_collector "ohai" do
   interval "15m"
+  user "root"
+  proc_subset "all"
+  capability_bounding_set %w[CAP_DAC_OVERRIDE CAP_SYS_ADMIN]
+  private_devices false
+  private_users false
+  protect_clock false
+  protect_kernel_modules false
 end
diff --git a/cookbooks/hardware/templates/default/mcelog-trigger.erb b/cookbooks/hardware/templates/default/mcelog-trigger.erb
deleted file mode 100644 (file)
index 463b390..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-
-# DO NOT EDIT - This file is being maintained by Chef
-
-echo "$MESSAGE" | /usr/bin/mail -s "Machine Check Exception for <%= node[:fqdn] %>" admins@openstreetmap.org
index c7d245b94e555abf1d2978f2f786eae19e9eb359..6e6e5f37e200d1f86c50ba95882fcdf126553970 100644 (file)
@@ -426,6 +426,7 @@ Ohai.plugin(:Hardware) do
   def find_megaraid_disks(devices)
     controllers = []
     arrays = []
+    disks = []
 
     controller = nil
     array = nil
@@ -496,6 +497,8 @@ Ohai.plugin(:Hardware) do
         devices[:disks] << disk
         controller[:disks] << disk[:id]
         array[:disks] << disk[:id]
+
+        disks << disk
       elsif disk && line =~ /^Firmware state:\s+(\S.*)$/
         status, state = Regexp.last_match(1).split(/,\s*/)
         case status
@@ -516,7 +519,7 @@ Ohai.plugin(:Hardware) do
         end
       elsif disk && line =~ /^(\S.*\S)\s*:\s+(\S.*)$/
         case Regexp.last_match(1)
-        when "Device Id" then disk[:smart_device] = "megaraid,#{Regexp.last_match(2)}"
+        when "Device Id" then disk[:device_id] = Regexp.last_match(2)
         when "WWN" then disk[:wwn] = Regexp.last_match(2)
         when "PD Type" then disk[:interface] = Regexp.last_match(2)
         when "Raw Size" then disk[:size] = memory_to_disk_size(Regexp.last_match(2).sub(/\s*\[.*\]$/, ""))
@@ -546,7 +549,8 @@ Ohai.plugin(:Hardware) do
         controller = controllers[Regexp.last_match(1).to_i]
       elsif controller && line =~ /^Enclosure Device ID: \d+$/
         disk = {
-          :controller => controller[:id]
+          :controller => controller[:id],
+          :arrays => []
         }
       elsif disk && line =~ /^WWN:\s+(\S+)$/
         unless devices[:disks].find { |d| d[:wwn] == Regexp.last_match(1) }
@@ -554,6 +558,8 @@ Ohai.plugin(:Hardware) do
           disk[:wwn] = Regexp.last_match(1)
 
           devices[:disks] << disk
+
+          disks << disk
         end
       elsif disk && line =~ /^Firmware state:\s+(\S.*)$/
         status, state = Regexp.last_match(1).split(/,\s*/)
@@ -575,7 +581,7 @@ Ohai.plugin(:Hardware) do
         end
       elsif disk && line =~ /^(\S.*\S)\s*:\s+(\S.*)$/
         case Regexp.last_match(1)
-        when "Device Id" then disk[:smart_device] = "megaraid,#{Regexp.last_match(2)}"
+        when "Device Id" then disk[:device_id] = Regexp.last_match(2)
         when "PD Type" then disk[:interface] = Regexp.last_match(2)
         when "Raw Size" then disk[:size] = memory_to_disk_size(Regexp.last_match(2).sub(/\s*\[.*\]$/, ""))
         when "Inquiry Data" then disk[:vendor], disk[:model], disk[:serial_number] = Regexp.last_match(2).split
@@ -588,6 +594,18 @@ Ohai.plugin(:Hardware) do
         controller[:device] = "/dev/#{File.basename(device)}"
       end
     end
+
+    disks.each do |disk|
+      controller = devices[:controllers][disk[:controller]]
+
+      if id = disk.delete(:device_id)
+        if device = Dir.glob("/sys/bus/pci/devices/#{controller[:pci_slot]}/host*/target0:0:#{id}/0:0:#{id}:0/block/sd*").first
+          disk[:device] = "/dev/#{File.basename(device)}"
+        else
+          disk[:smart_device] = "megaraid,#{id}"
+        end
+      end
+    end
   end
 
   def find_mpt1_disks(devices)
index 36498d74efcc2b4d2f1b2ad847b8b4c45fa1f8d1..8b13ba61e68a2fcdeb47ddb7a0596b66ad640dc0 100644 (file)
@@ -4,6 +4,6 @@
 <% elsif disk[:device] =~ /nvme/ -%>
 /dev/<%= disk[:device] %>|nvme
 <% else -%>
-/dev/<%= disk[:device] %>|sat
+/dev/<%= disk[:device] %>|auto
 <% end -%>
 <% end -%>
diff --git a/cookbooks/ideditor/metadata.rb b/cookbooks/ideditor/metadata.rb
new file mode 100644 (file)
index 0000000..c177fdb
--- /dev/null
@@ -0,0 +1,9 @@
+name              "ideditor"
+maintainer        "OpenStreetMap Administrators"
+maintainer_email  "admins@openstreetmap.org"
+license           "Apache-2.0"
+description       "Configures ideditor.com web site"
+
+version           "1.0.0"
+supports          "ubuntu"
+depends           "apache"
diff --git a/cookbooks/ideditor/recipes/default.rb b/cookbooks/ideditor/recipes/default.rb
new file mode 100644 (file)
index 0000000..b65209f
--- /dev/null
@@ -0,0 +1,29 @@
+#
+# Cookbook:: ideditor
+# Recipe:: default
+#
+# Copyright:: 2022, 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 "apache"
+
+ssl_certificate "preview.ideditor.com" do
+  domains ["preview.ideditor.com"]
+  notifies :reload, "service[apache2]"
+end
+
+apache_site "preview.ideditor.com" do
+  template "apache.erb"
+end
diff --git a/cookbooks/ideditor/templates/default/apache.erb b/cookbooks/ideditor/templates/default/apache.erb
new file mode 100644 (file)
index 0000000..c9af627
--- /dev/null
@@ -0,0 +1,27 @@
+# DO NOT EDIT - This file is being maintained by Chef
+
+<VirtualHost *:80>
+  ServerName <%= @name %>
+  ServerAdmin webmaster@openstreetmap.org
+
+  CustomLog /var/log/apache2/<%= @name %>-access.log combined
+  ErrorLog /var/log/apache2/<%= @name %>-error.log
+
+  RedirectPermanent /.well-known/acme-challenge/ http://acme.openstreetmap.org/.well-known/acme-challenge/
+  Redirect permanent / https://<%= @name %>/
+</VirtualHost>
+<VirtualHost *:443>
+  ServerName <%= @name %>
+  ServerAdmin webmaster@openstreetmap.org
+
+  CustomLog /var/log/apache2/<%= @name %>-access.log combined
+  ErrorLog /var/log/apache2/<%= @name %>-error.log
+
+  SSLEngine on
+  SSLCertificateFile /etc/ssl/certs/<%= @name %>.pem
+  SSLCertificateKeyFile /etc/ssl/private/<%= @name %>.key
+
+  RewriteEngine on
+  RewriteRule ^/release/?.* https://ideditor-release.netlify.app/ [QSD,L,R=307]
+  RewriteRule ^/?.* https://ideditor.netlify.app/ [QSD,L,R=307]
+</VirtualHost>
index 7a5b55057133e6ac3ed94e0dfbae56e093c50324..316406e1336bef821c6b12402e104352e591abea 100644 (file)
 include_recipe "nginx"
 include_recipe "git"
 
-# Imagery gdal Requirements
-package "gdal-bin"
-# python-gdal - disable while broken in gis unstable repo
+# Imagery gdal and proj requirements
+package %w[
+  gdal-bin
+  python3-gdal
+  proj-bin
+]
 
-# Imagery MapServer + Mapcache Requirements
+# Imagery MapServer + Mapcache requirements
 package %w[
   cgi-mapserver
   mapcache-cgi
   mapcache-tools
 ]
 
-# Mapserver via Nginx requires as fastcgi spawner
+# Mapserver via nginx requires as fastcgi spawner
 package %w[
   spawn-fcgi
   multiwatch
@@ -60,22 +63,10 @@ directory "/srv/imagery/common" do
   recursive true
 end
 
-directory "/srv/imagery/common/ostn02-ntv2-data" do
-  owner "root"
-  group "root"
-  mode "755"
-end
-
-remote_file "#{Chef::Config[:file_cache_path]}/ostn02-ntv2-data.zip" do
-  source "https://www.ordnancesurvey.co.uk/docs/gps/ostn02-ntv2-data.zip"
-  not_if { ::File.exist?("/srv/imagery/common/ostn02-ntv2-data/OSTN02_NTv2.gsb") }
-end
-
-archive_file "#{Chef::Config[:file_cache_path]}/ostn02-ntv2-data.zip" do
-  destination "/srv/imagery/common/ostn02-ntv2-data"
-  owner "root"
-  group "root"
-  not_if { ::File.exist?("/srv/imagery/common/ostn02-ntv2-data/OSTN02_NTv2.gsb") }
+# Pre-download uk_os_OSTN15_NTv2_OSGBtoETRS.tif used for EPSG:27700 conversions
+execute "uk_os_OSTN15_NTv2_OSGBtoETRS.tif" do
+  command "projsync --file uk_os_OSTN15_NTv2_OSGBtoETRS.tif --system-directory"
+  not_if { ::File.exist?("/usr/share/proj/uk_os_OSTN15_NTv2_OSGBtoETRS.tif") }
 end
 
 nginx_site "default" do
index c200d05316486afefaa86eb2e0ef1b9d0cdbfd1e..108da32af4128bf7879f2d93b00c46b420a4810c 100644 (file)
@@ -1165,6 +1165,16 @@ imagery_layer "gb_os_om_local_2022_04" do
   copyright "Contains OS data &copy; Crown copyright and database right 2022"
   background_colour "213 244 248" # OS OpenMap Local Water Blue
   extension "os_om_local_png"
-  url_aliases ["/om-local-2022-04", "/om-local"]
+end
+
+imagery_layer "gb_os_om_local_2022_10" do
+  site "os.openstreetmap.org"
+  title "OS OpenMap Local - October 2022"
+  projection "EPSG:27700"
+  source "/data/imagery/gb/openmap-local/2022-10/os-openmap-local-2022-10.vrt"
+  copyright "Contains OS data &copy; Crown copyright and database right 2022"
+  background_colour "213 244 248" # OS OpenMap Local Water Blue
+  extension "os_om_local_png"
+  url_aliases ["/om-local-2022-10", "/om-local"]
   default_layer true
 end
index 14cb2842edf304894bb9ae337e9e2e9e2b3db35e..4fca7bb9ad770061c9653e9818800f8ff51ab27b 100644 (file)
@@ -86,7 +86,7 @@ action :create do
   end
 
   layers = Dir.glob("/srv/imagery/layers/#{new_resource.site}/*.yml").collect do |path|
-    YAML.safe_load(::File.read(path), [Symbol])
+    YAML.safe_load(::File.read(path), :permitted_classes => [Symbol])
   end
 
   declare_resource :template, "/srv/#{new_resource.site}/imagery.js" do
@@ -103,24 +103,20 @@ action :create do
   systemd_service "mapserv-fcgi-#{new_resource.site}" do
     description "Map server for #{new_resource.site} layer"
     environment "MS_MAP_PATTERN" => "^/srv/imagery/mapserver/",
-                "=" => "0",
+                "MS_DEBUGLEVEL" => "0",
                 "MS_ERRORFILE" => "stderr",
                 "GDAL_CACHEMAX" => "512"
     limit_nofile 16384
     memory_high "1G"
-    memory_max "2G"
+    memory_max "4G"
     user "imagery"
     group "imagery"
-    exec_start "/usr/bin/multiwatch -f 12 --signal=TERM -- /usr/lib/cgi-bin/mapserv"
+    exec_start "/usr/bin/multiwatch -f 8 --signal=TERM -- /usr/lib/cgi-bin/mapserv"
     standard_input "socket"
-    private_tmp true
-    private_devices true
-    private_network true
-    protect_system "full"
-    protect_home true
-    no_new_privileges true
-    # Terminate service after 5mins. Service is socket activated
-    runtime_max_sec 300
+    sandbox true
+    restrict_address_families "AF_UNIX"
+    # Terminate service after 30mins. Service is socket activated
+    runtime_max_sec 1800
   end
 
   systemd_socket "mapserv-fcgi-#{new_resource.site}" do
index 1f918d0f8f8023a75a5e163b1a1dc4cff5476c3a..c918ca9f1f6b2c99a52f50fb99ff1c9e71d5efa4 100644 (file)
@@ -44,10 +44,7 @@ MAP
   <% end -%>
   IMAGETYPE <%= @extension %>
     PROJECTION
-    <% if @projection == "EPSG:27700" -%>
-      <%# Override EPSG:27700 to use accurate nadgrid %>
-      "+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +datum=OSGB36 +units=m +no_defs +nadgrids=/srv/imagery/common/ostn02-ntv2-data/OSTN02_NTv2.gsb"
-    <% elsif @projection == "namibia_aerial" -%>
+    <% if @projection == "namibia_aerial" -%>
       "+proj=tmerc +lat_0=0 +lon_0=17 +k=1 +x_0=600000 +y_0=10000000 +ellps=WGS84 +units=m +no_defs"
     <% else -%>
       "init=<%= @projection.downcase %>"
@@ -58,10 +55,7 @@ MAP
     NAME "<%= @layer %>"
     DATA "<%= @source %>"
     PROJECTION
-    <% if @projection == "EPSG:27700" -%>
-      <%# Override EPSG:27700 to use accurate nadgrid %>
-      "+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +datum=OSGB36 +units=m +no_defs +nadgrids=/srv/imagery/common/ostn02-ntv2-data/OSTN02_NTv2.gsb"
-    <% elsif @projection == "namibia_aerial" -%>
+    <% if @projection == "namibia_aerial" -%>
       "+proj=tmerc +lat_0=0 +lon_0=17 +k=1 +x_0=600000 +y_0=10000000 +ellps=WGS84 +units=m +no_defs"
     <% else -%>
       "init=<%= @projection.downcase %>"
index 372bf0e561a21413107c584904a33a0c48aa2423..f286292371430744be7fc90603dc78be57dda856 100644 (file)
@@ -3,8 +3,6 @@ location ~* "^/layer/<%= @layer %>/(\d+)/(\d+)/(\d+)\.(png|jpg|jpeg)$" {
   # Override QUERY_STRING to force mapserver query parameters
   fastcgi_param QUERY_STRING "map=/srv/imagery/mapserver/layer-<%= @layer %>.map&mode=tile&layers=<%= @layer %>&tilemode=gmap&tile=$2+$3+$1";
   fastcgi_pass "<%= @site %>_fastcgi";
-  fastcgi_buffers 8 64k;
-  fastcgi_busy_buffers_size 64k;
   include fastcgi_params;
   fastcgi_param REQUEST_METHOD "GET";
   fastcgi_param HTTP_PROXY "";
@@ -28,9 +26,6 @@ location ~* "^/layer/<%= @layer %>/(\d+)/(\d+)/(\d+)\.(png|jpg|jpeg)$" {
 
   keepalive_requests 0;
 
-  # Ignore client abort as it causes issues with the pipeline
-  fastcgi_ignore_client_abort on;
-
   fastcgi_catch_stderr "Image handling error";
 
   fastcgi_next_upstream error timeout invalid_header http_500 http_503;
index 92c78a51d652b3e70397623e4ddf7dfebf32cf9c..382a0a58cfb01b25a097f1fa3af639086dd05005 100644 (file)
@@ -176,20 +176,44 @@ template "/srv/acme.openstreetmap.org/bin/check-certificates" do
   variables :certificates => certificates
 end
 
-cron_d "letencrypt-renew" do
-  minute "00"
-  hour "*/12"
+systemd_service "letsencrypt-renew" do
+  description "Renew letsencrypt certificates"
+  exec_start "/srv/acme.openstreetmap.org/bin/renew"
   user "letsencrypt"
-  command "/srv/acme.openstreetmap.org/bin/renew"
-  mailto "admins@openstreetmap.org"
+  sandbox :enable_network => true
+  read_write_paths [
+    "/srv/acme.openstreetmap.org/config",
+    "/srv/acme.openstreetmap.org/html",
+    "/srv/acme.openstreetmap.org/logs",
+    "/srv/acme.openstreetmap.org/work"
+  ]
 end
 
-cron_d "letencrypt-check" do
-  minute "30"
-  hour "*/12"
+systemd_timer "letsencrypt-renew" do
+  description "Renew letsencrypt certificates"
+  on_boot_sec "1h"
+  on_unit_inactive_sec "12h"
+end
+
+service "letsencrypt-renew.timer" do
+  action [:enable, :start]
+end
+
+systemd_service "letsencrypt-check" do
+  description "Check letsencrypt certificates"
+  exec_start "/srv/acme.openstreetmap.org/bin/check-certificates"
   user "letsencrypt"
-  command "/srv/acme.openstreetmap.org/bin/check-certificates"
-  mailto "admins@openstreetmap.org"
+  sandbox :enable_network => true
+end
+
+systemd_timer "letsencrypt-check" do
+  description "Check letsencrypt certificates"
+  on_boot_sec "2h"
+  on_unit_inactive_sec "12h"
+end
+
+service "letsencrypt-check.timer" do
+  action [:enable, :start]
 end
 
 template "/etc/logrotate.d/letsencrypt" do
index af74c9e4cf5fb2aca52e1ef4937c3592427560a8..2184da04864d2b093c5ab252c67690b75a782b94 100644 (file)
@@ -19,7 +19,7 @@
 
 require "yaml"
 
-include_recipe "apt"
+include_recipe "apt::elasticsearch8"
 
 package "filebeat"
 
index d65e034ecf0583b49c08bcb2579dfbb2ece63e51..f4ff47c4d53c00f7d8a761f31ba4e760b97f613d 100644 (file)
@@ -1,4 +1,4 @@
-default[:matomo][:version] = "4.11.0"
+default[:matomo][:version] = "4.13.0"
 default[:matomo][:plugins] = {
   "Actions" => nil,
   "Annotations" => nil,
index 6160ec17ec4c4f4ac94c5adfdb66f544c7c805d2..380cbbe430ac65face8029ebf8b5af4fb1ee7d46 100644 (file)
@@ -10,3 +10,4 @@ depends           "apache"
 depends           "geoipupdate"
 depends           "mysql"
 depends           "php"
+depends           "systemd"
index 9b2b6302c64278b364ac31a1db670c9ce263e1a6..0e6576103c3bb167be0c6d304837dabed689ce29 100644 (file)
@@ -25,6 +25,8 @@ include_recipe "php::fpm"
 passwords = data_bag_item("matomo", "passwords")
 
 package %w[
+  brotli
+  gzip
   php-cli
   php-curl
   php-mbstring
@@ -41,23 +43,12 @@ version = node[:matomo][:version]
 
 geoip_directory = node[:geoipupdate][:directory]
 
-directory "/opt/matomo-#{version}" do
-  owner "root"
-  group "root"
-  mode "0755"
-end
-
 remote_file "#{Chef::Config[:file_cache_path]}/matomo-#{version}.zip" do
   source "https://builds.matomo.org/matomo-#{version}.zip"
 end
 
 archive_file "#{Chef::Config[:file_cache_path]}/matomo-#{version}.zip" do
-  action :nothing
   destination "/opt/matomo-#{version}"
-  overwrite true
-  owner "root"
-  group "root"
-  subscribes :extract, "remote_file[#{Chef::Config[:file_cache_path]}/matomo-#{version}.zip]", :immediately
   notifies :run, "notify_group[matomo-updated]"
 end
 
@@ -69,12 +60,11 @@ node[:matomo][:plugins].each do |plugin_name, plugin_version|
   end
 
   archive_file "#{Chef::Config[:file_cache_path]}/matomo-#{plugin_name}-#{plugin_version}.zip" do
-    action :nothing
-    destination "/opt/matomo-#{version}/matomo/plugins"
-    overwrite true
-    owner "root"
-    group "root"
-    subscribes :extract, "remote_file[#{Chef::Config[:file_cache_path]}/matomo-#{plugin_name}-#{plugin_version}.zip]", :immediately
+    destination "/opt/matomo-#{plugin_name}-#{plugin_version}"
+  end
+
+  link "/opt/matomo-#{version}/matomo/plugins/#{plugin_name}" do
+    to "/opt/matomo-#{plugin_name}-#{plugin_version}/#{plugin_name}"
     notifies :run, "notify_group[matomo-updated]"
   end
 end
@@ -153,9 +143,27 @@ if File.symlink?("/srv/matomo.openstreetmap.org")
     subscribes :run, "execute[core:update]"
   end
 
+  execute "/opt/matomo-#{version}/matomo/matomo.br" do
+    action :nothing
+    command "brotli --keep --force --best /opt/matomo-#{version}/matomo/matomo.js"
+    cwd "/opt/matomo-#{version}"
+    user "root"
+    group "root"
+    subscribes :run, "execute[custom-matomo-js:update]"
+  end
+
   execute "/opt/matomo-#{version}/matomo/matomo.js" do
     action :nothing
-    command "gzip -k -9 /opt/matomo-#{version}/matomo/matomo.js"
+    command "gzip --keep --force --best /opt/matomo-#{version}/matomo/matomo.js"
+    cwd "/opt/matomo-#{version}"
+    user "root"
+    group "root"
+    subscribes :run, "execute[custom-matomo-js:update]"
+  end
+
+  execute "/opt/matomo-#{version}/matomo/piwik.br" do
+    action :nothing
+    command "brotli --keep --force --best /opt/matomo-#{version}/matomo/piwik.js"
     cwd "/opt/matomo-#{version}"
     user "root"
     group "root"
@@ -164,7 +172,7 @@ if File.symlink?("/srv/matomo.openstreetmap.org")
 
   execute "/opt/matomo-#{version}/matomo/piwik.js" do
     action :nothing
-    command "gzip -k -9 /opt/matomo-#{version}/matomo/piwik.js"
+    command "gzip --keep --force --best /opt/matomo-#{version}/matomo/piwik.js"
     cwd "/opt/matomo-#{version}"
     user "root"
     group "root"
@@ -191,8 +199,23 @@ apache_site "matomo.openstreetmap.org" do
   template "apache.erb"
 end
 
-cron_d "matomo" do
-  minute "5"
+systemd_service "matomo-archive" do
+  description "Matomo report archiving"
+  exec_start "/usr/bin/php /srv/matomo.openstreetmap.org/console core:archive --url=https://matomo.openstreetmap.org/"
   user "www-data"
-  command "/usr/bin/php /srv/matomo.openstreetmap.org/console core:archive --quiet --url=https://matomo.openstreetmap.org/"
+  sandbox true
+  proc_subset "all"
+  memory_deny_write_execute false
+  restrict_address_families "AF_UNIX"
+  read_write_paths "/opt/matomo-#{version}/matomo/tmp"
+end
+
+systemd_timer "matomo-archive" do
+  description "Matomo report archiving"
+  on_boot_sec "30m"
+  on_unit_inactive_sec "30m"
+end
+
+service "matomo-archive.timer" do
+  action [:enable, :start]
 end
index 589d563d6ceb01826448224b607f12e410630c0f..5fd21d6023b375807d8b32cf4f28f82dac6903a8 100644 (file)
        ExpiresActive On
        RewriteEngine on
 
-       RewriteCond "%{HTTP:Accept-encoding}" "gzip"
+       RewriteCond "%{HTTP:Accept-Encoding}" "br"
+       RewriteCond "%{REQUEST_FILENAME}\.br" -s
+       RewriteRule "^(.*)\.js" "$1\.js\.br" [QSA]
+
+       RewriteCond "%{HTTP:Accept-Encoding}" "gzip"
        RewriteCond "%{REQUEST_FILENAME}\.gz" -s
        RewriteRule "^(.*)\.js" "$1\.js\.gz" [QSA]
 
-       RewriteRule "\.js\.gz$"  "-" [T=text/javascript,E=no-gzip:1]
+       RewriteRule "\.js\.(br|gz)$"  "-" [T=text/javascript,E=no-gzip:1,E=no-brotli:1]
+
+       <FilesMatch "\.js\.br$">
+               Header append Content-Encoding br
+               Header append Vary Accept-Encoding
+       </FilesMatch>
 
        <FilesMatch "\.js\.gz$">
                Header append Content-Encoding gzip
                Header append Vary Accept-Encoding
        </FilesMatch>
 
-       <FilesMatch "(\.js|\.js\.gz)$">
+       <FilesMatch "(\.js|\.js\.gz|\.js\.br)$">
                ExpiresDefault "access plus 1 week"
                Header set Cache-Control "max-age=604800"
        </FilesMatch>
 
         <FilesMatch ".+\.ph(ar|p|tml)$">
-                SetHandler "proxy:unix:/run/php/matomo.openstreetmap.org.sock|fcgi://127.0.0.1"
+                SetHandler "proxy:unix:/run/php/php-matomo.openstreetmap.org-fpm.sock|fcgi://127.0.0.1"
         </FilesMatch>
 </Directory>
index 6bc4c0ee6aa8cba7fe0b64502e1e5881c0e73d8c..e3a159c8062ed3562a04784d5c610d495a1dd3c6 100644 (file)
@@ -14,3 +14,4 @@ depends           "git"
 depends           "memcached"
 depends           "mysql"
 depends           "php"
+depends           "systemd"
index 0d15cdef4dd36241a4d95995241d43d91613cae7..0295c413fad56f3e8c174d5910d2b3e5d9efc089 100644 (file)
@@ -40,6 +40,7 @@ package %w[
   php-zip
   composer
   unzip
+  ffmpeg
 ]
 
 # Mediawiki enhanced difference engine
@@ -78,3 +79,99 @@ end
 apache_module "proxy"
 apache_module "proxy_fcgi"
 apache_module "rewrite"
+
+systemd_service "mediawiki-sitemap@" do
+  description "Generate sitemap.xml for %i"
+  exec_start "/usr/bin/php -d memory_limit=2048M -d error_reporting=22517 /srv/%i/w/maintenance/generateSitemap.php --server=https://%i --urlpath=https://%i/ --fspath=/srv/%i --quiet --skip-redirects"
+  user node[:mediawiki][:user]
+  nice 10
+  sandbox true
+  memory_deny_write_execute false
+  restrict_address_families "AF_UNIX"
+  read_write_paths "/srv/%i"
+end
+
+systemd_timer "mediawiki-sitemap@" do
+  description "Generate sitemap.xml for %i"
+  on_calendar "00:30"
+end
+
+systemd_service "mediawiki-jobs@" do
+  description "Run mediawiki jobs for %i"
+  exec_start "/usr/bin/php -d memory_limit=2048M -d error_reporting=22517 /srv/%i/w/maintenance/runJobs.php --server=https://%i --maxtime=175 --memory-limit=2048M --procs=8 --nothrottle --quiet"
+  user node[:mediawiki][:user]
+  nice 10
+  sandbox true
+  memory_deny_write_execute false
+  restrict_address_families "AF_UNIX"
+  read_write_paths "/srv/%i"
+end
+
+systemd_timer "mediawiki-jobs@" do
+  description "Run mediawiki jobs for %i"
+  on_boot_sec "3m"
+  on_unit_inactive_sec "3m"
+end
+
+systemd_service "mediawiki-email-jobs@" do
+  description "Run mediawiki email jobs for %i"
+  exec_start "/usr/bin/php -d memory_limit=2048M -d error_reporting=22517 /srv/%i/w/maintenance/runJobs.php --server=https://%i --maxtime=55 --type=enotifNotify --memory-limit=2048M --procs=4 --nothrottle --quiet"
+  user node[:mediawiki][:user]
+  nice 10
+  sandbox :enable_network => true
+  memory_deny_write_execute false
+  restrict_address_families "AF_UNIX"
+end
+
+systemd_timer "mediawiki-email-jobs@" do
+  description "Run mediawiki email jobs for %i"
+  on_boot_sec "1m"
+  on_unit_inactive_sec "1m"
+end
+
+systemd_service "mediawiki-refresh-links@" do
+  description "Refresh mediawiki links for %i"
+  exec_start "/usr/bin/php -d memory_limit=2048M -d error_reporting=22517 /srv/%i/w/maintenance/refreshLinks.php --server=https://%i --memory-limit=2048M --quiet"
+  user node[:mediawiki][:user]
+  nice 10
+  sandbox true
+  memory_deny_write_execute false
+  restrict_address_families "AF_UNIX"
+end
+
+systemd_timer "mediawiki-refresh-links@" do
+  description "Refresh mediawiki links for %i"
+  on_calendar "Sat 00:05"
+end
+
+systemd_service "mediawiki-cleanup-gs" do
+  description "Clean up imagemagick gs_* files"
+  exec_start "/usr/bin/find /tmp -maxdepth 1 -type f -user www-data -mmin +90 -name 'gs_*' -delete"
+  user node[:mediawiki][:user]
+  sandbox true
+end
+
+systemd_timer "mediawiki-cleanup-gs" do
+  description "Clean up imagemagick gs_* files"
+  on_calendar "02:10"
+end
+
+service "mediawiki-cleanup-gs.timer" do
+  action [:enable, :start]
+end
+
+systemd_service "mediawiki-cleanup-magick" do
+  description "Clean up imagemagick magick-* files"
+  exec_start "/usr/bin/find /tmp -maxdepth 1 -type f -user www-data -mmin +90 -name 'magick-*' -delete"
+  user node[:mediawiki][:user]
+  sandbox true
+end
+
+systemd_timer "mediawiki-cleanup-magick" do
+  description "Clean up imagemagick magick-* files"
+  on_calendar "02:20"
+end
+
+service "mediawiki-cleanup-magick.timer" do
+  action [:enable, :start]
+end
index 62324b5de87c44b17fa4dc1e8f32a355279715f3..8be994ee3b1ae9af81f3791698b4755f06c1c4ba 100644 (file)
@@ -183,50 +183,20 @@ action :create do
     notifies :run, "execute[#{mediawiki_directory}/maintenance/update.php]"
   end
 
-  cron_d "mediawiki-#{cron_name}-sitemap" do
-    comment "Generate sitemap.xml daily"
-    minute "30"
-    hour "0"
-    user node[:mediawiki][:user]
-    command "/usr/bin/nice /usr/bin/php -d memory_limit=2048M -d error_reporting=22517 #{site_directory}/w/maintenance/generateSitemap.php --server=https://#{new_resource.site} --urlpath=https://#{new_resource.site}/ --fspath=#{site_directory} --quiet --skip-redirects"
+  service "mediawiki-sitemap@#{new_resource.site}.timer" do
+    action [:enable, :start]
   end
 
-  cron_d "mediawiki-#{cron_name}-jobs" do
-    comment "Run mediawiki jobs"
-    minute "*/3"
-    user node[:mediawiki][:user]
-    command "/usr/bin/nice /usr/bin/php -d memory_limit=2048M -d error_reporting=22517 #{site_directory}/w/maintenance/runJobs.php --server=https://#{new_resource.site} --maxtime=160 --memory-limit=2048M --procs=8 --quiet"
+  service "mediawiki-jobs@#{new_resource.site}.timer" do
+    action [:enable, :start]
   end
 
-  cron_d "mediawiki-#{cron_name}-email-jobs" do
-    comment "Run mediawiki email jobs"
-    user node[:mediawiki][:user]
-    command "/usr/bin/nice /usr/bin/php -d memory_limit=2048M -d error_reporting=22517 #{site_directory}/w/maintenance/runJobs.php --server=https://#{new_resource.site} --maxtime=30 --type=enotifNotify --memory-limit=2048M --procs=4 --quiet"
+  service "mediawiki-email-jobs@#{new_resource.site}.timer" do
+    action [:enable, :start]
   end
 
-  cron_d "mediawiki-#{cron_name}-refresh-links" do
-    comment "Run mediawiki refresh links table weekly"
-    minute "5"
-    hour "0"
-    weekday "0"
-    user node[:mediawiki][:user]
-    command "/usr/bin/nice /usr/bin/php -d memory_limit=2048M -d error_reporting=22517 #{site_directory}/w/maintenance/refreshLinks.php --server=https://#{new_resource.site} --memory-limit=2048M --quiet"
-  end
-
-  cron_d "mediawiki-#{cron_name}-cleanup-gs" do
-    comment "Clean up imagemagick garbage"
-    minute "10"
-    hour "2"
-    user node[:mediawiki][:user]
-    command "/usr/bin/find /tmp/ -maxdepth 1 -type f -user www-data -mmin +90 -name 'gs_*' -delete"
-  end
-
-  cron_d "mediawiki-#{cron_name}-cleanup-magick" do
-    comment "Clean up imagemagick garbage"
-    minute "20"
-    hour "2"
-    user node[:mediawiki][:user]
-    command "/usr/bin/find /tmp/ -maxdepth 1 -type f -user www-data -mmin +90 -name 'magick-*' -delete"
+  service "mediawiki-refresh-links@#{new_resource.site}.timer" do
+    action [:enable, :start]
   end
 
   template "/etc/cron.daily/mediawiki-#{cron_name}-backup" do
@@ -457,7 +427,7 @@ action :create do
 
   mediawiki_extension "osmtaginfo" do
     site new_resource.site
-    repository "https://github.com/Firefishy/osmtaginfo.git"
+    repository "https://github.com/openstreetmap/osmtaginfo.git"
     tag "live"
     update_site false
   end
@@ -469,27 +439,6 @@ action :create do
     update_site false
   end
 
-  mediawiki_extension "SimpleMap" do
-    site new_resource.site
-    template "mw-ext-SimpleMap.inc.php.erb"
-    repository "https://github.com/Firefishy/SimpleMap.git"
-    tag "live"
-    update_site false
-    action :delete
-  end
-
-  mediawiki_extension "SlippyMap" do
-    site new_resource.site
-    update_site false
-    action :delete
-  end
-
-  mediawiki_extension "Mantle" do
-    site new_resource.site
-    update_site false
-    action :delete
-  end
-
   mediawiki_extension "DisableAccount" do
     site new_resource.site
     template "mw-ext-DisableAccount.inc.php.erb"
@@ -512,7 +461,6 @@ action :create do
     mediawiki_extension "QuickInstantCommons" do
       site new_resource.site
       update_site false
-      reference "master"
     end
   else
     mediawiki_extension "QuickInstantCommons" do
@@ -629,7 +577,7 @@ action :delete do
 end
 
 action_class do
-  include Chef::Mixin::PersistentToken
+  include OpenStreetMap::Mixin::PersistentToken
 
   def site_directory
     new_resource.directory || "/srv/#{new_resource.site}"
index f50ae6866ea486adfcccf8f428c8e35756ca16d6..b7788396f4cd4ad180007c7f9623ddc4fded42ce 100644 (file)
@@ -54,6 +54,15 @@ $wgEmailAuthentication = true;
 
 $wgEnotifUseJobQ       = true;
 
+$wgSMTP = [
+  "host" => "localhost",
+  "socket_options" => [
+    "ssl" => [
+      "verify_peer_name" => false
+    ]
+  ]
+];
+
 ## Database settings
 $wgDBtype           = "mysql";
 $wgDBserver         = "<%= @database_params[:host] %>";
@@ -239,8 +248,8 @@ $wgDisableCounters = TRUE;
 # Disable IP in Header to avoid cache issue
 $wgShowIPinHeader = FALSE;
 
-# Job Runs mostly by cron
-$wgJobRunRate = 0.01;
+# Job Runs by cron
+$wgJobRunRate = 0;
 
 # dissolves double redirects automatically
 $wgFixDoubleRedirects = TRUE;
@@ -361,7 +370,7 @@ $wgExtraNamespaces[NS_PROPOSAL] = 'Proposal';
 $wgNamespacesWithSubpages[NS_PROPOSAL] = TRUE;
 $wgContentNamespaces[] = NS_PROPOSAL;
 define('NS_PROPOSAL_TALK', 3001);
-$wgExtraNamespaces[NS_PROPOSAL_TALK] = 'Proposal talk';
+$wgExtraNamespaces[NS_PROPOSAL_TALK] = 'Proposal_talk';
 $wgNamespacesWithSubpages[NS_PROPOSAL_TALK] = TRUE;
 
 $wgNamespacesToBeSearchedDefault[NS_LANG_DE] = TRUE;
@@ -383,10 +392,7 @@ $wgForceUIMsgAsContentMsg = array( 'mainpage-url', 'mapfeatures-url', 'contribut
 <% end -%>
 
 <% if @name == "wiki.openstreetmap.org" -%>
-# setting the search weight of the main wiki's proposal namespace lower then general talk pages (0.2), but
-# higher then wiki project namespace (0.1)
-# Documentation at https://phabricator.wikimedia.org/source/extension-cirrussearch/browse/master/docs/settings.txt$693
-$wgCirrusSearchNamespaceWeights = array_merge ( $wgCirrusSearchNamespaceWeights, array ( NS_PROPOSAL => 0.15 ));
+# Placeholder for the wiki.openstreetmap.org specific config
 <% end -%>
 
 <% if not(@mediawiki[:private_accounts]) and not(@mediawiki[:private_site]) -%>
@@ -422,3 +428,8 @@ unset( $wgRemoveGroups['autoconfirmed'] );
 unset( $wgGroupsAddToSelf['autoconfirmed'] );
 unset( $wgGroupsRemoveFromSelf['autoconfirmed'] );
 <% end -%>
+
+# Increase curl timeout to allow parsoid requests to heavy pages like Map Features
+# Mediawiki 1.38 has fix to allow this to be set by $wgVirtualRestConfig
+# https://phabricator.wikimedia.org/T285478
+$wgHTTPTimeout = 240;
index dc3dc5eb02fc4599d566b9b25411e8fc58d63d93..fd23a53418ef1aa5395e262cd5a5c19308d70a5b 100644 (file)
@@ -96,7 +96,7 @@
     Require all granted
 
     <FilesMatch ".+\.ph(ar|p|tml)$">
-      SetHandler "proxy:unix:/run/php/<%= @name %>.sock|fcgi://127.0.0.1"
+      SetHandler "proxy:unix:/run/php/php-<%= @name %>-fpm.sock|fcgi://127.0.0.1"
     </FilesMatch>
   </Directory>
 
index f9d22c9eb8593f0524392544aeb8e1069635ff47..dde0a55ddc816cab55bb047644995814927b095c 100644 (file)
@@ -117,18 +117,6 @@ else
   end
 end
 
-munin_plugin "hpasmcli_temp" do
-  action :delete
-end
-
-munin_plugin "hpasmcli_fans" do
-  action :delete
-end
-
-munin_plugin "http_loadtime" do
-  action :delete
-end
-
 node[:network][:interfaces].each do |ifname, ifattr|
   if ifattr[:flags]&.include?("UP") && !ifattr[:flags].include?("LOOPBACK")
     if node[:hardware] &&
index cd20d4d9bf518158167060750f04f72479b1afeb..2009ff6a59eba45f014d498bf27cff54957ae2b1 100644 (file)
@@ -27,6 +27,8 @@ unknown_limit 144
     address <%= client.internal_ipaddress || client.external_ipaddress %>
 <% elsif client[:networking][:roles][:external][:zone] == "ams" -%>
     address <%= client.internal_ipaddress || client.external_ipaddress %>
+<% elsif client[:networking][:roles][:external][:zone] == "dub" -%>
+    address <%= client.internal_ipaddress || client.external_ipaddress %>
 <% elsif client[:networking][:roles][:external][:zone] == "bm" -%>
     address <%= client.internal_ipaddress || client.external_ipaddress %>
 <% elsif client.external_ipaddress -%>
index 81437acc0869664f0213ce50759b2ec22465c03e..9bf8345222393787a066ed0401c9c192cf6d7d70 100644 (file)
@@ -94,12 +94,12 @@ node[:networking][:interfaces].each do |name, interface|
 
       deviceplan["parameters"] = {
         "mode" => interface[:bond][:mode] || "active-backup",
-        "primary" => interface[:bond][:slaves].first,
         "mii-monitor-interval" => interface[:bond][:miimon] || 100,
         "down-delay" => interface[:bond][:downdelay] || 200,
         "up-delay" => interface[:bond][:updelay] || 200
       }
 
+      deviceplan["parameters"]["primary"] = interface[:bond][:slaves].first if deviceplan["parameters"]["mode"] == "active-backup"
       deviceplan["parameters"]["transmit-hash-policy"] = interface[:bond][:xmithashpolicy] if interface[:bond][:xmithashpolicy]
       deviceplan["parameters"]["lacp-rate"] = interface[:bond][:lacprate] if interface[:bond][:lacprate]
     end
@@ -196,6 +196,7 @@ if node[:networking][:wireguard][:enabled]
 
   package "wireguard-tools" do
     compile_time true
+    options "--no-install-recommends"
   end
 
   directory "/var/lib/systemd/wireguard" do
@@ -240,7 +241,7 @@ if node[:networking][:wireguard][:enabled]
       }
     end
 
-    search(:node, "roles:mail OR roles:prometheus") do |server|
+    search(:node, "roles:shenron OR roles:prometheus") do |server|
       allowed_ips = server.interfaces(:role => :internal).map do |interface|
         "#{interface[:network]}/#{interface[:prefix]}"
       end
@@ -275,6 +276,18 @@ if node[:networking][:wireguard][:enabled]
       :allowed_ips => "10.89.123.1/32",
       :endpoint => "roaming.firefishy.com:51820"
     }
+  elsif node[:roles].include?("shenron")
+    search(:node, "roles:gateway") do |gateway|
+      allowed_ips = gateway.interfaces(:role => :internal).map do |interface|
+        "#{interface[:network]}/#{interface[:prefix]}"
+      end
+
+      node.default[:networking][:wireguard][:peers] << {
+        :public_key => gateway[:networking][:wireguard][:public_key],
+        :allowed_ips => allowed_ips,
+        :endpoint => "#{gateway.name}:51820"
+      }
+    end
   end
 
   template "/etc/systemd/network/wireguard.netdev" do
index 1ec804b047d565a96582ad4a136f6158d7985964..17eef48da2793dbf2c855b60cce27e526a9a53ad 100644 (file)
@@ -7,7 +7,7 @@
 STARTUP_ENABLED=Yes
 
 ###############################################################################
-#                            V E R B O S I T Y
+#                           V E R B O S I T Y
 ###############################################################################
 
 VERBOSITY=1
@@ -92,7 +92,7 @@ MODULESDIR=
 
 NFACCT=
 
-PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin
+PATH="/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin"
 
 PERL=/usr/bin/perl
 
@@ -116,7 +116,7 @@ QUEUE_DEFAULT="none"
 REJECT_DEFAULT="Broadcast(DROP),Multicast(DROP)"
 
 ###############################################################################
-#                        R S H / R C P  C O M M A N D S
+#                       R S H / R C P  C O M M A N D S
 ###############################################################################
 
 RCP_COMMAND='scp ${files} ${root}@${system}:${destination}'
index 21d22045bc60841f1e453369a6ffff924d97456e..e37b429997350aa7afe3e7507afc5079ac842a66 100644 (file)
@@ -14,6 +14,3 @@ default[:nginx][:cache][:proxy][:directory] = "/var/cache/nginx/proxy-cache"
 default[:nginx][:cache][:proxy][:keys_zone] = "proxy_cache_zone:128M"
 default[:nginx][:cache][:proxy][:inactive] = "45d"
 default[:nginx][:cache][:proxy][:max_size] = "16384M"
-
-# Enable nginx repository
-default[:apt][:sources] = node[:apt][:sources] | ["nginx"]
index cd321f6daceaceb7013b0c8b22aba1b9f9600821..6534c587e4d846780a147354f5acb632d2f1fb99 100644 (file)
@@ -11,3 +11,4 @@ depends           "munin"
 depends           "networking"
 depends           "prometheus"
 depends           "ssl"
+depends           "systemd"
index d215e51c82a7176bc565fc00deab209587c20ce6..085428583ef5e540deb4ce738011181ce2ac19ff 100644 (file)
@@ -17,7 +17,7 @@
 # limitations under the License.
 #
 
-include_recipe "apt"
+include_recipe "apt::nginx"
 include_recipe "munin"
 include_recipe "prometheus"
 include_recipe "ssl"
@@ -66,17 +66,3 @@ prometheus_exporter "nginx" do
   port 9113
   options "--nginx.scrape-uri=http://localhost:8050/nginx_status"
 end
-
-template "/usr/local/bin/nginx-old-cache-cleanup" do
-  source "nginx-old-cache-cleanup.erb"
-  owner "root"
-  group "root"
-  mode "755"
-end
-
-cron_d "nginx-old-cache-cleanup" do
-  minute "15"
-  hour "23"
-  user "www-data"
-  command "/usr/bin/timeout 6h /usr/local/bin/nginx-old-cache-cleanup"
-end
diff --git a/cookbooks/nginx/templates/default/nginx-old-cache-cleanup.erb b/cookbooks/nginx/templates/default/nginx-old-cache-cleanup.erb
deleted file mode 100644 (file)
index a67931b..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/bash
-set -e
-/usr/bin/renice -n 19 $$ >/dev/null
-/usr/bin/ionice -c 3 -p $$ >/dev/null
-[[ -d "/var/cache/nginx/fastcgi-cache" ]] && /usr/bin/find /var/cache/nginx/fastcgi-cache/?/??/ -maxdepth 1 -type f -delete 2>/dev/null || /bin/true
-[[ -d "/var/cache/nginx/fastcgi-cache" ]] && /usr/bin/find /var/cache/nginx/fastcgi-cache/ -maxdepth 2 -mindepth 2 -type d -wholename '*/?/??' -delete
-[[ -d "/var/cache/nginx/fastcgi-cache" ]] && /usr/bin/find /var/cache/nginx/fastcgi-cache/ -maxdepth 1 -mindepth 1 -type d -wholename '*/?' -delete
-[[ -d "/var/cache/nginx/proxy-cache" ]] && /usr/bin/find /var/cache/nginx/proxy-cache/?/??/ -maxdepth 1 -type f -delete 2>/dev/null || /bin/true
-[[ -d "/var/cache/nginx/proxy-cache" ]] && /usr/bin/find /var/cache/nginx/proxy-cache/ -maxdepth 2 -mindepth 2 -type d -wholename '*/?/??' -delete
-[[ -d "/var/cache/nginx/proxy-cache" ]] && /usr/bin/find /var/cache/nginx/proxy-cache/ -maxdepth 1 -mindepth 1 -type d -wholename '*/?' -delete
index 5cd33627c77dd7a64337bda994adc3377f1052bd..6285913540a9011b8c3d8e56a28326a1baf994c6 100644 (file)
@@ -6,3 +6,4 @@ description       "Installs and configures Node.js"
 
 version           "1.0.0"
 supports          "ubuntu"
+depends           "apt"
index 5f8ca526b4f6b0e491af932a1f2614576d13d377..9483d5893f9f98d0ebf824b98d8f480355ff01ad 100644 (file)
 # limitations under the License.
 #
 
+include_recipe "apt::nodesource"
+include_recipe "apt::yarn"
+
 package %w[
   nodejs
-  npm
+  yarn
   g++
   make
 ]
-
-template "/usr/local/bin/yarn" do
-  source "yarn.erb"
-  owner "root"
-  group "root"
-  mode "755"
-end
diff --git a/cookbooks/nodejs/templates/default/yarn.erb b/cookbooks/nodejs/templates/default/yarn.erb
deleted file mode 100644 (file)
index ed0b15f..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-
-<% if node[:lsb][:release].to_f < 22.04 -%>
-exec /usr/bin/yarnpkg --ignore-engines "$@"
-<% else -%>
-exec /usr/bin/yarnpkg "$@"
-<% end -%>
index dca4e71e6ea0076cb80351653948d7df90512268..301faf53d905aa4f029b9ab5cd452bcad35da870 100644 (file)
@@ -24,7 +24,8 @@ default[:nominatim][:fpm_pools] = {
 }
 
 default[:nominatim][:config] = {
-  :tokenizer => "icu"
+  :tokenizer => "icu",
+  :forward_dependencies => "no"
 }
 
 default[:nominatim][:redirects] = {}
index 7b218d9511324d6b876286bdb7a4ba79925f2072..537de83f5d8080e968bd312d52884a8925c4a9e9 100644 (file)
@@ -131,6 +131,8 @@ package %w[
   libbz2-dev
   libpq-dev
   libproj-dev
+  liblua5.3-dev
+  lua5.3
   python3-pyosmium
   python3-psycopg2
   python3-dotenv
@@ -226,7 +228,8 @@ template "#{project_directory}/.env" do
             :dbname => node[:nominatim][:dbname],
             :flatnode_file => node[:nominatim][:flatnode_file],
             :log_file => "#{node[:nominatim][:logdir]}/query.log",
-            :tokenizer => node[:nominatim][:config][:tokenizer]
+            :tokenizer => node[:nominatim][:config][:tokenizer],
+            :forward_dependencies => node[:nominatim][:config][:forward_dependencies]
 end
 
 %w[wikimedia-importance.sql.gz gb_postcodes.csv.gz us_postcodes.csv.gz].each do |fname|
@@ -509,6 +512,7 @@ end
 prometheus_exporter "nominatim" do
   port 8082
   user "www-data"
+  restrict_address_families "AF_UNIX"
   options [
     "--nominatim.query-log=#{node[:nominatim][:logdir]}/query.log",
     "--nominatim.database-name=#{node[:nominatim][:dbname]}"
index 998fcdfaa5f24606d0c81ad5174bc6279a417f3d..6f355dd11bf73fefdc0cb90e6bbd6a5037411a3e 100644 (file)
@@ -1,5 +1,5 @@
 upstream nominatim_service {
-  server unix:/run/php/nominatim.openstreetmap.org.sock;
+  server unix:/run/php/php-nominatim.openstreetmap.org-fpm.sock;
 }
 
 map $uri $nominatim_script_name {
@@ -60,6 +60,9 @@ geo $whitelisted {
     8.43.85.3 1; # gnome
     8.43.85.4 1; # gnome
     8.43.85.5 1; # gnome
+    2620:52:3:1:5054:ff:fe0a:75a4 1; # gnome
+    2620:52:3:1:5054:ff:fe0a:75a2 1; # gnome
+    2620:52:3:1:5054:ff:fe0a:75aa 1; # gnome
 }
 
 map $missing_email$missing_referer$http_user_agent $blocked_user_agent {
index aca17fdd5f9db28ce201945a085ced4578690a35..239208500888dbfdda6bfc6abf66e502df212ed8 100644 (file)
@@ -12,6 +12,7 @@ NOMINATIM_IMPORT_STYLE=extratags
 NOMINATIM_USE_US_TIGER_DATA=yes
 
 NOMINATIM_TOKENIZER="<%= @tokenizer %>"
+NOMINATIM_UPDATE_FORWARD_DEPENDENCIES="<%= @forward_dependencies %>"
 
 NOMINATIM_TABLESPACE_SEARCH_DATA=dsearch
 NOMINATIM_TABLESPACE_SEARCH_INDEX=isearch
index 03728fddb8c60d3b754555c81240ea87c38b5768..b3948809db4add73ed8bd03dad2f45a7c19d0f88 100644 (file)
@@ -1,5 +1,10 @@
 # DO NOT EDIT - This file is being maintained by Chef
 
+<% if node[:lsb][:release].to_f >= 22.04 -%>
+# Include configuration files found in /etc/chrony/conf.d.
+confdir /etc/chrony/conf.d
+<% end -%>
+
 # Servers
 <% node[:ntp][:servers].each do |server| -%>
 pool <%= server %> iburst
@@ -14,7 +19,13 @@ allow 127.0.0.1/32
 allow ::1/128
 
 # Run an initial NTP sync on daemon startup
-initstepslew 30 time.cloudflare.com time.google.com <%= node[:ntp][:servers].join(" ") %>
+# Use a few IPs here to workaround DNSSEC failure if time is wrong: https://github.com/openstreetmap/operations/issues/654
+initstepslew 30 216.239.35.0 216.239.35.4 216.239.35.8 216.239.35.12 time.google.com time.cloudflare.com <%= node[:ntp][:servers].join(" ") %>
+
+<% if node[:lsb][:release].to_f >= 22.04 -%>
+# Use NTP sources found in /etc/chrony/sources.d.
+sourcedir /etc/chrony/sources.d
+<% end -%>
 
 # This directive specify the location of the file containing ID/key pairs for
 # NTP authentication.
@@ -24,6 +35,11 @@ keyfile /etc/chrony/chrony.keys
 # information.
 driftfile /var/lib/chrony/chrony.drift
 
+<% if node[:lsb][:release].to_f >= 22.04 -%>
+# Save NTS keys and cookies.
+ntsdumpdir /var/lib/chrony
+<% end -%>
+
 # Uncomment the following line to turn logging on.
 #log tracking measurements statistics
 
index 5caa4404be1b898b3fc252fa822f23e0f0359ba5..739c98a05838a58cdd6411256decec78f6c9d175 100644 (file)
@@ -14,8 +14,6 @@ ridley.oob.openstreetmap.org,ridley.oob,10.0.1.3 ssh-rsa AAAAB3NzaC1yc2EAAAADAQA
 ridley.oob.openstreetmap.org,ridley.oob,10.0.1.3 ssh-dss AAAAB3NzaC1kc3MAAACBAKzNiUprAK/uF6ippll2gTyE7QIYg8kcE1a59/4iyyh56ChG3W4bq8jgA6ZLvJRks+rbKnjs98duqFKFoGC7sXmvNvLGD7jtSbAUkiPzNUsQ1uwPatNJk/mY5zzHjaxmgOUfA0EtDxKgvxli0atn8Xj8PGy49BbtlBPdnS+tItQ/AAAAFQCO2II1Su14H1gaeU0ogUCkG20ePQAAAIEAo0+0I7Ha53KM9xJWt1qQAVTV3FTGrOwrmedpz6JYcyELhNhC/ZUDOXu5GKqkp5SRcXZ9NRV4FiDMZgKvMGyvRcF1ZOkytNGtx12FiXAzVsM55O+hszLouqZocJVXY6Km3SKmVkymGi+unoowCHWMWJEIAjz80KyR7dsXHQKqIXEAAACAdlDbeOLTQLcgwTGRMbJR63fz6zvQQMZVJ3DDYzQxiW/0qB2CeaB0CuS9DDSJBLVlp2C9MIVnDxxaQi1KmUOvNs2fqb0NEZ8AQG7clCASgf9nXN0EBju+dZ+lGcB6c5ZIcDB/z0gFEp/16sHe8bay70Zp+S4ot6jXD5UM/pLSmF4=
 snap-02.oob.openstreetmap.org,snap-02.oob,10.0.1.4 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCKyiu+/H4R/Dx1dzhWIH2Z4+SHyhgo6xONxKjlC6te2blHPjbiWgZzS+WWQXj8siiv6w98p/DonTV/+tqW9RP7fJLca0UBjexQwZBGxjBWPsMCG5bdjWLtiQCN5vVD5Hy3A/6TUeHFYfbSbEuUO+VZVHR6fVMJ0sHHy9eIIwDNsyzGoi2SDB/QsuNgSK8y0TGBQzqHPv0AAGhvmvRONGO/htLZ3lsSuvZQ0D9NPx2fNbcFzkPsOUH05I+1+Wq3tnB7doJ/+hzj6/+wyPZar0zqhNs9YJrKrSOxiltVNnObwFHWvEZabHF3jKDNzmr4IHYUgEMwoMeHvXwI1ly0xz8T
 snap-02.oob.openstreetmap.org,snap-02.oob,10.0.1.4 ssh-dss AAAAB3NzaC1kc3MAAACBAJPM2TEec9aDLSkHqKHQ6mLj9Z2SFsCWIA63kxUSw8wOZMFY7nkoYw9N/ieNLCpw/cfVO7W9Lo0TNXbnSew9js6Zvs6HvKQq+gzTVbBwep5s1jzjxeXUmVBx7Ifef3Fy2vpDUhNigS7tPjw6lXP4EZTnTmzXM7tUHO7EdUX9SiajAAAAFQCyZBIKfsp0XFvi8udODBp8XDHgOQAAAIEAgVA5BUZVTGiD61bSEnbnDCVtJRUVInCeyWspw6gWD1xVtWcxkgznayGINl7E7BtSMuIYXKaagCkr0bEyTaeZNspJhRPEYxqKKFlipvBFZB0KbblrRRfURA5HZmlIZlTlf2hyNpIEEIzPLXkwTgU43wRfsaBl7Pkzwo/3zMfF5+sAAACBAIfSYe40ueqHSxP9X/j0K0LpF9qprmA3P1N4+vE8vVOJsAnTQuXMcVNKdyN1bATCtGZKMGWOPnpiBaXK8K8ckiRrE/nNfyvSKBcvyvPLQ9yyN3BYpXak+GAj3sJCekl6tQwD4Z9N/0229+Ot2/ymJ0lrnyHsI8+p2Gj2als4uAXZ
-urmel.oob.openstreetmap.org,urmel.oob,10.0.1.6 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQC/Z50neDHObFvqY7SjrvtebendKtlfZ5KdpUHJXzootFg5zli09HaMep8YuEqBK9n1H06qnLQY6Hr3tKUEMBjjn1VS/hiB3OQlAqci0YEqcgwyiBTz2Etkb7lDXgJVDcFA5Pjj5sKnXw7gi4Nmkgg6cfQb81fed1ySGArcFY6PFQ==
-urmel.oob.openstreetmap.org,urmel.oob,10.0.1.6 ssh-rsa AAAAB3NzaC1kc3MAAACBAJr/RfX1uZxsD/wuhnTwManZnbVET7yjqGx9H9oVXgDfGNDpk22U0/7VKh0BVHi7iC6Z92YWgCG2Os/SuZgOLqXxdJAjZv9iYqBFQBszzBjGpbtpmOZPzi4q/B4KtXmsiWVPk/eQoW7JodeaalGEflJbYY4rdtfNhWl7uR79NH9lAAAAFQCGJ68LbEk6z0t0fV6UuM2C3KDODwAAAIEAilB3PdoejxgWtd5zVWfK1pYooWyplBp0/qkQ/WV1sT/4+LsuDk1ttszD4DkyvSFwgXKULdcWl56YI2+rFS9busxyNVhM8u5ou7rMvL/laNqkruK8FGdObo1CrpqNS1CuTEcZnIXJcz9grYdmwx9Vt51V0TP7ExKggijX0FmYN4YAAACAJZy0ekCJk2l2kJwTN6D7J4NLIip4Xyv7YZhOuguhEXjmowQrAqsXRyBED0cMdC4DuUOO0AmbLJ7cw/IJ9rf5d87ZVRx8EBaGLd+WAtDGoSsLnYgY9iRWpKkYqfhLAwSfXA9d5iO1rh+FWngLsCBJ3aDurJvQHCw/xVai76tnWTU=
 #zark.oob.openstreetmap.org,zark.oob,10.0.1.8 ssh-rsa
 #zark.oob.openstreetmap.org,zark.oob,10.0.1.8 ssh-dss
 eustace.oob.openstreetmap.org,eustace.oob,10.0.1.9 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQC9wLWa3gAdXL/oUw67cLoHKiIOd959u++OOjXLR2OcyDkSLNTQgYkawEOcNgRVBcLjXh7ej9ktuTFbLWwR/Uvx7ftP5MH0Luo7Z9CvrQjw9Eu+G/CdGzvilHSeSAdCJYWemHXqKT9Qo9zJt2BI7wRfkFKdA5uXezwMYQtiQRHMkw==
@@ -27,8 +25,6 @@ sarel.oob.openstreetmap.org,sarel.oob,10.0.1.12 ssh-rsa AAAAB3NzaC1yc2EAAAADAQAB
 sarel.oob.openstreetmap.org,sarel.oob,10.0.1.12 ssh-dss AAAAB3NzaC1kc3MAAACBAKZf6qtRHGHjPfOP3drwO1m28l4fpN5X5c8ArkeKhV3aTzY404uwCsSvfYQUw/s24E+989MWZxLUO0Ib+nV+hWlK0nxI85bQPIvOjaWNtbggOfNdz4VyNcLxxzsiJqNhQpGQ3LW2zQ7fsP9pM5ALAs7MDOaSdNja58aUgEMY1ta5AAAAFQC1r9L5Mkax780fOnwkDB6eIaNjCwAAAH97vSxdyRel4IucL4Ckn7Y/zVwFeLpwHiVP41MN7dO2aApuWvsygLU/FUAouv/3PRug/bAAS56w2/JLKVvyo1aRPNHAvgPFEDodqLc+dnC1bXFu1VR69ntQYTEe6iReLlwzeEPLwTW5ucGHddXVbP2jG3R+JEmGGt87P3JxicCjAAAAgQCXV76oba/hqR50+HL1YjMeMPjBj8DfyNPcuEJwSO+TFbn4IW4xkxYYl3w4NuD8H6gj2Myk55Wza5BIR0oTWtuQuGiAKld+sIcMb7R2rT2KustEVuvy5GM1/NkAJ+sUa4lTTl64KPpFukFIC8Ma4hiEhXA4LnN02DZe0NdvyqkC9Q==
 noquiklos.oob.openstreetmap.org,noquiklos.oob,10.0.1.13 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQDE5XeF6tG4hu9M0m+JWh4QJmL/52+cfeXbV4qfWwdJjSH9yBzYP9LiDM97gMXMUSnomAs7GO0KMwEdO9xuIZWeYFyHvs+1a73fAus8bcAbrZPuFfPfrW3JHKtWsfhUqYNJuRHLaimLIRyqgsXy3WAHf35v9kY1DmMWkf5/VTrp0w==
 noquiklos.oob.openstreetmap.org,noquiklos.oob,10.0.1.13 ssh-dss AAAAB3NzaC1kc3MAAACBAPK6Av/wAEtRnOx12117EtAhBPnodjQur0/k0pTAaGCZNnLY3E5SD7CvSqtB+LhRO/VSHXl1Obkh4mvR6oKEDE2XOWEG5Ofq3mWngT9Ejo0Rretzc1JU7L6WPZ8N/D+3kQUXpxDYzK9CcKz90k0msZUFRfGkHVE12ip9f7G/BWPRAAAAFQC5wUn4ZkWjt0z+/bUUOe298i0QvwAAAIEAz6dx6w5equWz3T8DWPM8LRGhE6ASrwR2UNpFe+sW5EBp/M+Zgg5Ztne1nIQaDSh1iKL0qzSGYxTIb/sIDKAxy6CzTjEhWRGmuDRTPQkXwD9iXcNaLChEEP6AryrI193LnLKRGKVve6gP2vH4tpn3Ve68HSKL4Ggz2L9ysKxJppEAAACABSHM7Ez/2oMaDGNRvgWc+ViB3QZOB1CTnDOkRZuhZXFMmTGXaWPzlwqPLZKg+wVOnJgBJ4BTUV6WovPGPYWadNuqhlsKjflFQyYSkyBA+4gvZ45TwbDE4HTQ1BGlXJVA3vq5HAqcxlo2CAj4HCQJgVHzd7sfH+WwyruGDu58ThU=
-errol.oob.openstreetmap.org,errol.oob,10.0.1.14 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEA1riMj4gWqiovniYhlFNUxMm/AGmV/C2GjcMP+NcJ1ZyP4OdytGeGfhUm5GwVwraimkFQQlfEDcUWY7OX4EG115E8i15cUt6s6Ya2E6AXydigvBbrdp8MNnPOWBifVN3/5Cgi8nrAebmPs88ZZx2KM/Df5qIB2rHYpuHYyl+MpqE=
-errol.oob.openstreetmap.org,errol.oob,10.0.1.14 ssh-dss AAAAB3NzaC1kc3MAAACBAKcnhyMz3C4sku0e1/nFailjoPcMwLazXq4H/kUsdlt+f2By73F5KdUWffxoeRNL0UVT7+VCKG6IXmXGkKVfvpTipFjkP1N+b7I4SuJcQ/EUNPTCGAfC3l691K8jUBD6WSlQUqZtKGnpDS1zI/ZIYiNqrQnWu2RTYnP3QvY7JigDAAAAFQDI6aaH6mWx7vTVS9m3tyXQ4GQ08wAAAIAQjAM+q8Hfp1h45UjTeD2jIA74asQl0M+4q+4EcnNPnKXRbEBIg4rCWkHdd06uhayXZ91KzCDcj1b2LSb2zOE4U1MDEpdVnz22PuEl/f6/epKmLOqHoOGu9/9Lud6OoZQSveEPYmcpEEpt1RCN9ZvkVtFdLwtQ8+CSSGXg8yfCxgAAAIEAjQztmG1LN/e7pNRY0MtV148rJY3mR2knJegg0yBOEWHUGtKY91lgboWie1YTGR3RiXckJFFYkOGWAxqEVM//+rW0hatCxEp/mWEt/GWKPpV52fc4BUhJbi9hb8sg+dAvfoHwUL3CzHzqapaRNxxbfest8dfvascAjRDFP7yxU9w=
 yevaud.oob.openstreetmap.org,yevaud.oob,10.0.1.15 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEAuWeUQd5ssUd5VFyTMXgC+U6c7s63mtuEj+cL6x8EU8PqNS12RGwLpeAI5VL8UzM0YLyPjPh/yzdQN2tl9ufK7KZF0apvoSZgp/uwyG+CgdFSf66nTrZN4NA/QP1ikH3kbqcM87LfNjCrMXnqMBJ/OCqz2z+An8t0KGDXS8haxlU=
 yevaud.oob.openstreetmap.org,yevaud.oob,10.0.1.15 ssh-dss AAAAB3NzaC1kc3MAAACBAL6RC7IMuQEtD4JIRmBJEownC0a7ZEvfCTw20PV5MjWb6twZlGBK3IA/0yV0oJ+75W6VWizn3cWSBS3y1zD8KktF4fh4+FVyin9WTyFuwME8cYmRPV+kuOa1lF1sLJxqvZJRjKMjweLeNTKnl1mb03049SL2YoGwMOTdVgVBjEyFAAAAFQC7rQIvnfLYbQdX87DwlzfMDALOoQAAAIEAmAu2kK8atEOR1Sc6maxYKSf68MYMHoTpm2MW9q2x5ls982kfEUMJ3h641cbRgOAuCmQU3gHnt73sl5LY3K3oLijIhSQm8+l+GkrXVhdwx7ScLXf+8TJZRWiP6Q98VWM4E3L4wmiJksLbTlxdoew3lv8gGhbpk0XuSyLWIBZIKJAAAACATogkqFXhPFzOMRJAR6G8J4bOqg9Ae2cGtf4aMZ9xdm/Hm7YLSu3kn5IhawwU+DL494VF+ky69T01iY3e4m/kQhYB4emlqsRHzVscblVH+GL6sVEkct0HMzfqzEFcfYWqqMdig9EwTzHwJzkAb4WqZdGnWG3Ln88x3liyDZTpGco=
 clifford.oob.openstreetmap.org,clifford.oob,10.0.1.17 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCsCrNQ+QQg2UUGhBpgjlLAF4gI48VDGmcF9prulYDxduyGJIrqhOjQtKLjNksMr8TEblmJsI4JzPf1lY1rVL3Q/aZWJD5X4Q0DgEtNzfinI9JAy77JASj1osBPU2RfWSvK9C2TnEoXHxuyGKMw9iuuPLppNMjZ103PYprQeAXi1w==
@@ -58,7 +54,6 @@ tabaluga.oob.openstreetmap.org,tabaluga.oob,10.0.49.14 ssh-rsa AAAAB3NzaC1yc2EAA
 tabaluga.oob.openstreetmap.org,tabaluga.oob,10.0.49.14 ssh-dss AAAAB3NzaC1kc3MAAACBAIQNHSK0uo1CehCFag09Hd+bJ+CDD0LPWoE/6B8Ye3woVQw8XhJPIygWyHlsFo4rbgkTnvz4ooKTUHnisEIoAA6hlqFTVP1LQQarkmba5Gf05x42hYKjM6mYvcoDMAdnkPueqKIa2CQVNCg3sopI2isxaUUWPEqrVeTMgI40ofd7AAAAFQCSNIl/McB7R/7q4fFxZ2dVGtvJGwAAAIBNRHSJrnm4IDYufJetkWyn4KEIkycUMDs1WE1H1LbtmsIaBAGaz1QJKclPCin+hCv/Rne4oPoZWGl3SqB7hjBkvKUOKRaMp4eG1YCpEvAhgNIFjPkgdekctQ1H6/+7CkQmMVelh78cUMOUYEoky7ISiaKUT3z8O9EEjPIndreNBQAAAIAQeqPxG9B+RJtcOqnW5d9M8VVUNeW10A2R2AMtTEH+/hjaoXUPpL3bQ0Fl3aWQKYJMRpOM64GgLswEhxeWf0PzSAi5CwBmyhIEUJpJ0jHOYSUXC6sLpBMV1ad4gF/63CBAgL1fUnQ/FWDtZwDEnBksDbYSS6EJB5m1o1vOx3SHWw==
 odin.oob.openstreetmap.org,odin.oob,10.0.49.15 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCeK2EVK4rbsdoTq84Cl5kLhbJk7gbaNav61yFuSKfSsizzbH/tzxmiFA7mtB39WU/BlFsTHAg1mHY7cCPE01E811CDPIQhZGEyloh5ftbTACCcGAjKBhYpwTPEteBqlIk3lpN1TNTsnJSYaQay3rbOQ+IXTb8nzKYjTgANQ6QXxSq4BfuRmvMRlNw7ZuIerhs8OL2G/pxldL6AYDPDFXBs9mvvqqS0fw8rzxkjFNUc/z9odFoChtlZVbp33/LTIBQU1dY/XTxaekErjT7H93KG9NP8mmIFZtU8oRo8553ogTYVxFr6hD5D6KkbveaFU9oBDRYlJPWtdHksF8RAEpjN
 odin.oob.openstreetmap.org,odin.oob,10.0.49.15 ssh-dss AAAAB3NzaC1kc3MAAACBAMxXgZGeLxWyQCErmy0aGppk2/xHj3GTATPCQgf/Mtm5PYK7c3x8Z/fEop/BBnY2/YDE709g28Tv+61I4SD9D33OO6ABPEapHEwqp3CIYuA8+JFJhuo6Sz9h9bca6fx/KVjdDq9wbmx5IOqEFQlBoCSGJvYw5pTptVFN+nLeiTLjAAAAFQDt76BO4R+GaDn6/SeJvP3xAuqkmwAAAIEAgbhpMfB2Gk+babYDnWTWMkFO1FObUdi8/3NmiS1XUPCzdGkL1h2psoQIMXFtrNfEzSPx320rjC17T+JD1KGzXTBsPSd49MhznMc13JK2YT6KJm3io1CLKuzje4SxrpddM1Uvs/sOLmeAbdNqlUsAM8KUedEYTo/SXeVecos6dboAAACAasbTSjiTPW3NwH1yrEV8xWFCAmsmAPvqwGjaLjrrDdNQCbJ0KHMY+lbUAmT6oZ5qcrwwc2A6B+/v9XBISiT5XWELdP56bhuDcWC78aJDdtfDK1xuMtsHX5tpQcKB7IrPI+2UYVhz7zosvcCbn8FukgDx8sEcp28rHaFB5WPCjig=
-lockheed.oob.openstreetmap.org,lockheed.oob,10.0.49.16 ssh-dss AAAAB3NzaC1kc3MAAACBAKZf6qtRHGHjPfOP3drwO1m28l4fpN5X5c8ArkeKhV3aTzY404uwCsSvfYQUw/s24E+989MWZxLUO0Ib+nV+hWlK0nxI85bQPIvOjaWNtbggOfNdz4VyNcLxxzsiJqNhQpGQ3LW2zQ7fsP9pM5ALAs7MDOaSdNja58aUgEMY1ta5AAAAFQC1r9L5Mkax780fOnwkDB6eIaNjCwAAAH97vSxdyRel4IucL4Ckn7Y/zVwFeLpwHiVP41MN7dO2aApuWvsygLU/FUAouv/3PRug/bAAS56w2/JLKVvyo1aRPNHAvgPFEDodqLc+dnC1bXFu1VR69ntQYTEe6iReLlwzeEPLwTW5ucGHddXVbP2jG3R+JEmGGt87P3JxicCjAAAAgQCFBaTPsbNtWlUSsGnRzObp3NVC6MOro10p4qSXB0kwAB+hQx/IrIH8BjduR+b6Uv2cm/UMnGRzS/1lGYe15cSs0V/IOUyXdVeX+jB0TXzS4hTqclGKJ0Ay2WEsgW27IdPxIjQg/W77s9AZ2UlyEtT7gK2oergD60yUvRfLLJioYA==
 norbert.oob.openstreetmap.org,norbert.oob,10.0.49.17 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDAHaxesONNY+jIQmZKVKjsg5PPTYytFpBG9qx5Qjgk7PoPt4VcxZu0X3snv6toy2s4zjmnIo7+T014+ihKF5RzzYB3sRwHgx2QIXp9zjCkeB8HCSyMsnKWUoJcyxDrVy0gS0GgbmzIAL3n47budeyxYW20Bk9iy+b4z2KUGJnMrmhJ76eZkawtsr1DxRIrCWDrXNz66+msk7v/3DDUZFAACkPEF83YVECiNsBeKn5nm82W16OEFKOMsQXM65DjPTzH4iKajlA2j8DTf5qOtgiGGtLVQ8b5erwibgbXFfd1wWsqxhEP25z5omnheSujCkhYoZJ4+larVgqU+CUvCHE7
 snap-01.oob.openstreetmap.org,snap-01.oob,10.0.49.49 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDcKedgjsKRd3zPnZkJNL7iZYHay+KBd73bw4PjyHmblyUOcdtMx5yEntBHGcWAs5lwc4mNZgKbSJfuuW142oq+r+3I8UzcvYQGJKAvR5quKCn/c+iDkX56SQvh7SOtgf0K2K0dfHdQEh/jw56AewKcPxgCV5vBJ63ce0gETq3/Fj6mJwIYLU1kjyJiyusng9EWlgbodx8ma1zFM0dlxdHxeMkE38pcnrpOxNhV7qbGY9doU2VFUPQnCQOzpUtLr6n0J8l/1ubPnBsN/VAAYGMNbxwGgpUt+Hpwgl7dcn+1FQfFUUL54inUuP7Y2EV1bEY/WyhfLDkMRwgm+X96QctT
 snap-01.oob.openstreetmap.org,snap-01.oob,10.0.49.49 ssh-dss AAAAB3NzaC1kc3MAAACBAL7X2T4wZtS3IUAc4YiwmM96y6dCC95Rxx1ybwYd37muYousIUYA4W5h9uUQivSmcrjfEQB4kvL6Ie3fEElMnY0Zo3hVcbC5fknJ4Xmfk03Ubg6cVPAkI2xfDsmh0zlpo70WbWSB9d/NuSkRb1rE3LwIk3dn5N5l8+HZjF3jpe6NAAAAFQDV2cgvPobL9hg6v4cx0ftM8sFs4QAAAIEAuYP9hGd/O8C7fMYKqD9w8VnCSgiKRV+KZyyAQBl89mm7VjFlDwu+9yxhQ7VRMSaLVVY3oeHWo5H5Fd5ajRBOpQZRIfjQ56c2kEfuQ31Ind7gqUDRGypNSpWti7Tw5ELTzfV2JPyWQVXQAmoEKzqYsOYktwWmjVCjI9wiiSoPrXkAAACACUoUI2o3eO9wSTiha/arqt4qkTHiESi7L9IuSomAr7JpvMMcCanKVSqhOV22wS08z7IVz2bVAIjzzMCf08b8Z+l8ypKtMkrDqkLr2MwkPR6cX85v+TMAdZ1kEDjWSLqsvcQOYLSlkKWDp3XbSO8G8GAQL4Vkk1uenMs7YSPVCWg=
index a42e22eb055e5f340426d4bfb140ad3079250e6d..0b391a62cc3479cede8e5b1bfcfe32d962e296eb 100644 (file)
@@ -119,9 +119,9 @@ systemd_service "otrs" do
   group "otrs"
   exec_start "/opt/otrs/bin/otrs.Daemon.pl start"
   private_tmp true
-  protect_system "full"
+  protect_system "strict"
   protect_home true
-  read_write_paths "/var/log/exim4"
+  read_write_paths ["/opt/otrs-#{version}/var", "/var/log/exim4", "/var/spool/exim4"]
 end
 
 service "otrs" do
index 5c7cfcaaffdee732fb181a8b15c67c24086f9f17..ed2d82ad8cdf879963901507e9b947155c90f4e3 100644 (file)
@@ -1,6 +1,5 @@
 default[:overpass][:fqdn] = "overpass.openstreetmap.org"
-default[:overpass][:version] = "0.7.57"
-default[:overpass][:full_version] = "0.7.57.2"
+default[:overpass][:version] = "0.7.59.1"
 # One of: no, meta, attic
 default[:overpass][:meta_mode] = "attic"
 # One of: no, gz, lz4
index cde954602abfbb2ece5c3471584c05dcddc3c4f8..3f2aa322c325ae1d9c65720bbcf7c2713847147d 100644 (file)
@@ -9,5 +9,6 @@ supports          "ubuntu"
 depends           "accounts"
 depends           "apache"
 depends           "munin"
+depends           "prometheus"
 depends           "ruby"
 depends           "systemd"
index be930135fc24ad9a3470d5118925b8b70d2e19ba..720b113216d342abe8f6ccec947cd0aa5f15eb28 100644 (file)
@@ -20,6 +20,7 @@
 include_recipe "accounts"
 include_recipe "apache"
 include_recipe "munin"
+include_recipe "prometheus"
 include_recipe "ruby"
 
 username = "overpass"
@@ -37,7 +38,7 @@ end
 
 ## Install overpass from source
 
-srcdir = "#{basedir}/src/osm-3s_v#{node[:overpass][:full_version]}"
+srcdir = "#{basedir}/src/osm-3s_v#{node[:overpass][:version]}"
 
 package %w[
   build-essential
@@ -69,6 +70,8 @@ execute "install_overpass" do
   user username
   cwd srcdir
   command "./configure --enable-lz4 --prefix=#{basedir} && make install"
+  notifies :restart, "service[overpass-dispatcher]"
+  notifies :restart, "service[overpass-area-dispatcher]"
 end
 
 ## Setup Apache
@@ -148,6 +151,7 @@ end
 
 systemd_service "overpass-dispatcher" do
   description "Overpass Main Dispatcher"
+  wants ["overpass-area-dispatcher.service"]
   working_directory basedir
   exec_start "#{basedir}/bin/dispatcher --osm-base #{meta_map_short[node[:overpass][:meta_mode]]} --db-dir=#{basedir}/db --rate-limit=#{node[:overpass][:rate_limit]} --space=#{node[:overpass][:dispatcher_space]}"
   exec_stop "#{basedir}/bin/dispatcher --osm-base --terminate"
@@ -161,7 +165,7 @@ end
 
 systemd_service "overpass-area-dispatcher" do
   description "Overpass Area Dispatcher"
-  after ["overpass-dispatcher"]
+  after ["overpass-dispatcher.service"]
   working_directory basedir
   exec_start "#{basedir}/bin/dispatcher --areas #{meta_map_short[node[:overpass][:meta_mode]]} --db-dir=#{basedir}/db"
   exec_stop "#{basedir}/bin/dispatcher --areas --terminate"
@@ -175,43 +179,46 @@ end
 
 systemd_service "overpass-update" do
   description "Overpass Update Application"
-  after ["overpass-dispatcher"]
+  after ["overpass-dispatcher.service"]
+  wants ["overpass-area-processor.service"]
   working_directory basedir
   exec_start "#{basedir}/bin/overpass-update-db"
   standard_output "append:#{logdir}/update.log"
   user username
+  restart "on-success"
 end
 
 if node[:overpass][:meta_mode] == "attic"
   systemd_service "overpass-area-processor" do
     description "Overpass Area Processor"
-    after ["overpass-area-dispatcher"]
+    after ["overpass-area-dispatcher.service", "overpass-update.service"]
     working_directory basedir
     exec_start "#{basedir}/bin/overpass-update-areas"
     standard_output "append:#{logdir}/area-processor.log"
+    restart "on-success"
     nice 19
     user username
   end
 else
   systemd_service "overpass-area-processor" do
     description "Overpass Area Processor"
-    after ["overpass-area-dispatcher"]
+    after ["overpass-area-dispatcher.service", "overpass-update.service"]
     working_directory basedir
     exec_start "#{basedir}/bin/osm3s_query --progress --rules"
     standard_input "file:#{srcdir}/rules/areas.osm3s"
     standard_output "append:#{logdir}/area-processor.log"
+    restart "on-success"
     nice 19
     user username
   end
 end
 
 systemd_timer "overpass-area-processor" do
-  description "Update areas in Overpass"
-  on_calendar "*-*-* *:*:00"
+  action :delete
 end
 
 service "overpass-area-processor" do
-  action [:enable]
+  action [:disable]
 end
 
 template "/etc/logrotate.d/overpass" do
@@ -239,3 +246,12 @@ end
     conf_variables :user => username
   end
 end
+
+prometheus_exporter "overpass" do
+  port 9898
+  user username
+  restrict_address_families "AF_UNIX"
+  options [
+    "--overpass.base-directory=#{basedir}"
+  ]
+end
index 47e1363813592d994d51f03fd2bf48a30e33ae65..8ccd28a9d3eae34cfe2e2eabcca8614a03073144 100644 (file)
 
         DocumentRoot <%= @directory %>
 
+        RewriteEngine on
         RewriteMap totp prg:/srv/query.openstreetmap.org/apache/totp-filter
         RewriteCond ${totp:%{HTTP_COOKIE}} =0
-        RewriteRule ^.*$ - [F,L]
+        RewriteRule ^/query-features - [F,L]
 
 <% if node[:overpass][:restricted_api] -%>
         ScriptAlias /query-features <%= @script_directory %>/interpreter
@@ -39,6 +40,7 @@
         # Remove Origin so Overpass does not interfere.
         RequestHeader unset Origin
         Header always add Access-Control-Allow-Origin %{AccessControlAllowOrigin}e env=AccessControlAllowOrigin
+        Header always add Access-Control-Allow-Credentials true
 <% else -%>
         ScriptAlias /api/ <%= @script_directory %>/
 <% end -%>
index 5ac8d15701dc5115b6f7ef59e8e8337cc6709d7e..09b8648fb4eeb075a52f20403f6706bc07e519ef 100644 (file)
@@ -13,35 +13,33 @@ META=--keep-attic
 META=
 <% end -%>
 
-while true; do
-  status=3 # make it sleep on issues
+status=3 # make it sleep on issues
 
-  if [ -f <%= @basedir %>/db/replicate-id ]; then
-    # first apply any pending updates
-    if [ -f <%= @basedir %>/diffs/latest.osc ]; then
-      DATA_VERSION=`osmium fileinfo -e -g data.timestamp.last <%= @basedir %>/diffs/latest.osc`
-      if [ "x$DATA_VERSION" != "x" ]; then
-        echo "Downloaded up to timestamp $DATA_VERSION"
-        while ! <%= @basedir %>/bin/update_from_dir --osc-dir=<%= @basedir %>/diffs --version=$DATA_VERSION $META --flush-size=0; do
-          echo "Error while updating. Retry in 1 min."
-          sleep 60
-        done
-      fi
-      rm <%= @basedir %>/diffs/latest.osc
+if [ -f <%= @basedir %>/db/replicate-id ]; then
+  # first apply any pending updates
+  if [ -f <%= @basedir %>/diffs/latest.osc ]; then
+    DATA_VERSION=`osmium fileinfo -e -g data.timestamp.last <%= @basedir %>/diffs/latest.osc`
+    if [ "x$DATA_VERSION" != "x" ]; then
+      echo "Downloaded up to timestamp $DATA_VERSION"
+      while ! <%= @basedir %>/bin/update_from_dir --osc-dir=<%= @basedir %>/diffs --version=$DATA_VERSION $META --flush-size=0; do
+        echo "Error while updating. Retry in 1 min."
+        sleep 60
+      done
     fi
-
-    $PYOSMIUM -v -s 1000 -o <%= @basedir %>/diffs/latest.osc
-    status=$?
-  fi
-
-  if [ $status -eq 0 ]; then
-    echo "Downloaded next batch."
-  elif [ $status -eq 3 ]; then
     rm <%= @basedir %>/diffs/latest.osc
-    echo "No new data, sleeping for a minute."
-    sleep 60
-  else
-    echo "Fatal error, stopping updates."
-    exit $status
   fi
-done
+
+  $PYOSMIUM -v -s 1000 -o <%= @basedir %>/diffs/latest.osc
+  status=$?
+fi
+
+if [ $status -eq 0 ]; then
+  echo "Downloaded next batch."
+elif [ $status -eq 3 ]; then
+  rm <%= @basedir %>/diffs/latest.osc
+  echo "No new data, sleeping for a minute."
+  sleep 60
+else
+  echo "Fatal error, stopping updates."
+  exit $status
+fi
index 75145c63213d0121a3f2b96f103801a3c5f4449a..8245f2ae3ace64ecf753526b3829313ca95e8675 100644 (file)
@@ -1,17 +1,21 @@
 #!/usr/bin/ruby
 
-requrie "cgi"
+require "cgi"
 require "rotp"
 
 totp = ROTP::TOTP.new("<%= @totp_key %>", :interval => 3600)
 
 STDIN.each_line do |header|
-  cookies = CGI::Cookie.parse(header)
+  cookies = CGI::Cookie.parse(header.chomp)
 
-  if totp.verify(cookies["_osm_totp_token"], :drift_behind => 3600, :drift_ahead => 3600)
-    puts "1"
+  if cookie = cookies.fetch("_osm_totp_token", nil)
+    if totp.verify(cookie.value.first, :drift_behind => 3600, :drift_ahead => 3600)
+      STDOUT.syswrite("1\n")
+    else
+      STDOUT.syswrite("0\n")
+    end
   else
-    puts "0"
+    STDOUT.syswrite("0\n")
   end
 end
 
diff --git a/cookbooks/oxidized/README.md b/cookbooks/oxidized/README.md
new file mode 100644 (file)
index 0000000..55cfbc5
--- /dev/null
@@ -0,0 +1,4 @@
+# oxidized cookbook
+
+This cookbook installs and configures [oxidized](https://github.com/ytti/oxidized) to
+backup the configurations of OpenStreetMap equipment.
diff --git a/cookbooks/oxidized/attributes/default.rb b/cookbooks/oxidized/attributes/default.rb
new file mode 100644 (file)
index 0000000..cd69a5d
--- /dev/null
@@ -0,0 +1 @@
+default[:accounts][:users][:oxidized][:status] = :role
diff --git a/cookbooks/oxidized/metadata.rb b/cookbooks/oxidized/metadata.rb
new file mode 100644 (file)
index 0000000..1826280
--- /dev/null
@@ -0,0 +1,11 @@
+name              "oxidized"
+maintainer        "OpenStreetMap Administrators"
+maintainer_email  "admins@openstreetmap.org"
+license           "Apache-2.0"
+description       "Configures oxidized to backup equipment configuration"
+
+version           "1.0.0"
+supports          "ubuntu"
+depends           "accounts"
+depends           "git"
+depends           "ruby"
diff --git a/cookbooks/oxidized/recipes/default.rb b/cookbooks/oxidized/recipes/default.rb
new file mode 100644 (file)
index 0000000..7e4803c
--- /dev/null
@@ -0,0 +1,165 @@
+#
+# Cookbook:: oxidized
+# Recipe:: default
+#
+# Copyright:: 2022, 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 "git"
+include_recipe "ruby"
+
+package %w[
+  gcc
+  g++
+  make
+  cmake
+  libssl-dev
+  libssh2-1-dev
+  zlib1g-dev
+  pkg-config
+]
+
+keys = data_bag_item("oxidized", "keys")
+devices = data_bag_item("oxidized", "devices")
+
+directory "/etc/oxidized" do
+  owner "root"
+  group "root"
+  mode "755"
+end
+
+template "/etc/oxidized/config" do
+  source "config.erb"
+  owner "oxidized"
+  group "oxidized"
+  mode "444"
+  notifies :restart, "service[oxidized]"
+end
+
+template "/etc/oxidized/routers.db" do
+  source "routers.db.erb"
+  owner "oxidized"
+  group "oxidized"
+  mode "400"
+  variables :devices => devices
+  notifies :restart, "service[oxidized]"
+end
+
+directory "/var/log/oxidized" do
+  owner "oxidized"
+  group "oxidized"
+  mode "755"
+end
+
+directory "/opt/oxidized" do
+  owner "oxidized"
+  group "oxidized"
+  mode "755"
+end
+
+git "/opt/oxidized/daemon" do
+  action :sync
+  repository "https://github.com/openstreetmap/oxidized.git"
+  depth 1
+  user "oxidized"
+  group "oxidized"
+  notifies :run, "bundle_install[/opt/oxidized/daemon]", :immediately
+end
+
+directory "/opt/oxidized/.ssh" do
+  owner "oxidized"
+  group "oxidized"
+  mode "700"
+end
+
+# Key is set as a deployment key in github repo
+file "/opt/oxidized/.ssh/id_ed25519" do
+  content keys["git"].join("\n")
+  owner "oxidized"
+  group "oxidized"
+  mode "400"
+  notifies :delete, "file[/opt/oxidized/.ssh/id_ed25519.pub]", :immediately
+  notifies :restart, "service[oxidized]"
+end
+
+# Ensure public key is deleted if private key is changed. Trigged by notify
+file "/opt/oxidized/.ssh/id_ed25519.pub" do
+  action :nothing
+end
+
+execute "/opt/oxidized/.ssh/id_ed25519.pub" do
+  command "ssh-keygen -f /opt/oxidized/.ssh/id_ed25519 -y > /opt/oxidized/.ssh/id_ed25519.pub"
+  user "oxidized"
+  group "oxidized"
+  creates "/opt/oxidized/.ssh/id_ed25519.pub"
+  notifies :restart, "service[oxidized]"
+end
+
+ssh_known_hosts_entry "github.com" do
+  action [:create, :flush]
+  file_location "/opt/oxidized/.ssh/known_hosts"
+  owner "oxidized"
+  group "oxidized"
+end
+
+directory "/var/lib/oxidized" do
+  owner "oxidized"
+  group "oxidized"
+  mode "750"
+end
+
+git "/var/lib/oxidized/configs.git" do
+  action :sync
+  repository "git@github.com:openstreetmap/oxidized-configs.git" # Uses oxidized ssh key
+  checkout_branch "master" # branch is hardcoded in oxidized
+  user "oxidized"
+  group "oxidized"
+end
+
+bundle_install "/opt/oxidized/daemon" do
+  action :nothing
+  options "--deployment"
+  user "oxidized"
+  group "oxidized"
+  notifies :restart, "service[oxidized]"
+end
+
+# Based on https://github.com/ytti/oxidized/blob/master/extra/oxidized.service
+systemd_service "oxidized" do
+  description "oxidized network device backup daemon"
+  after "network.target"
+  user "oxidized"
+  working_directory "/opt/oxidized/daemon"
+  runtime_directory "oxidized"
+  exec_start "#{node[:ruby][:bundle]} exec oxidized"
+  environment "OXIDIZED_HOME" => "/etc/oxidized",
+              "OXIDIZED_LOGS" => "/var/log/oxidized"
+  nice 10
+  sandbox :enable_network => true
+  read_write_paths ["/run/oxidized", "/var/lib/oxidized", "/var/log/oxidized"]
+  restart "on-failure"
+  notifies :restart, "service[oxidized]"
+end
+
+service "oxidized" do
+  action [:enable, :start]
+end
+
+template "/etc/logrotate.d/oxidized" do
+  source "logrotate.erb"
+  owner "root"
+  group "root"
+  mode "644"
+end
diff --git a/cookbooks/oxidized/templates/default/config.erb b/cookbooks/oxidized/templates/default/config.erb
new file mode 100644 (file)
index 0000000..a8684ca
--- /dev/null
@@ -0,0 +1,39 @@
+---
+# DO NOT EDIT - This file is being maintained by Chef
+rest: false
+timeout: 60
+vars:
+  remove_secret: true
+pid: "/run/oxidized/oxidized.pid"
+crash:
+  directory: /var/lib/oxidized/crashes
+input:
+  default: ssh
+output:
+  default: git
+  git:
+    single_repo: true
+    user: oxidized
+    email: oxidized@openstreetmap.org
+    repo: "/var/lib/oxidized/configs.git"
+hooks:
+  push_to_remote:
+    type: githubrepo
+    events: [post_store]
+    remote_repo: git@github.com:openstreetmap/oxidized-configs.git
+    privatekey: /opt/oxidized/.ssh/id_ed25519
+source:
+  default: csv
+  csv:
+    file: "/etc/oxidized/routers.db"
+    delimiter: !ruby/regexp /:/
+    map:
+      name: 0
+      model: 1
+      input: 2
+      username: 3
+      password: 4
+model_map:
+  juniper: junos
+  apc: apc_aos
+  ciscocmb: ciscosmb
diff --git a/cookbooks/oxidized/templates/default/logrotate.erb b/cookbooks/oxidized/templates/default/logrotate.erb
new file mode 100644 (file)
index 0000000..81adecb
--- /dev/null
@@ -0,0 +1,10 @@
+# DO NOT EDIT - This file is being maintained by Chef
+
+/var/log/oxidized/*.log {
+    rotate 12
+    weekly
+    size 10M
+    compress
+    delaycompress
+    missingok
+}
diff --git a/cookbooks/oxidized/templates/default/routers.db.erb b/cookbooks/oxidized/templates/default/routers.db.erb
new file mode 100644 (file)
index 0000000..9a7bf02
--- /dev/null
@@ -0,0 +1,4 @@
+# DO NOT EDIT - This file is being maintained by Chef
+<% @devices[:hardware].keys.sort.each do |d| -%>
+<%= d -%>:<%= @devices[:hardware][d][:device] -%>:<%= @devices[:hardware][d][:input] -%>:<%= @devices[:hardware][d][:username] -%>:<%= @devices[:hardware][d][:password] %>
+<% end -%>
index 2ac125c126008d471d9c58576619bcc500420a0d..1540a8592e58cc6e37204cb3ff20fdd7d2b176fb 100644 (file)
@@ -1,5 +1,3 @@
 default[:passenger][:max_pool_size] = 6
 default[:passenger][:pool_idle_time] = 300
 default[:passenger][:instance_registry_dir] = "/run/passenger"
-
-default[:apt][:sources] = node[:apt][:sources] | ["passenger"]
index f8ea95808c4ac38dcb21c9d85e5ee63b69d4d1fc..47b4018b711d49f2dc08d795e9fb748ed608eae8 100644 (file)
@@ -18,7 +18,7 @@
 #
 
 include_recipe "apache"
-include_recipe "apt"
+include_recipe "apt::passenger"
 include_recipe "munin"
 include_recipe "prometheus"
 include_recipe "ruby"
@@ -53,5 +53,7 @@ munin_plugin "passenger_requests"
 
 prometheus_exporter "passenger" do
   port 9149
+  user "root"
   environment "PASSENGER_INSTANCE_REGISTRY_DIR" => node[:passenger][:instance_registry_dir]
+  restrict_address_families "AF_UNIX"
 end
index 657f3b51b285e9d6302219c28fff1c855d8b593c..3ac51d0b7986b4aa2c7425219501b79cfdd0d48a 100644 (file)
@@ -53,9 +53,11 @@ action :create do
   if new_resource.prometheus_port
     prometheus_exporter "phpfpm" do
       port new_resource.prometheus_port
+      restrict_address_families "AF_UNIX"
       service service_name
+      group "www-data"
       command "server"
-      options "--phpfpm.scrape-uri=#{scrape_uri}"
+      options "--phpfpm.scrape-uri=#{scrape_uri} --phpfpm.fix-process-count"
     end
   else
     prometheus_exporter "phpfpm" do
@@ -93,7 +95,7 @@ action_class do
     if new_resource.port
       "tcp://127.0.0.1:#{new_resource.port}/status"
     else
-      "unix:///run/php/#{new_resource.pool}.sock;/status"
+      "unix:///run/php/php-#{new_resource.pool}-fpm.sock;/status"
     end
   end
 end
index 1877b7bef246615ba3116d79f10b947bed854c2f..cec611ade00ddb7df24b66f123e5931b80ef0313 100644 (file)
@@ -5,7 +5,7 @@
 listen = 127.0.0.1:<%= @port %>
 listen.backlog = 256
 <% else -%>
-listen = /run/php/<%= @pool %>.sock
+listen = /run/php/php-<%= @pool %>-fpm.sock
 listen.owner = www-data
 listen.group = www-data
 <% end -%>
index f01d8acc4b11744b68c2d19e7ffef3d98fda4b5c..7c8a60466ae572bd12973a0a4b3bb592bf1be597 100644 (file)
@@ -4,5 +4,3 @@ default[:planet][:dump][:xml_directory] = "/store/planet/planet"
 default[:planet][:dump][:xml_history_directory] = "/store/planet/planet/full-history"
 default[:planet][:dump][:pbf_directory] = "/store/planet/pbf"
 default[:planet][:dump][:pbf_history_directory] = "/store/planet/pbf/full-history"
-
-default[:planet][:current][:jobs] = {}
diff --git a/cookbooks/planet/files/default/ccbysa_cgi/HEADER.cgi b/cookbooks/planet/files/default/ccbysa_cgi/HEADER.cgi
new file mode 100644 (file)
index 0000000..9e68c94
--- /dev/null
@@ -0,0 +1,14 @@
+#!/usr/bin/python3
+
+print( """
+<html>
+ <head>
+  <title>OpenStreetMap historical CC BY-SA 2.0 licensed data</title>
+  <link href="/style.css" rel="stylesheet" type="text/css">
+ </head>
+ <body>
+<img id="logo" src="/logo.png" alt="OSM logo" width="128" height="128">
+<h1>planet.openstreetmap.org - cc by-sa</h1>
+<p>Licensed under the <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC BY-SA 2.0</a></p>
+<p>&nbsp;</p>
+""")
index c7175e6e17ebd0b55597b55a2d33f93ce1c79176..517123f5913219f97a73d9402c419e81415bdac7 100644 (file)
@@ -17,6 +17,8 @@
 # limitations under the License.
 #
 
+node.default[:accounts][:users][:planet][:status] = :role
+
 include_recipe "accounts"
 
 package %w[
@@ -30,13 +32,6 @@ template "/usr/local/bin/planet-update" do
   mode "755"
 end
 
-template "/usr/local/bin/planet-update-file" do
-  source "planet-update-file.erb"
-  owner "root"
-  group "root"
-  mode "755"
-end
-
 directory "/var/lib/planet" do
   owner "planet"
   group "planet"
@@ -52,16 +47,11 @@ remote_file "/var/lib/planet/planet.osh.pbf" do
   not_if { kitchen? }
 end
 
-cron_d "planet-update" do
-  minute "37"
-  hour "1"
-  user "root"
-  command "/usr/local/bin/planet-update"
-end
-
-template "/etc/logrotate.d/planet-update" do
-  source "planet-update.logrotate.erb"
-  owner "root"
-  group "root"
-  mode "644"
+systemd_service "planet-update" do
+  description "Planet file update"
+  type "oneshot"
+  exec_start "/usr/local/bin/planet-update"
+  user "planet"
+  sandbox :enable_network => true
+  read_write_paths "/var/lib/planet"
 end
index 2a5fdfee16a3b56031fa0bb27b248aa8085bad33..4dbd51a7da37e46b6aca4d288cdc85cc905ff4cd 100644 (file)
@@ -58,6 +58,16 @@ remote_directory node[:planet][:dump][:xml_history_directory] do
   files_mode "755"
 end
 
+remote_directory "/store/planet/cc-by-sa" do
+  source "ccbysa_cgi"
+  owner "www-data"
+  group "planet"
+  mode "775"
+  files_owner "root"
+  files_group "root"
+  files_mode "755"
+end
+
 remote_directory "/store/planet/cc-by-sa/full-experimental" do
   source "ccbysa_history_cgi"
   owner "www-data"
@@ -120,19 +130,29 @@ end
 
 munin_plugin "planet_age"
 
-template "/usr/local/bin/old-planet-file-cleanup" do
-  source "old-planet-file-cleanup.erb"
+template "/usr/local/bin/planet-file-cleanup" do
+  source "planet-file-cleanup.erb"
   owner "root"
   group "root"
   mode "755"
 end
 
-cron_d "old-planet-file-cleanup" do
-  comment "run this on the first monday of the month at 3:44am"
-  minute "44"
-  hour "3"
-  day "1-7"
+systemd_service "planet-file-cleanup" do
+  description "Cleanup old planet files"
+  exec_start "/usr/local/bin/planet-file-cleanup --debug"
   user "www-data"
-  command "test $(date +\\%u) -eq 1 && /usr/local/bin/old-planet-file-cleanup --debug"
-  mailto "zerebubuth@gmail.com"
+  sandbox true
+  read_write_paths [
+    node[:planet][:dump][:xml_directory],
+    node[:planet][:dump][:pbf_directory]
+  ]
+end
+
+systemd_timer "planet-file-cleanup" do
+  description "Cleanup old planet files"
+  on_calendar "Mon *-*-1..7 03:44"
+end
+
+service "planet-file-cleanup.timer" do
+  action [:enable, :start]
 end
index 5e236c6bb6d5037b736da3a91bd5506e171192f2..39c8196dd64d3dd1459b5cf9a93e890ec9e26983 100644 (file)
@@ -61,7 +61,7 @@ end
 git "/opt/planet-dump-ng" do
   action :sync
   repository "https://github.com/zerebubuth/planet-dump-ng.git"
-  revision "v1.2.4"
+  revision "v1.2.6"
   depth 1
   user "root"
   group "root"
@@ -115,15 +115,31 @@ systemd_service "planetdump@" do
   user "www-data"
   exec_start "/usr/local/bin/planetdump %i"
   memory_max "64G"
-  private_tmp true
-  protect_system "full"
-  protect_home true
-  read_write_paths "/var/log/exim4"
+  sandbox true
+  read_write_paths [
+    "/store/planetdump",
+    "/store/planet/pbf",
+    "/store/planet/planet",
+    "/var/log/exim4",
+    "/var/spool/exim4"
+  ]
 end
 
-cron_d "planet-dump-mirror" do
-  minute "*/10"
+systemd_service "planet-dump-mirror" do
+  description "Update planet dump mirrors"
+  exec_start "/usr/local/bin/planet-mirror-redirect-update"
   user "www-data"
-  command "/usr/local/bin/planet-mirror-redirect-update"
-  mailto "horntail-www-data-cron@firefishy.com"
+  sandbox :enable_network => true
+  memory_deny_write_execute false
+  read_write_paths "/store/planet/.htaccess"
+end
+
+systemd_timer "planet-dump-mirror" do
+  description "Update planet dump mirrors"
+  on_boot_sec "10min"
+  on_unit_inactive_sec "10min"
+end
+
+service "planet-dump-mirror.timer" do
+  action [:enable, :start]
 end
index bccbb0fcf11a3fca95f431d0ffae851b3873dcbf..3f0e2c996afcb5dbd69ad97ee7c336d4ff75e8cd 100644 (file)
@@ -50,19 +50,43 @@ template "/usr/local/bin/planet-notes-dump" do
   variables :password => db_passwords["planetdump"]
 end
 
-cron_d "planet-notes-dump" do
-  minute "0"
-  hour "3"
+systemd_service "planet-notes-dump" do
+  description "Create notes dump"
+  exec_start "/usr/local/bin/planet-notes-dump"
   user "www-data"
-  command "/usr/local/bin/planet-notes-dump"
-  mailto "grant-smaug@firefishy.com"
+  sandbox :enable_network => true
+  read_write_paths "/store/planet/notes"
 end
 
-cron_d "planet-notes-cleanup" do
-  comment "Delete Planet Notes dump files older than 8 days"
-  minute "10"
-  hour "8"
+systemd_timer "planet-notes-dump" do
+  description "Create notes dump"
+  on_calendar "03:00"
+end
+
+service "planet-notes-dump.timer" do
+  action [:enable, :start]
+end
+
+template "/usr/local/bin/planet-notes-cleanup" do
+  source "planet-notes-cleanup.erb"
+  owner "root"
+  group "root"
+  mode "755"
+end
+
+systemd_service "planet-notes-cleanup" do
+  description "Delete old notes dumps"
+  exec_start "/usr/local/bin/planet-notes-cleanup"
   user "www-data"
-  command "find /store/planet/notes/20??/ -maxdepth 1 -type f -iname 'planet-notes-??????.osn*' -printf '\%T@ \%p\n' | sort -k 1nr | sed 's/^[^ ]* //' | tail -n +17 | xargs -r rm -f"
-  mailto "grant-smaug@firefishy.com"
+  sandbox true
+  read_write_paths "/store/planet/notes"
+end
+
+systemd_timer "planet-notes-cleanup" do
+  description "Delete old notes dumps"
+  on_calendar "08:10"
+end
+
+service "planet-notes-cleanup.timer" do
+  action [:enable, :start]
 end
index a31f98288c3217f71152552f95be266f777a64c7..fa9649a3897b19747d68bcadddc38d210e216ea3 100644 (file)
@@ -161,12 +161,9 @@ systemd_service "users-agreed" do
   description "Update list of users accepting CTs"
   user "planet"
   exec_start "/usr/local/bin/users-agreed"
-  private_tmp true
-  private_devices true
-  protect_system "full"
-  protect_home true
-  restrict_address_families %w[AF_INET AF_INET6]
-  no_new_privileges true
+  nice 10
+  sandbox :enable_network => true
+  read_write_paths "/store/planet/users_agreed"
 end
 
 systemd_timer "users-agreed" do
@@ -178,12 +175,9 @@ systemd_service "users-deleted" do
   description "Update list of deleted users"
   user "planet"
   exec_start "/usr/local/bin/users-deleted"
-  private_tmp true
-  private_devices true
-  protect_system "full"
-  protect_home true
-  restrict_address_families %w[AF_INET AF_INET6]
-  no_new_privileges true
+  nice 10
+  sandbox :enable_network => true
+  read_write_paths "/store/planet/users_deleted"
 end
 
 systemd_timer "users-deleted" do
@@ -211,12 +205,11 @@ systemd_service "replication-changesets" do
   description "Changesets replication"
   user "planet"
   exec_start "/usr/local/bin/replicate-changesets /etc/replication/changesets.conf"
-  private_tmp true
-  private_devices true
-  protect_system "full"
-  protect_home true
-  restrict_address_families %w[AF_INET AF_INET6]
-  no_new_privileges true
+  sandbox :enable_network => true
+  read_write_paths [
+    "/run/replication",
+    "/store/planet/replication/changesets"
+  ]
 end
 
 systemd_timer "replication-changesets" do
@@ -272,12 +265,12 @@ systemd_service "replication-minutely" do
   user "planet"
   working_directory "/etc/replication"
   exec_start "/usr/local/bin/replicate-minute"
-  private_tmp true
-  private_devices true
-  protect_system "full"
-  protect_home true
-  restrict_address_families %w[AF_INET AF_INET6]
-  no_new_privileges true
+  sandbox :enable_network => true
+  read_write_paths [
+    "/run/replication",
+    "/store",
+    "/var/lib/replication/minute"
+  ]
 end
 
 systemd_timer "replication-minutely" do
@@ -318,12 +311,12 @@ systemd_service "replication-hourly" do
   user "planet"
   exec_start "/usr/local/bin/osmosis -q --merge-replication-files workingDirectory=/var/lib/replication/hour"
   environment "LD_PRELOAD" => "/opt/flush/flush.so"
-  private_tmp true
-  private_devices true
-  protect_system "full"
-  protect_home true
-  restrict_address_families %w[AF_INET AF_INET6]
-  no_new_privileges true
+  sandbox :enable_network => true
+  memory_deny_write_execute false
+  read_write_paths [
+    "/store/planet/replication/hour",
+    "/var/lib/replication/hour"
+  ]
 end
 
 systemd_timer "replication-hourly" do
@@ -362,12 +355,12 @@ systemd_service "replication-daily" do
   user "planet"
   exec_start "/usr/local/bin/osmosis -q --merge-replication-files workingDirectory=/var/lib/replication/day"
   environment "LD_PRELOAD" => "/opt/flush/flush.so"
-  private_tmp true
-  private_devices true
-  protect_system "full"
-  protect_home true
-  restrict_address_families %w[AF_INET AF_INET6]
-  no_new_privileges true
+  sandbox :enable_network => true
+  memory_deny_write_execute false
+  read_write_paths [
+    "/store/planet/replication/day",
+    "/var/lib/replication/day"
+  ]
 end
 
 systemd_timer "replication-daily" do
@@ -381,12 +374,8 @@ systemd_service "replication-cleanup" do
   description "Cleanup replication"
   user "planet"
   exec_start "/usr/local/bin/replicate-cleanup"
-  private_tmp true
-  private_devices true
-  private_network true
-  protect_system "full"
-  protect_home true
-  no_new_privileges true
+  sandbox true
+  read_write_paths "/var/lib/replication"
 end
 
 systemd_timer "replication-cleanup" do
diff --git a/cookbooks/planet/templates/default/planet-notes-cleanup.erb b/cookbooks/planet/templates/default/planet-notes-cleanup.erb
new file mode 100644 (file)
index 0000000..6c248c2
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+exec find /store/planet/notes/20?? -maxdepth 1 -type f -iname 'planet-notes-??????.osn*' -printf '%T@ %p\n' | \
+  sort -k 1nr | \
+  sed 's/^[^ ]* //' | \
+  tail -n +17 | \
+  xargs -r rm -f
diff --git a/cookbooks/planet/templates/default/planet-update-file.erb b/cookbooks/planet/templates/default/planet-update-file.erb
deleted file mode 100644 (file)
index 73a778b..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/sh
-
-# DO NOT EDIT - This file is being maintained by Chef
-
-# setup
-
-SUFFIX="osh.pbf"
-
-PLANETDIR="/var/lib/planet"
-PLANETPREV="${PLANETDIR}/planet-previous.${SUFFIX}"
-PLANETCURR="${PLANETDIR}/planet.${SUFFIX}"
-PLANETNEW="${PLANETDIR}/planet-new.${SUFFIX}"
-
-pyosmium-up-to-date -vvv -o "$PLANETNEW" "$PLANETCURR"
-retval=$?
-
-while [ $retval -eq 1 ]; do
-    mv "$PLANETCURR" "$PLANETPREV"
-    mv "$PLANETNEW" "$PLANETCURR"
-    pyosmium-up-to-date -vvv -o "$PLANETNEW" "$PLANETCURR"
-    retval=$?
-done
-
-if [ $retval -ne 0 ]; then
-    exit $retval
-fi
-
-# cleanup
-
-mv "$PLANETCURR" "$PLANETPREV"
-mv "$PLANETNEW" "$PLANETCURR"
index 4c00592b9b0c74684b09f48bde497e2f0cadbbc2..73a778bbaaa812c9bd33455683f0e05b0b41d3d7 100644 (file)
@@ -2,18 +2,30 @@
 
 # DO NOT EDIT - This file is being maintained by Chef
 
-exec >> /var/log/planet-update.log 2>&1
+# setup
 
-echo "Updating planet file..."
+SUFFIX="osh.pbf"
 
-/sbin/runuser -u planet -- /usr/local/bin/planet-update-file
+PLANETDIR="/var/lib/planet"
+PLANETPREV="${PLANETDIR}/planet-previous.${SUFFIX}"
+PLANETCURR="${PLANETDIR}/planet.${SUFFIX}"
+PLANETNEW="${PLANETDIR}/planet-new.${SUFFIX}"
 
-echo "Running jobs..."
-<% node[:planet][:current][:jobs].each_value do |job| -%>
+pyosmium-up-to-date -vvv -o "$PLANETNEW" "$PLANETCURR"
+retval=$?
 
-echo "Running '<%= job[:command] %>' as user '<%= job[:user] %>'..."
+while [ $retval -eq 1 ]; do
+    mv "$PLANETCURR" "$PLANETPREV"
+    mv "$PLANETNEW" "$PLANETCURR"
+    pyosmium-up-to-date -vvv -o "$PLANETNEW" "$PLANETCURR"
+    retval=$?
+done
 
-/sbin/runuser -u "<%= job[:user] %>" -- "<%= job[:command] %>"
-<% end -%>
+if [ $retval -ne 0 ]; then
+    exit $retval
+fi
 
-echo "Done."
+# cleanup
+
+mv "$PLANETCURR" "$PLANETPREV"
+mv "$PLANETNEW" "$PLANETCURR"
diff --git a/cookbooks/planet/templates/default/planet-update.logrotate.erb b/cookbooks/planet/templates/default/planet-update.logrotate.erb
deleted file mode 100644 (file)
index a3ca8ac..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-/var/log/planet-update.log {
-       compress
-       notifempty
-       missingok
-}
index c7f8b2658cfb6c55c166492d4c38298226b96c0a..6b3a83656bac446190ec92c7bb1f2138988ff16d 100644 (file)
@@ -26,13 +26,6 @@ if [ -f /tmp/planetdump.lock ]; then
     fi
 fi
 
-# Redirect this shell's output to a file. This is so that it
-# can be emailed later, since this script is run from incron
-# and incron doesn't yet support MAILTO like cron does. The
-# command below appears to work in bash as well as dash.
-logfile="/tmp/planetdump.log.$$"
-exec > "${logfile}" 2>&1
-
 # Create lock file
 echo $$ > /tmp/planetdump.lock
 
@@ -40,16 +33,6 @@ echo $$ > /tmp/planetdump.lock
 function cleanup {
     # Remove the lock file
     rm /tmp/planetdump.lock
-
-    # Send an email with the output, since incron doesn't yet
-    # support doing this in the incrontab
-    if [[ -s "$logfile" ]]
-    then
-        mailx -s "Planet dump output: ${file}" admins@openstreetmap.org zerebubuth@gmail.com < "${logfile}"
-    fi
-
-    # Remove the log file
-    rm -f "${logfile}"
 }
 
 # Remove lock on exit
@@ -99,10 +82,8 @@ function mk_torrent {
      -w "https://ftp5.gwdg.de/pub/misc/openstreetmap/planet.openstreetmap.org/${web_path}" \
      -w "https://ftpmirror.your.org/pub/openstreetmap/${web_path}" \
      -w "https://mirror.init7.net/openstreetmap/${web_path}" \
-     -w "https://free.nchc.org.tw/osm.planet/${web_path}" \
      -w "https://ftp.fau.de/osm-planet/${web_path}" \
      -w "https://ftp.spline.de/pub/openstreetmap/${web_path}" \
-     -w "https://osm.openarchive.site/${name}" \
      -w "https://downloads.opencagedata.com/planet/${name}" \
      -w "https://planet.osm-hr.org/${web_path}" \
      -w "https://planet.maps.mail.ru/${web_path}" \
index 770c0dbeacf1b3eccbf40e14ccf715318e055945..568e53b5768a2cbc312185b9d8ec9e6d622098e1 100644 (file)
@@ -49,5 +49,3 @@ default[:postgresql][:settings][:defaults][:user_name_maps] = {}
 default[:postgresql][:settings][:defaults][:early_authentication_rules] = []
 default[:postgresql][:settings][:defaults][:late_authentication_rules] = []
 default[:postgresql][:settings][:defaults][:standby_mode] = "off"
-
-default[:apt][:sources] = node[:apt][:sources] | ["postgresql"]
index b5e7be908ceea5ac55e52b525d3ef732bdc755bb..a57e1b3481f3918d011342bcc559940ce5cba9d6 100644 (file)
@@ -17,7 +17,7 @@
 # limitations under the License.
 #
 
-include_recipe "apt"
+include_recipe "apt::postgresql"
 include_recipe "munin"
 include_recipe "prometheus"
 
@@ -174,10 +174,13 @@ end
 
 prometheus_exporter "postgres" do
   port 9187
+  scrape_interval "1m"
+  scrape_timeout "1m"
   user "postgres"
   options "--extend.query-path=/etc/prometheus/exporters/postgres_queries.yml"
   environment "DATA_SOURCE_URI" => uris.sort.uniq.first,
               "PG_EXPORTER_AUTO_DISCOVER_DATABASES" => "true",
               "PG_EXPORTER_EXCLUDE_DATABASES" => "postgres,template0,template1"
+  restrict_address_families "AF_UNIX"
   subscribes :restart, "template[/etc/prometheus/exporters/postgres_queries.yml]"
 end
index f513b33e7662cee3906b2f2acc158f951d13137b..37d854f7725221589d40bef998a6b9f153b0bd49 100644 (file)
@@ -1,5 +1,5 @@
 pg_replication:
-  query: "SELECT EXTRACT(EPOCH FROM (now() - pg_last_xact_replay_timestamp())) AS lag_seconds"
+  query: "SELECT CASE WHEN NOT pg_is_in_recovery() THEN 0 ELSE GREATEST (0, EXTRACT(EPOCH FROM (now() - pg_last_xact_replay_timestamp()))) END AS lag_seconds"
   master: true
   metrics:
     - lag_seconds:
@@ -16,7 +16,7 @@ pg_postmaster:
 <% if node[:postgresql][:monitor_tables] -%>
 
 pg_stat_user_tables:
-  query: "SELECT current_database() datname, schemaname, relname, seq_scan, seq_tup_read, idx_scan, idx_tup_fetch, n_tup_ins, n_tup_upd, n_tup_del, n_tup_hot_upd, n_live_tup, n_dead_tup, n_mod_since_analyze, COALESCE(last_vacuum, '1970-01-01Z'), COALESCE(last_vacuum, '1970-01-01Z') as last_vacuum, COALESCE(last_autovacuum, '1970-01-01Z') as last_autovacuum, COALESCE(last_analyze, '1970-01-01Z') as last_analyze, COALESCE(last_autoanalyze, '1970-01-01Z') as last_autoanalyze, vacuum_count, autovacuum_count, analyze_count, autoanalyze_count FROM pg_stat_user_tables"
+  query: "SELECT current_database() datname, schemaname, relname, seq_scan, seq_tup_read, idx_scan, idx_tup_fetch, n_tup_ins, n_tup_upd, n_tup_del, n_tup_hot_upd, n_live_tup, n_dead_tup, n_mod_since_analyze, COALESCE(last_vacuum, '1970-01-01Z') as last_vacuum, COALESCE(last_autovacuum, '1970-01-01Z') as last_autovacuum, COALESCE(last_analyze, '1970-01-01Z') as last_analyze, COALESCE(last_autoanalyze, '1970-01-01Z') as last_autoanalyze, vacuum_count, autovacuum_count, analyze_count, autoanalyze_count FROM pg_stat_user_tables"
   metrics:
     - datname:
         usage: "LABEL"
@@ -123,21 +123,6 @@ pg_statio_user_tables:
         description: "Number of buffer hits in this table's TOAST table indexes (if any)"
 <% end -%>
 
-pg_database:
-  query: "SELECT pg_database.oid AS datid, pg_database.datname, pg_database_size(pg_database.datname) AS size_bytes FROM pg_database"
-  master: true
-  cache_seconds: 30
-  metrics:
-    - datid:
-        usage: "LABEL"
-        description: "ID of the database"
-    - datname:
-        usage: "LABEL"
-        description: "Name of the database"
-    - size_bytes:
-        usage: "GAUGE"
-        description: "Disk space used by the database"
-
 pg_unfrozen_ids:
   query: "SELECT current_database() AS datname, max(age(relfrozenxid)) AS xid_age, max(mxid_age(relminmxid)) AS mxid_age FROM pg_class WHERE relkind IN ('r', 'm')"
   metrics:
index 1fe3790ab3571afe896d34b0c3b7c456781e082a..a104883e7b12079ca2a7900741fa58439c26300e 100644 (file)
@@ -3,8 +3,4 @@ default[:prometheus][:exporters] = {}
 default[:prometheus][:snmp] = {}
 default[:prometheus][:metrics] = {}
 default[:prometheus][:files] = []
-default[:prometheus][:promscale] = false
-
-if node[:recipes].include?("prometheus::server")
-  default[:apt][:sources] |= %w[grafana timescaledb]
-end
+default[:prometheus][:promscale] = true
index de601b766f64ea588a4dc331ca95707e727e2f28..0806061e6c594c565e373636d73c56ade1e0cf99 100644 (file)
@@ -99,6 +99,11 @@ end
 
 prometheus_exporter "node" do
   port 9100
+  user "root"
+  proc_subset "all"
+  protect_clock false
+  restrict_address_families %w[AF_UNIX AF_NETLINK]
+  system_call_filter ["@system-service", "@clock"]
   options %w[
     --collector.textfile.directory=/var/lib/prometheus/node-exporter
     --collector.interrupts
index 1556089265c5752a5c2d5f6bbe0eb21120fe845e..02bc587d4fb082516f5e22a84b6d6758cc808c1b 100644 (file)
@@ -18,7 +18,8 @@
 #
 
 include_recipe "apache"
-include_recipe "apt"
+include_recipe "apt::grafana"
+include_recipe "apt::timescaledb"
 include_recipe "networking"
 include_recipe "timescaledb"
 
@@ -40,14 +41,16 @@ end
 
 prometheus_exporter "statuscake" do
   port 9595
+  scrape_interval "5m"
+  scrape_timeout "2m"
   environment "STATUSCAKE_APIKEY" => tokens["statuscake"]
 end
 
 cache_dir = Chef::Config[:file_cache_path]
 
-prometheus_version = "2.31.1"
-alertmanager_version = "0.23.0"
-karma_version = "0.105"
+prometheus_version = "2.39.1"
+alertmanager_version = "0.24.0"
+karma_version = "0.108"
 
 directory "/opt/prometheus-server" do
   owner "root"
@@ -108,7 +111,7 @@ archive_file "#{cache_dir}/karma-linux-amd64.tar.gz" do
   subscribes :extract, "remote_file[#{cache_dir}/karma-linux-amd64.tar.gz]"
 end
 
-promscale_version = "0.13.0"
+promscale_version = "0.16.0"
 
 database_version = node[:timescaledb][:database_version]
 database_cluster = "#{database_version}/main"
@@ -155,10 +158,8 @@ systemd_service "promscale" do
   user "prometheus"
   exec_start "/opt/promscale/bin/promscale --db.uri postgresql:///promscale?host=/run/postgresql&port=5432 --db.connections-max 400"
   limit_nofile 16384
-  private_tmp true
-  protect_system "strict"
-  protect_home true
-  no_new_privileges true
+  sandbox :enable_network => true
+  restrict_address_families "AF_UNIX"
 end
 
 if node[:prometheus][:promscale]
@@ -203,12 +204,14 @@ search(:node, "recipes:prometheus\\:\\:default").sort_by(&:name).each do |client
       address = exporter[:address]
       sni = exporter[:sni]
       scrape_interval = exporter[:scrape_interval]
+      scrape_timeout = exporter[:scrape_timeout]
       metric_relabel = exporter[:metric_relabel] || []
     else
       name = key
       address = exporter
       sni = nil
       scrape_interval = nil
+      scrape_timeout = nil
       metric_relabel = []
     end
 
@@ -218,6 +221,7 @@ search(:node, "recipes:prometheus\\:\\:default").sort_by(&:name).each do |client
       :sni => sni,
       :instance => client.name.split(".").first,
       :scrape_interval => scrape_interval,
+      :scrape_timeout => scrape_timeout,
       :metric_relabel => metric_relabel
     }
   end
@@ -296,6 +300,10 @@ systemd_service "prometheus-alertmanager-executable" do
   notifies :restart, "service[prometheus-alertmanager]"
 end
 
+link "/usr/local/bin/promtool" do
+  to "/opt/prometheus-server/prometheus/promtool"
+end
+
 template "/etc/prometheus/alertmanager.yml" do
   source "alertmanager.yml.erb"
   owner "root"
@@ -309,13 +317,23 @@ service "prometheus-alertmanager" do
   subscribes :restart, "archive_file[#{cache_dir}/alertmanager.linux-amd64.tar.gz]"
 end
 
-template "/etc/prometheus/amtool.yml" do
+directory "/etc/amtool" do
+  owner "root"
+  group "root"
+  mode "755"
+end
+
+template "/etc/amtool/config.yml" do
   source "amtool.yml.erb"
   owner "root"
   group "root"
   mode "644"
 end
 
+link "/usr/local/bin/amtool" do
+  to "/opt/prometheus-server/alertmanager/amtool"
+end
+
 template "/etc/prometheus/karma.yml" do
   source "karma.yml.erb"
   owner "root"
@@ -327,11 +345,7 @@ systemd_service "prometheus-karma" do
   description "Alert dashboard for Prometheus Alertmanager"
   user "prometheus"
   exec_start "/opt/prometheus-server/karma/karma-linux-amd64 --config.file=/etc/prometheus/karma.yml"
-  private_tmp true
-  private_devices true
-  protect_system "full"
-  protect_home true
-  no_new_privileges true
+  sandbox :enable_network => true
   restart "on-failure"
 end
 
@@ -339,6 +353,7 @@ service "prometheus-karma" do
   action [:enable, :start]
   subscribes :reload, "template[/etc/prometheus/karma.yml]"
   subscribes :restart, "archive_file[#{cache_dir}/karma-linux-amd64.tar.gz]"
+  subscribes :restart, "systemd_service[prometheus-karma]"
 end
 
 package "grafana-enterprise"
index e82984b143354b45326bb12d47eb71c51d1fed8b..1dfd8764df27e873b727caf7a34e8a688b22d4d6 100644 (file)
@@ -23,23 +23,35 @@ default_action :create
 
 property :collector, :kind_of => String, :name_property => true
 property :interval, :kind_of => [Integer, String], :required => [:create]
+property :user, :kind_of => String
 property :options, :kind_of => [String, Array]
 property :environment, :kind_of => Hash, :default => {}
+property :proc_subset, String
+property :capability_bounding_set, [String, Array]
+property :private_devices, [true, false]
+property :private_users, [true, false]
+property :protect_clock, [true, false]
+property :protect_kernel_modules, [true, false]
 
 action :create do
   systemd_service service_name do
     description "Prometheus #{new_resource.collector} collector"
-    user "root"
+    user new_resource.user
+    dynamic_user new_resource.user.nil?
+    group "adm"
     environment new_resource.environment
     standard_output "file:/var/lib/prometheus/node-exporter/#{new_resource.collector}.new"
     standard_error "journal"
     exec_start "#{executable_path} #{executable_options}"
     exec_start_post "/bin/mv /var/lib/prometheus/node-exporter/#{new_resource.collector}.new /var/lib/prometheus/node-exporter/#{new_resource.collector}.prom"
-    private_tmp true
-    protect_system "strict"
-    protect_home true
+    sandbox true
+    proc_subset new_resource.proc_subset if new_resource.property_is_set?(:proc_subset)
+    capability_bounding_set new_resource.capability_bounding_set if new_resource.property_is_set?(:capability_bounding_set)
+    private_devices new_resource.private_devices if new_resource.property_is_set?(:private_devices)
+    private_users new_resource.private_users if new_resource.property_is_set?(:private_users)
+    protect_clock new_resource.protect_clock if new_resource.property_is_set?(:protect_clock)
+    protect_kernel_modules new_resource.protect_kernel_modules if new_resource.property_is_set?(:protect_kernel_modules)
     read_write_paths ["/var/lib/prometheus/node-exporter", "/var/lock", "/var/log"]
-    no_new_privileges true
   end
 
   systemd_timer service_name do
index 7ff729211b2738fae6a442c4ce1c9b7da8900357..3087f9c93084eede68b1104ac035dd7632594862 100644 (file)
@@ -26,12 +26,20 @@ property :address, :kind_of => String
 property :port, :kind_of => Integer, :required => [:create]
 property :listen_switch, :kind_of => String, :default => "web.listen-address"
 property :listen_type, :kind_of => String, :default => "address"
-property :user, :kind_of => String, :default => "root"
+property :user, :kind_of => String
+property :group, :kind_of => String
 property :command, :kind_of => String
 property :options, :kind_of => [String, Array]
 property :environment, :kind_of => Hash, :default => {}
+property :protect_proc, String
+property :proc_subset, String
+property :private_devices, [true, false]
+property :protect_clock, [true, false]
+property :restrict_address_families, [String, Array]
+property :system_call_filter, [String, Array]
 property :service, :kind_of => String
 property :scrape_interval, :kind_of => String
+property :scrape_timeout, :kind_of => String
 property :metric_relabel, :kind_of => Array
 property :register_target, :kind_of => [TrueClass, FalseClass], :default => true
 
@@ -42,12 +50,17 @@ action :create do
     description "Prometheus #{new_resource.exporter} exporter"
     type "simple"
     user new_resource.user
+    dynamic_user new_resource.user.nil?
+    group new_resource.group
     environment new_resource.environment
     exec_start "#{executable_path} #{new_resource.command} #{executable_options}"
-    private_tmp true
-    protect_system "strict"
-    protect_home true
-    no_new_privileges true
+    sandbox :enable_network => true
+    protect_proc new_resource.protect_proc if new_resource.property_is_set?(:protect_proc)
+    proc_subset new_resource.proc_subset if new_resource.property_is_set?(:proc_subset)
+    private_devices new_resource.private_devices if new_resource.property_is_set?(:private_devices)
+    protect_clock new_resource.protect_clock if new_resource.property_is_set?(:protect_clock)
+    restrict_address_families new_resource.restrict_address_families if new_resource.property_is_set?(:restrict_address_families)
+    system_call_filter new_resource.system_call_filter if new_resource.property_is_set?(:system_call_filter)
   end
 
   service service_name do
@@ -71,6 +84,7 @@ action :create do
       :name => new_resource.exporter,
       :address => listen_address,
       :scrape_interval => new_resource.scrape_interval,
+      :scrape_timeout => new_resource.scrape_timeout,
       :metric_relabel => new_resource.metric_relabel
     }
   end
@@ -107,7 +121,23 @@ action_class do
   end
 
   def executable_path
-    "/opt/prometheus-exporters/exporters/#{new_resource.exporter}/#{new_resource.exporter}_exporter"
+    if ::File.exist?("#{executable_directory}/#{executable_name}_#{executable_architecture}")
+      "#{executable_directory}/#{executable_name}_#{executable_architecture}"
+    else
+      "#{executable_directory}/#{executable_name}"
+    end
+  end
+
+  def executable_directory
+    "/opt/prometheus-exporters/exporters/#{new_resource.exporter}"
+  end
+
+  def executable_name
+    "#{new_resource.exporter}_exporter"
+  end
+
+  def executable_architecture
+    node[:kernel][:machine]
   end
 
   def executable_options
index 28a5b311363a2fe2565bc92906a9dce803e6c39a..149ff86bc6580b515b333b3ba86dd3dcf7339925 100644 (file)
@@ -5,28 +5,28 @@ groups:
     rules:
       - alert: pdu current draw
         expr: rPDU2PhaseStatusCurrent{site="amsterdam",rPDU2PhaseStatusIndex="1"} / 10 > 10
-        for: 5m
+        for: 6m
         labels:
           alertgroup: "amsterdam"
         annotations:
           current: "{{ $value | humanize }}A"
       - alert: site current draw
         expr: sum(rPDU2PhaseStatusCurrent{site="amsterdam",rPDU2PhaseStatusIndex="1"} / 10) > 13
-        for: 5m
+        for: 6m
         labels:
           alertgroup: "amsterdam"
         annotations:
           current: "{{ $value | humanize }}A"
       - alert: site temperature
-        expr: min(rPDU2SensorTempHumidityStatusTempC{site="amsterdam"}) / 10 < 18 or min(rPDU2SensorTempHumidityStatusTempC{site="amsterdam"}) / 10 > 25
-        for: 5m
+        expr: min(rPDU2SensorTempHumidityStatusTempC{site="amsterdam"}) / 10 < 18 or min(rPDU2SensorTempHumidityStatusTempC{site="amsterdam"}) / 10 > 25.5
+        for: 6m
         labels:
           alertgroup: "amsterdam"
         annotations:
           temperature: "{{ $value | humanize }}C"
       - alert: site humidity
         expr: max(rPDU2SensorTempHumidityStatusRelativeHumidity{site="amsterdam"}) / 100 < 0.25 or max(rPDU2SensorTempHumidityStatusRelativeHumidity{site="amsterdam"}) / 100 > 0.65
-        for: 5m
+        for: 6m
         labels:
           alertgroup: "amsterdam"
         annotations:
@@ -105,6 +105,36 @@ groups:
           alertgroup: database
         annotations:
           delay: "{{ $value | humanizeDuration }}"
+  - name: dublin
+    rules:
+      - alert: pdu current draw
+        expr: rPDU2PhaseStatusCurrent{site="dublin",rPDU2PhaseStatusIndex="1"} / 10 > 13
+        for: 6m
+        labels:
+          alertgroup: "dublin"
+        annotations:
+          current: "{{ $value | humanize }}A"
+      - alert: site current draw
+        expr: sum(rPDU2PhaseStatusCurrent{site="dublin",rPDU2PhaseStatusIndex="1"} / 10) > 17
+        for: 6m
+        labels:
+          alertgroup: "dublin"
+        annotations:
+          current: "{{ $value | humanize }}A"
+      - alert: site temperature
+        expr: min(rPDU2SensorTempHumidityStatusTempC{site="dublin"}) / 10 < 18 or min(rPDU2SensorTempHumidityStatusTempC{site="dublin"}) / 10 > 25.5
+        for: 6m
+        labels:
+          alertgroup: "dublin"
+        annotations:
+          temperature: "{{ $value | humanize }}C"
+      - alert: site humidity
+        expr: max(rPDU2SensorTempHumidityStatusRelativeHumidity{site="dublin"}) / 100 < 0.25 or max(rPDU2SensorTempHumidityStatusRelativeHumidity{site="dublin"}) / 100 > 0.65
+        for: 6m
+        labels:
+          alertgroup: "dublin"
+        annotations:
+          humidity: "{{ $value | humanizePercentage }}"
   - name: fastly
     rules:
       - alert: fastly error rate
@@ -115,12 +145,12 @@ groups:
         annotations:
           error_rate: "{{ $value | humanizePercentage }}"
       - alert: fastly healthcheck failing
-        expr: count(fastly_healthcheck_status == 0) > 0
+        expr: count(fastly_healthcheck_status == 0) by (service) > 0
         for: 15m
         labels:
           alertgroup: fastly
-      - alert: fastly healthcheck failing
-        expr: count(fastly_healthcheck_status == 0) > 4
+      - alert: multiple fastly healthchecks failing
+        expr: count(fastly_healthcheck_status == 0) by (service) > 4
         for: 5m
         labels:
           alertgroup: fastly
@@ -216,18 +246,28 @@ groups:
           alertgroup: "{{ $labels.instance }}"
   - name: juniper
     rules:
+      - alert: juniper cpu alarm
+        expr: jnxOperatingCPU{jnxOperatingContentsIndex="7"} > 30
+        for: 5m
+        labels:
+          alertgroup: "{{ $labels.site }}"
       - alert: juniper fan alarm
-        expr: jnxOperatingState{jnxOperatingContentsIndex="4",jnxOperatingState!="running"} > 0
+        expr: jnxOperatingState{jnxOperatingContentsIndex="4",jnxOperatingState!~"running.*"} > 0
         for: 5m
         labels:
           alertgroup: "{{ $labels.site }}"
       - alert: juniper power alarm
-        expr: jnxOperatingState{jnxOperatingContentsIndex="2",jnxOperatingState!="running"} > 0
+        expr: jnxOperatingState{jnxOperatingContentsIndex="2",jnxOperatingState!~"running.*"} > 0
         for: 5m
         labels:
           alertgroup: "{{ $labels.site }}"
   - name: mail
     rules:
+      - alert: exim down
+        expr: exim_up == 0
+        for: 5m
+        labels:
+          alertgroup: "{{ $labels.instance }}"
       - alert: exim queue length
         expr: exim_queue > exim_queue_limit
         for: 60m
@@ -320,7 +360,7 @@ groups:
           alertgroup: "{{ $labels.instance }}"
         annotations:
           error_rate: "{{ $value | humanizePercentage }}"
-      - alert: interface transmit errors
+      - alert: wireguard interface transmit errors
         expr: rate(node_network_transmit_errs_total{device=~"wg.*"}[1m]) / rate(node_network_transmit_packets_total{device=~"wg.*"}[1m]) > 0.05
         for: 1h
         labels:
@@ -341,6 +381,48 @@ groups:
           alertgroup: "{{ $labels.instance }}"
         annotations:
           entries_used: "{{ $value | humanizePercentage }}"
+  - name: nominatim
+    rules:
+      - alert: nominatim replication delay
+        expr: nominatim_replication_delay > 10800
+        for: 1h
+        labels:
+          alertgroup: nominatim
+        annotations:
+          delay: "{{ $value | humanizeDuration }}"
+  - name: overpass
+    rules:
+      - alert: overpass osm database age
+        expr: overpass_database_age_seconds{database="osm"} > 3600
+        for: 1h
+        labels:
+          alertgroup: overpass
+        annotations:
+          age: "{{ $value | humanizeDuration }}"
+      - alert: overpass area database age
+        expr: overpass_database_age_seconds{database="area"} > 86400
+        for: 1h
+        labels:
+          alertgroup: overpass
+        annotations:
+          age: "{{ $value | humanizeDuration }}"
+  - name: passenger
+    rules:
+      - alert: passenger down
+        expr: passenger_up == 0
+        for: 5m
+        labels:
+          alertgroup: "{{ $labels.instance }}"
+      - alert: passenger queuing
+        expr: passenger_top_level_request_queue > 0
+        for: 5m
+        labels:
+          alertgroup: "{{ $labels.instance }}"
+      - alert: passenger application queuing
+        expr: passenger_app_request_queue > 0
+        for: 5m
+        labels:
+          alertgroup: "{{ $labels.instance }}"
   - name: planet
     rules:
       - alert: planet dump overdue
@@ -407,7 +489,7 @@ groups:
         annotations:
           connections_used: "{{ $value | humanizePercentage }}"
       - alert: postgresql deadlocks
-        expr: increase(pg_stat_database_deadlocks[1m]) > 5
+        expr: increase(pg_stat_database_deadlocks{datname!="nominatim"}[1m]) > 5
         for: 0m
         labels:
           alertgroup: "{{ $labels.instance }}"
@@ -444,6 +526,22 @@ groups:
         for: 5m
         labels:
           alertgroup: "{{ $labels.instance }}"
+  - name: rasdaemon
+    rules:
+      - alert: memory controller errors
+        expr: increase(rasdaemon_mc_events_total[1m]) > 0
+        for: 0m
+        labels:
+          alertgroup: "{{ $labels.instance }}"
+        annotations:
+          new_errors: "{{ $value }}"
+      - alert: pcie aer errors
+        expr: increase(rasdaemon_aer_events_total[1m]) > 0
+        for: 0m
+        labels:
+          alertgroup: "{{ $labels.instance }}"
+        annotations:
+          new_ercrors: "{{ $value }}"
   - name: smart
     rules:
       - alert: smart failure
@@ -496,7 +594,7 @@ groups:
         for: 5m
         labels:
           alertgroup: "{{ $labels.instance }}"
-      - alert: systemd failed service
+      - alert: systemd failed chef client service
         expr: node_systemd_unit_state{state="failed",name="chef-client.service"} == 1
         for: 6h
         labels:
index d3ea1ce655a9e14515b90f04babd9f7edeac6253..ffd8f976005c1cac03a181e7ac49a115dc09e3b9 100644 (file)
@@ -8,6 +8,8 @@ root_url = https://prometheus.openstreetmap.org/
 [security]
 admin_user = admin
 admin_password = <%= @passwords[:grafana_admin] %>
+disable_gravatar = true
+cookie_secure = true
 
 [smtp]
 enabled = true
index 00f3c65dfe3aee54e243e6ca2342bf6c76e6b625..0caf619a29af8913011ce2a59169fb023ab42dfb 100644 (file)
@@ -60,6 +60,9 @@ scrape_configs:
 <% if targets.first[:scrape_interval] -%>
     scrape_interval: <%= targets.first[:scrape_interval] %>
 <% end -%>
+<% if targets.first[:scrape_timeout] -%>
+    scrape_timeout: <%= targets.first[:scrape_timeout] %>
+<% end -%>
 <% if targets.first[:sni] -%>
     tls_config:
       server_name: <%= targets.first[:sni] %>
@@ -106,6 +109,9 @@ scrape_configs:
       - source_labels: [__address__]
         regex: "[^/]+/([^/]+)/.*"
         target_label: __param_module
+      - source_labels: [__address__]
+        regex: "[^/]+/([^/]+)/.*"
+        target_label: module
       - source_labels: [__address__]
         regex: "[^/]+/[^/]+/(.*)"
         target_label: __address__
index 0946a0c19f1f9fcf9a38a34e2b0b62db4582802f..b13568acabeb52d2e7fae07d9c5efd647bb42f62 100644 (file)
@@ -48,7 +48,8 @@ package "rsync"
 systemd_service "rsync-override" do
   service "rsync"
   dropin "override"
-  exec_start "/usr/bin/rsync --daemon --no-detach --bwlimit=16384"
+  exec_start "/usr/bin/rsync --daemon --no-detach"
+  nice 10
   read_write_paths writable_paths.sort
   notifies :restart, "service[rsync]"
 end
index d830ffb526730de275254fe56ce3563ec279e155..3589308a0ac527f03c60e46f3a4a4e1fcd031479 100644 (file)
@@ -88,12 +88,12 @@ bundle_exec "/srv/hardware.openstreetmap.org" do
 end
 
 ssl_certificate "hardware.openstreetmap.org" do
-  domains ["hardware.openstreetmap.org", "hardware.osm.org"]
+  domains ["hardware.openstreetmap.org", "hardware.osm.org", "hardware.osmfoundation.org"]
   notifies :reload, "service[apache2]"
 end
 
 apache_site "hardware.openstreetmap.org" do
   template "apache.erb"
   directory "/srv/hardware.openstreetmap.org/_site"
-  variables :aliases => ["hardware.osm.org"]
+  variables :aliases => ["hardware.osm.org", "hardware.osmfoundation.org"]
 end
index 0725996d62948986121f64db5f9c2f0c003fbace..b1785343efa6288e081405985270d2358e9f4506 100644 (file)
@@ -1,4 +1,4 @@
 default[:ssl][:openssl_ciphers] = "ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS"
-default[:ssl][:gnutls_ciphers] = "NONE:+AEAD:+SHA256:+SHA1:+SHA384:+SHA512:+CURVE-X25519:+CURVE-SECP256R1:+CURVE-SECP384R1:+CURVE-SECP521R1:+SIGN-ALL:-SIGN-RSA-MD5:-SIGN-DSA-SHA1:-SIGN-DSA-SHA224:-SIGN-DSA-SHA256:-SIGN-DSA-SHA384:-SIGN-DSA-SHA512:+AES-256-GCM:+AES-256-CCM:+CHACHA20-POLY1305:+CAMELLIA-256-GCM:+AES-256-CBC:+CAMELLIA-256-CBC:+AES-128-GCM:+AES-128-CCM:+CAMELLIA-128-GCM:+AES-128-CBC:+CAMELLIA-128-CBC:+ECDHE-RSA:+ECDHE-ECDSA:+RSA:+DHE-RSA:+VERS-TLS1.2:+VERS-TLS1.1:+VERS-TLS1.0:+VERS-DTLS1.2:+VERS-DTLS1.0:+COMP-NULL:%PROFILE_LOW"
+default[:ssl][:gnutls_ciphers] = "NONE:+AEAD:+SHA256:+SHA1:+SHA384:+SHA512:+CURVE-X25519:+CURVE-SECP256R1:+CURVE-SECP384R1:+CURVE-SECP521R1:+SIGN-ALL:-SIGN-RSA-MD5:-SIGN-DSA-SHA1:-SIGN-DSA-SHA224:-SIGN-DSA-SHA256:-SIGN-DSA-SHA384:-SIGN-DSA-SHA512:+AES-256-GCM:+AES-256-CCM:+CHACHA20-POLY1305:+CAMELLIA-256-GCM:+AES-256-CBC:+CAMELLIA-256-CBC:+AES-128-GCM:+AES-128-CCM:+CAMELLIA-128-GCM:+AES-128-CBC:+CAMELLIA-128-CBC:+ECDHE-RSA:+ECDHE-ECDSA:+RSA:+DHE-RSA:+VERS-TLS1.3:+VERS-TLS1.2:+VERS-TLS1.1:+VERS-TLS1.0:+VERS-DTLS1.2:+VERS-DTLS1.0:+COMP-NULL:%PROFILE_LOW"
 default[:ssl][:strict_transport_security] = "max-age=31536000; includeSubDomains; preload"
 default[:ssl][:ct_report_uri] = "https://openstreetmap.report-uri.com/r/d/ct/reportOnly"
index b872349b24f68b476c896f087c06d12e06c85e58..206bddd07e897257c669acc9d09682b1ec9d4347 100644 (file)
@@ -6,5 +6,7 @@ description       "Installs and configures State of the Map services"
 
 version           "1.0.0"
 supports          "ubuntu"
+depends           "apache"
+depends           "git"
 depends           "ruby"
 depends           "wordpress"
index 06d3eed879965b1136f0e5042baf7db6ed057fca..aa98e5bc5b36d931eee37b20e3a1327cb77c8c5d 100644 (file)
 # limitations under the License.
 #
 
-include_recipe "ruby"
-include_recipe "wordpress"
+include_recipe "apache"
+include_recipe "git"
 
-passwords = data_bag_item("stateofthemap", "passwords")
+apache_module "expires"
 
 git "/srv/stateofthemap.org" do
   action :sync
@@ -42,333 +42,3 @@ apache_site "stateofthemap.org" do
   template "apache.erb"
   directory "/srv/stateofthemap.org"
 end
-
-directory "/srv/2007.stateofthemap.org" do
-  owner "wordpress"
-  group "wordpress"
-  mode "755"
-end
-
-wordpress_site "2007.stateofthemap.org" do
-  aliases "2007.stateofthemap.com"
-  directory "/srv/2007.stateofthemap.org/wp"
-  database_name "sotm2007"
-  database_user "sotm2007"
-  database_password passwords["sotm2007"]
-  database_prefix "wp_sotm_"
-  fpm_prometheus_port 12007
-end
-
-wordpress_theme "2007.stateofthemap.org-refreshwp-11" do
-  theme "refreshwp-11"
-  site "2007.stateofthemap.org"
-  repository "https://git.openstreetmap.org/public/stateofthemap.git"
-  revision "theme-2007"
-end
-
-# wordpress_plugin "2007.stateofthemap.org-geopress" do
-#   plugin "geopress"
-#   site "2007.stateofthemap.org"
-# end
-
-directory "/srv/2008.stateofthemap.org" do
-  owner "wordpress"
-  group "wordpress"
-  mode "755"
-end
-
-wordpress_site "2008.stateofthemap.org" do
-  aliases "2008.stateofthemap.com"
-  directory "/srv/2008.stateofthemap.org/wp"
-  database_name "sotm2008"
-  database_user "sotm2008"
-  database_password passwords["sotm2008"]
-  database_prefix "wp_sotm08_"
-  fpm_prometheus_port 12008
-end
-
-wordpress_theme "2008.stateofthemap.org-refreshwp-11" do
-  theme "refreshwp-11"
-  site "2008.stateofthemap.org"
-  repository "https://git.openstreetmap.org/public/stateofthemap.git"
-  revision "theme-2008"
-end
-
-# wordpress_plugin "2008.stateofthemap.org-geopress" do
-#   plugin "geopress"
-#   site "2008.stateofthemap.org"
-# end
-
-directory "/srv/2009.stateofthemap.org" do
-  owner "wordpress"
-  group "wordpress"
-  mode "755"
-end
-
-git "/srv/2009.stateofthemap.org" do
-  action :sync
-  repository "https://git.openstreetmap.org/public/stateofthemap.git"
-  revision "resources-2009"
-  depth 1
-  user "wordpress"
-  group "wordpress"
-end
-
-wordpress_site "2009.stateofthemap.org" do
-  aliases "2009.stateofthemap.com"
-  directory "/srv/2009.stateofthemap.org/wp"
-  database_name "sotm2009"
-  database_user "sotm2009"
-  database_password passwords["sotm2009"]
-  urls "/register" => "/srv/2009.stateofthemap.org/register",
-       "/register-pro-user" => "/srv/2009.stateofthemap.org/register-pro-user",
-       "/podcasts" => "/srv/2009.stateofthemap.org/podcasts"
-  fpm_prometheus_port 12009
-end
-
-wordpress_theme "2009.stateofthemap.org-aerodrome" do
-  theme "aerodrome"
-  site "2009.stateofthemap.org"
-  repository "https://git.openstreetmap.org/public/stateofthemap.git"
-  revision "theme-2009"
-end
-
-# wordpress_plugin "2009.stateofthemap.org-wp-sticky" do
-#   plugin "wp-sticky"
-#   site "2009.stateofthemap.org"
-# end
-
-directory "/srv/2010.stateofthemap.org" do
-  owner "wordpress"
-  group "wordpress"
-  mode "755"
-end
-
-git "/srv/2010.stateofthemap.org" do
-  action :sync
-  repository "https://git.openstreetmap.org/public/stateofthemap.git"
-  revision "resources-2010"
-  depth 1
-  user "wordpress"
-  group "wordpress"
-end
-
-wordpress_site "2010.stateofthemap.org" do
-  aliases "2010.stateofthemap.com"
-  directory "/srv/2010.stateofthemap.org/wp"
-  database_name "sotm2010"
-  database_user "sotm2010"
-  database_password passwords["sotm2010"]
-  urls "/register" => "/srv/2010.stateofthemap.org/register"
-  fpm_prometheus_port 12010
-end
-
-wordpress_theme "2010.stateofthemap.org-aerodrome" do
-  theme "aerodrome"
-  site "2010.stateofthemap.org"
-  repository "https://git.openstreetmap.org/public/stateofthemap.git"
-  revision "theme-2010"
-end
-
-wordpress_plugin "2010.stateofthemap.org-sitepress-multilingual-cms" do
-  plugin "sitepress-multilingual-cms"
-  site "2010.stateofthemap.org"
-  repository "https://git.openstreetmap.org/private/sitepress-multilingual-cms.git"
-  revision "master"
-  not_if { kitchen? }
-end
-
-# wordpress_plugin "2010.stateofthemap.org-wp-sticky" do
-#   plugin "wp-sticky"
-#   site "2010.stateofthemap.org"
-# end
-
-directory "/srv/2011.stateofthemap.org" do
-  owner "wordpress"
-  group "wordpress"
-  mode "755"
-end
-
-git "/srv/2011.stateofthemap.org" do
-  action :sync
-  repository "https://git.openstreetmap.org/public/stateofthemap.git"
-  revision "resources-2011"
-  depth 1
-  user "wordpress"
-  group "wordpress"
-end
-
-wordpress_site "2011.stateofthemap.org" do
-  aliases "2011.stateofthemap.com"
-  directory "/srv/2011.stateofthemap.org/wp"
-  database_name "sotm2011"
-  database_user "sotm2011"
-  database_password passwords["sotm2011"]
-  urls "/register" => "/srv/2011.stateofthemap.org/register"
-  fpm_prometheus_port 12011
-end
-
-wordpress_theme "2011.stateofthemap.org-aerodrome" do
-  theme "aerodrome"
-  site "2011.stateofthemap.org"
-  repository "https://git.openstreetmap.org/public/stateofthemap.git"
-  revision "theme-2011"
-end
-
-wordpress_plugin "2011.stateofthemap.org-sitepress-multilingual-cms" do
-  plugin "sitepress-multilingual-cms"
-  site "2011.stateofthemap.org"
-  repository "https://git.openstreetmap.org/private/sitepress-multilingual-cms.git"
-  revision "master"
-  not_if { kitchen? }
-end
-
-# wordpress_plugin "2011.stateofthemap.org-wp-sticky" do
-#   plugin "wp-sticky"
-#   site "2011.stateofthemap.org"
-# end
-
-directory "/srv/2012.stateofthemap.org" do
-  owner "wordpress"
-  group "wordpress"
-  mode "755"
-end
-
-git "/srv/2012.stateofthemap.org" do
-  action :sync
-  repository "https://git.openstreetmap.org/public/stateofthemap.git"
-  revision "resources-2012"
-  depth 1
-  user "wordpress"
-  group "wordpress"
-end
-
-wordpress_site "2012.stateofthemap.org" do
-  aliases "2012.stateofthemap.com"
-  directory "/srv/2012.stateofthemap.org/wp"
-  database_name "sotm2012"
-  database_user "sotm2012"
-  database_password passwords["sotm2012"]
-  urls "/register" => "/srv/2012.stateofthemap.org/register"
-  fpm_prometheus_port 12012
-end
-
-wordpress_theme "2012.stateofthemap.org-aerodrome" do
-  theme "aerodrome"
-  site "2012.stateofthemap.org"
-  repository "https://git.openstreetmap.org/public/stateofthemap.git"
-  revision "theme-2012"
-end
-
-wordpress_plugin "2012.stateofthemap.org-leaflet-maps-marker" do
-  plugin "leaflet-maps-marker"
-  site "2012.stateofthemap.org"
-end
-
-wordpress_plugin "2012.stateofthemap.org-sitepress-multilingual-cms" do
-  plugin "sitepress-multilingual-cms"
-  site "2012.stateofthemap.org"
-  repository "https://git.openstreetmap.org/private/sitepress-multilingual-cms.git"
-  revision "master"
-  not_if { kitchen? }
-end
-
-# wordpress_plugin "2012.stateofthemap.org-wp-sticky" do
-#   plugin "wp-sticky"
-#   site "2012.stateofthemap.org"
-# end
-
-%w[2013].each do |year|
-  git "/srv/#{year}.stateofthemap.org" do
-    action :sync
-    repository "https://git.openstreetmap.org/public/stateofthemap.git"
-    revision "site-#{year}"
-    depth 1
-    user "root"
-    group "root"
-  end
-
-  ssl_certificate "#{year}.stateofthemap.org" do
-    domains ["#{year}.stateofthemap.org", "#{year}.stateofthemap.com", "#{year}.sotm.org"]
-    notifies :reload, "service[apache2]"
-  end
-
-  apache_site "#{year}.stateofthemap.org" do
-    template "apache.static.erb"
-    directory "/srv/#{year}.stateofthemap.org"
-    variables :year => year
-  end
-end
-
-package %w[
-  gcc
-  g++
-  make
-  libssl-dev
-  zlib1g-dev
-  pkg-config
-]
-
-apache_module "expires"
-apache_module "rewrite"
-
-%w[2016 2017 2018 2019 2020 2021 2022].each do |year|
-  git "/srv/#{year}.stateofthemap.org" do
-    action :sync
-    repository "https://github.com/openstreetmap/stateofthemap-#{year}.git"
-    depth 1
-    user "root"
-    group "root"
-    notifies :run, "bundle_install[/srv/#{year}.stateofthemap.org]"
-  end
-
-  directory "/srv/#{year}.stateofthemap.org/_site" do
-    mode "755"
-    owner "nobody"
-    group "nogroup"
-  end
-
-  # Workaround https://github.com/jekyll/jekyll/issues/7804
-  # by creating a .jekyll-cache folder
-  directory "/srv/#{year}.stateofthemap.org/.jekyll-cache" do
-    mode "755"
-    owner "nobody"
-    group "nogroup"
-  end
-
-  bundle_install "/srv/#{year}.stateofthemap.org" do
-    action :nothing
-    options "--deployment --jobs #{node[:cpu][:total]}"
-    user "root"
-    group "root"
-    notifies :run, "bundle_exec[/srv/#{year}.stateofthemap.org]"
-    only_if { ::File.exist?("/srv/#{year}.stateofthemap.org/Gemfile") }
-  end
-
-  bundle_exec "/srv/#{year}.stateofthemap.org" do
-    action :nothing
-    command "jekyll build --trace --baseurl=https://#{year}.stateofthemap.org"
-    user "nobody"
-    group "nogroup"
-    environment "LANG" => "C.UTF-8"
-  end
-
-  ssl_certificate "#{year}.stateofthemap.org" do
-    domains ["#{year}.stateofthemap.org", "#{year}.stateofthemap.com", "#{year}.sotm.org"]
-    notifies :reload, "service[apache2]"
-  end
-
-  apache_site "#{year}.stateofthemap.org" do
-    template "apache.jekyll.erb"
-    directory "/srv/#{year}.stateofthemap.org/_site"
-    variables :year => year
-  end
-end
-
-template "/etc/cron.daily/sotm-backup" do
-  source "backup.cron.erb"
-  owner "root"
-  group "root"
-  mode "750"
-  variables :passwords => passwords
-end
diff --git a/cookbooks/stateofthemap/recipes/jekyll.rb b/cookbooks/stateofthemap/recipes/jekyll.rb
new file mode 100644 (file)
index 0000000..a57d230
--- /dev/null
@@ -0,0 +1,86 @@
+#
+# Cookbook:: stateofthemap
+# Recipe:: jekyll
+#
+# Copyright:: 2022, 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 "stateofthemap"
+include_recipe "ruby"
+
+package %w[
+  gcc
+  g++
+  make
+  libssl-dev
+  zlib1g-dev
+  pkg-config
+]
+
+apache_module "expires"
+apache_module "rewrite"
+
+%w[2016 2017 2018 2019 2020 2021 2022].each do |year|
+  git "/srv/#{year}.stateofthemap.org" do
+    action :sync
+    repository "https://github.com/openstreetmap/stateofthemap-#{year}.git"
+    depth 1
+    user "root"
+    group "root"
+    notifies :run, "bundle_install[/srv/#{year}.stateofthemap.org]"
+  end
+
+  directory "/srv/#{year}.stateofthemap.org/_site" do
+    mode "755"
+    owner "nobody"
+    group "nogroup"
+  end
+
+  # Workaround https://github.com/jekyll/jekyll/issues/7804
+  # by creating a .jekyll-cache folder
+  directory "/srv/#{year}.stateofthemap.org/.jekyll-cache" do
+    mode "755"
+    owner "nobody"
+    group "nogroup"
+  end
+
+  bundle_install "/srv/#{year}.stateofthemap.org" do
+    action :nothing
+    options "--deployment --jobs #{node.cpu_cores}"
+    user "root"
+    group "root"
+    notifies :run, "bundle_exec[/srv/#{year}.stateofthemap.org]"
+    only_if { ::File.exist?("/srv/#{year}.stateofthemap.org/Gemfile") }
+  end
+
+  bundle_exec "/srv/#{year}.stateofthemap.org" do
+    action :nothing
+    command "jekyll build --trace --baseurl=https://#{year}.stateofthemap.org"
+    user "nobody"
+    group "nogroup"
+    environment "LANG" => "C.UTF-8"
+  end
+
+  ssl_certificate "#{year}.stateofthemap.org" do
+    domains ["#{year}.stateofthemap.org", "#{year}.stateofthemap.com", "#{year}.sotm.org"]
+    notifies :reload, "service[apache2]"
+  end
+
+  apache_site "#{year}.stateofthemap.org" do
+    template "apache.jekyll.erb"
+    directory "/srv/#{year}.stateofthemap.org/_site"
+    variables :year => year
+  end
+end
diff --git a/cookbooks/stateofthemap/recipes/static.rb b/cookbooks/stateofthemap/recipes/static.rb
new file mode 100644 (file)
index 0000000..2ed4361
--- /dev/null
@@ -0,0 +1,42 @@
+#
+# Cookbook:: stateofthemap
+# Recipe:: static
+#
+# Copyright:: 2022, 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 "stateofthemap"
+
+%w[2013].each do |year|
+  git "/srv/#{year}.stateofthemap.org" do
+    action :sync
+    repository "https://git.openstreetmap.org/public/stateofthemap.git"
+    revision "site-#{year}"
+    depth 1
+    user "root"
+    group "root"
+  end
+
+  ssl_certificate "#{year}.stateofthemap.org" do
+    domains ["#{year}.stateofthemap.org", "#{year}.stateofthemap.com", "#{year}.sotm.org"]
+    notifies :reload, "service[apache2]"
+  end
+
+  apache_site "#{year}.stateofthemap.org" do
+    template "apache.static.erb"
+    directory "/srv/#{year}.stateofthemap.org"
+    variables :year => year
+  end
+end
diff --git a/cookbooks/stateofthemap/recipes/wordpress.rb b/cookbooks/stateofthemap/recipes/wordpress.rb
new file mode 100644 (file)
index 0000000..75b0e34
--- /dev/null
@@ -0,0 +1,266 @@
+#
+# Cookbook:: stateofthemap
+# Recipe:: wordpress
+#
+# Copyright:: 2022, 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 "stateofthemap"
+include_recipe "wordpress"
+
+passwords = data_bag_item("stateofthemap", "passwords")
+
+directory "/srv/2007.stateofthemap.org" do
+  owner "wordpress"
+  group "wordpress"
+  mode "755"
+end
+
+wordpress_site "2007.stateofthemap.org" do
+  aliases "2007.stateofthemap.com"
+  directory "/srv/2007.stateofthemap.org/wp"
+  database_name "sotm2007"
+  database_user "sotm2007"
+  database_password passwords["sotm2007"]
+  database_prefix "wp_sotm_"
+  fpm_prometheus_port 12007
+end
+
+wordpress_theme "2007.stateofthemap.org-refreshwp-11" do
+  theme "refreshwp-11"
+  site "2007.stateofthemap.org"
+  repository "https://git.openstreetmap.org/public/stateofthemap.git"
+  revision "theme-2007"
+end
+
+# wordpress_plugin "2007.stateofthemap.org-geopress" do
+#   plugin "geopress"
+#   site "2007.stateofthemap.org"
+# end
+
+directory "/srv/2008.stateofthemap.org" do
+  owner "wordpress"
+  group "wordpress"
+  mode "755"
+end
+
+wordpress_site "2008.stateofthemap.org" do
+  aliases "2008.stateofthemap.com"
+  directory "/srv/2008.stateofthemap.org/wp"
+  database_name "sotm2008"
+  database_user "sotm2008"
+  database_password passwords["sotm2008"]
+  database_prefix "wp_sotm08_"
+  fpm_prometheus_port 12008
+end
+
+wordpress_theme "2008.stateofthemap.org-refreshwp-11" do
+  theme "refreshwp-11"
+  site "2008.stateofthemap.org"
+  repository "https://git.openstreetmap.org/public/stateofthemap.git"
+  revision "theme-2008"
+end
+
+# wordpress_plugin "2008.stateofthemap.org-geopress" do
+#   plugin "geopress"
+#   site "2008.stateofthemap.org"
+# end
+
+directory "/srv/2009.stateofthemap.org" do
+  owner "wordpress"
+  group "wordpress"
+  mode "755"
+end
+
+git "/srv/2009.stateofthemap.org" do
+  action :sync
+  repository "https://git.openstreetmap.org/public/stateofthemap.git"
+  revision "resources-2009"
+  depth 1
+  user "wordpress"
+  group "wordpress"
+end
+
+wordpress_site "2009.stateofthemap.org" do
+  aliases "2009.stateofthemap.com"
+  directory "/srv/2009.stateofthemap.org/wp"
+  database_name "sotm2009"
+  database_user "sotm2009"
+  database_password passwords["sotm2009"]
+  urls "/register" => "/srv/2009.stateofthemap.org/register",
+       "/register-pro-user" => "/srv/2009.stateofthemap.org/register-pro-user",
+       "/podcasts" => "/srv/2009.stateofthemap.org/podcasts"
+  fpm_prometheus_port 12009
+end
+
+wordpress_theme "2009.stateofthemap.org-aerodrome" do
+  theme "aerodrome"
+  site "2009.stateofthemap.org"
+  repository "https://git.openstreetmap.org/public/stateofthemap.git"
+  revision "theme-2009"
+end
+
+# wordpress_plugin "2009.stateofthemap.org-wp-sticky" do
+#   plugin "wp-sticky"
+#   site "2009.stateofthemap.org"
+# end
+
+directory "/srv/2010.stateofthemap.org" do
+  owner "wordpress"
+  group "wordpress"
+  mode "755"
+end
+
+git "/srv/2010.stateofthemap.org" do
+  action :sync
+  repository "https://git.openstreetmap.org/public/stateofthemap.git"
+  revision "resources-2010"
+  depth 1
+  user "wordpress"
+  group "wordpress"
+end
+
+wordpress_site "2010.stateofthemap.org" do
+  aliases "2010.stateofthemap.com"
+  directory "/srv/2010.stateofthemap.org/wp"
+  database_name "sotm2010"
+  database_user "sotm2010"
+  database_password passwords["sotm2010"]
+  urls "/register" => "/srv/2010.stateofthemap.org/register"
+  fpm_prometheus_port 12010
+end
+
+wordpress_theme "2010.stateofthemap.org-aerodrome" do
+  theme "aerodrome"
+  site "2010.stateofthemap.org"
+  repository "https://git.openstreetmap.org/public/stateofthemap.git"
+  revision "theme-2010"
+end
+
+wordpress_plugin "2010.stateofthemap.org-sitepress-multilingual-cms" do
+  plugin "sitepress-multilingual-cms"
+  site "2010.stateofthemap.org"
+  repository "https://git.openstreetmap.org/private/sitepress-multilingual-cms.git"
+  revision "master"
+  not_if { kitchen? }
+end
+
+# wordpress_plugin "2010.stateofthemap.org-wp-sticky" do
+#   plugin "wp-sticky"
+#   site "2010.stateofthemap.org"
+# end
+
+directory "/srv/2011.stateofthemap.org" do
+  owner "wordpress"
+  group "wordpress"
+  mode "755"
+end
+
+git "/srv/2011.stateofthemap.org" do
+  action :sync
+  repository "https://git.openstreetmap.org/public/stateofthemap.git"
+  revision "resources-2011"
+  depth 1
+  user "wordpress"
+  group "wordpress"
+end
+
+wordpress_site "2011.stateofthemap.org" do
+  aliases "2011.stateofthemap.com"
+  directory "/srv/2011.stateofthemap.org/wp"
+  database_name "sotm2011"
+  database_user "sotm2011"
+  database_password passwords["sotm2011"]
+  urls "/register" => "/srv/2011.stateofthemap.org/register"
+  fpm_prometheus_port 12011
+end
+
+wordpress_theme "2011.stateofthemap.org-aerodrome" do
+  theme "aerodrome"
+  site "2011.stateofthemap.org"
+  repository "https://git.openstreetmap.org/public/stateofthemap.git"
+  revision "theme-2011"
+end
+
+wordpress_plugin "2011.stateofthemap.org-sitepress-multilingual-cms" do
+  plugin "sitepress-multilingual-cms"
+  site "2011.stateofthemap.org"
+  repository "https://git.openstreetmap.org/private/sitepress-multilingual-cms.git"
+  revision "master"
+  not_if { kitchen? }
+end
+
+# wordpress_plugin "2011.stateofthemap.org-wp-sticky" do
+#   plugin "wp-sticky"
+#   site "2011.stateofthemap.org"
+# end
+
+directory "/srv/2012.stateofthemap.org" do
+  owner "wordpress"
+  group "wordpress"
+  mode "755"
+end
+
+git "/srv/2012.stateofthemap.org" do
+  action :sync
+  repository "https://git.openstreetmap.org/public/stateofthemap.git"
+  revision "resources-2012"
+  depth 1
+  user "wordpress"
+  group "wordpress"
+end
+
+wordpress_site "2012.stateofthemap.org" do
+  aliases "2012.stateofthemap.com"
+  directory "/srv/2012.stateofthemap.org/wp"
+  database_name "sotm2012"
+  database_user "sotm2012"
+  database_password passwords["sotm2012"]
+  urls "/register" => "/srv/2012.stateofthemap.org/register"
+  fpm_prometheus_port 12012
+end
+
+wordpress_theme "2012.stateofthemap.org-aerodrome" do
+  theme "aerodrome"
+  site "2012.stateofthemap.org"
+  repository "https://git.openstreetmap.org/public/stateofthemap.git"
+  revision "theme-2012"
+end
+
+wordpress_plugin "2012.stateofthemap.org-leaflet-maps-marker" do
+  plugin "leaflet-maps-marker"
+  site "2012.stateofthemap.org"
+end
+
+wordpress_plugin "2012.stateofthemap.org-sitepress-multilingual-cms" do
+  plugin "sitepress-multilingual-cms"
+  site "2012.stateofthemap.org"
+  repository "https://git.openstreetmap.org/private/sitepress-multilingual-cms.git"
+  revision "master"
+  not_if { kitchen? }
+end
+
+# wordpress_plugin "2012.stateofthemap.org-wp-sticky" do
+#   plugin "wp-sticky"
+#   site "2012.stateofthemap.org"
+# end
+
+template "/etc/cron.daily/sotm-backup" do
+  source "backup.cron.erb"
+  owner "root"
+  group "root"
+  mode "750"
+  variables :passwords => passwords
+end
index 38e14d60a430bab4164f770c421fa6dfaa8fad71..01d4da50a3480e174a4db46503d8384b6b15952c 100644 (file)
   RewriteRule ^/applications/editors/merkaartor/?.* https://github.com/openstreetmap/svn-archive/tree/main/applications/editors/merkaartor [QSD,L,R=permanent]
   RewriteRule ^/applications/editors/josm-ng/?.* https://github.com/openstreetmap/svn-archive/tree/main/applications/editors/josm-ng [QSD,L,R=permanent]
   RewriteRule ^/applications/editors/osmpedit/?.* https://github.com/openstreetmap/svn-archive/tree/main/applications/editors/osmpedit [QSD,L,R=permanent]
+  RewriteRule ^/applications/editors/josm/plugins/opendata/dist/fr\.datagouvfr\.jar.* https://raw.githubusercontent.com/openstreetmap/svn-archive/main/applications/editors/josm/plugins/opendata/dist/fr.datagouvfr.jar [QSD,L,R=permanent]
+  RewriteRule ^/applications/editors/josm/plugins/opendata/dist/fr\.paris\.jar.*  https://raw.githubusercontent.com/openstreetmap/svn-archive/main/applications/editors/josm/plugins/opendata/dist/fr.paris.jar [QSD,L,R=permanent]
+  RewriteRule ^/applications/editors/josm/plugins/opendata/dist/fr\.toulouse\.jar.* https://raw.githubusercontent.com/openstreetmap/svn-archive/main/applications/editors/josm/plugins/opendata/dist/fr.toulouse.jar [QSD,L,R=permanent]
+  RewriteRule ^/applications/editors/josm/plugins/opendata/modules-icons\.zip https://raw.githubusercontent.com/openstreetmap/svn-archive/main/applications/editors/josm/plugins/opendata/modules-icons.zip [QSD,L,R=permanent]
+  RewriteRule ^/applications/editors/josm/plugins/opendata/modules\.txt.* https://raw.githubusercontent.com/openstreetmap/svn-archive/main/applications/editors/josm/plugins/opendata/modules.txt [QSD,L,R=permanent]
+  RewriteRule ^/applications/editors/josm/plugins/cadastre-fr/images/cadastre_small\.png https://raw.githubusercontent.com/openstreetmap/svn-archive/main/applications/editors/josm/plugins/cadastre-fr/images/cadastre_small.png [QSD,L,R=permanent]
   RewriteRule ^/applications/editors/josm/plugins/?.* https://github.com/openstreetmap/svn-archive/tree/main/applications/editors/josm/plugins [QSD,L,R=permanent]
   RewriteRule ^/applications/editors/josm/?.* https://github.com/openstreetmap/svn-archive/tree/main/applications/editors/josm [QSD,L,R=permanent]
   RewriteRule ^/applications/editors/osm-editor/?.* https://github.com/openstreetmap/svn-archive/tree/main/applications/editors/osm-editor [QSD,L,R=permanent]
index 68d8eb7447e53891bbc87a513d70e5b3d067baeb..7545ff331767bd814742ac281c72f176bf5e7b40 100644 (file)
@@ -131,11 +131,8 @@ systemd_service "supybot" do
   after "network.target"
   user "supybot"
   exec_start "/usr/bin/supybot /etc/supybot/supybot.conf"
-  private_tmp true
-  private_devices true
-  protect_system true
-  protect_home true
-  no_new_privileges true
+  sandbox :enable_network => true
+  read_write_paths ["/etc/supybot", "/var/lib/supybot", "/var/log/supybot"]
   restart "on-failure"
 end
 
index 6c7aeaae675b89c8852858fabf1b9bf7de5dc40b..844ba302d4d510adb38fc4c90b0d54b782a2407d 100644 (file)
@@ -38,22 +38,6 @@ commit link = https://github.com/openstreetmap/dns/commit/%c
 channels = #osm-dev
 commit message = [%s|%b|%a] %m %l
 
-[osm-potlatch2]
-short name = osm-potlatch2
-url = https://git.openstreetmap.org/public/potlatch2.git
-branch = master
-commit link = https://github.com/openstreetmap/potlatch2/commit/%c
-channels = #osm-dev
-commit message = [%s|%b|%a] %m %l
-
-[osm-gpx-import]
-short name = osm-gpx-import
-url = https://git.openstreetmap.org/public/gpx-import.git
-branch = master
-commit link = https://git.osm.org/gpx-import.git/commitdiff/%c
-channels = #osm-dev
-commit message = [%s|%b|%a] %m %l
-
 [osm-nominatim]
 short name = osm-nominatim
 url = https://git.openstreetmap.org/public/nominatim.git
@@ -62,11 +46,11 @@ commit link = https://git.osm.org/nominatim.git/commitdiff/%c
 channels = #osm-dev
 commit message = [%s|%b|%a] %m %l
 
-[osm-planetdump]
-short name = osm-planetdump
-url = https://git.openstreetmap.org/public/planetdump.git
+[osm-planetdump-ng]
+short name = osm-planetdump-ng
+url = https://github.com/zerebubuth/planet-dump-ng.git
 branch = master
-commit link = https://git.osm.org/planetdump.git/commitdiff/%c
+commit link = https://github.com/zerebubuth/planet-dump-ng-commit/%c
 channels = #osm-dev
 commit message = [%s|%b|%a] %m %l
 
index aa575189defcf9c495d7a972a55821e8072f984c..1194d4fd6435f1e183cb51274c368dc3fc26ca10 100644 (file)
@@ -29,6 +29,7 @@ property :condition_path_exists_glob, [String, Array]
 property :after, [String, Array]
 property :conflicts, [String, Array]
 property :wants, [String, Array]
+property :joins_namespace_of, [String, Array]
 property :type, String, :is => %w[simple forking oneshot dbus notify idle]
 property :limit_nofile, Integer
 property :limit_as, [Integer, String]
@@ -40,10 +41,11 @@ property :environment, Hash, :default => {}
 property :environment_file, [String, Hash]
 property :user, String
 property :group, String
+property :dynamic_user, [true, false]
 property :working_directory, String
-property :exec_start_pre, String
-property :exec_start, String
-property :exec_start_post, String
+property :exec_start_pre, [String, Array]
+property :exec_start, [String, Array]
+property :exec_start_post, [String, Array]
 property :exec_stop, String
 property :exec_reload, String
 property :runtime_directory, String
@@ -58,16 +60,37 @@ property :standard_error, String,
 property :success_exit_status, [Integer, String, Array]
 property :restart, String,
          :is => %w[on-success on-failure on-abnormal on-watchdog on-abort always]
-property :private_tmp, [true, false]
-property :private_devices, [true, false]
-property :private_network, [true, false]
-property :protect_system, [TrueClass, FalseClass, String]
-property :protect_home, [TrueClass, FalseClass, String]
+property :protect_proc, String,
+         :is => %w[noaccess invisible ptraceable default]
+property :proc_subset, String,
+         :is => %w[all pid]
+property :capability_bounding_set, [String, Array]
+property :no_new_privileges, [true, false]
+property :protect_system, [true, false, String]
+property :protect_home, [true, false, String]
 property :read_write_paths, [String, Array]
 property :read_only_paths, [String, Array]
 property :inaccessible_paths, [String, Array]
+property :private_tmp, [true, false]
+property :private_devices, [true, false]
+property :private_network, [true, false]
+property :private_ipc, [true, false]
+property :private_users, [true, false]
+property :protect_hostname, [true, false]
+property :protect_clock, [true, false]
+property :protect_kernel_tunables, [true, false]
+property :protect_kernel_modules, [true, false]
+property :protect_kernel_logs, [true, false]
+property :protect_control_groups, [true, false]
 property :restrict_address_families, [String, Array]
-property :no_new_privileges, [true, false]
+property :restrict_namespaces, [true, false, String, Array]
+property :lock_personality, [true, false]
+property :memory_deny_write_execute, [true, false]
+property :restrict_realtime, [true, false]
+property :restrict_suid_sgid, [true, false]
+property :remove_ipc, [true, false]
+property :system_call_filter, [String, Array]
+property :system_call_architectures, [String, Array]
 property :tasks_max, Integer
 property :timeout_start_sec, Integer
 property :timeout_stop_sec, Integer
@@ -79,6 +102,7 @@ property :io_scheduling_class, [Integer, String]
 property :io_scheduling_priority, Integer
 property :kill_mode, String,
          :is => %w[control-group process mixed none]
+property :sandbox, [true, false, Hash]
 
 action :create do
   service_variables = new_resource.to_hash
@@ -87,6 +111,40 @@ action :create do
     service_variables[:type] ||= "simple"
   end
 
+  if new_resource.sandbox
+    service_variables[:protect_proc] = "invisible" unless property_is_set?(:protect_proc)
+    service_variables[:proc_subset] = "pid" unless property_is_set?(:proc_subset)
+    service_variables[:capability_bounding_set] = [] unless property_is_set?(:capability_bounding_set)
+    service_variables[:no_new_privileges] = true unless property_is_set?(:no_new_privileges)
+    service_variables[:protect_system] = "strict" unless property_is_set?(:protect_system)
+    service_variables[:protect_home] = true unless property_is_set?(:protect_home)
+    service_variables[:private_tmp] = true unless property_is_set?(:private_tmp)
+    service_variables[:private_devices] = true unless property_is_set?(:private_devices)
+    service_variables[:private_network] = true unless property_is_set?(:private_network)
+    service_variables[:private_ipc] = true unless property_is_set?(:private_ipc)
+    service_variables[:private_users] = true unless property_is_set?(:private_users)
+    service_variables[:protect_hostname] = true unless property_is_set?(:protect_hostname)
+    service_variables[:protect_clock] = true unless property_is_set?(:protect_clock)
+    service_variables[:protect_kernel_tunables] = true unless property_is_set?(:protect_kernel_tunables)
+    service_variables[:protect_kernel_modules] = true unless property_is_set?(:protect_kernel_modules)
+    service_variables[:protect_kernel_logs] = true unless property_is_set?(:protect_kernel_logs)
+    service_variables[:protect_control_groups] = true unless property_is_set?(:protect_control_groups)
+    service_variables[:restrict_address_families] = [] unless property_is_set?(:restrict_address_families)
+    service_variables[:restrict_namespaces] = true unless property_is_set?(:restrict_namespaces)
+    service_variables[:lock_personality] = true unless property_is_set?(:lock_personality)
+    service_variables[:memory_deny_write_execute] = true unless property_is_set?(:memory_deny_write_execute)
+    service_variables[:restrict_realtime] = true unless property_is_set?(:restrict_realtime)
+    service_variables[:restrict_suid_sgid] = true unless property_is_set?(:restrict_suid_sgid)
+    service_variables[:remove_ipc] = true unless property_is_set?(:remove_ipc)
+    service_variables[:system_call_filter] = "@system-service" unless property_is_set?(:system_call_filter)
+    service_variables[:system_call_architectures] = "native" unless property_is_set?(:system_call_architectures)
+
+    if sandbox_option(:enable_network)
+      service_variables[:private_network] = false
+      service_variables[:restrict_address_families] = Array(service_variables[:restrict_address_families]).append("AF_INET", "AF_INET6").reject { |f| f == "none" }
+    end
+  end
+
   if new_resource.environment_file.is_a?(Hash)
     template "/etc/default/#{new_resource.service}" do
       cookbook "systemd"
@@ -146,6 +204,10 @@ action :delete do
 end
 
 action_class do
+  def sandbox_option(option)
+    new_resource.sandbox[option] if new_resource.sandbox.is_a?(Hash)
+  end
+
   def dropin_directory
     "/etc/systemd/system/#{new_resource.service}.service.d"
   end
index 4fba56c0f7cdc905df3b80980bbd438766eeec48..858dbb3278fe9a2dc7384d540d3dc37c1ef69139 100644 (file)
@@ -19,6 +19,9 @@ Conflicts=<%= Array(@conflicts).join(" ") %>
 <% if @wants -%>
 Wants=<%= Array(@wants).join(" ") %>
 <% end -%>
+<% if @joins_namespace_of -%>
+JoinsNamespaceOf=<%= Array(@joins_namespace_of).join(" ") %>
+<% end -%>
 
 [Service]
 <% if @type -%>
@@ -54,6 +57,9 @@ User=<%= @user %>
 <% if @group -%>
 Group=<%= @group %>
 <% end -%>
+<% if @dynamic_user -%>
+DynamicUser=<%= @dynamic_user %>
+<% end -%>
 <% if @working_directory -%>
 WorkingDirectory=<%= @working_directory %>
 <% end -%>
@@ -61,19 +67,25 @@ WorkingDirectory=<%= @working_directory %>
 <% if @dropin -%>
 ExecStartPre=
 <% end -%>
-ExecStartPre=<%= @exec_start_pre %>
+<% Array(@exec_start_pre).each do |exec_start_pre| -%>
+ExecStartPre=<%= exec_start_pre %>
+<% end -%>
 <% end -%>
 <% if @exec_start -%>
 <% if @dropin -%>
 ExecStart=
 <% end -%>
-ExecStart=<%= @exec_start %>
+<% Array(@exec_start).each do |exec_start| -%>
+ExecStart=<%= exec_start %>
+<% end -%>
 <% end -%>
 <% if @exec_start_post -%>
 <% if @dropin -%>
 ExecStartPost=
 <% end -%>
-ExecStartPost=<%= @exec_start_post %>
+<% Array(@exec_start_post).each do |exec_start_post| -%>
+ExecStartPost=<%= exec_start_post %>
+<% end -%>
 <% end -%>
 <% if @exec_stop -%>
 <% if @dropin -%>
@@ -105,14 +117,17 @@ StandardOutput=<%= @standard_output %>
 <% if @standard_error -%>
 StandardError=<%= @standard_error %>
 <% end -%>
-<% if @private_tmp -%>
-PrivateTmp=<%= @private_tmp %>
+<% if @protect_proc && node[:lsb][:release].to_f >= 22.04  -%>
+ProtectProc=<%= @protect_proc %>
 <% end -%>
-<% if @private_devices -%>
-PrivateDevices=<%= @private_devices %>
+<% if @proc_subset && node[:lsb][:release].to_f >= 22.04 -%>
+ProcSubset=<%= @proc_subset %>
 <% end -%>
-<% if @private_network -%>
-PrivateNetwork=<%= @private_network %>
+<% if @no_new_privileges -%>
+NoNewPrivileges=<%= @no_new_privileges %>
+<% end -%>
+<% if @capability_bounding_set -%>
+CapabilityBoundingSet=<%= Array(@capability_bounding_set).sort.uniq.join(" ") %>
 <% end -%>
 <% if @protect_system -%>
 ProtectSystem=<%= @protect_system %>
@@ -121,19 +136,73 @@ ProtectSystem=<%= @protect_system %>
 ProtectHome=<%= @protect_home %>
 <% end -%>
 <% if @read_write_paths -%>
-ReadWritePaths=<%= Array(@read_write_paths).join(" ") %>
+ReadWritePaths=<%= Array(@read_write_paths).sort.uniq.join(" ") %>
 <% end -%>
 <% if @read_only_paths -%>
-ReadOnlyPaths=<%= Array(@read_only_paths).join(" ") %>
+ReadOnlyPaths=<%= Array(@read_only_paths).sort.uniq.join(" ") %>
 <% end -%>
 <% if @inaccessible_paths -%>
-InaccessiblePaths=<%= Array(@inaccessible_paths).join(" ") %>
+InaccessiblePaths=<%= Array(@inaccessible_paths).sort.uniq.join(" ") %>
+<% end -%>
+<% if @private_tmp -%>
+PrivateTmp=<%= @private_tmp %>
+<% end -%>
+<% if @private_devices -%>
+PrivateDevices=<%= @private_devices %>
+<% end -%>
+<% if @private_network -%>
+PrivateNetwork=<%= @private_network %>
+<% end -%>
+<% if @private_ipc && node[:lsb][:release].to_f >= 22.04 -%>
+PrivateIPC=<%= @private_ipc %>
+<% end -%>
+<% if @private_users -%>
+PrivateUsers=<%= @private_users %>
+<% end -%>
+<% if @protect_hostname -%>
+ProtectHostname=<%= @protect_hostname %>
+<% end -%>
+<% if @protect_clock -%>
+ProtectClock=<%= @protect_clock %>
+<% end -%>
+<% if @protect_kernel_tunables -%>
+ProtectKernelTunables=<%= @protect_kernel_tunables %>
+<% end -%>
+<% if @protect_kernel_modules -%>
+ProtectKernelModules=<%= @protect_kernel_modules %>
+<% end -%>
+<% if @protect_kernel_logs -%>
+ProtectKernelLogs=<%= @protect_kernel_logs %>
+<% end -%>
+<% if @protect_control_groups -%>
+ProtectControlGroups=<%= @protect_control_groups %>
 <% end -%>
 <% if @restrict_address_families -%>
-RestrictAddressFamilies=<%= Array(@restrict_address_families).join(" ") %>
+RestrictAddressFamilies=<%= Array(@restrict_address_families).sort.uniq.join(" ") %>
 <% end -%>
-<% if @no_new_privileges -%>
-NoNewPrivileges=<%= @no_new_privileges %>
+<% if @restrict_namespaces -%>
+RestrictNamespaces=<%= Array(@restrict_namespaces).sort.uniq.join(" ") %>
+<% end -%>
+<% if @lock_personality -%>
+LockPersonality=<%= @lock_personality %>
+<% end -%>
+<% if @memory_deny_write_execute -%>
+MemoryDenyWriteExecute=<%= @memory_deny_write_execute %>
+<% end -%>
+<% if @restrict_realtime -%>
+RestrictRealtime=<%= @restrict_realtime %>
+<% end -%>
+<% if @restrict_suid_sgid -%>
+RestrictSUIDSGID=<%= @restrict_suid_sgid %>
+<% end -%>
+<% if @remove_ipc -%>
+RemoveIPC=<%= @remove_ipc %>
+<% end -%>
+<% if @system_call_filter -%>
+SystemCallFilter=<%= Array(@system_call_filter).join(" ") %>
+<% end -%>
+<% if @system_call_architectures -%>
+SystemCallArchitectures=<%= Array(@system_call_architectures).sort.uniq.join(" ") %>
 <% end -%>
 <% if @tasks_max -%>
 TasksMax=<%= @tasks_max %>
index dd79000ab118d2ebaa5df0199ec2d637cc80fb9d..5e468f00c57329830a46a19d0cb78eb62b82edd7 100644 (file)
@@ -10,4 +10,5 @@ depends           "accounts"
 depends           "apache"
 depends           "git"
 depends           "passenger"
+depends           "planet"
 depends           "ruby"
index ba25e998421f73076a071e4d3f5cf9e9441fdc32..e3f2b334f37bd855b4a9b98c0b04acb5d436268b 100644 (file)
@@ -23,6 +23,7 @@ include_recipe "accounts"
 include_recipe "apache"
 include_recipe "git"
 include_recipe "passenger"
+include_recipe "planet::current"
 include_recipe "ruby"
 
 package %w[
@@ -68,6 +69,27 @@ template "/etc/sudoers.d/taginfo" do
   mode "440"
 end
 
+systemd_service "taginfo-update@" do
+  description "Taginfo update for %i"
+  wants "planet-update.service"
+  after "planet-update.service"
+  exec_start "/srv/%i/bin/update"
+  user "taginfo"
+  sandbox :enable_network => true
+  restrict_address_families "AF_UNIX"
+  read_write_paths [
+    "/srv/%i/data",
+    "/srv/%i/download",
+    "/srv/%i/sources",
+    "/var/log/taginfo/%i"
+  ]
+end
+
+systemd_timer "taginfo-update@" do
+  description "Taginfo update for %i"
+  on_calendar "01:37"
+end
+
 node[:taginfo][:sites].each do |site|
   site_name = site[:name]
   site_aliases = Array(site[:aliases])
@@ -193,12 +215,8 @@ node[:taginfo][:sites].each do |site|
     directory "#{directory}/taginfo/web/public"
     variables :aliases => site_aliases
   end
-end
 
-template "/usr/local/bin/taginfo-update" do
-  source "taginfo-update.erb"
-  owner "root"
-  group "root"
-  mode "755"
-  variables :sites => node[:taginfo][:sites]
+  service "taginfo-update@#{site_name}.timer" do
+    action [:enable, :start]
+  end
 end
diff --git a/cookbooks/taginfo/templates/default/taginfo-update.erb b/cookbooks/taginfo/templates/default/taginfo-update.erb
deleted file mode 100644 (file)
index 0dd05b8..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-# DO NOT EDIT - This file is being maintained by Chef
-
-<% @sites.each do |site| -%>
-<% if site[:directory] -%>
-<%= site[:directory] %>/bin/update
-<% else -%>
-/srv/<%= site[:name] %>/bin/update
-<% end -%>
-<% end -%>
index 99b322f57468357c1a844d875c76f37d49f0c6dc..caad713535e30848ab0aa5eb5ec5c818bb970208 100644 (file)
@@ -19,7 +19,7 @@ mv $ROOT/data/taginfo-* $ROOT/data/old
 mv $ROOT/sources/taginfo-*.db $ROOT/sources/*/taginfo-*.db $ROOT/data
 mv $ROOT/sources/download/* $ROOT/download
 
-sudo PASSENGER_INSTANCE_REGISTRY_DIR=<%= node[:passenger][:instance_registry_dir] %> /usr/bin/passenger-config restart-app $ROOT/taginfo/web > /dev/null
+PASSENGER_INSTANCE_REGISTRY_DIR=<%= node[:passenger][:instance_registry_dir] %> /usr/bin/passenger-config restart-app $ROOT/taginfo/web > /dev/null
 
 find $ROOT/sources/log -mtime +28 -delete
 
index e8bef858c83b2b7f21ffdd28e6fae8a876286eb5..d1a394b2f8b4532b1d569a0e25ea128fe85aa241 100644 (file)
@@ -108,6 +108,10 @@ file "/srv/tile.openstreetmap.org/conf/ip.map" do
   mode "644"
 end
 
+tile_directories = node[:tile][:styles].collect do |_, style|
+  style[:tile_directories].collect { |directory| directory[:name] }
+end.flatten.sort.uniq
+
 package "renderd"
 
 systemd_service "renderd" do
@@ -115,19 +119,12 @@ systemd_service "renderd" do
   after "postgresql.service"
   wants "postgresql.service"
   limit_nofile 4096
-  private_tmp true
-  private_devices true
-  private_network true
-  protect_system "full"
-  protect_home true
-  no_new_privileges true
+  sandbox true
+  restrict_address_families "AF_UNIX"
+  read_write_paths tile_directories
   restart "on-failure"
 end
 
-systemd_service "renderd" do
-  action :delete
-end
-
 service "renderd" do
   action [:enable, :start]
   subscribes :restart, "systemd_service[renderd]"
@@ -176,30 +173,6 @@ python_package "pyotp" do
   python_version "3"
 end
 
-unifont = if node[:lsb][:release].to_f < 22.04
-            "ttf-unifont"
-          else
-            "fonts-unifont"
-          end
-
-package %W[
-  fonts-noto-cjk
-  fonts-noto-hinted
-  fonts-noto-unhinted
-  fonts-hanazono
-  #{unifont}
-]
-
-["NotoSansArabicUI-Regular.ttf", "NotoSansArabicUI-Bold.ttf"].each do |font|
-  remote_file "/usr/share/fonts/truetype/noto/#{font}" do
-    action :create_if_missing
-    source "https://github.com/googlei18n/noto-fonts/raw/master/hinted/#{font}"
-    owner "root"
-    group "root"
-    mode "644"
-  end
-end
-
 directory "/srv/tile.openstreetmap.org/cgi-bin" do
   owner "tile"
   group "tile"
@@ -221,11 +194,22 @@ template "/srv/tile.openstreetmap.org/cgi-bin/debug" do
   mode "755"
 end
 
-template "/etc/cron.hourly/export" do
-  source "export.cron.erb"
-  owner "root"
-  group "root"
-  mode "755"
+systemd_service "export-cleanup" do
+  description "Cleanup stale export temporary files"
+  joins_namespace_of "apache2.service"
+  exec_start "find /tmp -ignore_readdir_race -name 'export??????' -mmin +60 -delete"
+  user "www-data"
+  sandbox true
+end
+
+systemd_timer "export-cleanup" do
+  description "Cleanup stale export temporary files"
+  on_boot_sec "60m"
+  on_unit_inactive_sec "60m"
+end
+
+service "export-cleanup.timer" do
+  action [:enable, :start]
 end
 
 directory "/srv/tile.openstreetmap.org/data" do
@@ -234,7 +218,11 @@ directory "/srv/tile.openstreetmap.org/data" do
   mode "755"
 end
 
-package "mapnik-utils"
+package %w[
+  mapnik-utils
+  tar
+  unzip
+]
 
 node[:tile][:data].each_value do |data|
   url = data[:url]
@@ -253,8 +241,6 @@ node[:tile][:data].each_value do |data|
   end
 
   if file =~ /\.tgz$/
-    package "tar"
-
     execute file do
       action :nothing
       command "tar -zxf #{file} -C #{directory}"
@@ -262,8 +248,6 @@ node[:tile][:data].each_value do |data|
       group "tile"
     end
   elsif file =~ /\.tar\.bz2$/
-    package "tar"
-
     execute file do
       action :nothing
       command "tar -jxf #{file} -C #{directory}"
@@ -271,8 +255,6 @@ node[:tile][:data].each_value do |data|
       group "tile"
     end
   elsif file =~ /\.zip$/
-    package "unzip"
-
     execute file do
       action :nothing
       command "unzip -qq -o #{file} -d #{directory}"
@@ -312,16 +294,16 @@ nodejs_package "carto"
 
 systemd_service "update-lowzoom@" do
   description "Low zoom tile update service for %i layer"
-  conflicts "render-lowzoom.service"
   user "tile"
+  exec_start_pre "+/bin/systemctl stop render-lowzoom.service"
   exec_start "/bin/bash /usr/local/bin/update-lowzoom-%i"
   runtime_directory "update-lowzoom-%i"
-  private_tmp true
-  private_devices true
-  private_network true
-  protect_system "full"
-  protect_home true
-  no_new_privileges true
+  sandbox true
+  restrict_address_families "AF_UNIX"
+  read_write_paths [
+    "/srv/tile.openstreetmap.org/tiles/%i",
+    "/var/log/tile"
+  ]
   restart "on-failure"
 end
 
@@ -397,9 +379,20 @@ node[:tile][:styles].each do |name, details|
     group "tile"
   end
 
+  if details[:fonts_script]
+    execute details[:fonts_script] do
+      action :nothing
+      command details[:fonts_script]
+      cwd style_directory
+      user "tile"
+      group "tile"
+      subscribes :run, "git[#{style_directory}]"
+    end
+  end
+
   execute "#{style_directory}/project.mml" do
     action :nothing
-    command "carto -a 3.0.0 project.mml > project.xml"
+    command "carto -a 3.0.22 project.mml > project.xml"
     cwd style_directory
     user "tile"
     group "tile"
@@ -424,6 +417,11 @@ postgresql_user "tomh" do
   superuser true
 end
 
+postgresql_user "pnorman" do
+  cluster node[:tile][:database][:cluster]
+  superuser true
+end
+
 postgresql_user "tile" do
   cluster node[:tile][:database][:cluster]
 end
@@ -561,13 +559,9 @@ systemd_service "tile-ratelimit" do
   user "tile"
   group "adm"
   exec_start "/usr/local/bin/tile-ratelimit"
-  private_tmp true
-  private_devices true
-  private_network true
-  protect_system "full"
-  protect_home true
+  nice 10
+  sandbox true
   read_write_paths "/srv/tile.openstreetmap.org/conf"
-  no_new_privileges true
   restart "on-failure"
 end
 
@@ -609,12 +603,14 @@ systemd_service "expire-tiles" do
   type "simple"
   user "_renderd"
   exec_start "/usr/local/bin/expire-tiles"
+  nice 10
   standard_output "null"
-  private_tmp true
-  private_devices true
-  protect_system "full"
-  protect_home true
-  no_new_privileges true
+  sandbox true
+  read_write_paths tile_directories + [
+    "/store/database/nodes",
+    "/var/lib/replicate/expire-queue",
+    "/var/log/tile"
+  ]
 end
 
 systemd_path "expire-tiles" do
@@ -633,11 +629,13 @@ systemd_service "replicate" do
   wants "postgresql.service"
   user "tile"
   exec_start "/usr/local/bin/replicate"
-  private_tmp true
-  private_devices true
-  protect_system "full"
-  protect_home true
-  no_new_privileges true
+  sandbox :enable_network => true
+  restrict_address_families "AF_UNIX"
+  read_write_paths [
+    "/store/database/nodes",
+    "/var/lib/replicate",
+    "/var/log/tile"
+  ]
   restart "on-failure"
 end
 
@@ -666,12 +664,9 @@ systemd_service "render-lowzoom" do
   condition_path_exists_glob "!/run/update-lowzoom-*"
   user "tile"
   exec_start "/usr/local/bin/render-lowzoom"
-  private_tmp true
-  private_devices true
-  private_network true
-  protect_system "full"
-  protect_home true
-  no_new_privileges true
+  sandbox true
+  restrict_address_families "AF_UNIX"
+  read_write_paths "/var/log/tile"
 end
 
 systemd_timer "render-lowzoom" do
@@ -693,18 +688,27 @@ template "/usr/local/bin/cleanup-tiles" do
   mode "755"
 end
 
-tile_directories = node[:tile][:styles].collect do |_, style|
-  style[:tile_directories].collect { |directory| directory[:name] }
-end.flatten.sort.uniq
+systemd_service "cleanup-tiles@" do
+  description "Cleanup old tiles for /%I"
+  exec_start "/usr/local/bin/cleanup-tiles /%I"
+  user "_renderd"
+  io_scheduling_class "idle"
+  sandbox true
+  read_write_paths "/%I"
+end
+
+systemd_timer "cleanup-tiles@" do
+  description "Cleanup old tiles for /%I"
+  on_boot_sec "30m"
+  on_unit_inactive_sec "60m"
+  randomized_delay_sec "10m"
+end
 
 tile_directories.each do |directory|
-  label = directory.gsub("/", "-")
+  label = directory[1..].gsub("/", "-")
 
-  cron_d "cleanup-tiles#{label}" do
-    minute "0"
-    user "_renderd"
-    command "ionice -c 3 /usr/local/bin/cleanup-tiles #{directory}"
-    mailto "admins@openstreetmap.org"
+  service "cleanup-tiles@#{label}.timer" do
+    action [:enable, :start]
   end
 end
 
diff --git a/cookbooks/tile/templates/default/export.cron.erb b/cookbooks/tile/templates/default/export.cron.erb
deleted file mode 100644 (file)
index b598e41..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-
-# DO NOT EDIT - This file is being maintained by Chef
-
-# Removes stale tmp files from the export tab
-exec find /tmp -ignore_readdir_race -name 'export??????' -mmin +60 -delete
index 586d8660762971334720cd767c9cba6843bd39a9..1d7e24e45fed23820c0821fc735dae9a6f1d23c1 100644 (file)
@@ -4,7 +4,7 @@
   daily
   size 1G
   missingok
-  rotate 28
+  rotate 14
   compress
   delaycompress
   notifempty
index 95e4ed6e8f943610752b21d2e67cb02f96ef0efe..834eecc3040b79ea0b00b7e341de2e404ff3b39d 100644 (file)
@@ -16,9 +16,9 @@ function update_<%= style %>
     --timestamp=${timestamp} \
     --tile-dir=/srv/tile.openstreetmap.org/tiles \
     --socket=/var/run/renderd/renderd.sock \
-    --num-threads=<%= node[:cpu][:total] - 1 %> \
+    --num-threads=<%= node.cpu_cores - 1 %> \
     --map="<%= style %>" \
-    --max-load=<%= node[:cpu][:total] %> \
+    --max-load=<%= node.cpu_cores - 1 %> \
     --min-zoom=0 --max-zoom=12
 }
 
index 8f441db2ca216269b8a627b85a1455861e02ad39..d29c58aa7728f9512a6fe22d2dac67269319ed9e 100644 (file)
@@ -2,7 +2,7 @@
 
 [renderd]
 socketname=/var/run/renderd/renderd.sock
-num_threads=<%= node[:cpu][:total] - 1 %>
+num_threads=<%= node.cpu_cores - 1 %>
 tile_dir=/srv/tile.openstreetmap.org/tiles
 stats_file=/var/run/renderd/renderd.stats
 
index 85f32c13d3688527f20383b3180b7eceb376568c..81e138076b72066581124f1225c8f5557880172c 100644 (file)
@@ -12,9 +12,9 @@ function update_tiles
     --timestamp=$(stat -c %Y "/srv/tile.openstreetmap.org/styles/<%= @style %>/project.xml") \
     --tile-dir=/srv/tile.openstreetmap.org/tiles \
     --socket=/var/run/renderd/renderd.sock \
-    --num-threads=<%= node[:cpu][:total] - 1 %> \
+    --num-threads=<%= node.cpu_cores - 1 %> \
     --map="<%= @style %>" \
-    --max-load=<%= node[:cpu][:total] %> \
+    --max-load=<%= node.cpu_cores - 1 %> \
     --min-zoom=0 --max-zoom=12
 }
 
index 9d1935ff4882d803a9f3527e19dbad7b70f7f320..44791c28868e797732ec8d388b62cdbe5573365f 100644 (file)
@@ -31,7 +31,7 @@ end
 python_package "tilelog" do
   python_virtualenv tilelog_directory
   python_version "3"
-  version "1.4.0"
+  version "1.4.1"
 end
 
 directory tilelog_output_directory do
@@ -54,10 +54,8 @@ systemd_service "tilelog" do
   description "Tile log analysis"
   user "www-data"
   exec_start "/usr/local/bin/tilelog"
-  private_tmp true
-  private_devices true
-  protect_system "strict"
-  protect_home true
+  nice 10
+  sandbox :enable_network => true
   read_write_paths tilelog_output_directory
 end
 
index 9c789bffcfcbd512a43e745e374392e4162c1e28..3aa5110aac28b088d91ec5e77ec12a56dcb33f3b 100644 (file)
@@ -1,4 +1,2 @@
 default[:timescaledb][:database_version] = "14"
 default[:timescaledb][:max_background_workers] = 8
-
-default[:apt][:sources] |= ["timescaledb"]
index a9878595a429a556b38f35679c2c0e84fed366ef..05085d948c98224f3bec618a7f1917b3817f87b7 100644 (file)
@@ -17,7 +17,7 @@
 # limitations under the License.
 #
 
-include_recipe "apt"
+include_recipe "apt::timescaledb"
 
 database_version = node[:timescaledb][:database_version]
 
index 80fde7f057da6a8935e542ff2f09a29414b1eb2b..05420a1d2b2a058a4791ab32901c6778a634bf8f 100644 (file)
@@ -46,7 +46,7 @@ service "rsyslog" do
 end
 
 # Remove some unused and unwanted packages
-package %w[mlocate nano whoopsie] do
+package %w[mlocate whoopsie] do
   action :purge
 end
 
index e18974af8507c7e441c7e7408897a8420ebdd18d..8956b78bbd21e6844413567ab244d2bfc9302eaf 100644 (file)
@@ -33,6 +33,7 @@ apache_module "proxy"
 apache_module "proxy_fcgi"
 apache_module "lbmethod_byrequests"
 apache_module "lbmethod_bybusyness"
+apache_module "reqtimeout"
 apache_module "rewrite"
 apache_module "unique_id"
 
@@ -67,19 +68,19 @@ service "rails-jobs@mailers" do
   action [:enable, :start]
   supports :restart => true
   subscribes :restart, "rails_port[www.openstreetmap.org]"
-  subscribes :restart, "systemd_service[rails-jobs]"
+  subscribes :restart, "systemd_service[rails-jobs@]"
 end
 
 service "rails-jobs@storage" do
   action [:enable, :start]
   supports :restart => true
   subscribes :restart, "rails_port[www.openstreetmap.org]"
-  subscribes :restart, "systemd_service[rails-jobs]"
+  subscribes :restart, "systemd_service[rails-jobs@]"
 end
 
 service "rails-jobs@traces" do
   action [:enable, :start]
   supports :restart => true
   subscribes :restart, "rails_port[www.openstreetmap.org]"
-  subscribes :restart, "systemd_service[rails-jobs]"
+  subscribes :restart, "systemd_service[rails-jobs@]"
 end
index c60655f9e74a797856a4d09211781f891b099250..8a2acef3267634b8c8e2e037fb65a21062269313 100644 (file)
@@ -42,14 +42,6 @@ end
 
 nodejs_package "svgo"
 
-template "/etc/cron.hourly/passenger" do
-  cookbook "web"
-  source "passenger.cron.erb"
-  owner "root"
-  group "root"
-  mode "755"
-end
-
 rails_directory = "#{node[:web][:base_directory]}/rails"
 
 matomo = data_bag_item("web", "matomo")
@@ -122,6 +114,9 @@ rails_port "www.openstreetmap.org" do
   oauth_application web_passwords["oauth_application"]
   matomo_configuration "location" => matomo[:location],
                        "site" => matomo[:site],
+                       "visitor_cookie_timeout" => matomo[:visitor_cookie_timeout],
+                       "referral_cookie_timeout" => matomo[:referral_cookie_timeout],
+                       "session_cookie_timeout" => matomo[:session_cookie_timeout],
                        "goals" => matomo[:goals].to_hash
   google_auth_id "651529786092-6c5ahcu0tpp95emiec8uibg11asmk34t.apps.googleusercontent.com"
   google_auth_secret web_passwords["google_auth_secret"]
@@ -147,21 +142,21 @@ rails_port "www.openstreetmap.org" do
   avatar_storage_url "https://openstreetmap-user-avatars.s3.dualstack.eu-west-1.amazonaws.com"
   trace_image_storage_url "https://openstreetmap-gps-images.s3.dualstack.eu-west-1.amazonaws.com"
   overpass_url "https://query.openstreetmap.org/query-features"
+  overpass_credentials true
 end
 
 systemd_service "rails-jobs@" do
   description "Rails job queue runner"
   type "simple"
-  environment "RAILS_ENV" => "production", "QUEUE" => "%I"
+  environment "RAILS_ENV" => "production", "QUEUE" => "%I", "SLEEP_DELAY" => "60"
   user "rails"
   working_directory rails_directory
   exec_start "#{node[:ruby][:bundle]} exec rails jobs:work"
   restart "on-failure"
-  private_tmp true
-  private_devices true
-  protect_system "full"
-  protect_home true
-  no_new_privileges true
+  nice 10
+  sandbox :enable_network => true
+  memory_deny_write_execute false
+  read_write_paths "/var/log/web"
 end
 
 package "libjson-xs-perl"
@@ -193,12 +188,12 @@ systemd_service "api-statistics" do
   user "rails"
   group "adm"
   exec_start "/usr/local/bin/api-statistics"
-  private_tmp true
-  private_devices true
-  private_network true
-  protect_system "full"
-  protect_home true
-  no_new_privileges true
+  nice 10
+  sandbox true
+  read_write_paths [
+    "/srv/www.openstreetmap.org/rails/tmp",
+    "/var/lib/prometheus/node-exporter"
+  ]
   restart "on-failure"
 end
 
index 29ee80e6c71af6cef064fe83651740a4e772b115..d3829f06c73815a839cb782c862717afd1277852 100644 (file)
@@ -30,9 +30,22 @@ template "/usr/local/bin/statistics" do
   variables :ruby => ruby, :directory => rails_directory
 end
 
-cron_d "statistics" do
-  minute "0"
-  hour "0"
+systemd_service "web-statistics" do
+  description "Generate web statistics"
+  environment "RAILS_ENV" => "production"
   user "rails"
-  command "/usr/local/bin/statistics"
+  working_directory rails_directory
+  exec_start "/usr/local/bin/statistics"
+  sandbox :enable_network => true
+  memory_deny_write_execute false
+  read_write_paths ["#{rails_directory}/tmp", "/var/log/web"]
+end
+
+systemd_timer "web-statistics" do
+  description "Generate web statistics"
+  on_calendar "00:00:00"
+end
+
+service "web-statistics.timer" do
+  action [:enable, :start]
 end
index 16402d243043fb5c724516363fd17ceee541fd93..27cb3b02f9b09ca9c5dad6a13cbf99f5bda0b699 100644 (file)
@@ -55,6 +55,7 @@ property :oauth_key, String
 property :oauth_application, String
 property :nominatim_url, String
 property :overpass_url, String
+property :overpass_credentials, [true, false], :default => false
 property :google_auth_id, String
 property :google_auth_secret, String
 property :google_openid_realm, String
@@ -306,6 +307,7 @@ action :create do
     "oauth_application",
     "nominatim_url",
     "overpass_url",
+    "overpass_credentials",
     "google_auth_id",
     "google_auth_secret",
     "google_openid_realm",
@@ -403,10 +405,6 @@ action :create do
     only_if { new_resource.run_migrations }
   end
 
-  package "yarnpkg" do
-    only_if { new_resource.build_assets }
-  end
-
   bundle_exec "#{rails_directory}/package.json" do
     action :nothing
     directory rails_directory
@@ -486,7 +484,7 @@ action :restart do
 end
 
 action_class do
-  include Chef::Mixin::EditFile
+  include OpenStreetMap::Mixin::EditFile
 
   def rails_directory
     new_resource.directory || "/srv/#{new_resource.site}"
index 91304f497bf5f07057bfa3205b49fc3561ca3c28..c3309cd23b6a671998e81f7bc7c445d5244a4ca6 100644 (file)
   ExpiresActive On
   RewriteEngine on
 
+  #
+  # Configure timeouts
+  #
+  RequestReadTimeout handshake=20-40,MinRate=500 header=20-40,MinRate=500 body=20,MinRate=500
+
   #
   # Add the unique ID to the request headers
   #
diff --git a/cookbooks/web/templates/default/passenger.cron.erb b/cookbooks/web/templates/default/passenger.cron.erb
deleted file mode 100644 (file)
index d3cef76..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/sh
-
-# Get a list of rack processes that are running
-pgrep -u rails -f Rack | sort > /tmp/rails.actual.$$
-
-# Get a list of rack processes we expect to be running
-PASSENGER_INSTANCE_REGISTRY_DIR=<%= node[:passenger][:instance_registry_dir] %> passenger-status | awk '/PID:/ { print $3 }' | sort > /tmp/rails.expected.$$
-
-# Get a list of unexpected rack processes
-pids=$(comm -23 /tmp/rails.actual.$$ /tmp/rails.expected.$$)
-
-# Kill any expected rack processes
-[ -n "$pids" ] && kill -9 $pids > /dev/null 2>&1
-
-# Remove our temporary files
-rm -f /tmp/rails.actual.$$ /tmp/rails.expected.$$
index 0b77f3aa725ca3615c9b9805eae91beeb8d285cf..1c39edb1b6602c208c4382884362100ac096752e 100644 (file)
@@ -7,3 +7,4 @@ description       "Installs and configures servers for wiki.openstreetmap.org"
 version           "1.0.0"
 supports          "ubuntu"
 depends           "mediawiki"
+depends           "systemd"
index ef0d16b8b67d79330da40cea7e23d919595ca55b..2485932b3df66596bbc52146bf71b789e19da3af 100644 (file)
@@ -134,9 +134,48 @@ directory "/srv/wiki.openstreetmap.org/dump" do
   mode "0775"
 end
 
-cron_d "wiki-dump" do
-  minute "0"
-  hour "2"
+systemd_service "wiki-dump" do
+  description "Wiki dump"
+  type "oneshot"
+  exec_start "/usr/bin/php w/maintenance/dumpBackup.php --full --quiet --output=gzip:dump/dump.xml.gz"
+  working_directory "/srv/wiki.openstreetmap.org"
   user "wiki"
-  command "cd /srv/wiki.openstreetmap.org && php w/maintenance/dumpBackup.php --full --quiet --output=gzip:dump/dump.xml.gz"
+  sandbox :enable_network => true
+  memory_deny_write_execute false
+  restrict_address_families "AF_UNIX"
+  read_write_paths "/srv/wiki.openstreetmap.org/dump"
+end
+
+systemd_timer "wiki-dump" do
+  description "Wiki dump"
+  on_calendar "02:00"
+end
+
+service "wiki-dump.timer" do
+  action [:enable, :start]
+end
+
+systemd_service "wiki-rdf-dump" do
+  description "Wiki RDF dump"
+  type "oneshot"
+  exec_start [
+    "/usr/bin/php w/extensions/Wikibase/repo/maintenance/dumpRdf.php --wiki wiki --format ttl --flavor full-dump --entity-type item --entity-type property --no-cache --output /tmp/wikibase-rdf.ttl",
+    "/bin/gzip -9 /tmp/wikibase-rdf.ttl",
+    "/bin/mv /tmp/wikibase-rdf.ttl.gz /srv/wiki.openstreetmap.org/dump/wikibase-rdf.ttl.gz"
+  ]
+  working_directory "/srv/wiki.openstreetmap.org"
+  user "wiki"
+  sandbox :enable_network => true
+  memory_deny_write_execute false
+  restrict_address_families "AF_UNIX"
+  read_write_paths "/srv/wiki.openstreetmap.org/dump"
+end
+
+systemd_timer "wiki-rdf-dump" do
+  description "Wiki RDF dump"
+  on_calendar "04:00"
+end
+
+service "wiki-rdf-dump.timer" do
+  action [:enable, :start]
 end
index 0b69f5c94e26ca7105d109e5a0e0ebd32b11d081..6f7e8d6ebb7a22e75531ebd1d694dd32e45e922c 100644 (file)
@@ -125,6 +125,7 @@ $wgWBClientSettings['entitySources'] = [
 ];
 
 $wgWBClientSettings['namespaces'] = [ NS_MAIN ];
+$wgWBClientSettings['repoSiteName'] = 'Data Items';
 
 // Avoid complaints that nobody seems to know the cause off...
 $wgWBClientSettings['entityUsagePerPageLimit'] = 500;
index c3f16ddca51ffa506e5ee37d6aeab1595857e29a..c8a3e388321e200f56289d84b5d105dfbd0a0c88 100644 (file)
@@ -217,8 +217,8 @@ action :delete do
 end
 
 action_class do
-  include Chef::Mixin::EditFile
-  include Chef::Mixin::PersistentToken
+  include OpenStreetMap::Mixin::EditFile
+  include OpenStreetMap::Mixin::PersistentToken
 
   def site_directory
     new_resource.directory || "/srv/#{new_resource.site}"
index a1187818a55d60d3527b6f614af36c9588181f96..0e0790fdb8359f10e6d318a0759b9dddbdf1f8d1 100644 (file)
@@ -61,7 +61,7 @@
     Require all granted
 
     <FilesMatch ".+\.ph(ar|p|tml)$">
-      SetHandler "proxy:unix:/run/php/<%= @name %>.sock|fcgi://127.0.0.1"
+      SetHandler "proxy:unix:/run/php/php-<%= @name %>-fpm.sock|fcgi://127.0.0.1"
     </FilesMatch>
   </Directory>
 
diff --git a/roles/aws-us-east-2.rb b/roles/aws-us-east-2.rb
new file mode 100644 (file)
index 0000000..2cdc4c2
--- /dev/null
@@ -0,0 +1,11 @@
+name "aws-us-east-2"
+description "Role applied to all servers at AWS us-east-2"
+
+default_attributes(
+  :location => "Ohio"
+)
+
+run_list(
+  "role[us]",
+  "role[aws]"
+)
diff --git a/roles/aws.rb b/roles/aws.rb
new file mode 100644 (file)
index 0000000..4438781
--- /dev/null
@@ -0,0 +1,12 @@
+name "aws"
+description "Role applied to all servers at AWS"
+
+default_attributes(
+  :hosted_by => "AWS"
+)
+
+override_attributes(
+  :ntp => {
+    :servers => ["169.254.169.123"]
+  }
+)
index 879a11a3d3c55a219c3e699c77928e2eb0945b26..2da7e4e243f9a920d07286a5b09803cea50cfb04 100644 (file)
@@ -74,10 +74,9 @@ default_attributes(
       }
     },
     :default_qdisc => {
-      :comment => "Use fq as the default queuing discipline and cubic for congestion control",
+      :comment => "Use fq as the default queuing discipline",
       :parameters => {
-        "net.core.default_qdisc" => "fq",
-        "net.ipv4.tcp_congestion_control" => "cubic"
+        "net.core.default_qdisc" => "fq"
       }
     },
     :tune_cpu_scheduler => {
diff --git a/roles/blogs.rb b/roles/blogs.rb
new file mode 100644 (file)
index 0000000..3881d13
--- /dev/null
@@ -0,0 +1,6 @@
+name "blogs"
+description "Role applied to all blog aggregators"
+
+run_list(
+  "recipe[blogs]"
+)
index c24e40fbbe80ac01902647787d8a33e187ffd393..b482cfce0ebc3297b7aaf0339c01c4c986866153 100644 (file)
@@ -9,6 +9,9 @@ default_attributes(
         :members => [:grant, :tomh]
       }
     }
+  },
+  :exim => {
+    :smarthost_via => "fafnir.openstreetmap.org:26"
   }
 )
 
index 5d2c36edb5c80e5b93cb434bb1b5ad141dca89d6..18e0edfcf279fbf63a1f05f4b87f464bb050ec19 100644 (file)
@@ -58,6 +58,7 @@ default_attributes(
       :cobra => { :status => :user },
       :ppawel => { :status => :user },
       :simon04 => { :status => :user },
+      :jeslop => { :status => :user },
       :jfire => { :status => :user },
       :malenki => { :status => :user },
       :lonvia => { :status => :user },
@@ -125,6 +126,9 @@ default_attributes(
       }
     }
   },
+  :exim => {
+    :smarthost_via => "fafnir.openstreetmap.org:26"
+  },
   :postgresql => {
     :versions => ["14"],
     :settings => {
index b3f864c6a08ad7f3a133d1bed341f0680b5df3a4..bc251288181b27ebac5f51e650db2acc17dce4b7 100644 (file)
@@ -10,6 +10,9 @@ default_attributes(
         :family => :inet,
         :address => "10.0.48.9",
         :bond => {
+          :mode => "802.3ad",
+          :lacprate => "fast",
+          :xmithashpolicy => "layer3+4",
           :slaves => %w[ens18f0 ens18f1]
         }
       },
@@ -42,7 +45,10 @@ default_attributes(
     :dbcluster => "14/main",
     :postgis => "3",
     :flatnode_file => "/ssd/nominatim/nodes.store",
-    :logdir => "/ssd/nominatim/log"
+    :logdir => "/ssd/nominatim/log",
+    :config => {
+      :forward_dependencies => "yes"
+    }
   }
 )
 
diff --git a/roles/errol.rb b/roles/errol.rb
deleted file mode 100644 (file)
index e4db08b..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-name "errol"
-description "Master role applied to errol"
-
-default_attributes(
-  :devices => {
-    :osdsk => {
-      :comment => "First os disk",
-      :type => "block",
-      :bus => "scsi",
-      :serial => "20004d927fffff800",
-      :attrs => {
-        "queue/scheduler" => "deadline",
-        "queue/nr_requests" => "512"
-      }
-    },
-    :homedsk => {
-      :comment => "First home disk",
-      :type => "block",
-      :bus => "scsi",
-      :serial => "20004d927fffff801",
-      :attrs => {
-        "queue/scheduler" => "deadline",
-        "queue/nr_requests" => "512"
-      }
-    }
-  },
-  :networking => {
-    :interfaces => {
-      :internal_ipv4 => {
-        :interface => "eth0.2801",
-        :role => :internal,
-        :family => :inet,
-        :address => "10.0.0.14"
-      },
-      :external_ipv4 => {
-        :interface => "eth0.2800",
-        :role => :external,
-        :family => :inet,
-        :address => "193.60.236.13"
-      }
-    }
-  }
-)
-
-run_list(
-  "role[ucl]",
-  "role[tyan-s7010]",
-  "role[dev]"
-)
similarity index 59%
rename from roles/lockheed.rb
rename to roles/faffy.rb
index ec3f788f7c12a42123949897951662c695a37960..c7b8170d2b5ffd4212caee79cd66196feb511e6f 100644 (file)
@@ -1,5 +1,5 @@
-name "lockheed"
-description "Master role applied to lockheed"
+name "faffy"
+description "Master role applied to faffy"
 
 default_attributes(
   :networking => {
@@ -8,32 +8,31 @@ default_attributes(
         :interface => "bond0",
         :role => :internal,
         :family => :inet,
-        :address => "10.0.48.16",
+        :address => "10.0.48.3",
         :bond => {
-          :slaves => %w[eth0 eth1]
+          :mode => "802.3ad",
+          :lacprate => "fast",
+          :xmithashpolicy => "layer3+4",
+          :slaves => %w[eno1 eno2 eno3 eno4 eno5 eno6]
         }
       },
       :external_ipv4 => {
         :interface => "bond0.2",
         :role => :external,
         :family => :inet,
-        :address => "130.117.76.16"
+        :address => "130.117.76.3"
       },
       :external_ipv6 => {
         :interface => "bond0.2",
         :role => :external,
         :family => :inet6,
-        :address => "2001:978:2:2C::172:10"
+        :address => "2001:978:2:2C::172:3"
       }
-
     }
   }
 )
 
 run_list(
   "role[equinix-ams]",
-  "role[subversion]",
-  "role[trac]",
-  "role[irc]",
-  "recipe[blogs]"
+  "role[dev]"
 )
index 81210a2e02bdcae9942145d0340a8c63dadd3a18..8261d7afda3d531468abf8812e54b32852259571 100644 (file)
@@ -9,6 +9,16 @@ default_attributes(
     :first_address => "10.0.79.1",
     :last_address => "10.0.79.254"
   },
+  :exim => {
+    :smarthost_name => "fafnir.openstreetmap.org",
+    :routes => {
+      :openstreetmap => {
+        :comment => "openstreetmap.org",
+        :domains => ["openstreetmap.org"],
+        :host => ["shenron.openstreetmap.org"]
+      }
+    }
+  },
   :networking => {
     :interfaces => {
       :internal_ipv4 => {
@@ -56,5 +66,6 @@ run_list(
   "role[equinix-dub]",
   "role[hp-g9]",
   "role[gateway]",
+  "role[mail]",
   "recipe[dhcpd]"
 )
index 466e575f1c259bb7c60f63512ef199f7a1062df1..bafa81db75bf0647e5c77a8e01c77217bccfb2f8 100644 (file)
@@ -2,9 +2,6 @@ name "foundation"
 description "Role applied to all OSMF servers"
 
 default_attributes(
-  :apt => {
-    :sources => ["passenger"]
-  },
   :elasticsearch => {
     :version => "6.x",
     :cluster => {
index a31437a697444fec0dcf63c21bf3ff2ea2a3eed1..a2ad092f323812b6e142dc427bb0ea7bdadaaf0f 100644 (file)
@@ -12,7 +12,8 @@ default_attributes(
         :list => false,
         :transfer_logging => false,
         :hosts_allow => [
-          "193.60.236.20" # sarel
+          "184.104.226.102",  # idris
+          "2001:470:1:b3b::6" # idris
         ]
       }
     }
index 31ad54036829706b2021062d37b0d9b213cf2927..c401c865f6311eece5ec360cb16bccedb864d613 100644 (file)
@@ -16,9 +16,13 @@ default_attributes(
         :status => :user,
         :shell => "/usr/bin/git-shell"
       },
+      :stereo => {
+        :status => :user,
+        :shell => "/usr/bin/git-shell"
+      },
       :git => {
         :status => :role,
-        :members => [:tomh, :grant, :matt, :lonvia, :yellowbkpk]
+        :members => [:tomh, :grant, :matt, :lonvia, :yellowbkpk, :stereo]
       }
     }
   },
index aec768e827a90b17094528710c7ecff931014b3a..276d45ae7019dab646617edaf8979718d54f66c7 100644 (file)
@@ -34,5 +34,12 @@ default_attributes(
 
 run_list(
   "role[equinix-dub]",
-  "role[hp-g9]"
+  "role[hp-g9]",
+  "role[chef-server]",
+  "role[chef-repository]",
+  "role[dns]",
+  "role[git]",
+  "role[letsencrypt]",
+  "role[oxidized]",
+  "recipe[serverinfo]"
 )
index 635e197fa8dee4ebdd487a9a154f0faa590f6d09..e6b27496cb09b6de8fdbc219733e833371955acd 100644 (file)
@@ -2,9 +2,6 @@ name "ironbelly"
 description "Master role applied to ironbelly"
 
 default_attributes(
-  :apt => {
-    :sources => ["ubuntugis-unstable"]
-  },
   :bind => {
     :clients => "equinix-ams"
   },
@@ -38,6 +35,9 @@ default_attributes(
         :family => :inet,
         :address => "10.0.48.10",
         :bond => {
+          :mode => "802.3ad",
+          :lacprate => "fast",
+          :xmithashpolicy => "layer3+4",
           :slaves => %w[eth0 eth1]
         }
       },
@@ -62,12 +62,12 @@ default_attributes(
     :snmp => {
       "pdu1" => { :address => "10.0.48.100", :modules => %w[apcups], :labels => { "site" => "amsterdam" } },
       "pdu2" => { :address => "10.0.48.101", :modules => %w[apcups], :labels => { "site" => "amsterdam" } },
-      "switch1" => { :address => "130.117.76.2", :modules => %w[if_mib cisco_550x], :labels => { "site" => "amsterdam" } }
+      "switch1" => { :address => "130.117.76.2", :modules => %w[if_mib juniper_ex4300], :labels => { "site" => "amsterdam" } }
     },
     :metrics => {
       :uplink_interface => {
         :help => "Site uplink interface name",
-        :labels => { :site => "amsterdam", :name => "te[12]/0/1" }
+        :labels => { :site => "amsterdam", :name => "ge-[01]/2/0" }
       }
     }
   },
index ffad6d2eeca6213893e651b48e485dc33958a4e5..675a210cf366deece90d769c4e969f3cbcceea92 100644 (file)
@@ -10,6 +10,9 @@ default_attributes(
         :family => :inet,
         :address => "10.0.48.50",
         :bond => {
+          :mode => "802.3ad",
+          :lacprate => "fast",
+          :xmithashpolicy => "layer3+4",
           :slaves => %w[enp1s0f0 enp1s0f1 enp2s0f0 enp2s0f1]
         }
       }
index 509934ae4cad8877557a710e86f754f55cf5edfa..bb0b777f3d1602e2ceaebb2a58e7666080fd8626 100644 (file)
@@ -1,12 +1,6 @@
 name "logstash-forwarder"
 description "Role applied to all logstash forwarders"
 
-default_attributes(
-  :apt => {
-    :sources => ["elasticsearch8.x"]
-  }
-)
-
 run_list(
   "recipe[logstash::forwarder]"
 )
index f8ff9cd871085fde7af8f407d4c064da88c0a24e..14a634c9c34ef4e0d161f00fe189c0d8f7714f27 100644 (file)
@@ -52,6 +52,9 @@ default_attributes(
       "nominatim.openstreetmap.org" => {
         :max_children => 200
       }
+    },
+    :config => {
+      :forward_dependencies => "yes"
     }
   }
 )
index ae632f8982bd6dd22ac006a0c53a57a0ae27127b..b3ac245814113e9df0bf4c80f6a48fd8709c821f 100644 (file)
@@ -5,10 +5,11 @@ default_attributes(
   :apache => {
     :mpm => "event",
     :event => {
-      :server_limit => 18,
-      :max_request_workers => 450,
-      :min_spare_threads => 50,
-      :max_spare_threads => 150,
+      :server_limit => 30,
+      :max_request_workers => 1000,
+      :threads_per_child => 50,
+      :min_spare_threads => 75,
+      :max_spare_threads => 175,
       :listen_cores_buckets_ratio => 4
     }
   },
index 01a0d080396bc11d902161122a11f3c20460ae87..280afe21ee8fd36cd1772301a0db95da79c9537d 100644 (file)
@@ -34,5 +34,10 @@ default_attributes(
 
 run_list(
   "role[equinix-dub]",
-  "role[hp-g9]"
+  "role[hp-g9]",
+  "role[subversion]",
+  "role[trac]",
+  "role[irc]",
+  "role[blogs]",
+  "role[munin]"
 )
index b94298604a9ce434a8a908f7ed454fac6ca8af76..9fe581a977ca314c9ee3291e52da87e378aca854 100644 (file)
@@ -10,6 +10,9 @@ default_attributes(
         :family => :inet,
         :address => "10.0.48.17",
         :bond => {
+          :mode => "802.3ad",
+          :lacprate => "fast",
+          :xmithashpolicy => "layer3+4",
           :slaves => %w[enp25s0f0 enp25s0f1]
         }
       },
index b0c49764760cedc693dd47db40335034557b3424..abce74926bbb19d62fc273a556e5e2221d353ccb 100644 (file)
@@ -10,6 +10,9 @@ default_attributes(
         :family => :inet,
         :address => "10.0.48.15",
         :bond => {
+          :mode => "802.3ad",
+          :lacprate => "fast",
+          :xmithashpolicy => "layer3+4",
           :slaves => %w[eno1 eno2]
         }
       },
index 94d4c4cd291120f93af8a57d10d26c5ee2a9112f..7355e664ef3b1e2bf13ca2137bbfadccd0d3889e 100644 (file)
@@ -3,6 +3,7 @@ description "Role applied to all OTRS servers"
 
 default_attributes(
   :exim => {
+    :smarthost_via => "fafnir.openstreetmap.org:26",
     :local_domains => ["otrs.openstreetmap.org"],
     :routes => {
       :otrs_otrs => {
index cb0dfb4a209d719c6e461584080bc110bcd212d6..819bad11779c2e0e831b51c45c3ced38a6742d00 100644 (file)
@@ -14,8 +14,13 @@ default_attributes(
   :overpass => {
     :fqdn => "query.openstreetmap.org",
     :meta_mode => "no",
-    :compression_mode => "no",
+    :compression_mode => "lz4",
     :restricted_api => true
+  },
+  :prometheus => {
+    :files => %w[
+      /srv/query.openstreetmap.org/diffs/latest.osc
+    ]
   }
 )
 
diff --git a/roles/oxidized.rb b/roles/oxidized.rb
new file mode 100644 (file)
index 0000000..7835c2e
--- /dev/null
@@ -0,0 +1,17 @@
+name "oxidized"
+description "Role applied to all oxidized servers"
+
+default_attributes(
+  :accounts => {
+    :users => {
+      :oxidized => {
+        :status => :role,
+        :members => [:grant, :tomh]
+      }
+    }
+  }
+)
+
+run_list(
+  "recipe[oxidized]"
+)
diff --git a/roles/palulukon.rb b/roles/palulukon.rb
new file mode 100644 (file)
index 0000000..69183cb
--- /dev/null
@@ -0,0 +1,61 @@
+name "palulukon"
+description "Master role applied to palulukon"
+
+default_attributes(
+  :networking => {
+    :interfaces => {
+      :external_ipv4 => {
+        :interface => "ens5",
+        :role => :external,
+        :family => :inet,
+        :address => "172.31.37.101",
+        :prefix => "20",
+        :gateway => "172.31.32.1",
+        :public_address => "3.144.0.72"
+      }
+    }
+  },
+  :postgresql => {
+    :settings => {
+      :defaults => {
+        :shared_buffers => "8GB",
+        :maintenance_work_mem => "7144MB",
+        :effective_cache_size => "16GB"
+      }
+    }
+  },
+  :sysctl => {
+    :postgres => {
+      :comment => "Increase shared memory for postgres",
+      :parameters => {
+        "kernel.shmmax" => 9 * 1024 * 1024 * 1024,
+        "kernel.shmall" => 9 * 1024 * 1024 * 1024 / 4096
+      }
+    }
+  },
+  :tile => {
+    :database => {
+      :cluster => "14/main",
+      :postgis => "3"
+    },
+    :mapnik => "3.1",
+    :styles => {
+      :default => {
+        :tile_directories => [
+          { :name => "/store/tiles/default", :min_zoom => 0, :max_zoom => 19 }
+        ]
+      }
+    }
+  }
+)
+
+override_attributes(
+  :networking => {
+    :nameservers => ["172.31.0.2"]
+  }
+)
+
+run_list(
+  "role[aws-us-east-2]",
+  "role[tile]"
+)
diff --git a/roles/planet-current.rb b/roles/planet-current.rb
deleted file mode 100644 (file)
index 97f23d2..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-name "planet-current"
-description "Role applied to all servers needing an up to date planet file"
-
-default_attributes(
-  :accounts => {
-    :users => {
-      :planet => {
-        :status => :role
-      }
-    }
-  }
-)
-
-run_list(
-  "recipe[planet::current]"
-)
index d7f349b4475b4b094bbf07df300a8fa63d3720f1..4dd1f1d7476ec2cd3533c37280f0738f1427e129 100644 (file)
@@ -6,7 +6,7 @@ default_attributes(
     :mpm => "event",
     :keepalive => true,
     :event => {
-      :server_limit => 20,
+      :server_limit => 30,
       :max_request_workers => 1000,
       :threads_per_child => 50,
       :min_spare_threads => 75,
index d16fa71ad041d6ad5f5cf65f53e64f349e86241b..15cd24e9b34ec7a09a40703b946bf89aed80b1d0 100644 (file)
@@ -44,6 +44,9 @@ default_attributes(
     :tablespaces => {
       "daux" => "/data/tablespaces/daux",
       "iaux" => "/data/tablespaces/iaux"
+    },
+    :config => {
+      :forward_dependencies => "yes"
     }
 
   }
index ae27c20e2ac53f40557f27f3a7d89b1947f86e61..aee7655c99daf98c409cb0ff8be304a376145096 100644 (file)
@@ -49,5 +49,6 @@ run_list(
   "role[donate]",
   "recipe[hot]",
   "recipe[dmca]",
-  "recipe[dhcpd]"
+  "recipe[dhcpd]",
+  "recipe[ideditor]"
 )
index ab1bf393b259706a5a450e7336db8d71a1cb9cfb..30229a1c74d91f0a352ecc707557d019470a3e29 100644 (file)
@@ -33,11 +33,5 @@ default_attributes(
 )
 
 run_list(
-  "role[ucl]",
-  "role[chef-server]",
-  "role[chef-repository]",
-  "role[letsencrypt]",
-  "role[git]",
-  "role[dns]",
-  "recipe[serverinfo]"
+  "role[ucl]"
 )
index 36b8e4450dd79515b7610933080393a98d34f8d2..86c38424ef63bec8f719bce2c0e8ab589ad28c73 100644 (file)
@@ -15,11 +15,6 @@ default_attributes(
       }
     }
   },
-  :hardware => {
-    :mcelog => {
-      :enabled => false
-    }
-  },
   :networking => {
     :interfaces => {
       :external_ipv4 => {
index c57441b1149a6adc62090b4c8a93d40d302b3552..c82e4cd211adfa60ee3cd3fbc92385b1d9a6e841 100644 (file)
@@ -15,9 +15,6 @@ default_attributes(
         :ignore => %w[in6]
       }
     },
-    :mcelog => {
-      :enabled => false
-    },
     :modules => [
       "it87"
     ]
index 2baf1af94f2892f19ac31765c51c100837ad838b..db9b16e7420a6b6c258fe1b9c9d9bb3fc6330dee 100644 (file)
@@ -10,6 +10,9 @@ default_attributes(
         :family => :inet,
         :address => "10.0.48.49",
         :bond => {
+          :mode => "802.3ad",
+          :lacprate => "fast",
+          :xmithashpolicy => "layer3+4",
           :slaves => %w[eno1 eno2 eno3 eno4]
         }
       }
diff --git a/roles/spike-04.rb b/roles/spike-04.rb
deleted file mode 100644 (file)
index 559abc0..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-name "spike-04"
-description "Master role applied to spike-04"
-
-default_attributes(
-  :networking => {
-    :interfaces => {
-      :internal_ipv4 => {
-        :interface => "bond0",
-        :role => :internal,
-        :family => :inet,
-        :address => "10.0.32.21",
-        :bond => {
-          :slaves => %w[enp3s0f0 enp3s0f1]
-        }
-      },
-      :external_ipv4 => {
-        :interface => "bond0.214",
-        :role => :external,
-        :family => :inet,
-        :address => "89.16.162.21"
-      },
-      :external_ipv6 => {
-        :interface => "bond0.214",
-        :role => :external,
-        :family => :inet6,
-        :address => "2001:41c9:2:d6::21"
-      }
-    }
-  }
-)
-
-run_list(
-  "role[bytemark]",
-  "role[web-frontend]"
-  # "role[web-gpximport]",
-  # "role[web-statistics]",
-  # "role[web-cleanup]"
-)
diff --git a/roles/spike-05.rb b/roles/spike-05.rb
deleted file mode 100644 (file)
index c11255d..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-name "spike-05"
-description "Master role applied to spike-05"
-
-default_attributes(
-  :networking => {
-    :interfaces => {
-      :internal_ipv4 => {
-        :interface => "bond0",
-        :role => :internal,
-        :family => :inet,
-        :address => "10.0.32.22",
-        :bond => {
-          :slaves => %w[enp3s0f0 enp3s0f1]
-        }
-      },
-      :external_ipv4 => {
-        :interface => "bond0.214",
-        :role => :external,
-        :family => :inet,
-        :address => "89.16.162.22"
-      },
-      :external_ipv6 => {
-        :interface => "bond0.214",
-        :role => :external,
-        :family => :inet6,
-        :address => "2001:41c9:2:d6::22"
-      }
-    }
-  }
-)
-
-run_list(
-  "role[bytemark]",
-  "role[web-frontend]"
-)
index 5a0e536bc7369ced5dfc0c5bcef7acb2ced7be7f..50379928c1b2d1a47f0c471e1cf119c40cd4d9e8 100644 (file)
@@ -10,6 +10,9 @@ default_attributes(
         :family => :inet,
         :address => "10.0.48.11",
         :bond => {
+          :mode => "802.3ad",
+          :lacprate => "fast",
+          :xmithashpolicy => "layer3+4",
           :slaves => %w[eno1 eno2]
         }
       },
index b511461ada8c5806cc6ad892c6a9da833dfd718d..0e852a9d5af69e6783a9d742ff05f262c3028e07 100644 (file)
@@ -10,6 +10,9 @@ default_attributes(
         :family => :inet,
         :address => "10.0.48.12",
         :bond => {
+          :mode => "802.3ad",
+          :lacprate => "fast",
+          :xmithashpolicy => "layer3+4",
           :slaves => %w[eno1 eno2]
         }
       },
index 5b96cecfa11efd3c105c2096ccd4beb09abb7c11..823fd9e087454e1edd359835e58f1e94d1a91e41 100644 (file)
@@ -10,6 +10,9 @@ default_attributes(
         :family => :inet,
         :address => "10.0.48.13",
         :bond => {
+          :mode => "802.3ad",
+          :lacprate => "fast",
+          :xmithashpolicy => "layer3+4",
           :slaves => %w[eno1 eno2]
         }
       },
index 5afe706c2d6628b4c29f14516d9dd56591f307f4..9eba0c4198666e6f255d0f1bb19cbe89c8ea6304 100644 (file)
@@ -2,5 +2,8 @@ name "stateofthemap"
 description "Role applied to State of the Map servers"
 
 run_list(
-  "recipe[stateofthemap]"
+  "recipe[stateofthemap]",
+  "recipe[stateofthemap::jekyll]",
+  "recipe[stateofthemap::static]",
+  "recipe[stateofthemap::wordpress]"
 )
diff --git a/roles/supermicro-x8dtt-h.rb b/roles/supermicro-x8dtt-h.rb
deleted file mode 100644 (file)
index 84e172e..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-name "supermicro-x8dtt-h"
-description "Role applied to all Supermicro X8DTT-H machines"
-
-default_attributes(
-  :hardware => {
-    :watchdog => "w83627hf_wdt"
-  }
-)
index 191c92d3e0a1d93c0a6129a2764720ba444c96cf..8094e63c0d8d880676fda2956deec0bb2bd75ed6 100644 (file)
@@ -14,6 +14,9 @@ default_attributes(
         :family => :inet,
         :address => "10.0.48.14",
         :bond => {
+          :mode => "802.3ad",
+          :lacprate => "fast",
+          :xmithashpolicy => "layer3+4",
           :slaves => %w[eno1 eno2]
         }
       },
index c7d3d5b51cd7ecdf2905d385e266be97fae9cd10..40bffdce2f48f91b0e45504523325a9e9712a081 100644 (file)
@@ -26,16 +26,6 @@ default_attributes(
   :passenger => {
     :max_pool_size => 50
   },
-  :planet => {
-    :current => {
-      :jobs => {
-        :taginfo => {
-          :command => "/usr/local/bin/taginfo-update",
-          :user => "taginfo"
-        }
-      }
-    }
-  },
   :taginfo => {
     :sites => [
       {
@@ -51,6 +41,5 @@ default_attributes(
 )
 
 run_list(
-  "role[planet-current]",
   "recipe[taginfo]"
 )
diff --git a/roles/thorn-02.rb b/roles/thorn-02.rb
deleted file mode 100644 (file)
index 9ec920d..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-name "thorn-02"
-description "Master role applied to thorn-02"
-
-default_attributes(
-  :networking => {
-    :interfaces => {
-      :internal_ipv4 => {
-        :interface => "bond0",
-        :role => :internal,
-        :family => :inet,
-        :address => "10.0.48.52",
-        :bond => {
-          :slaves => %w[eth0 eth1]
-        }
-      }
-    }
-  }
-)
-
-run_list(
-  "role[equinix-ams]"
-)
diff --git a/roles/thorn-03.rb b/roles/thorn-03.rb
deleted file mode 100644 (file)
index dbf11b5..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-name "thorn-03"
-description "Master role applied to thorn-03"
-
-default_attributes(
-  :networking => {
-    :interfaces => {
-      :internal_ipv4 => {
-        :interface => "bond0",
-        :role => :internal,
-        :family => :inet,
-        :address => "10.0.48.53",
-        :bond => {
-          :slaves => %w[eth0 eth1]
-        }
-      }
-    }
-  }
-)
-
-run_list(
-  "role[equinix-ams]"
-)
diff --git a/roles/thorn-04.rb b/roles/thorn-04.rb
deleted file mode 100644 (file)
index baf14f7..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-name "thorn-04"
-description "Master role applied to thorn-04"
-
-default_attributes(
-  :networking => {
-    :interfaces => {
-      :internal_ipv4 => {
-        :interface => "bond0",
-        :role => :internal,
-        :family => :inet,
-        :address => "10.0.32.41",
-        :bond => {
-          :slaves => %w[enp3s0f0 enp3s0f1]
-        }
-      }
-    }
-  }
-)
-
-run_list(
-  "role[bytemark]"
-)
diff --git a/roles/thorn-05.rb b/roles/thorn-05.rb
deleted file mode 100644 (file)
index b628591..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-name "thorn-05"
-description "Master role applied to thorn-05"
-
-default_attributes(
-  :networking => {
-    :interfaces => {
-      :internal_ipv4 => {
-        :interface => "bond0",
-        :role => :internal,
-        :family => :inet,
-        :address => "10.0.32.42",
-        :bond => {
-          :slaves => %w[enp3s0f0 enp3s0f1]
-        }
-      }
-    }
-  }
-)
-
-run_list(
-  "role[bytemark]"
-)
diff --git a/roles/tiamat-00.rb b/roles/tiamat-00.rb
deleted file mode 100644 (file)
index 4b5a385..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-name "tiamat-00"
-description "Master role applied to tiamat-00"
-
-default_attributes(
-  :networking => {
-    :interfaces => {
-      :internal_ipv4 => {
-        :interface => "enp1s0.2801",
-        :role => :internal,
-        :family => :inet,
-        :address => "10.0.0.40"
-      },
-      :external_ipv4 => {
-        :interface => "enp1s0.2800",
-        :role => :external,
-        :family => :inet,
-        :address => "193.60.236.40"
-      }
-    }
-  }
-)
-
-run_list(
-  "role[ucl]",
-  "role[supermicro-x8dtt-h]",
-  "role[crm]"
-)
diff --git a/roles/tiamat-01.rb b/roles/tiamat-01.rb
deleted file mode 100644 (file)
index 463381c..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-name "tiamat-01"
-description "Master role applied to tiamat-01"
-
-default_attributes(
-  :networking => {
-    :interfaces => {
-      :internal_ipv4 => {
-        :interface => "enp1s0.2801",
-        :role => :internal,
-        :family => :inet,
-        :address => "10.0.0.41"
-      },
-      :external_ipv4 => {
-        :interface => "enp1s0.2800",
-        :role => :external,
-        :family => :inet,
-        :address => "193.60.236.41"
-      }
-    }
-  }
-)
-
-run_list(
-  "role[ucl]",
-  "role[supermicro-x8dtt-h]"
-)
diff --git a/roles/tiamat-02.rb b/roles/tiamat-02.rb
deleted file mode 100644 (file)
index d81ada6..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-name "tiamat-02"
-description "Master role applied to tiamat-02"
-
-default_attributes(
-  :networking => {
-    :interfaces => {
-      :internal_ipv4 => {
-        :interface => "enp1s0.2801",
-        :role => :internal,
-        :family => :inet,
-        :address => "10.0.0.42"
-      },
-      :external_ipv4 => {
-        :interface => "enp1s0.2800",
-        :role => :external,
-        :family => :inet,
-        :address => "193.60.236.42"
-      }
-    }
-  }
-)
-
-run_list(
-  "role[ucl]",
-  "role[supermicro-x8dtt-h]"
-)
diff --git a/roles/tiamat-03.rb b/roles/tiamat-03.rb
deleted file mode 100644 (file)
index 7c31e7e..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-name "tiamat-03"
-description "Master role applied to tiamat-03"
-
-default_attributes(
-  :networking => {
-    :interfaces => {
-      :internal_ipv4 => {
-        :interface => "enp1s0.2801",
-        :role => :internal,
-        :family => :inet,
-        :address => "10.0.0.43"
-      },
-      :external_ipv4 => {
-        :interface => "enp1s0.2800",
-        :role => :external,
-        :family => :inet,
-        :address => "193.60.236.43"
-      }
-    }
-  }
-)
-
-run_list(
-  "role[ucl]",
-  "role[supermicro-x8dtt-h]"
-)
diff --git a/roles/tiamat-10.rb b/roles/tiamat-10.rb
deleted file mode 100644 (file)
index 1aa3781..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-name "tiamat-10"
-description "Master role applied to tiamat-10"
-
-default_attributes(
-  :networking => {
-    :interfaces => {
-      :internal_ipv4 => {
-        :interface => "enp1s0.2801",
-        :role => :internal,
-        :family => :inet,
-        :address => "10.0.0.44"
-      },
-      :external_ipv4 => {
-        :interface => "enp1s0.2800",
-        :role => :external,
-        :family => :inet,
-        :address => "193.60.236.44"
-      }
-    }
-  }
-)
-
-run_list(
-  "role[ucl]",
-  "role[supermicro-x8dtt-h]"
-)
diff --git a/roles/tiamat-11.rb b/roles/tiamat-11.rb
deleted file mode 100644 (file)
index 2fd7e44..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-name "tiamat-11"
-description "Master role applied to tiamat-11"
-
-default_attributes(
-  :networking => {
-    :interfaces => {
-      :internal_ipv4 => {
-        :interface => "enp1s0.2801",
-        :role => :internal,
-        :family => :inet,
-        :address => "10.0.0.45"
-      },
-      :external_ipv4 => {
-        :interface => "enp1s0.2800",
-        :role => :external,
-        :family => :inet,
-        :address => "193.60.236.45"
-      }
-    }
-  }
-)
-
-run_list(
-  "role[ucl]",
-  "role[supermicro-x8dtt-h]"
-)
diff --git a/roles/tiamat-12.rb b/roles/tiamat-12.rb
deleted file mode 100644 (file)
index 661e25a..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-name "tiamat-12"
-description "Master role applied to tiamat-12"
-
-default_attributes(
-  :networking => {
-    :interfaces => {
-      :internal_ipv4 => {
-        :interface => "enp1s0.2801",
-        :role => :internal,
-        :family => :inet,
-        :address => "10.0.0.46"
-      },
-      :external_ipv4 => {
-        :interface => "enp1s0.2800",
-        :role => :external,
-        :family => :inet,
-        :address => "193.60.236.46"
-      }
-    }
-  }
-)
-
-run_list(
-  "role[ucl]",
-  "role[supermicro-x8dtt-h]"
-)
diff --git a/roles/tiamat-13.rb b/roles/tiamat-13.rb
deleted file mode 100644 (file)
index c75c4ff..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-name "tiamat-13"
-description "Master role applied to tiamat-13"
-
-default_attributes(
-  :networking => {
-    :interfaces => {
-      :internal_ipv4 => {
-        :interface => "enp1s0.2801",
-        :role => :internal,
-        :family => :inet,
-        :address => "10.0.0.47"
-      },
-      :external_ipv4 => {
-        :interface => "enp1s0.2800",
-        :role => :external,
-        :family => :inet,
-        :address => "193.60.236.47"
-      }
-    }
-  }
-)
-
-run_list(
-  "role[ucl]",
-  "role[supermicro-x8dtt-h]"
-)
diff --git a/roles/tiamat-20.rb b/roles/tiamat-20.rb
deleted file mode 100644 (file)
index d1369cf..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-name "tiamat-20"
-description "Master role applied to tiamat-20"
-
-default_attributes(
-  :networking => {
-    :interfaces => {
-      :internal_ipv4 => {
-        :interface => "enp1s0.2801",
-        :role => :internal,
-        :family => :inet,
-        :address => "10.0.0.48"
-      },
-      :external_ipv4 => {
-        :interface => "enp1s0.2800",
-        :role => :external,
-        :family => :inet,
-        :address => "193.60.236.48"
-      }
-    }
-  }
-)
-
-run_list(
-  "role[ucl]",
-  "role[supermicro-x8dtt-h]"
-)
diff --git a/roles/tiamat-21.rb b/roles/tiamat-21.rb
deleted file mode 100644 (file)
index 73b7710..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-name "tiamat-21"
-description "Master role applied to tiamat-21"
-
-default_attributes(
-  :networking => {
-    :interfaces => {
-      :internal_ipv4 => {
-        :interface => "enp1s0.2801",
-        :role => :internal,
-        :family => :inet,
-        :address => "10.0.0.49"
-      },
-      :external_ipv4 => {
-        :interface => "enp1s0.2800",
-        :role => :external,
-        :family => :inet,
-        :address => "193.60.236.49"
-      }
-    }
-  }
-)
-
-run_list(
-  "role[ucl]",
-  "role[supermicro-x8dtt-h]"
-)
diff --git a/roles/tiamat-22.rb b/roles/tiamat-22.rb
deleted file mode 100644 (file)
index 094c8c8..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-name "tiamat-22"
-description "Master role applied to tiamat-22"
-
-default_attributes(
-  :networking => {
-    :interfaces => {
-      :internal_ipv4 => {
-        :interface => "enp1s0.2801",
-        :role => :internal,
-        :family => :inet,
-        :address => "10.0.0.50"
-      },
-      :external_ipv4 => {
-        :interface => "enp1s0.2800",
-        :role => :external,
-        :family => :inet,
-        :address => "193.60.236.50"
-      }
-    }
-  }
-)
-
-run_list(
-  "role[ucl]",
-  "role[supermicro-x8dtt-h]"
-)
diff --git a/roles/tiamat-23.rb b/roles/tiamat-23.rb
deleted file mode 100644 (file)
index e1b0ada..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-name "tiamat-23"
-description "Master role applied to tiamat-23"
-
-default_attributes(
-  :networking => {
-    :interfaces => {
-      :internal_ipv4 => {
-        :interface => "enp1s0.2801",
-        :role => :internal,
-        :family => :inet,
-        :address => "10.0.0.51"
-      },
-      :external_ipv4 => {
-        :interface => "enp1s0.2800",
-        :role => :external,
-        :family => :inet,
-        :address => "193.60.236.51"
-      }
-    }
-  }
-)
-
-run_list(
-  "role[ucl]",
-  "role[supermicro-x8dtt-h]"
-)
index ea8b27daf1fbfb913673792625acbe4969ce5ab8..56f6fe958c713a5565d4a413317581fa2b86cbc1 100644 (file)
@@ -4,8 +4,9 @@ description "Role applied to all tile servers"
 default_attributes(
   :accounts => {
     :users => {
+      :pnorman => { :status => :administrator },
       :tile => {
-        :members => [:jburgess, :tomh]
+        :members => [:jburgess, :tomh, :pnorman]
       }
     }
   },
@@ -104,7 +105,8 @@ default_attributes(
     :styles => {
       :default => {
         :repository => "https://github.com/gravitystorm/openstreetmap-carto.git",
-        :revision => "v5.5.1",
+        :revision => "v5.6.2",
+        :fonts_script => "/srv/tile.openstreetmap.org/styles/default/scripts/get-fonts.sh",
         :max_zoom => 19
       }
     }
diff --git a/roles/urmel.rb b/roles/urmel.rb
deleted file mode 100644 (file)
index dba68ec..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-name "urmel"
-description "Master role applied to urmel"
-
-default_attributes(
-  :networking => {
-    :interfaces => {
-      :internal_ipv4 => {
-        :interface => "eth0.2801",
-        :role => :internal,
-        :family => :inet,
-        :address => "10.0.0.6"
-      },
-      :external_ipv4 => {
-        :interface => "eth0.2800",
-        :role => :external,
-        :family => :inet,
-        :address => "193.60.236.21"
-      }
-    }
-  }
-)
-
-run_list(
-  "role[ucl]",
-  "role[hp-dl360-g6]",
-  "role[munin]"
-)
index 057131b914846f3fa7a9d4c771cd0f06551563d2..b7243e2934d6625d74d67362f580f62c2c68e6fd 100644 (file)
@@ -24,6 +24,7 @@ default_attributes(
     }
   },
   :exim => {
+    :smarthost_via => "fafnir.openstreetmap.org:26",
     :trusted_users => %w[www-data wiki],
     :aliases => {
       :root => "grant"
@@ -37,11 +38,19 @@ default_attributes(
     ]
   },
   :memcached => {
-    :memory_limit => 1024,
+    :memory_limit => 4096,
     :connection_limit => 8192,
     :chunk_growth_factor => 1.25,
     :min_item_size => 48
   },
+  :sysctl => {
+    :swappiness => {
+      :comment => "Reduce swap usage",
+      :parameters => {
+        "vm.swappiness" => 10
+      }
+    }
+  },
   :mysql => {
     :settings => {
       :mysqld => {
index de7c426d2eff19b09b57d0ffebf0c44baf48ca88..0ed66a3be24c4353b59bc4d489696b60ff5363d2 100644 (file)
@@ -11,3 +11,15 @@ describe service("docker") do
   it { should be_enabled }
   it { should be_running }
 end
+
+describe docker_image("local_discourse/data:latest") do
+  it { should exist }
+end
+
+describe docker_image("local_discourse/mail-receiver:latest") do
+  it { should exist }
+end
+
+describe docker_image("local_discourse/web_only:latest") do
+  it { should exist }
+end
diff --git a/test/integration/db-backup/serverspec/backup_spec.rb b/test/integration/db-backup/serverspec/backup_spec.rb
new file mode 100644 (file)
index 0000000..a620c0a
--- /dev/null
@@ -0,0 +1,9 @@
+require "serverspec"
+
+# Required by serverspec
+set :backend, :exec
+
+describe service("backup-db.timer") do
+  it { should be_enabled }
+  it { should be_running }
+end
diff --git a/test/integration/db-base/serverspec/postgresql_spec.rb b/test/integration/db-base/serverspec/postgresql_spec.rb
new file mode 100644 (file)
index 0000000..b6e920c
--- /dev/null
@@ -0,0 +1,17 @@
+require "serverspec"
+
+# Required by serverspec
+set :backend, :exec
+
+describe package("postgresql-9.5") do
+  it { should be_installed }
+end
+
+describe service("postgresql@9.5-main") do
+  it { should be_enabled }
+  it { should be_running }
+end
+
+describe port(5432) do
+  it { should be_listening.with("tcp") }
+end
diff --git a/test/integration/db-master/serverspec/postgresql_spec.rb b/test/integration/db-master/serverspec/postgresql_spec.rb
new file mode 100644 (file)
index 0000000..b6e920c
--- /dev/null
@@ -0,0 +1,17 @@
+require "serverspec"
+
+# Required by serverspec
+set :backend, :exec
+
+describe package("postgresql-9.5") do
+  it { should be_installed }
+end
+
+describe service("postgresql@9.5-main") do
+  it { should be_enabled }
+  it { should be_running }
+end
+
+describe port(5432) do
+  it { should be_listening.with("tcp") }
+end
diff --git a/test/integration/db-slave/serverspec/postgresql_spec.rb b/test/integration/db-slave/serverspec/postgresql_spec.rb
new file mode 100644 (file)
index 0000000..b6e920c
--- /dev/null
@@ -0,0 +1,17 @@
+require "serverspec"
+
+# Required by serverspec
+set :backend, :exec
+
+describe package("postgresql-9.5") do
+  it { should be_installed }
+end
+
+describe service("postgresql@9.5-main") do
+  it { should be_enabled }
+  it { should be_running }
+end
+
+describe port(5432) do
+  it { should be_listening.with("tcp") }
+end
diff --git a/test/integration/dns/serverspec/dnscontrol_spec.rb b/test/integration/dns/serverspec/dnscontrol_spec.rb
new file mode 100644 (file)
index 0000000..3103344
--- /dev/null
@@ -0,0 +1,12 @@
+require "serverspec"
+
+# Required by serverspec
+set :backend, :exec
+
+describe package("dnscontrol") do
+  it { should be_installed }
+end
+
+describe command("dnscontrol version") do
+  its(:exit_status) { should eq 0 }
+end
index f63cb11990540ef63e9941d399b5d37fcbfb0623..2d4e7fd20d617713a3d06dcf78aec415104a42f3 100644 (file)
@@ -7,6 +7,6 @@ describe package("nodejs") do
   it { should be_installed }
 end
 
-describe package("npm") do
+describe package("yarn") do
   it { should be_installed }
 end
index ed082b910a631d07873f55eabc7c3c5ea17207c3..ea3de5d7f54e0d7f3a8fef4e100b88ae54fff504 100644 (file)
@@ -18,6 +18,7 @@ describe file("/usr/local/bin/planet-mirror-redirect-update") do
   it { should be_executable }
 end
 
-describe file("/etc/cron.d/planet-dump-mirror") do
-  it { should be_file }
+describe service("planet-dump-mirror.timer") do
+  it { should be_enabled }
+  it { should be_running }
 end
index 6d35a497b9e0239c1116b4bb0ccab7c2832a1bf8..18a34b4f72b6cacf8afb6478c4fae0d17f90cbcd 100644 (file)
@@ -8,6 +8,7 @@ describe file("/usr/local/bin/planet-notes-dump") do
   it { should be_executable }
 end
 
-describe file("/etc/cron.d/planet-notes-dump") do
-  it { should be_file }
+describe service("planet-notes-dump.timer") do
+  it { should be_enabled }
+  it { should be_running }
 end
diff --git a/test/integration/stateofthemap-static/serverspec/apache_spec.rb b/test/integration/stateofthemap-static/serverspec/apache_spec.rb
new file mode 100644 (file)
index 0000000..446d3b9
--- /dev/null
@@ -0,0 +1,21 @@
+require "serverspec"
+
+# Required by serverspec
+set :backend, :exec
+
+describe package("apache2") do
+  it { should be_installed }
+end
+
+describe service("apache2") do
+  it { should be_enabled }
+  it { should be_running }
+end
+
+describe port(80) do
+  it { should be_listening.with("tcp") }
+end
+
+describe port(443) do
+  it { should be_listening.with("tcp") }
+end
diff --git a/test/integration/stateofthemap-wordpress/serverspec/apache_spec.rb b/test/integration/stateofthemap-wordpress/serverspec/apache_spec.rb
new file mode 100644 (file)
index 0000000..446d3b9
--- /dev/null
@@ -0,0 +1,21 @@
+require "serverspec"
+
+# Required by serverspec
+set :backend, :exec
+
+describe package("apache2") do
+  it { should be_installed }
+end
+
+describe service("apache2") do
+  it { should be_enabled }
+  it { should be_running }
+end
+
+describe port(80) do
+  it { should be_listening.with("tcp") }
+end
+
+describe port(443) do
+  it { should be_listening.with("tcp") }
+end
diff --git a/test/integration/stateofthemap/serverspec/apache_spec.rb b/test/integration/stateofthemap/serverspec/apache_spec.rb
new file mode 100644 (file)
index 0000000..446d3b9
--- /dev/null
@@ -0,0 +1,21 @@
+require "serverspec"
+
+# Required by serverspec
+set :backend, :exec
+
+describe package("apache2") do
+  it { should be_installed }
+end
+
+describe service("apache2") do
+  it { should be_enabled }
+  it { should be_running }
+end
+
+describe port(80) do
+  it { should be_listening.with("tcp") }
+end
+
+describe port(443) do
+  it { should be_listening.with("tcp") }
+end