You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@whimsical.apache.org by sebb <se...@gmail.com> on 2017/10/05 14:54:58 UTC
Re: [whimsy] branch master updated: allow vhosttest and mkconf to be
used together
On 5 October 2017 at 15:29, <ru...@apache.org> wrote:
> This is an automated email from the ASF dual-hosted git repository.
>
> rubys 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 89c0520 allow vhosttest and mkconf to be used together
> 89c0520 is described below
>
> commit 89c0520831546f7c19ce9e22ab0ac12fd706730b
> Author: Sam Ruby <ru...@intertwingly.net>
> AuthorDate: Thu Oct 5 10:29:26 2017 -0400
>
> allow vhosttest and mkconf to be used together
> ---
> tools/mkconf.rb | 13 ++++++++++---
> tools/vhosttest.rb | 2 +-
> 2 files changed, 11 insertions(+), 4 deletions(-)
>
> diff --git a/tools/mkconf.rb b/tools/mkconf.rb
> index 52784a1..b679ef7 100644
> --- a/tools/mkconf.rb
> +++ b/tools/mkconf.rb
> @@ -1,16 +1,23 @@
> #
> # Generate a whimsy.local version of the deployed whimsy configuration
> #
> +# Example usage:
> +# ruby vhosttest.rb | ruby mkconf.rb /private/etc/apache2/other/whimsy.conf
> +#
>
> require 'rbconfig'
>
> -conf = `ssh whimsy-vm4.apache.org cat \
> - /etc/apache2/sites-enabled/*-whimsy-vm-443.conf`
> +if STDIN.tty?
> + conf = `ssh whimsy-vm4.apache.org cat \
> + /etc/apache2/sites-enabled/*-whimsy-vm-443.conf`
Might be better to use the generic host name here?
> +else
> + conf = STDIN.read
> +end
>
> conf.sub! 'VirtualHost *:443', 'VirtualHost *:80'
> conf.sub! 'ServerName whimsy.apache.org', 'ServerName whimsy.local'
>
> -conf.gsub! /\n\s*RemoteIPHeader.*/, ''
> +conf.gsub! /(\A|\n)\s*RemoteIPHeader.*/, ''
>
> conf.gsub! /\n\s*PassengerDefault.*/, ''
>
> diff --git a/tools/vhosttest.rb b/tools/vhosttest.rb
> index 62adbcf..a45f16a 100644
> --- a/tools/vhosttest.rb
> +++ b/tools/vhosttest.rb
> @@ -20,7 +20,7 @@ end
> require 'yaml'
> require "#{IP}/modules/vhosts_whimsy/lib/puppet/parser/functions/preprocess_vhosts.rb"
>
> -facts = YAML.load_file("#{IP}//data/nodes/whimsy.apache.org.yaml")
> +facts = YAML.load_file("#{IP}/data/nodes/whimsy-vm4.apache.org.yaml")
Cannot use the generic hostname here because the yaml does not exist.
> facts = facts['vhosts_whimsy::vhosts::vhosts']['whimsy-vm-443']
> ldap = ASF::LDAP.hosts.sort.first
>
>
> --
> To stop receiving notification emails like this one, please contact
> ['"commits@whimsical.apache.org" <co...@whimsical.apache.org>'].