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
Package Registry
Container Registry
Model registry
Operate
Terraform modules
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
cyrinux
Hiboo
Commits
c43d8ec7
Commit
c43d8ec7
authored
5 years ago
by
kaiyou
Browse files
Options
Downloads
Patches
Plain Diff
Add a seafile application template
parent
2c9fbc62
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
hiboo/application/storage.py
+31
-0
31 additions, 0 deletions
hiboo/application/storage.py
hiboo/application/templates/application_seafile.html
+23
-0
23 additions, 0 deletions
hiboo/application/templates/application_seafile.html
with
54 additions
and
0 deletions
hiboo/application/storage.py
+
31
−
0
View file @
c43d8ec7
...
...
@@ -32,3 +32,34 @@ class GitlabApplication(base.OIDCApplication):
obj
=
service
,
application_uri
=
service
.
config
.
get
(
"
application_uri
"
)
)
@register
(
"
seafile
"
)
class
SeafileApplication
(
base
.
OIDCApplication
):
"""
Seafile is a file sharing and synchronization application with a Web viewer
"""
name
=
_
(
"
Seafile
"
)
class
Form
(
base
.
BaseForm
):
application_uri
=
fields
.
StringField
(
_
(
"
Seafile 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
+
"
/users/auth/openid_connect/callback
"
service
.
config
.
update
({
"
application_uri
"
:
form
.
application_uri
.
data
,
"
token_endpoint_auth_method
"
:
"
client_secret_post
"
,
"
redirect_uris
"
:
[
callback_uri
],
"
grant_types
"
:
[
"
authorization_code
"
],
"
response_types
"
:
[
"
code
"
],
"
special_mappings
"
:
[]
})
self
.
fill_service
(
service
)
def
populate_form
(
self
,
service
,
form
):
form
.
process
(
obj
=
service
,
application_uri
=
service
.
config
.
get
(
"
application_uri
"
)
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
hiboo/application/templates/application_seafile.html
0 → 100644
+
23
−
0
View file @
c43d8ec7
<h3>
Setting up Seafile
</h3>
<p>
Seafile supports OIDC authentication through its Seahub frontend.
</p>
<p>
In order to enable OIDC, you may add the following settings to your `seahub_settings.py` file.
</p>
<pre>
# Authentication
ENABLE_OAUTH = True
OAUTH_ENABLE_INSECURE_TRANSPORT = True
OAUTH_CLIENT_ID = "{{ service.config["client_id"] }}"
OAUTH_CLIENT_SECRET = "{{ service.config["client_secret"] }}"
OAUTH_REDIRECT_URL = "{{ service.config["redirect_uris"][0] }}"
OAUTH_PROVIDER_DOMAIN = "
<your
hiboo
domain
>
"
OAUTH_AUTHORIZATION_URL = "{{ url_for("sso.oidc_authorize", service_uuid=service.uuid, _external=True) }}"
OAUTH_TOKEN_URL = "{{ url_for("sso.oidc_authorize", service_uuid=service.uuid, _external=True) }}"
OAUTH_USER_INFO_URL = "{{ url_for("sso.oidc_authorize", service_uuid=service.uuid, _external=True) }}"
OAUTH_SCOPE = ["openid", "profile", "email"]
OAUTH_ATTRIBUTE_MAP = {
"id": (False, "no_destination"),
"name": (True, "name"),
"email": (True, "email")
}
</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