Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
funkwhale
Manage
Activity
Members
Labels
Plan
Issues
498
Issue boards
Milestones
Wiki
Code
Merge requests
13
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
funkwhale
funkwhale
Commits
6f79768d
Verified
Commit
6f79768d
authored
5 years ago
by
Eliot Berriot
Browse files
Options
Downloads
Patches
Plain Diff
See
#872
: expose banner URL in nodeinfo
parent
9f3c45a7
No related branches found
No related tags found
1 merge request
!893
See #872: banner setting
Pipeline
#5567
passed with stages
in 2 minutes and 47 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
api/funkwhale_api/instance/nodeinfo.py
+4
-0
4 additions, 0 deletions
api/funkwhale_api/instance/nodeinfo.py
api/tests/instance/test_nodeinfo.py
+5
-1
5 additions, 1 deletion
api/tests/instance/test_nodeinfo.py
with
9 additions
and
1 deletion
api/funkwhale_api/instance/nodeinfo.py
+
4
−
0
View file @
6f79768d
...
...
@@ -3,6 +3,7 @@ import memoize.djangocache
import
funkwhale_api
from
funkwhale_api.common
import
preferences
from
funkwhale_api.federation
import
actors
,
models
as
federation_models
from
funkwhale_api.federation
import
utils
as
federation_utils
from
funkwhale_api.moderation
import
models
as
moderation_models
from
funkwhale_api.music
import
utils
as
music_utils
...
...
@@ -17,6 +18,7 @@ def get():
share_stats
=
all_preferences
.
get
(
"
instance__nodeinfo_stats_enabled
"
)
allow_list_enabled
=
all_preferences
.
get
(
"
moderation__allow_list_enabled
"
)
allow_list_public
=
all_preferences
.
get
(
"
moderation__allow_list_public
"
)
banner
=
all_preferences
.
get
(
"
instance__banner
"
)
unauthenticated_report_types
=
all_preferences
.
get
(
"
moderation__unauthenticated_report_types
"
)
...
...
@@ -42,6 +44,7 @@ def get():
"
longDescription
"
:
all_preferences
.
get
(
"
instance__long_description
"
),
"
terms
"
:
all_preferences
.
get
(
"
instance__terms
"
),
"
nodeName
"
:
all_preferences
.
get
(
"
instance__name
"
),
"
banner
"
:
federation_utils
.
full_url
(
banner
.
url
)
if
banner
else
None
,
"
library
"
:
{
"
federationEnabled
"
:
all_preferences
.
get
(
"
federation__enabled
"
),
"
federationNeedsApproval
"
:
all_preferences
.
get
(
...
...
@@ -59,6 +62,7 @@ def get():
],
},
}
if
share_stats
:
getter
=
memo
(
lambda
:
stats
.
get
(),
max_age
=
600
)
statistics
=
getter
()
...
...
This diff is collapsed.
Click to expand it.
api/tests/instance/test_nodeinfo.py
+
5
−
1
View file @
6f79768d
...
...
@@ -3,10 +3,12 @@ import pytest
import
funkwhale_api
from
funkwhale_api.instance
import
nodeinfo
from
funkwhale_api.federation
import
actors
from
funkwhale_api.federation
import
utils
as
federation_utils
from
funkwhale_api.music
import
utils
as
music_utils
def
test_nodeinfo_dump
(
preferences
,
mocker
):
def
test_nodeinfo_dump
(
preferences
,
mocker
,
avatar
):
preferences
[
"
instance__banner
"
]
=
avatar
preferences
[
"
instance__nodeinfo_stats_enabled
"
]
=
True
preferences
[
"
moderation__unauthenticated_report_types
"
]
=
[
"
takedown_request
"
,
...
...
@@ -39,6 +41,7 @@ def test_nodeinfo_dump(preferences, mocker):
"
longDescription
"
:
preferences
[
"
instance__long_description
"
],
"
nodeName
"
:
preferences
[
"
instance__name
"
],
"
terms
"
:
preferences
[
"
instance__terms
"
],
"
banner
"
:
federation_utils
.
full_url
(
preferences
[
"
instance__banner
"
].
url
),
"
library
"
:
{
"
federationEnabled
"
:
preferences
[
"
federation__enabled
"
],
"
federationNeedsApproval
"
:
preferences
[
...
...
@@ -107,6 +110,7 @@ def test_nodeinfo_dump_stats_disabled(preferences, mocker):
"
longDescription
"
:
preferences
[
"
instance__long_description
"
],
"
nodeName
"
:
preferences
[
"
instance__name
"
],
"
terms
"
:
preferences
[
"
instance__terms
"
],
"
banner
"
:
None
,
"
library
"
:
{
"
federationEnabled
"
:
preferences
[
"
federation__enabled
"
],
"
federationNeedsApproval
"
:
preferences
[
...
...
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