Skip to content
Open
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 .docker/nginx/config/nextcloud.conf
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ server {
# Hide metadata files which would otherwise be served as plain files and
# leak dependency information (composer.json, package.json, core/shipped.json).
location ~ ^/(?:composer\.(?:json|lock)|package(?:-lock)?\.json|core/shipped\.json)$ { return 404; }
location ~ ^/(?:apps|apps-extra|apps-writable)/[^/]+/(?:\.|composer\.(?:json|lock)$|package(?:-lock)?\.json$) { return 404; }

# Pass PHP requests to PHP-FPM.
#
Expand Down
4 changes: 4 additions & 0 deletions tests/proxy/compose-policy.bats
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,7 @@ setup() {
done < <(grep -E '^[[:space:]]*-?[[:space:]]*uses:[[:space:]]+[^./][^[:space:]]+@' "$workflow" || true)
done < <(find "$REPO_ROOT/.github/workflows" -type f \( -name '*.yml' -o -name '*.yaml' \))
}

@test "nginx hides dotfiles and dependency manifests inside app directories" {
grep -Fxq ' location ~ ^/(?:apps|apps-extra|apps-writable)/[^/]+/(?:\.|composer\.(?:json|lock)$|package(?:-lock)?\.json$) { return 404; }' "$REPO_ROOT/.docker/nginx/config/nextcloud.conf"
}
Loading