Add support for Content-Security-Policy in images
This commit adds support for the "Content-Security-Policy" header in the barrel images.
This commit is contained in:
parent
17d64826df
commit
760aae0dc1
32 changed files with 162 additions and 48 deletions
|
|
@ -120,6 +120,14 @@
|
|||
<code>{{ .Instance.System.OpCacheDevelopment }}</code>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Content Security Policy
|
||||
</td>
|
||||
<td>
|
||||
<code>{{ .Instance.System.ContentSecurityPolicy }}</code>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
|
@ -143,7 +151,7 @@
|
|||
Directory
|
||||
</td>
|
||||
<td>
|
||||
<code style="overflow: auto;">{{ .Instance.FilesystemBase }}</code>
|
||||
<code class="overflow">{{ .Instance.FilesystemBase }}</code>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
|
@ -351,7 +359,7 @@
|
|||
{{ $slug := .Instance.Slug }}
|
||||
{{ $csrf := .CSRF }}
|
||||
{{ range $index, $user := .Info.Users }}
|
||||
<tr {{ if not $user.Status }}style="color:gray" aria-disabled="true"{{ end }}>
|
||||
<tr {{ if not $user.Status }}class="disabled" aria-disabled="true"{{ end }}>
|
||||
<td>
|
||||
<code>{{ $user.UID }}</code>
|
||||
</td>
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
<div class="pure-control-group">
|
||||
<label for="slug">Slug</label>
|
||||
<input name="slug" id="slug" placeholder="" autocomplete="slug">
|
||||
<input name="slug" id="slug" placeholder="">
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
|
|
@ -24,6 +24,10 @@
|
|||
<input type="checkbox" id="opcacheDevelopment" />
|
||||
Opache Development Configuration
|
||||
</label>
|
||||
<div class="pure-control-group">
|
||||
<label for="contentsecuritypolicy">Content Security Policy</label>
|
||||
<input class="pure-input-1" name="contentsecuritypolicy" id="contentsecuritypolicy" list="content-security-policy" placeholder="">
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend>Profile</legend>
|
||||
|
|
@ -35,4 +39,9 @@
|
|||
|
||||
<input type="submit" value="Provision" class="pure-button">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<datalist id="content-security-policy">
|
||||
{{ range .ContentSecurityPolicies }}
|
||||
<option value="{{ . }}">
|
||||
{{ end }}
|
||||
</datalist>
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
<div class="pure-u-1-1">
|
||||
<form class="pure-form pure-form-aligned" id="provision">
|
||||
<form class="pure-form pure-form-aligned" id="rebuild">
|
||||
<fieldset>
|
||||
<legend>Main Parameters</legend>
|
||||
|
||||
<div class="pure-control-group">
|
||||
<label for="slug">Slug</label>
|
||||
<input name="slug" id="slug" placeholder="" autocomplete="slug" readonly="readonly" value="{{ .Slug }}">
|
||||
<input name="slug" id="slug" placeholder="" readonly="readonly" value="{{ .Slug }}">
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
|
|
@ -22,9 +22,13 @@
|
|||
</select>
|
||||
</div>
|
||||
<label for="opcacheDevelopment" class="pure-checkbox">
|
||||
<input {{ if .System.OpCacheDevelopment }}checked{{end}} type="checkbox" id="opcacheDevelopment" check/>
|
||||
<input {{ if .System.OpCacheDevelopment }}checked{{end}} type="checkbox" id="opcacheDevelopment"/>
|
||||
Opache Development Configuration
|
||||
</label>
|
||||
<div class="pure-control-group" class="pure-input-1">
|
||||
<label for="contentsecuritypolicy">Content Security Policy</label>
|
||||
<input name="contentsecuritypolicy" id="contentsecuritypolicy" list="content-security-policy" value="{{ .System.ContentSecurityPolicy }}">
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend>Profile</legend>
|
||||
|
|
@ -36,4 +40,10 @@
|
|||
|
||||
<input type="submit" value="Rebuild" class="pure-button">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<datalist id="content-security-policy">
|
||||
{{ range .ContentSecurityPolicies }}
|
||||
<option value="{{ . }}">
|
||||
{{ end }}
|
||||
</datalist>
|
||||
|
|
@ -37,7 +37,7 @@
|
|||
<tbody>
|
||||
{{ $csrf := .CSRF }}
|
||||
{{ range .Users }}
|
||||
<tr {{ if not .User.IsEnabled }}style="color:gray"{{ end }}>
|
||||
<tr {{ if not .User.IsEnabled }}class="disabled"{{ end }}>
|
||||
<td>
|
||||
{{ .User.User }}
|
||||
</td>
|
||||
|
|
|
|||
|
|
@ -27,12 +27,14 @@ type instanceProvisionContext struct {
|
|||
}
|
||||
|
||||
type systemParams struct {
|
||||
PHPVersions []string
|
||||
DefaultPHPVersion string
|
||||
PHPVersions []string
|
||||
ContentSecurityPolicies []string
|
||||
DefaultPHPVersion string
|
||||
}
|
||||
|
||||
func newSystemParams() (sp systemParams) {
|
||||
sp.PHPVersions = models.KnownPHPVersions()
|
||||
sp.ContentSecurityPolicies = models.ContentSecurityPolicyExamples()
|
||||
sp.DefaultPHPVersion = models.DefaultPHPVersion
|
||||
return sp
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue