/
SecurityPrivacyTab.vue
152 lines (143 loc) · 5.52 KB
/
SecurityPrivacyTab.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
<template>
<b-form-fieldset>
<template #label>
{{ $gettext('Privacy') }}
</template>
<div class="form-row">
<b-wrapped-form-group
id="edit_form_analytics"
class="col-md-12"
:field="form.analytics"
>
<template #label>
{{ $gettext('Listener Analytics Collection') }}
</template>
<template #description>
{{
$gettext('Aggregate listener statistics are used to show station reports across the system. IP-based listener statistics are used to view live listener tracking and may be required for royalty reports.')
}}
</template>
<template #default="slotProps">
<b-form-radio-group
:id="slotProps.id"
v-model="slotProps.field.$model"
stacked
>
<b-form-radio value="all">
<b>
{{ $gettext('Full:') }}
</b>
{{ $gettext('Collect aggregate listener statistics and IP-based listener statistics') }}
</b-form-radio>
<b-form-radio value="no_ip">
<b>
{{ $gettext('Limited:') }}
</b>
{{ $gettext('Only collect aggregate listener statistics') }}
</b-form-radio>
<b-form-radio value="none">
<b>
{{ $gettext('None:') }}
</b>
{{ $gettext('Do not collect any listener analytics') }}
</b-form-radio>
</b-form-radio-group>
</template>
</b-wrapped-form-group>
</div>
</b-form-fieldset>
<b-form-fieldset>
<template #label>
{{ $gettext('Security') }}
</template>
<div class="form-row">
<b-wrapped-form-checkbox
id="edit_form_always_use_ssl"
class="col-md-12"
:field="form.always_use_ssl"
>
<template #label>
{{ $gettext('Always Use HTTPS') }}
</template>
<template #description>
{{
$gettext('Set to "Yes" to always use "https://" secure URLs, and to automatically redirect to the secure URL when an insecure URL is visited.')
}}
</template>
</b-wrapped-form-checkbox>
<b-wrapped-form-group
id="edit_form_ip_source"
class="col-md-6"
:field="form.ip_source"
>
<template #label>
{{ $gettext('IP Address Source') }}
</template>
<template #description>
{{
$gettext('Customize this setting to ensure you get the correct IP address for remote users. Only change this setting if you use a reverse proxy, either within Docker or a third-party service like CloudFlare.')
}}
</template>
<template #default="slotProps">
<b-form-radio-group
:id="slotProps.id"
v-model="slotProps.field.$model"
stacked
:options="ipSourceOptions"
/>
</template>
</b-wrapped-form-group>
<b-wrapped-form-group
id="edit_form_api_access_control"
class="col-md-6"
:field="form.api_access_control"
>
<template #label>
{{ $gettext('API "Access-Control-Allow-Origin" Header') }}
</template>
<template #description>
{{
$gettext('Set to * to allow all sources, or specify a list of origins separated by a comma (,).')
}}
<br>
<a
href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin"
target="_blank"
>
{{ $gettext('Learn more about this header.') }}
</a>
</template>
</b-wrapped-form-group>
</div>
</b-form-fieldset>
</template>
<script setup>
import BWrappedFormGroup from "~/components/Form/BWrappedFormGroup.vue";
import BFormFieldset from "~/components/Form/BFormFieldset.vue";
import BWrappedFormCheckbox from "~/components/Form/BWrappedFormCheckbox.vue";
import {useTranslate} from "~/vendor/gettext";
import {computed} from "vue";
const props = defineProps({
form: {
type: Object,
required: true
}
});
const {$gettext} = useTranslate();
const ipSourceOptions = computed(() => {
return [
{
value: 'local',
text: $gettext('Local IP (Default)')
},
{
value: 'cloudflare',
text: $gettext('CloudFlare (CF-Connecting-IP)')
},
{
value: 'xff',
text: $gettext('Reverse Proxy (X-Forwarded-For)')
}
]
});
</script>