├── README.textile └── reverseproxy └── plugin.php /README.textile: -------------------------------------------------------------------------------- 1 | **This project has been archived, you may fork it and continue to develop it further.** 2 | 3 | **The code may be insecure as it is and no effort to correct any bugs will be taken.** 4 | 5 | h2. YOURLS Reverse Proxy Plugin 6 | 7 | Fixes the user IPs to point to the actual user instead of your cloud provider's infrastructure IPs, for now the following providers and their headers are supported: 8 | * Cloudflare: This information is gathered from _CF-Connecting-IP_ and applied as a filter to _yourls_get_IP()_ 9 | * Heroku: This information is gathered from _X-Forwarded-For_ and applied as a filter to _yourls_get_IP()_ 10 | 11 | h3. Why? 12 | 13 | Due to how CloudFlare is essentially a reverse proxy between your server and the internet at large, your server will end up seeing the reverse proxy instead of the client requesting the pagethe server will see the proxy IPs instead of the real IP that[1] 14 | and Heroku has router infrastructure which behaves in a similar fashion.[3] 15 | 16 | h3. Installation 17 | 18 | # Fetch/pull/download the repo 19 | # Copy the folder _reverseproxy_ into _YOURLS_ABSPATH/user/plugins_ where _YOURLS_ABSPATH_ is the location your YOURLS install is located in. 20 | # Activate plugin on administrator interface. 21 | # ??? 22 | # Profit! 23 | 24 | 25 | fn1. "https://support.cloudflare.com/hc/en-us/articles/200170786-Restoring-original-visitor-IPs-Logging-visitor-IP-addresses-with-mod-cloudflare-":https://support.cloudflare.com/hc/en-us/articles/200170786-Restoring-original-visitor-IPs-Logging-visitor-IP-addresses-with-mod-cloudflare- 26 | 27 | fn2. "https://devcenter.heroku.com/articles/http-routing#heroku-headers":https://devcenter.heroku.com/articles/http-routing#heroku-headers 28 | -------------------------------------------------------------------------------- /reverseproxy/plugin.php: -------------------------------------------------------------------------------- 1 |