Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Further CSP fixes #2140

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,5 @@ src/fppd.xcodeproj/project.xcworkspace/xcshareddata
*-workspace
.DS_Store
capes/drivers/bb64/pinctrl
etc/apache2.csp

2 changes: 1 addition & 1 deletion etc/apache2.csp
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<IfModule mod_headers.c>
Header set Content-Security-Policy "default-src 'self' http://www.w3.org ; script-src 'self' 'unsafe-inline' https://api.falconplayer.com https://raw.githubusercontent.com/FalconChristmas/fpp-data https://raw.githubusercontent.co; style-src 'self' 'unsafe-inline' ; object-src 'none' ; connect-src 'self' https://raw.githubusercontent.com https://kulplights.com https://www.hansonelectronics.com.au https://www.wiredwatts.com ; img-src 'self' blob: data: http://www.w3.org https://www.paypal.com https://www.paypalobjects.com https://a.espncdn.com"
Header set Content-Security-Policy "default-src 'self' http://www.w3.org ; script-src 'self' 'unsafe-inline' https://api.falconplayer.com https://raw.githubusercontent.com/FalconChristmas/fpp-data https://raw.githubusercontent.co; style-src 'self' 'unsafe-inline' ; object-src 'none' ; connect-src 'self' https://raw.githubusercontent.com https://kulplights.com https://www.hansonelectronics.com.au https://www.wiredwatts.com; img-src 'self' blob: data: http://www.w3.org https://www.paypal.com https://www.paypalobjects.com https://kulplights.com https://www.hansonelectronics.com.au https://www.wiredwatts.com"
</IfModule>
8 changes: 8 additions & 0 deletions etc/csp_allowed_default_struct.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"default-src": [],
"img-src": [],
"script-src": [],
"style-src": [],
"connect-src": [],
"object-src": []
}
13 changes: 0 additions & 13 deletions etc/csp_allowed_domains.json

This file was deleted.

13 changes: 10 additions & 3 deletions scripts/ManageApacheContentPolicy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,27 @@ BINDIR=$(cd $(dirname $0) && pwd)
. ${BINDIR}/functions

#############################################################################
# Path to your JSON file
JSON_FILE=$FPPDIR"/etc/csp_allowed_domains.json"
# Path to your JSON default structure file
JSON_STRUCT=$FPPDIR"/etc/csp_allowed_default_struct.json"
# Path to your local CSP JSON override file
JSON_FILE=$MEDIADIR"/config/csp_allowed_domains.json"

# Default key values hard-coded to include in all configs
declare -A DEFAULT_VALUES
DEFAULT_VALUES=(
["default-src"]="'self' http://www.w3.org"
["connect-src"]="'self' https://raw.githubusercontent.com https://kulplights.com https://www.hansonelectronics.com.au https://www.wiredwatts.com"
["object-src"]="'none' "
["img-src"]="'self' blob: data: http://www.w3.org https://www.paypal.com https://www.paypalobjects.com"
["img-src"]="'self' blob: data: http://www.w3.org https://www.paypal.com https://www.paypalobjects.com https://kulplights.com https://www.hansonelectronics.com.au https://www.wiredwatts.com"
["script-src"]="'self' 'unsafe-inline' https://api.falconplayer.com"
["style-src"]="'self' 'unsafe-inline'"
)

#Generate local CSP JSON override file in NOT exists
if [ ! -f $JSON_FILE ]; then
cp $JSON_STRUCT $JSON_FILE
fi

# Function to check if a key exists in the JSON file
key_exists() {
key=$1
Expand Down
2 changes: 1 addition & 1 deletion www/changelog.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ function GitCheckoutVersion(version) {
What action would you like to take?
</div>
<div id='upgradePopup' title='Switch Version' style="display: none">
<textarea style='width: 99%; height: 94%;' disabled id='upgradeText'>
<textarea style='width: 99%; height: 94%;' disabled id='upgradeText' title="Upgrade Text">
</textarea>
<input id='closeDialogButton' type='button' class='buttons' value='Close' onClick='CloseUpgradeDialog();'
style='display: none;'>
Expand Down