| 1 |
# ReverseProxy::FormFiller config example |
| 2 |
# Put this file somewhere on your server - typically in |
| 3 |
# /etc/apache2/FormFiller/ -, adapt it and point to it in Apache2 config, |
| 4 |
# through a directive like |
| 5 |
# PerlSetVar FormFillerParamFile "<current file path>" |
| 6 |
|
| 7 |
# jQuery selector to the form to fill |
| 8 |
# optional: if not defined, first form in web page will be filled |
| 9 |
form => '"form:first"', |
| 10 |
# may rely on perl functions and Apache environment vars, e.g |
| 11 |
#form => '(localtime)[2] >= 12 ? "#morningForm" : "#afternoonForm"', |
| 12 |
# If the inputs/textareas/select markups do not belong to any form, you can set |
| 13 |
#form => '"body"' |
| 14 |
|
| 15 |
# To enable form auto-submit, or to automatically click on a button |
| 16 |
# may be true (enabled), false (disabled), or a jQuery selector to the button to click on |
| 17 |
submit => '"true"', |
| 18 |
# may also rely on perl functions and Apache environment vars |
| 19 |
# optional, default value: false |
| 20 |
|
| 21 |
# URL to load jQuery, |
| 22 |
# since ReverseProxy::FormFiller response filter relies on jQuery (any version >= 1.0) |
| 23 |
# optional: if not defined, jQuery is supposed to be already loaded in the web page |
| 24 |
jQueryUrl => "", |
| 25 |
|
| 26 |
# Form fields to fill in response body - filled data will be seen by user |
| 27 |
# Hash keys refer to input/textarea/select's name attribute |
| 28 |
# Fields value can rely on perl functions and Apache environment vars |
| 29 |
publicFormData => { |
| 30 |
company => '"SnakeOilsInc"', |
| 31 |
user => '$ENV{REMOTE_USER} =~ /(rtyler|msmith)/ ? "user" : $ENV{REMOTE_USER} =~ /dwho/ ? "admin" : "nobody"', |
| 32 |
password => '"hidden"' |
| 33 |
}, |
| 34 |
|
| 35 |
# Alternatively, if the inputs you want to fill in the html page |
| 36 |
# have no name attribute, you can define them with jQuery selectors |
| 37 |
#publicFilledData => { |
| 38 |
# 'textarea.company' => '"SnakeOilsInc"', |
| 39 |
# 'input#user' => '$ENV{REMOTE_USER} =~ /(rtyler|msmith)/ ? "user" : $ENV{REMOTE_USER} =~ /dwho/ ? "admin" : "nobody"', |
| 40 |
# 'input[type=password]' => '"hidden"' |
| 41 |
#}, |
| 42 |
|
| 43 |
# Form fields to fill in request body - filled data will not be seen by user |
| 44 |
# Fields value can rely on perl functions and Apache environment vars |
| 45 |
# Note that publicFormData are also re-filled in request body, |
| 46 |
# to prevent malicious users to tamper them |
| 47 |
secretFormData => { |
| 48 |
password => '$ENV{REMOTE_USER} =~ /(rtyler|msmith)/ ? "user-secret" : $ENV{REMOTE_USER} =~ /dwho/ ? "admin-secret" : ""', |
| 49 |
}, |
| 50 |
|
| 51 |
# Alternatively, you can do substitutions on POST data |
| 52 |
#postDataSub => [ |
| 53 |
# 's/foo/bar/', |
| 54 |
# 's/user:(.+?):password:[^:]+/user:$1:password:admin-secret/', |
| 55 |
#] |
| 56 |
|
| 57 |
# Arbitrary javascript code to run after fields are filled, but before posting the form |
| 58 |
# If you call jQuery through its shortcut '$', you have to escape it |
| 59 |
# Use single quotes and double quotes as in the following example |
| 60 |
# javascript => 'alert("Hello $ENV{REMOTE_USER}"); \$(input.mycheckbox).prop("checked", true)' |
| 61 |
|