diff --git a/.vagrant.yml.example b/.vagrant.yml.example deleted file mode 100644 index 2e9751df20..0000000000 --- a/.vagrant.yml.example +++ /dev/null @@ -1,11 +0,0 @@ -fqdn: alaveteli.10.10.10.30.nip.io -ip: 10.10.10.30 -# Only use this on networks you trust -public_network: false -memory: 1536 -themes_dir: ../alaveteli-themes -os: bullseye64 -use_nfs: false -show_settings: false -# By default CPU count is calculated dynamically -cpus: 2 diff --git a/Vagrantfile b/Vagrantfile deleted file mode 100644 index f08833608d..0000000000 --- a/Vagrantfile +++ /dev/null @@ -1,243 +0,0 @@ -require 'pp' -require 'yaml' -# Welcome! Thanks for taking an interest in contributing to Alaveteli. -# This Vagrantfile should get you started with the minimum of fuss. -# -# Usage -# ===== -# -# Install a vagrant plugin (if you don't already have it) that -# automatically install guest additions -# -# # Host -# $ vagrant plugin install vagrant-vbguest -# $ vagrant vbguest -# -# Get a copy of Alaveteli from GitHub and create the Vagrant instance -# -# # Host -# $ git clone git@github.com:mysociety/alaveteli.git -# $ cd alaveteli -# $ git submodule update --init -# $ vagrant --no-color up -# -# You should now be able to ssh in to the guest and run the test suite -# -# # Host -# $ vagrant ssh -# -# # Guest -# $ cd /home/vagrant/alaveteli -# $ bundle exec rake spec -# -# Run the rails server and visit the application in your host browser -# at http://10.10.10.30:3000 -# -# # Guest -# bundle exec rails server -b 0.0.0.0 -# -# -# Log-in to the Vagrant instance -# ================================ -# -# Once the application is running, you can login with any of the sample users -# that get created automatically. You can find more details of these users in -# spec/fixtures/users.yml. -# -# Customizing the Vagrant instance -# ================================ -# -# This Vagrantfile allows customisation of some aspects of the virtaual machine -# See the customization options below for details. -# -# The options can be set either by prefixing the vagrant command, using -# `.vagrant.yml`, or by exporting to the environment. -# -# # Prefixing the command -# $ ALAVETELI_VAGRANT_MEMORY=2048 vagrant up -# -# # .vagrant.yml -# $ echo "memory: 2048" >> .vagrant.yml -# $ vagrant up -# -# # Exporting to the environment -# $ export ALAVETELI_VAGRANT_MEMORY=2048 -# $ vagrant up -# -# All have the same effect, but exporting will retain the variable for the -# duration of your shell session, whereas `.vagrant.yml` will be persistent. -# The environment takes precedence over `.vagrant.yml`. -# -# Using Themes -# ------------ -# -# You can also use the built in theme switcher (script/switch-theme.rb). The -# ALAVETELI_THEMES_DIR will be shared in to /home/vagrant/alaveteli-themes so -# that the default location is used on the guest. You can use the env var -# ALAVETELI_THEMES_DIR to change where this Vagrantfile looks for the themes -# directory on the host. - -def cpu_count - host = RbConfig::CONFIG['host_os'] - # Give VM access to all cpu cores on the host - if host =~ /darwin/ - `sysctl -n hw.ncpu`.to_i - elsif host =~ /linux/ - `nproc`.to_i - else # sorry Windows folks, I can't help you - 1 - end -end - -# Customization Options -# ===================== -# -# Defaults can be overridden either in `.vagrant.yml` with the same key name, or -# via the environment by prefixing the key with `ALAVETELI_VAGRANT_` and -# upcasing. Boolean values can be set to `false` in the environment with "0", -# "false" or "no". -DEFAULTS = { - 'fqdn' => 'alaveteli.10.10.10.30.nip.io', - 'ip' => '10.10.10.30', - 'public_network' => false, - 'memory' => 1536, - 'themes_dir' => '../alaveteli-themes', - 'os' => 'bullseye64', - 'name' => 'default', - 'use_nfs' => false, - 'show_settings' => false, - 'cpus' => cpu_count -}.freeze - -env = DEFAULTS.keys.reduce({}) do |memo, key| - value = ENV["ALAVETELI_VAGRANT_#{ key.upcase }"] - value = false if %w(0 false no).include?(value) - memo[key] = value unless value.nil? - memo -end - -settings_file_path = File.dirname(__FILE__) + '/.vagrant.yml' -settings_file = if File.exist?(settings_file_path) - YAML.load(File.read(settings_file_path)) -else - {} -end - -SUPPORTED_OPERATING_SYSTEMS = { - 'focal64' => { - box: 'ubuntu/focal64', - box_url: 'https://app.vagrantup.com/ubuntu/boxes/focal64' - }, - 'bullseye64' => { - box: 'debian/bullseye64', - box_url: 'https://app.vagrantup.com/debian/boxes/bullseye64' - } -} - -def os - SUPPORTED_OPERATING_SYSTEMS.fetch(SETTINGS['os'], box: SETTINGS['os']) -end - -SETTINGS = DEFAULTS.merge(settings_file).merge(env).freeze - -if SETTINGS['show_settings'] - puts 'Current machine settings:' - puts "\n" - pp SETTINGS - puts "\n" - puts 'Current OS settings:' - puts "\n" - pp os - puts "\n" -end - -VAGRANTFILE_API_VERSION = '2' - -Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| - config.vm.box = os[:box] - config.vm.define SETTINGS['name'] - config.vm.box_url = os[:box_url] - config.vm.hostname = "alaveteli-#{ SETTINGS['os'] }" - - config.vm.network :public_network if SETTINGS['public_network'] - - config.vm.network :private_network, ip: SETTINGS['ip'] - - config.vm.synced_folder '.', '/vagrant', disabled: true - - if SETTINGS['use_nfs'] - config.vm.synced_folder '.', '/home/vagrant/alaveteli', nfs: true - else - config.vm.synced_folder '.', - '/home/vagrant/alaveteli', - owner: 'vagrant', - group: 'vagrant' - end - - if File.directory?(SETTINGS['themes_dir']) - if SETTINGS['use_nfs'] - config.vm.synced_folder SETTINGS['themes_dir'], - '/home/vagrant/alaveteli-themes', - nfs: true - else - config.vm.synced_folder SETTINGS['themes_dir'], - '/home/vagrant/alaveteli-themes', - owner: 'vagrant', - group: 'vagrant' - end - end - - config.ssh.forward_agent = true - - # The bundle install fails unless you have quite a large amount of - # memory; insist on 1.5GiB: - config.vm.provider 'virtualbox' do |vb| - vb.customize ['modifyvm', :id, '--memory', SETTINGS['memory']] - vb.customize ['modifyvm', :id, '--cpus', SETTINGS['cpus']] - end - - config.vm.provision :shell, keep_color: true, inline: <<-EOF - if [[ -f "/home/vagrant/alaveteli/commonlib/bin/install-site.sh" ]] - then - /home/vagrant/alaveteli/commonlib/bin/install-site.sh \ - --dev \ - alaveteli \ - vagrant \ - #{ SETTINGS['fqdn'] } - else - echo "Couldn't find provisioning script." >&2 - echo "Did you forget to run git submodule update --init?" >&2 - exit 1 - fi -EOF - - # Append basic usage instructions to the MOTD - motd = <<-EOF -To start your alaveteli instance: -* cd alaveteli -* bundle exec rails server -b 0.0.0.0 -EOF - - config.vm.provision :shell, keep_color: true, inline: "echo '#{ motd }' >> /etc/motd.tail" - - # Display next steps info at the end of a successful install - instructions = <<-EOF - -Welcome to your new Alaveteli development site! - -If you are planning to use a custom theme, you should create -an `alaveteli-themes` folder at the same level as your `alaveteli` -code folder to hold your theme repositories so that your -Vagrant box will see your theme folders when using the -switch-theme.rb script (take a look at the documentation in -the script/switch-theme.rb file for more information). - -Full instructions for customising your install can be found online: -http://alaveteli.org/docs/customising/ - -Type `vagrant ssh` to log into the Vagrant box to start the site -or run the test suite -EOF - - config.vm.provision :shell, keep_color: true, inline: "echo '#{ instructions }'" -end diff --git a/bin/vagrant-bullseye b/bin/vagrant-bullseye deleted file mode 100755 index c0b8baca2b..0000000000 --- a/bin/vagrant-bullseye +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -ALAVETELI_VAGRANT_NAME=bullseye ALAVETELI_VAGRANT_OS=bullseye64 exec vagrant "$@" diff --git a/bin/vagrant-focal b/bin/vagrant-focal deleted file mode 100755 index c4638a55dd..0000000000 --- a/bin/vagrant-focal +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -ALAVETELI_VAGRANT_NAME=focal ALAVETELI_VAGRANT_OS=focal64 exec vagrant "$@" diff --git a/doc/CHANGES.md b/doc/CHANGES.md index 061f8165a7..6bd4b481d3 100644 --- a/doc/CHANGES.md +++ b/doc/CHANGES.md @@ -1,3 +1,15 @@ +# develop + +## Highlighted Features + +* Remove Vagrant development boxes (Graeme Porteous) + +## Upgrade Notes + +* _Note:_ If you were using Vagrant development boxes these are now unsupported. + Please switch to using Docker. See: + https://alaveteli.org/docs/installing/docker/ + # 0.43.2.0 ## Highlighted Features diff --git a/script/defer b/script/defer index 9cfb21b9b6..7dce2cb1d2 100755 --- a/script/defer +++ b/script/defer @@ -8,8 +8,8 @@ # In /var/www/alaveteli/config/aliases, swap the filter to mailin to send to # the defer script. # -# # ^foi\\+.*: "|/home/vagrant/alaveteli/script/mailin" -# ^foi\\+.*: "|/home/vagrant/alaveteli/script/defer" +# # ^foi\\+.*: "|/home/alaveteli/script/mailin" +# ^foi\\+.*: "|/home/alaveteli/script/defer" # # If you have Alaveteli set up to filter messages to site admin addresses, # redirect that to the defer script too. diff --git a/script/site-specific-install.sh b/script/site-specific-install.sh index 7dcafe4ba8..dab645b1de 100755 --- a/script/site-specific-install.sh +++ b/script/site-specific-install.sh @@ -302,20 +302,6 @@ if [ "$DEVELOPMENT_INSTALL" = true ]; then gem install mailcatcher fi -if [ "$DEVELOPMENT_INSTALL" = true ] && [ x"$SUDO_USER" = x"vagrant" ] -then - VAGRANT_DEV_INSTALL=true -fi - -if [ "$VAGRANT_DEV_INSTALL" = true ] && [ ! -e "$REPOSITORY/config/xapian.yml" ] - then - cat > "$REPOSITORY/config/xapian.yml" < /etc/cron.d/alaveteli diff --git a/script/test-vagrant-provisioning b/script/test-vagrant-provisioning deleted file mode 100755 index a0d586f901..0000000000 --- a/script/test-vagrant-provisioning +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -OS=$1 - -vagrant destroy - -ALAVETELI_VAGRANT_OS="$OS" vagrant up && - vagrant ssh -c "cd /home/vagrant/alaveteli && bundle exec rails s -b 10.10.10.30 --daemon" && - sleep 10 && - curl -I http://10.10.10.30:3000 - -sleep 30 - -if [[ $? -ne 0 ]] -then - echo "Failed with exit code $?" - exit 1 -else - echo "Success!" - exit 0 -fi diff --git a/spec/models/mail_server_log/postfix_line_spec.rb b/spec/models/mail_server_log/postfix_line_spec.rb index 63cd2654cc..f10961efd4 100644 --- a/spec/models/mail_server_log/postfix_line_spec.rb +++ b/spec/models/mail_server_log/postfix_line_spec.rb @@ -13,7 +13,7 @@ describe '#to_s' do it 'returns the log line' do - line = 'Oct 2 08:57:45 vagrant-ubuntu-precise-64 postfix/pickup[7843]: E9B4F420D5: uid=1001 from=' + line = 'Oct 2 08:57:45 ubuntu-precise-64 postfix/pickup[7843]: E9B4F420D5: uid=1001 from=' expect(described_class.new(line).to_s).to eq(line) end