Commit Graph

24 Commits

Author SHA1 Message Date
Mcat12
0dec4b8aa0 Protect Enable/Disable with a CSRF token check
The token is now added for all pages.
2016-12-04 13:16:45 -05:00
Mcat12
d2fcc36341 Require CORS check on all admin pages
This is mainly added so that an ad can't enable/disable the Pi-hole
by simply loading a url like `http://pi.hole/admin/index.php?disable`
2016-11-07 21:10:36 -05:00
diginc
657fb7badc Fixes and refactoring WL/BL files more
* CORS was required to auth (bug) - fixed
* Logging defaults to the default lighttpd error log
* Overridable error log location to support alpine/nginx container or power users
* Put the repeated code into a include for sub/add, auth.php
* Error logs say what failed much better now
* VIRTUAL_HOST should theoretically allow custom hostnames for CORS
2016-07-07 00:28:28 -05:00
diginc
18d96f300f merge logic change from devel 2016-07-05 23:35:18 -05:00
Mcat12
cb32c5572a Fix up CORS
Previously had been checking Origin AND Host header, but we should not
check Host header... Removed Host check and only check if Origin header
is set, because otherwise CORS doesn't apply (could be a same-origin
request).
2016-07-03 16:29:19 -04:00
diginc
435ba91d18 thought of a better variable name 2016-06-28 12:27:44 -05:00
diginc
fb18e6b535 whitespace begone 2016-06-28 12:22:10 -05:00
diginc
5d0a399796 Remove SERVER_NAME var because of lighttpd bug
lighttpd suffers from the same same bug/feature apache does, it fills
SERVER_NAME in with the requested URL if connonical names and server
side server name is not configured.  No thanks.

Nginx seems to have secure defaults.
2016-06-28 12:21:16 -05:00
diginc
b4938b0a73 Added SERVER_NAME var check for CORS and refactor 2016-06-28 12:21:15 -05:00
Promofaux
b3dfd41ae5 Echo output of exec command 2016-06-10 20:26:19 -05:00
Mcat12
7067473d89 Return correct CORS header for Host
If only Host was correct (FireFox and IE only set Host
for same-origin requests) then it would still use the
empty Origin header for the CORS response, leading to
`Access-Control-Allow-Origin: `
2016-05-11 16:31:07 -04:00
Mcat12
0e44f7b992 Complete the fix
This fixes the fix. I still needed to account for
`pi.hole` as a Host value.
2016-05-10 20:41:59 -04:00
Mcat12
8a33af6d6b Possible fix for FireFox and IE
Both failed CORS as both browsers, unlike Chrome,
do not send `Origin` headers for same-origin requests.
Now the scripts check if the `Host` header equals
the IP of the Pi-hole. IE may require more fixing,
as it's IE. :P
2016-05-10 20:30:28 -04:00
Mcat12
05e7ebe7dd Implement CORS
Only allows requests from http://pi.hole and http://<Pi's IP>
2016-05-06 16:14:32 -04:00
Mcat12
283f4b7978 Implement CSRF token for list editing 2016-05-02 20:33:29 -04:00
Mcat12
b3d3e151e0 Update list editing commands
Updates from using `whitelist.sh` and `blacklist.sh` to
using `pihole`. Currently includes sudo in command, but
after the scripts get updated with sudo checking that
should not be needed.
2016-04-18 22:23:43 -04:00
Mcat12
4d6ec1c5a5 Remove password functionality
After the change to 0.0.0.0 there will
be no need for a password
2016-04-18 22:07:37 -04:00
Mcat12
5d1761b19d Implemented password checking
Currently allows anything for the password. This will be updated when I implment passwords on the main repo.
2016-02-28 14:52:54 -05:00
Mcat12
020f9a433b Add back in list functionality 2016-02-24 18:42:06 -05:00
Mcat12
18a44efd95 Disable Whitelist/Blacklist feature for release
See #39 for why this is needed
2016-02-21 15:02:48 -05:00
Mcat12
84d11b570e Changed line endings
- Also changed return to die
2016-01-17 17:07:49 -05:00
Mcat12
581494d4c5 Updated adding/subtracting to/from lists 2016-01-17 16:34:43 -05:00
Mcat12
e61a28642a Changed return to die
A little Java slipped there...
2016-01-14 20:06:16 -05:00
Mcat12
3f3ebef42f Integrated list managment with admin site
- Made favicon work across pages
- No longer needs root access to tee command, still needs root access for gravity.sh and whitelist.sh
- Added call to gravity.sh when you remove an item
- Moved header and footer into separate files
- Moved files from list into the main folder
- Got rid of extra dependencies from the old list setup
- Added home button to sidebar
- Renamed original whitelist to "Old Whitelist"
- Added buttons to sidebar for Whitelist and Blacklist
2016-01-13 20:34:43 -05:00