Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
pleroma
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
jeff
pleroma
Commits
df72978d
Commit
df72978d
authored
6 years ago
by
kaniini
Browse files
Options
Downloads
Patches
Plain Diff
csp plug: add support for certificate transparency
parent
331cf6ad
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
config/config.exs
+2
-1
2 additions, 1 deletion
config/config.exs
config/config.md
+1
-0
1 addition, 0 deletions
config/config.md
lib/pleroma/plugs/csp_plug.ex
+4
-2
4 additions, 2 deletions
lib/pleroma/plugs/csp_plug.ex
with
7 additions
and
3 deletions
config/config.exs
+
2
−
1
View file @
df72978d
...
...
@@ -179,7 +179,8 @@ config :pleroma, :suggestions,
config
:pleroma
,
:csp
,
enabled:
true
,
sts:
false
,
sts_max_age:
31_536_000
sts_max_age:
31_536_000
,
ct_max_age:
2_592_000
config
:cors_plug
,
max_age:
86_400
,
...
...
This diff is collapsed.
Click to expand it.
config/config.md
+
1
−
0
View file @
df72978d
...
...
@@ -85,3 +85,4 @@ This section is used to configure Pleroma-FE, unless ``:managed_config`` in ``:i
*
``enabled``
: Whether the managed content security policy is enabled
*
``sts``
: Whether to additionally send a
`Strict-Transport-Security`
header
*
``sts_max_age``
: The maximum age for the
`Strict-Transport-Security`
header if sent
*
``ct_max_age``
: The maximum age for the
`Except-CT`
header if sent
This diff is collapsed.
Click to expand it.
lib/pleroma/plugs/csp_plug.ex
+
4
−
2
View file @
df72978d
...
...
@@ -44,10 +44,12 @@ defmodule Pleroma.Plugs.CSPPlug do
end
defp
maybe_send_sts_header
(
conn
,
true
)
do
max_age
=
Config
.
get
([
:csp
,
:sts_max_age
])
max_age_sts
=
Config
.
get
([
:csp
,
:sts_max_age
])
max_age_ct
=
Config
.
get
([
:csp
,
:ct_max_age
])
merge_resp_headers
(
conn
,
[
{
"strict-transport-security"
,
"max-age=
#{
max_age
}
; includeSubDomains"
}
{
"strict-transport-security"
,
"max-age=
#{
max_age_sts
}
; includeSubDomains"
},
{
"expect-ct"
,
"enforce, max-age=
#{
max_age_ct
}
"
}
])
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment