Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
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
Maunium
synapse
Commits
f25f638c
Unverified
Commit
f25f638c
authored
5 years ago
by
Brendan Abolivier
Browse files
Options
Downloads
Patches
Plain Diff
Lint
parent
3ff3dfe5
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
docs/sample_config.yaml
+1
-1
1 addition, 1 deletion
docs/sample_config.yaml
synapse/config/registration.py
+7
-12
7 additions, 12 deletions
synapse/config/registration.py
synapse/rest/client/v2_alpha/account_validity.py
+2
-4
2 additions, 4 deletions
synapse/rest/client/v2_alpha/account_validity.py
with
10 additions
and
17 deletions
docs/sample_config.yaml
+
1
−
1
View file @
f25f638c
...
...
@@ -805,7 +805,7 @@ uploads_path: "DATADIR/uploads"
# # Directory in which Synapse will try to find the HTML files to serve to the
# # user when trying to renew an account. Optional, defaults to
# # synapse/res/templates.
# template_dir: "res/templates"
# template_dir: "res/templates"
# # HTML to be displayed to the user after they successfully renewed their
# # account. Optional.
# account_renewed_html_path: "account_renewed.html"
...
...
This diff is collapsed.
Click to expand it.
synapse/config/registration.py
+
7
−
12
View file @
f25f638c
...
...
@@ -14,10 +14,10 @@
# limitations under the License.
import
os
import
pkg_resources
from
distutils.util
import
strtobool
import
pkg_resources
from
synapse.config._base
import
Config
,
ConfigError
from
synapse.types
import
RoomAlias
from
synapse.util.stringutils
import
random_string_with_symbols
...
...
@@ -54,13 +54,10 @@ class AccountValidityConfig(Config):
template_dir
=
pkg_resources
.
resource_filename
(
"
synapse
"
,
"
res/templates
"
)
if
"
account_renewed_html_path
"
in
config
:
file_path
=
os
.
path
.
join
(
template_dir
,
config
[
"
account_renewed_html_path
"
],
)
file_path
=
os
.
path
.
join
(
template_dir
,
config
[
"
account_renewed_html_path
"
])
self
.
account_renewed_html_content
=
self
.
read_file
(
file_path
,
"
account_validity.account_renewed_html_path
"
,
file_path
,
"
account_validity.account_renewed_html_path
"
)
else
:
self
.
account_renewed_html_content
=
(
...
...
@@ -68,12 +65,10 @@ class AccountValidityConfig(Config):
)
if
"
invalid_token_html_path
"
in
config
:
file_path
=
os
.
path
.
join
(
template_dir
,
config
[
"
invalid_token_html_path
"
],
)
file_path
=
os
.
path
.
join
(
template_dir
,
config
[
"
invalid_token_html_path
"
])
self
.
invalid_token_html_content
=
self
.
read_file
(
file_path
,
"
account_validity.invalid_token_html_path
"
,
file_path
,
"
account_validity.invalid_token_html_path
"
)
else
:
self
.
invalid_token_html_content
=
(
...
...
@@ -184,7 +179,7 @@ class RegistrationConfig(Config):
# # Directory in which Synapse will try to find the HTML files to serve to the
# # user when trying to renew an account. Optional, defaults to
# # synapse/res/templates.
# template_dir:
"
res/templates
"
# template_dir:
"
res/templates
"
# # HTML to be displayed to the user after they successfully renewed their
# # account. Optional.
# account_renewed_html_path:
"
account_renewed.html
"
...
...
This diff is collapsed.
Click to expand it.
synapse/rest/client/v2_alpha/account_validity.py
+
2
−
4
View file @
f25f638c
...
...
@@ -52,7 +52,7 @@ class AccountValidityRenewServlet(RestServlet):
renewal_token
=
request
.
args
[
b
"
token
"
][
0
]
token_valid
=
yield
self
.
account_activity_handler
.
renew_account
(
renewal_token
.
decode
(
"
utf8
"
)
,
renewal_token
.
decode
(
"
utf8
"
)
)
if
token_valid
:
...
...
@@ -64,9 +64,7 @@ class AccountValidityRenewServlet(RestServlet):
request
.
setResponseCode
(
status_code
)
request
.
setHeader
(
b
"
Content-Type
"
,
b
"
text/html; charset=utf-8
"
)
request
.
setHeader
(
b
"
Content-Length
"
,
b
"
%d
"
%
(
len
(
response
),)
)
request
.
setHeader
(
b
"
Content-Length
"
,
b
"
%d
"
%
(
len
(
response
),))
request
.
write
(
response
.
encode
(
"
utf8
"
))
finish_request
(
request
)
defer
.
returnValue
(
None
)
...
...
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