Skip to content

Commit 94a0e4a

Browse files
committed
fix default of npmplus_x_frame_options in custom locations again
1 parent 8cd52e7 commit 94a0e4a

5 files changed

Lines changed: 17 additions & 11 deletions

File tree

backend/templates/_proxy_host_custom_location.conf

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,13 @@ location {{ location_type }}{{ path }} {
1212
{% if npmplus_noindex == true %}include noindex-nofollow.conf;{% endif %}
1313
{% if npmplus_crowdsec_appsec == true %}set $crowdsec_disable_appsec 1;{% endif %}
1414

15-
{% if npmplus_x_frame_options == "none" %}
15+
{% if npmplus_x_frame_options == "upstream" %}
16+
{% elsif npmplus_x_frame_options == "none" %}
1617
more_clear_headers "X-Frame-Options";
17-
{% elsif npmplus_x_frame_options == "upstream" %}{% else %}
18-
more_set_headers "X-Frame-Options: {{ npmplus_x_frame_options }}";
18+
{% elsif npmplus_x_frame_options == "DENY" %}
19+
more_set_headers "X-Frame-Options: DENY";
20+
{% else %}
21+
more_set_headers "X-Frame-Options: SAMEORIGIN";
1922
{% endif %}
2023

2124
{% if forward_scheme == "http" or forward_scheme == "https" %}

backend/templates/proxy_host.conf

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,14 @@
3535
{% if npmplus_noindex == true %}include noindex-nofollow.conf;{% endif %}
3636
{% if npmplus_crowdsec_appsec == true %}set $crowdsec_disable_appsec 1;{% endif %}
3737

38-
{% if npmplus_x_frame_options == "none" %}
39-
more_clear_headers "X-Frame-Options";
40-
{% elsif npmplus_x_frame_options == "upstream" %}{% else %}
41-
more_set_headers "X-Frame-Options: {{ npmplus_x_frame_options }}";
42-
{% endif %}
38+
{% if npmplus_x_frame_options == "upstream" %}
39+
{% elsif npmplus_x_frame_options == "none" %}
40+
more_clear_headers "X-Frame-Options";
41+
{% elsif npmplus_x_frame_options == "DENY" %}
42+
more_set_headers "X-Frame-Options: DENY";
43+
{% else %}
44+
more_set_headers "X-Frame-Options: SAMEORIGIN";
45+
{% endif %}
4346

4447
{% if forward_scheme == "http" or forward_scheme == "https" %}
4548

frontend/src/components/Form/LocationsFields.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,8 +357,8 @@ export function LocationsFields({ initialValues, name = "locations" }: Props) {
357357
>
358358
<option value="SAMEORIGIN">SAMEORIGIN</option>
359359
<option value="DENY">DENY</option>
360-
<option value="upstream">upstream</option>
361360
<option value="none">none</option>
361+
<option value="upstream">upstream</option>
362362
</select>
363363
</label>
364364
</span>

frontend/src/modals/ProxyHostModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,10 +544,10 @@ const ProxyHostModal = EasyModal.create(({ id, isClone = false, visible, remove
544544
SAMEORIGIN
545545
</option>
546546
<option value="DENY">DENY</option>
547+
<option value="none">none</option>
547548
<option value="upstream">
548549
upstream
549550
</option>
550-
<option value="none">none</option>
551551
</select>
552552
{form.errors.npmplusXFrameOptions ? (
553553
<div className="invalid-feedback">

rootfs/usr/local/bin/envs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,7 @@ if [ "$GOA" = "true" ] && [ "$LOGROTATE" = "false" ]; then
726726
fi
727727

728728

729-
export TV="11"
729+
export TV="12"
730730
if [ ! -s /data/npmplus/env.sha512sum ] || [ "$(cat /data/npmplus/env.sha512sum)" != "$( (grep "env\.[A-Z0-9_]\+" -roh /app/templates | sed "s|env.||g" | sort | uniq | xargs printenv; echo "$TV") | tr -d "\n" | sha512sum | cut -d" " -f1)" ]; then
731731
echo "At least one env or the template version changed, all hosts will be regenerated. Please make sure to read the changelog."
732732
export REGENERATE_ALL="true"

0 commit comments

Comments
 (0)