This is an automated email from the ASF dual-hosted git repository.
sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git
The following commit(s) were added to refs/heads/master by this push:
new 1933cb6 Drop vagrant code
1933cb6 is described below
commit 1933cb6ce291df0bc4c9ebc162c0213ea41f4961
Author: Sebb <[email protected]>
AuthorDate: Mon Dec 13 00:25:47 2021 +0000
Drop vagrant code
---
vagrant/README | 101 -----------------
vagrant/Vagrantfile | 68 ------------
vagrant/cookbooks/whimsy/recipes/apache.rb | 142 ------------------------
vagrant/cookbooks/whimsy/recipes/default.rb | 4 -
vagrant/cookbooks/whimsy/recipes/model.rb | 152 --------------------------
vagrant/cookbooks/whimsy/recipes/secretary.rb | 143 ------------------------
vagrant/cookbooks/whimsy/recipes/system.rb | 36 ------
vagrant/recipes | 1 -
vagrant/secmail.rb | 48 --------
9 files changed, 695 deletions(-)
diff --git a/vagrant/README b/vagrant/README
deleted file mode 100644
index f65619e..0000000
--- a/vagrant/README
+++ /dev/null
@@ -1,101 +0,0 @@
-*** WORK IN PROGRESS ***
-
-This early prototype roughs-in the configuration of a virtual machine
-to run whimsy services.
-workbench.
-
-Step 1: download and install Oracle VirtualBox
-
- https://www.virtualbox.org/wiki/Downloads
-
-Step 2: download and install Vagrant
-
- http://www.vagrantup.com/downloads.html
-
-Step 3: configure the virtual machine
-
- Setup the network bridge your vagrant instance should use:
-
- http://docs-v1.vagrantup.com/v1/docs/bridged_networking.html
-
-Step 4: start the virtual machine
-
- Making sure that you are in this directory as your working directory, enter:
-
- USER=<user> vagrant up
-
- Change <user> to your ASF id. You can leave this part out entirely if your
ASF
- id matches your current user id.
- On Windows, try the following:
- set USER=<user> & vagrant up
-
- Messages will scroll by. Somewhere near the fourth from the last you will
- see a message like:
-
- Whimsy is available at http://192.168.1.165/whimsy
-
- Note the URL.
-
-Step 5a: (for use of the secretary workbench) check out foundation and
documents
-
- In the same working directory, enter:
-
- vagrant ssh
- cd /var/tools/secretary
- svn co https://svn.apache.org/repos/private/foundation --username=<yourid>
- svn co https://svn.apache.org/repos/private/documents --username=<yourid>
- exit
-
- Notes:
-
- a) vagrant ssh will also provide the whimsy URL for you. This can be
- handy if you forgot it
- b) svn co will prompt you for your password, and ask you if you want to
- save it as plain text. Doing so is likely necessary, but does mean
- that you will need to protect your machine from being accessed by
- others.
-
-Step 5b: (to use tools such as invoice or committee/committer roster):
-
- vagrant ssh
- bin/checkout-svn
- bin/get-cert
- bin/ldap-tunnel
-
- These will prompt you for things like your ASF password.
-
- If you forgot to define USER= before creating the VM, or you need to change
the username
- to be used for logging in to the ASF systems, define the following variable:
-
- AVAILID=<user>;export AVAILID
-
- before running the above commands.
-
- You will also need to edit /etc/apache2/sites-available/default
- and change the line RequestHeader set USER "<previous>"
-
-Step 6:
-
- Visit the URL, and click on the service you wish to use
-
------
-
-Todo:
-
-1) Complete checkouts of foundation and documents are cumbersome, and will
- be destroyed if you ever decide to destroy the virtual machine. Should you
- happen to have a checkout of documents and foundation on your machine,
- this vagrant script will attempt to 'mount' the directory on /mnt/svn.
- With this in place, an alternative version of step 4a is:
-
- vagrant ssh
- cd /var/tools/secretary
- ln -s /mnt/svn/foundation
- ln -s /mnt/svn/documents
- cd foundation
- svn update
- exit
-
- Note: if the autodetection of the checkout for the foundation directory
- on your host machine isn't working, you can control the directory being
- mounted by setting the SVN_ROOT environment variable.
diff --git a/vagrant/Vagrantfile b/vagrant/Vagrantfile
deleted file mode 100644
index 7535fee..0000000
--- a/vagrant/Vagrantfile
+++ /dev/null
@@ -1,68 +0,0 @@
-# -*- mode: ruby -*-
-# vi: set ft=ruby :
-
-Vagrant::Config.run do |config|
- # All Vagrant configuration is done here. The most common configuration
- # options are documented and commented below. For a complete reference,
- # please see the online documentation at vagrantup.com.
-
- # host name to use for the guest machine
- config.vm.host_name = 'whimsy'
-
- # Every Vagrant virtual environment requires a box to build off of.
- config.vm.box = "precise32"
-
- # The url from where the 'config.vm.box' box will be fetched if it
- # doesn't already exist on the user's system.
- config.vm.box_url = "http://files.vagrantup.com/precise32.box"
-
- # Boot with a GUI so you can see the screen. (Default is headless)
- # config.vm.boot_mode = :gui
-
- # Assign this VM to a host-only network IP, allowing you to access it
- # via the IP. Host-only networks can talk to the host machine as well as
- # any other machines on the same network, but cannot be accessed (through
this
- # network interface) by any external networks.
- # config.vm.network :hostonly, "192.168.33.10"
-
- # Assign this VM to a bridged network, allowing you to connect directly to a
- # network using the host's network device. This makes the VM appear as
another
- # physical device on your network.
- # To find the bridged devices, the following command can be used:
- # $ VBoxManage list bridgedifs | grep "^Name"
- # Note: VBoxManage is found in the VirtualBox installation directory
- # config.vm.network :bridged, :bridge => 'eth1'
- # For Windows, it might be something like:
- # config.vm.network :bridged, :bridge => 'Intel(R) PRO/1000 PL Network
Connection'
-
- # Forward a port from the guest to the host, which allows for outside
- # computers to access the VM, whereas host only networking does not.
- # config.vm.forward_port 3000, 3000
-
- # Provision VM using chef
- config.vm.provision :chef_solo do |chef|
- chef.cookbooks_path = "cookbooks"
- chef.add_recipe "whimsy"
- chef.json = {
- :user => ENV['USER']
- }
- end
-
- # Speed up network access
- # config.vm.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
- # config.vm.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
-
- # Adjust amount of memory
- # config.vm.customize ["modifyvm", :id, "--memory", 1024]
-
- # share svn folder if we can find a checkout of the foundation repository
- require 'pathname'
- path = Pathname.new(ENV['SVN_ROOT'] || __FILE__).realpath
- while not path.root?
- path = path.parent
- if (path+'foundation/.svn').exist?
- config.vm.share_folder "shared-svn", "/mnt/svn", path.to_s
- break
- end
- end
-end
diff --git a/vagrant/cookbooks/whimsy/recipes/apache.rb
b/vagrant/cookbooks/whimsy/recipes/apache.rb
deleted file mode 100644
index 173c610..0000000
--- a/vagrant/cookbooks/whimsy/recipes/apache.rb
+++ /dev/null
@@ -1,142 +0,0 @@
-#
-# install apache2
-# install and configure suexec
-# allow .htaccess overrides
-# configure CGI
-# enable file extensions to be omitted (MultiViewsMatch)
-# set servername
-# change owner of web directory to vagrant user and group
-# install wunderbar gem
-# install jquery
-# restart apache2 server
-# report on location of dashboard in Chef log and welcome message
-#
-
-package "apache2"
-package "apache2-suexec"
-
-bash 'enable suexec' do
- code 'a2enmod suexec'
- not_if {File.exist? '/etc/apache2/mods-enabled/suexec.load'}
-end
-
-bash 'enable headers' do
- code 'a2enmod headers'
- not_if {File.exist? '/etc/apache2/mods-enabled/headers.load'}
-end
-
-ruby_block 'update site' do
- block do
- default = '/etc/apache2/sites-available/default'
- original = File.read(default)
- content = original.dup
-
- unless File.exist? "#{default}.bak"
- File.open("#{default}.bak", 'w') {|file| file.write original}
- end
-
- unless content.include? 'SuexecUserGroup'
- content.sub! "\n\n", "\n\tSuexecUserGroup vagrant vagrant\n\n"
- end
-
- unless content.include? 'RequestHeader'
- content.sub! "\n\n", "\n\tRequestHeader set USER \"#{node.user}\"\n\n"
- end
-
- content.sub!(%r{<Directory /var/www/>.*?\n\s*</Directory>}m) do |var_www|
- var_www.sub! /^\s*AllowOverride\s.*/ do |line|
- line.sub 'None', 'All'
- end
-
- var_www.sub! /^\s*Options\s.*/ do |line|
- line += ' +ExecCGI' unless line.include? 'ExecCGI'
- line
- end
-
- unless var_www.include? 'AddHandler cgi-script'
- var_www[%r{^()\s*</Directory>}, 1] = "\t\tAddHandler cgi-script .cgi\n"
- end
-
- unless var_www.include? 'MultiViewsMatch Any'
- var_www[%r{^()\s*</Directory>}, 1] = "\t\tMultiViewsMatch Any\n"
- end
-
- var_www
- end
-
- unless content == original
- File.open(default, 'w') {|file| file.write content}
- end
- end
-end
-
-file '/etc/apache2/conf.d/servername' do
- content "ServerName #{`hostname`}"
-end
-
-directory '/var/www' do
- user 'vagrant'
- group 'vagrant'
-end
-
-subversion "whimsy site" do
- repository
'https://svn.apache.org/repos/infra/infrastructure/trunk/projects/whimsy/www'
- destination "/var/www/whimsy"
- user "vagrant"
- group "vagrant"
-end
-
-gem_package "wunderbar" do
- gem_binary "/usr/bin/gem1.9.1"
-end
-
-bash '/var/www/jquery-ui.css' do
- user 'vagrant'
- group 'vagrant'
- code %{
- cp /var/tools/www/jquery* /var/www
- }
- not_if {File.exist? '/var/www/jquery.min.js'}
-end
-
-link "/var/www/.subversion" do
- to "/home/vagrant/.subversion"
-end
-
-directory '/var/www/members' do
- user 'vagrant'
- group 'vagrant'
-end
-
-link "/var/www/members/received" do
- to "/var/tools/secretary/documents/received"
-end
-
-service "apache2" do
- action :restart
-end
-
-ruby_block 'welcome' do
- ip=%{/sbin/ifconfig eth1|grep inet|head -1|sed 's/\:/ /'|awk '{print \$3}'}
-
- block do
- profile = '/home/vagrant/.bash_profile'
- unless File.exist?(profile) and File.read(profile).include? ip
- open(profile, 'a') do |file|
- file.puts "\nip=$(#{ip})"
- file.write <<-'EOF'.gsub(/^ {10}/, '')
- if [[ "${TERM:-dumb}" != "dumb" ]]; then
- echo
- echo "Whimsy is available at http://$ip/whimsy"
-
- PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
- fi
- EOF
- end
-
- Chef::ShellOut.new("chown vagrant:vagrant #{profile}").run_command
- end
-
- Chef::Log.info "Whimsy is available at http://" + `#{ip}`.chomp + "/whimsy"
- end
-end
diff --git a/vagrant/cookbooks/whimsy/recipes/default.rb
b/vagrant/cookbooks/whimsy/recipes/default.rb
deleted file mode 100644
index 6db3a31..0000000
--- a/vagrant/cookbooks/whimsy/recipes/default.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-include_recipe "whimsy::system" # update packaging information
-include_recipe "whimsy::model" # asf model
-include_recipe "whimsy::secretary" # secretary workbench
-include_recipe "whimsy::apache" # web interface
diff --git a/vagrant/cookbooks/whimsy/recipes/model.rb
b/vagrant/cookbooks/whimsy/recipes/model.rb
deleted file mode 100644
index fb0eed0..0000000
--- a/vagrant/cookbooks/whimsy/recipes/model.rb
+++ /dev/null
@@ -1,152 +0,0 @@
-#
-# installs ruby, subversion, ldap-utils, wkhtmltopdf
-# check outs whimsy tools (a.k.a. asf model)
-# install configuration scripts:
-# checkout-svn
-# get-cert
-# ldap-tunnel
-# installs nokogiri gem
-# installs ruby-ldap gem
-#
-
-package 'ruby1.9.3'
-package 'subversion'
-package 'ldap-utils'
-package 'wkhtmltopdf'
-
-directory "/var/tools" do
- user "vagrant"
- group "vagrant"
-end
-
-subversion "asf model" do
- repository
'https://svn.apache.org/repos/infra/infrastructure/trunk/projects/whimsy'
- destination "/var/tools"
- user "vagrant"
- group "vagrant"
-end
-
-directory '/home/whimsysvn' do
- user "vagrant"
- group "vagrant"
-end
-
-directory '/home/whimsysvn/svn' do
- user "vagrant"
- group "vagrant"
-end
-
-link '/home/vagrant/svn' do
- to '/home/whimsysvn/svn'
-end
-
-directory '/home/vagrant/bin' do
- user "vagrant"
- group "vagrant"
-end
-
-file '/home/vagrant/bin/checkout-svn' do
- user "vagrant"
- group "vagrant"
- mode 0755
- content <<-EOF.gsub(/^ /,'')
- #!/bin/bash
- function update {
- if [[ -e $1 ]]; then
- (cd $1; svn update)
- else
- svn checkout $2 --depth=${3:-infinity} --username
${AVAILID:-#{node.user}} $1
- fi
- }
-
- cd $HOME/svn
-
- update foundation \\
- https://svn.apache.org/repos/private/foundation files
-
- update board \\
- https://svn.apache.org/repos/private/foundation/board files
-
- update committers-board \\
- https://svn.apache.org/repos/private/committers/board files
-
- update templates \\
- https://svn.apache.org/repos/asf/infrastructure/site/trunk/templates
-
- update officers \\
- https://svn.apache.org/repos/private/foundation/officers files
-
- EOF
-end
-
-file '/home/vagrant/bin/ldap-tunnel' do
- user "vagrant"
- group "vagrant"
- mode 0755
- content <<-EOF.gsub(/^ /,'')
- #!/bin/bash
- clear
- echo "******************************************************************"
- echo "* *"
- echo "* ASF LDAP Tunnel *"
- echo "* *"
- echo "******************************************************************"
- while [[ 1 ]]; do
- ssh -N -L 6636:minotaur.apache.org:636
${AVAILID:-#{node.user}}@minotaur.apache.org
- sleep 5
- done
- EOF
-end
-
-file '/home/vagrant/bin/get-cert' do
- user "vagrant"
- group "vagrant"
- mode 0755
- content <<-EOF.gsub(/^ /,'')
- #!/usr/bin/env ruby
- output = `ssh ${AVAILID:-#{node.user}}@minotaur.apache.org openssl
s_client -connect \\
- minotaur.apache.org:636 -showcerts < /dev/null 2> /dev/null`
- File.open("asf-ldap-client.pem", 'w') do |file|
- file.write output[/^-+BEGIN.*\\n-+END[^\\n]+\\n/m]
- end
- system "sudo chown root:root asf-ldap-client.pem"
- system "sudo mv asf-ldap-client.pem /etc/ldap"
- EOF
-end
-
-ruby_block 'update ldap.conf' do
- block do
- ldap_conf = '/etc/ldap/ldap.conf'
- content = File.read(ldap_conf)
- unless content.include? 'ldap-tunnel'
- content.gsub!(/^TLS_CACERT/, '# TLS_CACERT')
- content += "uri ldaps://ldap-tunnel.apache.org:6636\n"
- content += "TLS_CACERT /etc/ldap/asf-ldap-client.pem\n"
- File.open(ldap_conf, 'w') {|file| file.write content}
- end
- end
-end
-
-ruby_block 'update hosts' do
- block do
- content = File.read('/etc/hosts')
- unless content.include? 'ldap-tunnel'
- content[/localhost()\b/, 1] = ' ldap-tunnel.apache.org'
- File.open('/etc/hosts', 'w') {|file| file.write content}
- end
- end
-end
-
-directory "/var/tools/data" do
- user "vagrant"
- group "vagrant"
-end
-
-directory "/var/tools/invoice" do
- user "vagrant"
- group "vagrant"
-end
-
-package "build-essential"
-package "ruby-nokogiri"
-package "ruby-ldap"
diff --git a/vagrant/cookbooks/whimsy/recipes/secretary.rb
b/vagrant/cookbooks/whimsy/recipes/secretary.rb
deleted file mode 100644
index bf42511..0000000
--- a/vagrant/cookbooks/whimsy/recipes/secretary.rb
+++ /dev/null
@@ -1,143 +0,0 @@
-#
-# install pdftk
-# install escape gem
-# install secmail.rb
-#
-
-package 'pdftk'
-package 'imagemagick'
-
-gem_package "escape" do
- gem_binary "/usr/bin/gem"
-end
-
-gem_package "mail" do
- gem_binary "/usr/bin/gem"
-end
-
-directory "/var/tools/secretary" do
- user "vagrant"
- group "vagrant"
-end
-
-bash '/var/tools/secretary/secmail.rb' do
- user 'vagrant'
- group 'vagrant'
- code %{
- cp /vagrant/secmail.rb /var/tools/secretary/secmail.rb
- }
- not_if {File.exist? '/var/tools/secretary/secmail.rb'}
-end
-
-directory "/var/tools/svnrep" do
- user "vagrant"
- group "vagrant"
-end
-
-bash "/var/tools/svnrep/foundation" do
- user 'vagrant'
- group 'vagrant'
- code %{
- cd /var/tools/svnrep
- HOME=/home/vagrant svnadmin create foundation
- }
- not_if {File.exist? "/var/tools/svnrep/foundation"}
-end
-
-bash "/var/tools/svnrep/documents" do
- user 'vagrant'
- group 'vagrant'
- code %{
- cd /var/tools/svnrep
- HOME=/home/vagrant svnadmin create documents
- }
- not_if {File.exist? "/var/tools/svnrep/documents"}
-end
-
-subversion "documents" do
- repository 'file:///var/tools/svnrep/documents'
- destination "/var/tools/secretary/documents"
- user "vagrant"
- group "vagrant"
-end
-
-subversion "foundation" do
- repository 'file:///var/tools/svnrep/foundation'
- destination "/var/tools/secretary/foundation"
- user "vagrant"
- group "vagrant"
-end
-
-bash "documents received" do
- user 'vagrant'
- group 'vagrant'
- code %{
- cd /var/tools/secretary/documents
- mkdir -p received iclas cclas grants
- svn add *
- svn commit -m 'empty directories'
- }
- not_if {File.exist? "/var/tools/secretary/documents/received"}
-end
-
-bash "foundation officers" do
- user 'vagrant'
- group 'vagrant'
- code %{
- cd /var/tools/secretary/foundation
- mkdir -p officers
- if [[ -e /mnt/svn/foundation/officers/ ]]; then
- cd /mnt/svn/foundation/officers/
- cp iclas.txt cclas.txt grants.txt
/var/tools/secretary/foundation/officers
- cd -
- fi
- svn add officers
- svn commit -m 'officer files'
- }
- not_if {File.exist? "/var/tools/secretary/foundation/officers"}
-end
-
-bash "foundation meetings" do
- user 'vagrant'
- group 'vagrant'
- code %{
- cd /var/tools/secretary/foundation
- mkdir -p Meetings
- if [[ -e /mnt/svn/foundation/Meetings/ ]]; then
- cd /mnt/svn/foundation/Meetings/
- cp -r $(ls -d 2* | tail -1) /var/tools/secretary/foundation/Meetings
- cd -
- find Meetings -name .svn | xargs --no-run-if-empty rm -rf
- fi
- svn add Meetings
- svn commit -m 'meeting files'
- }
- not_if {File.exist? "/var/tools/secretary/foundation/Meetings"}
-end
-
-directory "/var/tools/secretary/secmail" do
- user "vagrant"
- group "vagrant"
-end
-
-file "/var/tools/secretary/secmail/latest" do
- user "vagrant"
- group "vagrant"
-end
-
-subversion "secmail received" do
- repository 'file:///var/tools/svnrep/documents/received'
- destination "/var/tools/secretary/secmail/received"
- user "vagrant"
- group "vagrant"
-end
-
-directory "/var/tools/secretary/secmail/tally" do
- user "vagrant"
- group "vagrant"
-end
-
-link '/var/tools/secretary/secmail/secmail.py' do
- to '/var/tools/secmail.py'
-end
-
diff --git a/vagrant/cookbooks/whimsy/recipes/system.rb
b/vagrant/cookbooks/whimsy/recipes/system.rb
deleted file mode 100644
index a0abde4..0000000
--- a/vagrant/cookbooks/whimsy/recipes/system.rb
+++ /dev/null
@@ -1,36 +0,0 @@
-#
-# Update packaging information if the previous info is over a day old
-# Install update-notifier-common to keep the update-success-stamp current
-#
-
-ruby_block 'upgrade subversion' do
- block do
- if File.exist? '/mnt/svn/foundation/.svn/format'
- cmd = Chef::ShellOut.new(
- 'apt-key adv --keyserver keyserver.ubuntu.com --recv-key A2F4C039 2>&1'
- ).run_command
-
- unless cmd.exitstatus == 0
- Chef::Application.fatal! 'Failed to import subversion signing key'
- end
-
- File.open('/etc/apt/sources.list.d/subversion.list', 'w') do |file|
- file.write <<-EOF.gsub(/^ +/,'')
- deb http://ppa.launchpad.net/svn/ppa/ubuntu precise main
- deb-src http://ppa.launchpad.net/svn/ppa/ubuntu precise main
- EOF
- end
- end
- end
-end
-
-execute "apt-get-update-periodic" do
- timestamp = '/var/lib/apt/periodic/update-success-stamp'
- command "apt-get update && touch #{timestamp}"
- ignore_failure true
- only_if do
- not File.exists?(timestamp) or File.mtime(timestamp) < Time.now - 86400
- end
-end
-
-package 'update-notifier-common'
diff --git a/vagrant/recipes b/vagrant/recipes
deleted file mode 120000
index 0ecc8d1..0000000
--- a/vagrant/recipes
+++ /dev/null
@@ -1 +0,0 @@
-cookbooks/whimsy/recipes/
\ No newline at end of file
diff --git a/vagrant/secmail.rb b/vagrant/secmail.rb
deleted file mode 100644
index 614e3c4..0000000
--- a/vagrant/secmail.rb
+++ /dev/null
@@ -1,48 +0,0 @@
-require 'mail'
-
-Mail.defaults do
- delivery_method :test
-
- if $USER == 'clr'
-
- @from = 'Craig L Russell <[email protected]>'
- @sig = %{
- -- Craig L Russell
- Secretary, Apache Software Foundation
- }
-
- elsif $USER == 'jcarman'
-
- @from = 'James Carman <[email protected]>'
- @sig = %{
- -- James Carman
- Assistant Secretary, Apache Software Foundation
- }
-
- elsif $USER == 'rubys'
-
- @from = 'Sam Ruby <[email protected]>'
- @sig = %{
- -- Sam Ruby
- Apache Software Foundation Secretarial Team
- }
-
- elsif $USER == 'sanders'
-
- @from = 'Scott Sander <[email protected]>'
- @sig = %{
- -- Scott Sander
- Apache Software Foundation Secretarial Team
- }
-
- elsif $USER == 'mnour'
-
- @from = 'Mohammad Nour El-Din <[email protected]>'
- @sig = %{
- -- Mohammad Nour El-Din
- Apache Software Foundation Secretarial Team
- }
- end
-end
-
-