From 678612936ebfcc5fb2638eba377b9c8b7df4cea2 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Tue, 27 Apr 2010 01:28:07 -0400 Subject: Package is now generating a sane default.vcl --- config/varnish64/varnish.inc | 68 +++++++++++--- config/varnish64/varnish_backends.xml | 9 +- config/varnish64/varnish_custom_vcl.xml | 9 +- config/varnish64/varnish_lb_directors.xml | 144 ++++++++++++++++++++++++++++++ config/varnish64/varnish_settings.xml | 9 +- 5 files changed, 219 insertions(+), 20 deletions(-) create mode 100644 config/varnish64/varnish_lb_directors.xml (limited to 'config') diff --git a/config/varnish64/varnish.inc b/config/varnish64/varnish.inc index 1a1cd0a3..c4fd5b4b 100644 --- a/config/varnish64/varnish.inc +++ b/config/varnish64/varnish.inc @@ -32,6 +32,7 @@ /* ========================================================================== */ function sync_package_varnish() { + global $config, $g; if($config['installedpackages']['varnishcustomvcl']['config'] != "") { foreach($config['installedpackages']['varnishcustomvcl']['config'] as $vcl) { if($vcl['vcl_fetch_early']) @@ -103,23 +104,57 @@ deliver; EOF; $backends = ""; + $urlmappings = ""; + + if($config['installedpackages']['varnishlbdirectors']['config'] != "") { + foreach($config['installedpackages']['varnishlbdirectors']['config'] as $backend) { + $director = ""; + if($backend['row']) + foreach($backend['row'] as $be) + $director .= "\t{\n\t\t.backend = {$be['backendname']};\n\t}"; + $backends .= <<varnishbackends 0.0.1 Varnish: Backends + /usr/local/pkg/varnish.inc /usr/local/pkg/ 0755 @@ -72,11 +73,15 @@ Settings - /pkg.php?xml=varnish_settings.xml + /pkg_edit.php?xml=varnish_settings.xml&id=0 Custom VCL - /pkg.php?xml=varnish_custom_vcl.xml + /pkg_edit.php?xml=varnish_custom_vcl.xml&id=0 + + + LB Directors + /pkg.php?xml=varnish_lb_directors.xml diff --git a/config/varnish64/varnish_custom_vcl.xml b/config/varnish64/varnish_custom_vcl.xml index c03d3352..6cd6d877 100644 --- a/config/varnish64/varnish_custom_vcl.xml +++ b/config/varnish64/varnish_custom_vcl.xml @@ -52,14 +52,17 @@ Settings - /pkg.php?xml=varnish_settings.xml - + /pkg_edit.php?xml=varnish_settings.xml&id=0 Custom VCL - /pkg.php?xml=varnish_custom_vcl.xml + /pkg_edit.php?xml=varnish_custom_vcl.xml&id=0 + + LB Directors + /pkg.php?xml=varnish_lb_directors.xml + diff --git a/config/varnish64/varnish_lb_directors.xml b/config/varnish64/varnish_lb_directors.xml new file mode 100644 index 00000000..1c771dbb --- /dev/null +++ b/config/varnish64/varnish_lb_directors.xml @@ -0,0 +1,144 @@ + + + + + + + + Describe your package here + Describe your package requirements here + Currently there are no FAQ items provided. + varnish_lb_directors + 0.0.1 + Varnish: Backends + /usr/local/pkg/varnish.inc + + /usr/local/pkg/ + 0755 + http://www.pfsense.com/packages/config/varnish64/varnish_settings.xml + + + /usr/local/pkg/ + 0755 + http://www.pfsense.com/packages/config/varnish64/varnish_custom_vcl.xml + + + /usr/local/pkg/ + 0755 + http://www.pfsense.com/packages/config/varnish64/varnish.inc + + + Varnish + +
Services
+ varnish_lb_directors.xml +
+ + + Varnish Backends + /pkg.php?xml=varnish_backends.xml + + + Settings + /pkg_edit.php?xml=varnish_settings.xml&id=0 + + + Custom VCL + /pkg_edit.php?xml=varnish_custom_vcl.xml&id=0 + + + LB Directors + /pkg.php?xml=varnish_lb_directors.xml + + + + + + URL + directorurl + + + Type + directortype + + + + + Director name + directorname + input + 40 + + + URL + directorurl + input + 40 + + + Type + directortype + select + + + + + + + Backend + Backend + rowhelper + + + Backend + backendname + Enter the URL that will be mapped to this lb_directors. + + backendname + backendname + select_source + + + + + + + + sync_package_varnish(); + + + sync_package_varnish(); + +
\ No newline at end of file diff --git a/config/varnish64/varnish_settings.xml b/config/varnish64/varnish_settings.xml index 2d7e6ea8..2e9032cd 100644 --- a/config/varnish64/varnish_settings.xml +++ b/config/varnish64/varnish_settings.xml @@ -52,12 +52,17 @@ Settings - /pkg.php?xml=varnish_settings.xml + /pkg_edit.php?xml=varnish_settings.xml&id=0 Custom VCL - /pkg.php?xml=varnish_custom_vcl.xml + /pkg_edit.php?xml=varnish_custom_vcl.xml&id=0 + + + LB Directors + /pkg.php?xml=varnish_lb_directors.xml + -- cgit v1.2.3