Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Hiboo
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ACIDES
Hiboo
Commits
ab2705ef
Commit
ab2705ef
authored
4 years ago
by
pascoual
Committed by
kaiyou
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add : app template for WriteFreely
parent
995cd008
No related branches found
No related tags found
1 merge request
!20
Add 'remember me' button
Pipeline
#1194
passed
4 years ago
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
hiboo/application/social.py
+29
-0
29 additions, 0 deletions
hiboo/application/social.py
hiboo/application/templates/application_writefreely.html
+17
-0
17 additions, 0 deletions
hiboo/application/templates/application_writefreely.html
with
46 additions
and
0 deletions
hiboo/application/social.py
+
29
−
0
View file @
ab2705ef
...
...
@@ -58,3 +58,32 @@ class SynapseApplication(base.SAMLApplication):
obj
=
service
,
application_uri
=
service
.
config
.
get
(
"
application_uri
"
)
)
@register
(
"
writefreely
"
)
class
GitlabApplication
(
base
.
OIDCApplication
):
"""
WriteFreely is free, open source, ActivityPub compliant blog software.
"""
name
=
_
(
"
WriteFreely
"
)
class
Form
(
base
.
BaseForm
):
application_uri
=
fields
.
StringField
(
_
(
"
WriteFreely URL
"
),
[
validators
.
URL
(
require_tld
=
False
)])
submit
=
fields
.
SubmitField
(
_
(
'
Submit
'
))
def
populate_service
(
self
,
form
,
service
):
service
.
profile_regex
=
"
[a-z0-9_.\-]*
"
callback_uri
=
form
.
application_uri
.
data
+
"
/oauth/callback/generic
"
service
.
config
.
update
({
"
application_uri
"
:
form
.
application_uri
.
data
,
"
token_endpoint_auth_method
"
:
"
client_secret_basic
"
,
"
redirect_uris
"
:
[
callback_uri
],
"
grant_types
"
:
[
"
authorization_code
"
],
"
response_types
"
:
[
"
code
"
],
"
special_mappings
"
:
[
"
ignore_scopes
"
]
})
self
.
fill_service
(
service
)
def
populate_form
(
self
,
service
,
form
):
form
.
process
(
obj
=
service
,
application_uri
=
service
.
config
.
get
(
"
application_uri
"
)
)
This diff is collapsed.
Click to expand it.
hiboo/application/templates/application_writefreely.html
0 → 100644
+
17
−
0
View file @
ab2705ef
<h3>
Setting up WriteFreely
</h3>
<p>
WriteFreely supports OIDC authentication through Oauth2.
</p>
<p>
In order to configure Oauth2 for WriteFreely, you may copy then paste the following lines directly into your WriteFreely config.ini and restart.
</p>
<pre>
[oauth.generic]
client_id = {{ service.config["client_id"] }}
client_secret = {{ service.config["client_secret"] }}
host = {{ url_for('account.home', _external=True).split('/account')[0] }}
display_name = Hiboo
callback_proxy =
callback_proxy_api =
token_endpoint = {{ url_for("sso.oidc_token", service_uuid=service.uuid, _external=False) }}
inspect_endpoint = {{ url_for("sso.oidc_userinfo", service_uuid=service.uuid, _external=False) }}
auth_endpoint = {{ url_for("sso.oidc_authorize", service_uuid=service.uuid, _external=False) }}
</pre>
{% include "application_oidc.html" %}
\ No newline at end of file
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