Koha/C4
Kyle M Hall a6838a3e35
Bug 23068: Add ability for Koha to handle X-Forwarded-For headers so REMOTE_ADDR features work behind a proxy
Koha has a number of features that rely on knowing the IP address of the connecting client. If that server is behind a proxy these features do not work.
This patch adds a module to automatically convert the X-Forwarded-For header into the REMOTE_ADDR environment variable for both CGI and Plack processes.

TEST PLAN:
1) Apply this patch set
2) Install Plack::Middleware::RealIP via cpanm or your favorite utility
3) Update your plack.psgi with the changes you find in this patch set ( this process differs based on your testing environment )
4) Restart plack
5) Tail the plack error log for your instance
6) Use curl to access the OPAC, adding an X-Forwarded-For header: curl --header "X-Forwarded-For: 32.32.32.32" http://127.0.0.1:8080
7) Note the logs output this address if you are unproxied
8) If you are proxied, restart plack using a command like below, where the ip you see in the logs ("REAL IP) is what you put in the koha conf:
    <koha_trusted_proxies>172.22.0.1 1.1.1.1</koha_trusted_proxies>
9) Restart all the things!
10) Repeat step 6
11) You should now see "REAL IP: 32.32.32.32" in the plack logs as the remote address in your plack-error.log logs!
12) Disable plack so you are running in cgi mode, repeat step 6 again
13) You should see "REAL IP: 32.32.32.32" as the remove address in your opac-error.log logs!

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Ed Veal <eveal@mckinneytexas.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-31 16:10:17 +00:00
..
AuthoritiesMarc
Barcodes Bug 21937: Syspref autoBarcode annual doesn't increment properly barcode 2019-04-19 14:32:36 +00:00
ClassSortRoutine
ClassSplitRoutine Bug 15836: Add the ability to defined custom methods to split call number in labels 2018-11-13 15:18:22 +00:00
Creators Bug 23289: Quote new 'rows' MariaDB reserved word 2019-09-06 13:17:48 +01:00
External Bug 22010: Check preferences for ebook integration 2019-04-30 11:42:51 +00:00
Form
Heading Bug 21826: (QA follow-up) Add UNIMARC support 2019-01-25 20:13:39 +00:00
ILSDI Bug 17247: (follow-up) Terminology fix: Use Restricted instead of debarred 2019-10-15 14:11:03 +01:00
Installer Bug 23068: Add ability for Koha to handle X-Forwarded-For headers so REMOTE_ADDR features work behind a proxy 2019-10-31 16:10:17 +00:00
Labels Bug 22721: Remove frameworkcode parameter in GetMarcFromKohaField calls 2019-07-15 11:28:08 +01:00
Linker Bug 21450: Cache authorities search using term and auth_type 2019-05-30 10:13:38 +00:00
Members Bug 20444: Remove sub GetAttributes 2018-05-03 13:26:49 -03:00
OAI
Output
Patroncards Bug 22429: Infinite loop in patron card printing 2019-03-15 11:59:28 +00:00
Reports Bug 23389: Add 'All' option to report dropdowns 2019-10-07 14:09:10 +01:00
Search
Serials
SIP Bug 23805: Update 'W' to 'WRITEOFF' for consistency 2019-10-24 17:35:20 +01:00
Utils Bug 20514: Use streetnumber when searching for patrons by address 2019-05-15 12:10:53 +00:00
Accounts.pm Bug 23049: Capitalise type passed to add_debit for lost_item 2019-10-24 17:24:33 +01:00
Acquisition.pm Bug 14669: Add search option for managing library to orders search 2019-10-08 14:04:48 +01:00
Auth.pm Bug 23068: Add ability for Koha to handle X-Forwarded-For headers so REMOTE_ADDR features work behind a proxy 2019-10-31 16:10:17 +00:00
Auth_cas_servers.yaml.sample
Auth_with_cas.pm
Auth_with_ldap.pm Bug 14570: Make it possible to add multiple guarantors to a record 2019-08-20 16:04:48 +01:00
Auth_with_shibboleth.pm Bug 23526: Don't use encoded question mark in shib_login_url 2019-09-23 10:43:09 +01:00
AuthoritiesMarc.pm Bug 21036: Remove odd number of elements warnings from AuthoritiesMarc.pm 2019-05-07 11:39:24 +00:00
BackgroundJob.pm
Barcodes.pm
Biblio.pm Bug 23392: Don't display private notes in MARC21 2019-10-24 10:58:02 +01:00
Bookseller.pm
Boolean.pm
Breeding.pm Bug 22532: Remove Z39.50 random 2019-04-18 10:48:10 +00:00
Budgets.pm Bug 10577: (QA follow-up) Remove tab chars 2019-03-28 12:46:14 +00:00
Calendar.pm
Charset.pm Bug 22721: Remove frameworkcode parameter in GetMarcFromKohaField calls 2019-07-15 11:28:08 +01:00
Circulation.pm Bug 14697: Add return claim handling to AddReturn 2019-10-31 12:03:48 +00:00
ClassSortRoutine.pm
ClassSource.pm Bug 15836: Remove deprecated subroutines 2018-11-13 18:56:18 +00:00
ClassSplitRoutine.pm Bug 15836: Add the ability to defined custom methods to split call number in labels 2018-11-13 15:18:22 +00:00
Context.pm Bug 23068: Add ability for Koha to handle X-Forwarded-For headers so REMOTE_ADDR features work behind a proxy 2019-10-31 16:10:17 +00:00
Contract.pm
CourseReserves.pm Bug 22142: Do not revert data if 'unchanged' was set 2019-08-13 11:22:13 +01:00
Creators.pm
Debug.pm
Heading.pm Bug 21826: Remove strict and warning from Heading.pm 2019-01-25 20:13:41 +00:00
HoldsQueue.pm Bug 11529: (RM follow-up) Fix missing comma in query 2019-08-05 17:25:08 +01:00
HTML5Media.pm Bug 21742: Fix YouTube variable propagation 2018-11-01 18:59:33 +00:00
Images.pm Bug 21987: Do not generate true color thumbnails if not needed 2019-03-15 12:19:56 +00:00
ImportBatch.pm Bug 18757: Problem when importing only items in MARC records 2019-10-29 12:17:38 +00:00
ImportExportFramework.pm Bug 18143: Silence ods MARC framework export flood 2019-02-19 13:52:15 +00:00
InstallAuth.pm Bug 21137: Replace USER_INFO with logged_in_user 2018-08-14 12:43:10 +00:00
Installer.pm Bug 23805: Add account_credit_types tables 2019-10-24 17:35:19 +01:00
ItemCirculationAlertPreference.pm
Items.pm Bug 23129: Set holdingbranch to library that initiates transfer 2019-10-15 14:12:59 +01:00
Koha.pm Bug 23324: (QA follow-up) Typo and remove unneeded use statement 2019-08-16 12:27:01 +01:00
Labels.pm
Languages.pm Bug 18213: Add Template plugin and fix for C4/Languages 2019-03-28 15:57:32 +00:00
Letters.pm Bug 5770: (QA follow-up) Revert change to GetQueuedMessages 2019-05-10 17:29:31 +00:00
Linker.pm
Log.pm Bug 22600: Add 'interface' to accountlines 2019-04-10 19:43:11 +00:00
MarcModificationTemplates.pm Bug 21831: Allow move all fields even if destination field is different 2019-05-23 14:50:57 +00:00
Matcher.pm Bug 23324: Add an ISBN normalization routine 2019-08-16 12:26:48 +01:00
Members.pm Bug 14570: Make it possible to add multiple guarantors to a record 2019-08-20 16:04:48 +01:00
Message.pm Bug 21206: Replace C4::Items::GetItem 2019-02-26 13:24:07 +00:00
NewsChannels.pm
Output.pm Bug 23117: Shortcut additem.pl on nonexistent biblionumber 2019-06-15 08:01:37 +01:00
Overdues.pm Bug 23049: (QA follow-up) Correction for 'M' => 'MANUAL' 2019-10-24 17:25:09 +01:00
Patroncards.pm
Print.pm
Record.pm Bug 14385: Squash of a lot of patches rebased 2018-11-02 10:33:12 +00:00
Reports.pm
Reserves.pm Bug 23049: Update debit_type_code 'Res' to 'RESERVE' 2019-10-24 17:24:18 +01:00
Ris.pm
RotatingCollections.pm
Scheduler.pm
Scrubber.pm
Search.pm Bug 23663: Only process itemtype summary if using non-xslt opac results 2019-10-29 12:17:43 +00:00
Serials.pm Bug 23416: Add PreserveSerialNotes system preference 2019-08-12 14:35:18 +01:00
Service.pm
ShelfBrowser.pm Bug 22445: Custom cover images - opac shelfbrowser 2019-10-22 15:02:48 +01:00
SMS.pm
SocialData.pm
Stats.pm Bug 21683: Remove accountlines.accountno 2019-03-21 18:19:22 +00:00
Suggestions.pm Bug 18743: Correct number of pending suggestions (acq home page) 2019-10-25 13:16:49 +01:00
Tags.pm
Templates.pm Bug 20538: Remove the need of writing [% KOHA_VERSION %] everywhere 2018-04-13 11:49:44 -03:00
TmplToken.pm
TmplTokenType.pm
TTParser.pm
UsageStats.pm Bug 23697: (QA follow-up) Rename PatronAutocompletion to PatronAutoComplete 2019-10-08 14:51:12 +01:00
XISBN.pm Bug 12537: Don't retrieve XISBN results for the same biblionumber 2019-07-15 11:27:59 +01:00
XSLT.pm Bug 22899: (QA follow-up) Change accessor name 2019-05-14 18:08:34 +00:00