Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision

Target

Select target project
  • funkwhale/funkwhale
  • Luclu7/funkwhale
  • mbothorel/funkwhale
  • EorlBruder/funkwhale
  • tcit/funkwhale
  • JocelynDelalande/funkwhale
  • eneiluj/funkwhale
  • reg/funkwhale
  • ButterflyOfFire/funkwhale
  • m4sk1n/funkwhale
  • wxcafe/funkwhale
  • andybalaam/funkwhale
  • jcgruenhage/funkwhale
  • pblayo/funkwhale
  • joshuaboniface/funkwhale
  • n3ddy/funkwhale
  • gegeweb/funkwhale
  • tohojo/funkwhale
  • emillumine/funkwhale
  • Te-k/funkwhale
  • asaintgenis/funkwhale
  • anoadragon453/funkwhale
  • Sakada/funkwhale
  • ilianaw/funkwhale
  • l4p1n/funkwhale
  • pnizet/funkwhale
  • dante383/funkwhale
  • interfect/funkwhale
  • akhardya/funkwhale
  • svfusion/funkwhale
  • noplanman/funkwhale
  • nykopol/funkwhale
  • roipoussiere/funkwhale
  • Von/funkwhale
  • aurieh/funkwhale
  • icaria36/funkwhale
  • floreal/funkwhale
  • paulwalko/funkwhale
  • comradekingu/funkwhale
  • FurryJulie/funkwhale
  • Legolars99/funkwhale
  • Vierkantor/funkwhale
  • zachhats/funkwhale
  • heyjake/funkwhale
  • sn0w/funkwhale
  • jvoisin/funkwhale
  • gordon/funkwhale
  • Alexander/funkwhale
  • bignose/funkwhale
  • qasim.ali/funkwhale
  • fakegit/funkwhale
  • Kxze/funkwhale
  • stenstad/funkwhale
  • creak/funkwhale
  • Kaze/funkwhale
  • Tixie/funkwhale
  • IISergII/funkwhale
  • lfuelling/funkwhale
  • nhaddag/funkwhale
  • yoasif/funkwhale
  • ifischer/funkwhale
  • keslerm/funkwhale
  • flupe/funkwhale
  • petitminion/funkwhale
  • ariasuni/funkwhale
  • ollie/funkwhale
  • ngaumont/funkwhale
  • techknowlogick/funkwhale
  • Shleeble/funkwhale
  • theflyingfrog/funkwhale
  • jonatron/funkwhale
  • neobrain/funkwhale
  • eorn/funkwhale
  • KokaKiwi/funkwhale
  • u1-liquid/funkwhale
  • marzzzello/funkwhale
  • sirenwatcher/funkwhale
  • newer027/funkwhale
  • codl/funkwhale
  • Zwordi/funkwhale
  • gisforgabriel/funkwhale
  • iuriatan/funkwhale
  • simon/funkwhale
  • bheesham/funkwhale
  • zeoses/funkwhale
  • accraze/funkwhale
  • meliurwen/funkwhale
  • divadsn/funkwhale
  • Etua/funkwhale
  • sdrik/funkwhale
  • Soran/funkwhale
  • kuba-orlik/funkwhale
  • cristianvogel/funkwhale
  • Forceu/funkwhale
  • jeff/funkwhale
  • der_scheibenhacker/funkwhale
  • owlnical/funkwhale
  • jovuit/funkwhale
  • SilverFox15/funkwhale
  • phw/funkwhale
  • mayhem/funkwhale
  • sridhar/funkwhale
  • stromlin/funkwhale
  • rrrnld/funkwhale
  • nitaibezerra/funkwhale
  • jaller94/funkwhale
  • pcouy/funkwhale
  • eduxstad/funkwhale
  • codingHahn/funkwhale
  • captain/funkwhale
  • polyedre/funkwhale
  • leishenailong/funkwhale
  • ccritter/funkwhale
  • lnceballosz/funkwhale
  • fpiesche/funkwhale
  • Fanyx/funkwhale
  • markusblogde/funkwhale
  • Firobe/funkwhale
  • devilcius/funkwhale
  • freaktechnik/funkwhale
  • blopware/funkwhale
  • cone/funkwhale
  • thanksd/funkwhale
  • vachan-maker/funkwhale
  • bbenti/funkwhale
  • tarator/funkwhale
  • prplecake/funkwhale
  • DMarzal/funkwhale
  • lullis/funkwhale
  • hanacgr/funkwhale
  • albjeremias/funkwhale
  • xeruf/funkwhale
  • llelite/funkwhale
  • RoiArthurB/funkwhale
  • cloo/funkwhale
  • nztvar/funkwhale
  • Keunes/funkwhale
  • petitminion/funkwhale-petitminion
  • m-idler/funkwhale
  • SkyLeite/funkwhale
140 results
Select Git revision
Show changes
Commits on Source (136)
Showing
with 368 additions and 101 deletions
COMPOSE_BAKE=true
# api + celeryworker # api + celeryworker
DEBUG=True DEBUG=True
DEFAULT_FROM_EMAIL=hello@funkwhale.test DEFAULT_FROM_EMAIL=hello@funkwhale.test
...@@ -20,6 +22,8 @@ C_FORCE_ROOT=true ...@@ -20,6 +22,8 @@ C_FORCE_ROOT=true
PYTHONDONTWRITEBYTECODE=true PYTHONDONTWRITEBYTECODE=true
PYTHONTRACEMALLOC=0 PYTHONTRACEMALLOC=0
CELERY_TASK_TIME_LIMIT=300
# api # api
FUNKWHALE_SPA_HTML_ROOT=http://nginx/ FUNKWHALE_SPA_HTML_ROOT=http://nginx/
......
...@@ -34,6 +34,8 @@ pip-log.txt ...@@ -34,6 +34,8 @@ pip-log.txt
.tox .tox
nosetests.xml nosetests.xml
htmlcov htmlcov
coverage.xml
report.xml
# Translations # Translations
*.mo *.mo
...@@ -75,11 +77,13 @@ api/staticfiles ...@@ -75,11 +77,13 @@ api/staticfiles
api/static api/static
api/.pytest_cache api/.pytest_cache
api/celerybeat-* api/celerybeat-*
# Front # Front
oldfront/node_modules/ oldfront/node_modules/
front/static/translations front/static/translations
front/node_modules/ front/node_modules/
front/dist/ front/dist/
front/dev-dist/
front/npm-debug.log* front/npm-debug.log*
front/yarn-debug.log* front/yarn-debug.log*
front/yarn-error.log* front/yarn-error.log*
...@@ -88,7 +92,16 @@ front/tests/e2e/reports ...@@ -88,7 +92,16 @@ front/tests/e2e/reports
front/test_results.xml front/test_results.xml
front/coverage/ front/coverage/
front/selenium-debug.log front/selenium-debug.log
# Vitepress
front/ui-docs/.vitepress/.vite
front/ui-docs/.vitepress/cache
front/ui-docs/.vitepress/dist
front/ui-docs/public
# Docs
docs/_build docs/_build
#Tauri #Tauri
front/tauri/gen front/tauri/gen
...@@ -116,8 +129,15 @@ tsconfig.tsbuildinfo ...@@ -116,8 +129,15 @@ tsconfig.tsbuildinfo
flake.nix flake.nix
flake.lock flake.lock
# Vscode # VS Code
.vscode/ .vscode/
# Zed # Zed
.zed/ .zed/
# Node version (asdf, mise)
.tool-versions
mise.toml
# Lychee link checker
.lycheecache
...@@ -8,50 +8,56 @@ include: ...@@ -8,50 +8,56 @@ include:
file: /templates/ssh-agent.yml file: /templates/ssh-agent.yml
variables: variables:
PYTHONDONTWRITEBYTECODE: "true" PYTHONDONTWRITEBYTECODE: 'true'
PIP_CACHE_DIR: $CI_PROJECT_DIR/.cache/pip PIP_CACHE_DIR: $CI_PROJECT_DIR/.cache/pip
YARN_CACHE_FOLDER: $CI_PROJECT_DIR/.cache/yarn YARN_CACHE_FOLDER: $CI_PROJECT_DIR/.cache/yarn
POETRY_VIRTUALENVS_IN_PROJECT: "true" POETRY_VIRTUALENVS_IN_PROJECT: 'true'
.shared_variables: .shared_variables:
# Keep the git files permissions during job setup # Keep the git files permissions during job setup
keep_git_files_permissions: &keep_git_files_permissions keep_git_files_permissions: &keep_git_files_permissions
GIT_STRATEGY: clone GIT_STRATEGY: clone
GIT_DEPTH: "5" GIT_DEPTH: '5'
FF_DISABLE_UMASK_FOR_DOCKER_EXECUTOR: "true" FF_DISABLE_UMASK_FOR_DOCKER_EXECUTOR: 'true'
.shared_caches: .shared_caches:
# Cache for front related jobs # Cache for front related jobs
front_cache: &front_cache yarn_cache: &yarn_cache
- key: front-yarn key: front-yarn-$CI_COMMIT_REF_SLUG
paths: [$YARN_CACHE_FOLDER] paths: [$YARN_CACHE_FOLDER]
- key: node_cache: &node_cache
prefix: front-node_modules key:
prefix: front-node_modules-$CI_COMMIT_REF_SLUG
files: [front/yarn.lock] files: [front/yarn.lock]
paths: [front/node_modules] paths: [front/node_modules]
- key: lint_cache: &lint_cache
prefix: front-lint key:
prefix: front-lint-$CI_COMMIT_REF_SLUG
files: files:
- front/.eslintcache - front/.eslintcache
- front/tsconfig.tsbuildinfo - front/tsconfig.tsbuildinfo
cypress_cache: &cypress_cache
key: cypress-cache-$CI_COMMIT_REF_SLUG
paths:
- /root/.cache/Cypress
# Cache for api related jobs # Cache for api related jobs
# Include the python version to prevent loosing caches in the test matrix # Include the python version to prevent loosing caches in the test matrix
api_cache: &api_cache api_cache: &api_cache
- key: api-pip-$PYTHON_VERSION - key: api-pip-$CI_COMMIT_REF_SLUG
paths: [$PIP_CACHE_DIR] paths: [$PIP_CACHE_DIR]
- key: - key:
prefix: api-venv-$PYTHON_VERSION prefix: api-venv-$CI_COMMIT_REF_SLUG
files: [api/poetry.lock] files: [api/poetry.lock]
paths: [api/.venv] paths: [api/.venv]
# Cache for docs related jobs # Cache for docs related jobs
docs_cache: &docs_cache docs_cache: &docs_cache
- key: docs-pip - key: docs-pip-$CI_COMMIT_REF_SLUG
paths: [$PIP_CACHE_DIR] paths: [$PIP_CACHE_DIR]
- key: - key:
prefix: docs-venv prefix: docs-venv-$CI_COMMIT_REF_SLUG
files: [docs/poetry.lock] files: [docs/poetry.lock]
paths: [docs/.venv] paths: [docs/.venv]
...@@ -71,6 +77,8 @@ workflow: ...@@ -71,6 +77,8 @@ workflow:
) )
# Run for merge requests from any repo or branches # Run for merge requests from any repo or branches
- if: $CI_MERGE_REQUEST_ID - if: $CI_MERGE_REQUEST_ID
# run if NOCHANGELOG is added in the title
- if: $CI_MERGE_REQUEST_TITLE =~ /NOCHANGELOG/
stages: stages:
- review - review
...@@ -87,7 +95,7 @@ review_front: ...@@ -87,7 +95,7 @@ review_front:
- if: $CI_PIPELINE_SOURCE == "merge_request_event" - if: $CI_PIPELINE_SOURCE == "merge_request_event"
when: manual when: manual
image: $CI_REGISTRY/funkwhale/ci/node-python:18 image: $CI_REGISTRY/funkwhale/ci/node-python:22
variables: variables:
BASE_URL: /-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/front-review/ BASE_URL: /-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/front-review/
VUE_APP_ROUTER_BASE_URL: /-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/front-review/ VUE_APP_ROUTER_BASE_URL: /-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/front-review/
...@@ -97,7 +105,10 @@ review_front: ...@@ -97,7 +105,10 @@ review_front:
environment: environment:
name: review/front/$CI_COMMIT_REF_NAME name: review/front/$CI_COMMIT_REF_NAME
url: http://$CI_PROJECT_NAMESPACE.pages.funkwhale.audio/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/front-review/index.html url: http://$CI_PROJECT_NAMESPACE.pages.funkwhale.audio/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/front-review/index.html
cache: *front_cache cache:
- *yarn_cache
- *node_cache
- *lint_cache
before_script: before_script:
- mkdir front-review - mkdir front-review
- cd front - cd front
...@@ -143,6 +154,7 @@ find_broken_links: ...@@ -143,6 +154,7 @@ find_broken_links:
lychee lychee
--cache --cache
--no-progress --no-progress
--include-fragments
--exclude-all-private --exclude-all-private
--exclude 'demo\.funkwhale\.audio' --exclude 'demo\.funkwhale\.audio'
--exclude 'nginx\.com' --exclude 'nginx\.com'
...@@ -150,7 +162,7 @@ find_broken_links: ...@@ -150,7 +162,7 @@ find_broken_links:
-- . || exit $? -- . || exit $?
require_changelog: require_changelog:
allow_failure: true allow_failure: false
stage: lint stage: lint
rules: rules:
# Don't run on merge request that mention NOCHANGELOG or renovate bot commits # Don't run on merge request that mention NOCHANGELOG or renovate bot commits
...@@ -175,7 +187,7 @@ lint_api: ...@@ -175,7 +187,7 @@ lint_api:
- if: $CI_COMMIT_BRANCH =~ /(stable|develop)/ - if: $CI_COMMIT_BRANCH =~ /(stable|develop)/
- changes: [api/**/*] - changes: [api/**/*]
image: $CI_REGISTRY/funkwhale/ci/python-funkwhale-api:3.11 image: $CI_REGISTRY/funkwhale/ci/python-funkwhale-api:3.13
cache: *api_cache cache: *api_cache
before_script: before_script:
- cd api - cd api
...@@ -190,14 +202,16 @@ lint_front: ...@@ -190,14 +202,16 @@ lint_front:
- if: $CI_COMMIT_BRANCH =~ /(stable|develop)/ - if: $CI_COMMIT_BRANCH =~ /(stable|develop)/
- changes: [front/**/*] - changes: [front/**/*]
image: $CI_REGISTRY/funkwhale/ci/node-python:18 image: $CI_REGISTRY/funkwhale/ci/node-python:22
cache: *front_cache cache:
- *yarn_cache
- *node_cache
- *lint_cache
before_script: before_script:
- cd front - cd front
- yarn install --frozen-lockfile - yarn install --frozen-lockfile
script: script:
- yarn lint --max-warnings 0 - yarn lint
- yarn lint:tsc
test_scripts: test_scripts:
stage: test stage: test
...@@ -232,7 +246,7 @@ test_api: ...@@ -232,7 +246,7 @@ test_api:
image: $CI_REGISTRY/funkwhale/ci/python-funkwhale-api:$PYTHON_VERSION image: $CI_REGISTRY/funkwhale/ci/python-funkwhale-api:$PYTHON_VERSION
parallel: parallel:
matrix: matrix:
- PYTHON_VERSION: ["3.10", "3.11", "3.12"] - PYTHON_VERSION: ['3.11', '3.12', '3.13']
services: services:
- name: postgres:15-alpine - name: postgres:15-alpine
command: command:
...@@ -242,11 +256,11 @@ test_api: ...@@ -242,11 +256,11 @@ test_api:
- name: redis:7-alpine - name: redis:7-alpine
cache: *api_cache cache: *api_cache
variables: variables:
DATABASE_URL: "postgresql://postgres@postgres/postgres" DATABASE_URL: 'postgresql://postgres@postgres/postgres'
FUNKWHALE_URL: "https://funkwhale.ci" FUNKWHALE_URL: 'https://funkwhale.ci'
DJANGO_SETTINGS_MODULE: config.settings.local DJANGO_SETTINGS_MODULE: config.settings.local
POSTGRES_HOST_AUTH_METHOD: trust POSTGRES_HOST_AUTH_METHOD: trust
CACHE_URL: "redis://redis:6379/0" CACHE_URL: 'redis://redis:6379/0'
before_script: before_script:
- cd api - cd api
- make install - make install
...@@ -276,8 +290,11 @@ test_front: ...@@ -276,8 +290,11 @@ test_front:
- if: $CI_COMMIT_BRANCH =~ /(stable|develop)/ - if: $CI_COMMIT_BRANCH =~ /(stable|develop)/
- changes: [front/**/*] - changes: [front/**/*]
image: $CI_REGISTRY/funkwhale/ci/node-python:18 image: $CI_REGISTRY/funkwhale/ci/node-python:22
cache: *front_cache cache:
- *yarn_cache
- *node_cache
- *lint_cache
before_script: before_script:
- cd front - cd front
- yarn install --frozen-lockfile - yarn install --frozen-lockfile
...@@ -316,12 +333,13 @@ test_integration: ...@@ -316,12 +333,13 @@ test_integration:
image: image:
name: cypress/included:13.6.4 name: cypress/included:13.6.4
entrypoint: [""] entrypoint: ['']
cache: cache:
- *front_cache - *yarn_cache
- key: - *node_cache
paths: - *lint_cache
- /root/.cache/Cypress - *cypress_cache
before_script: before_script:
- cd front - cd front
- yarn install - yarn install
...@@ -339,24 +357,29 @@ build_api_schema: ...@@ -339,24 +357,29 @@ build_api_schema:
# Add build_docs rules because it depends on the build_api_schema artifact # Add build_docs rules because it depends on the build_api_schema artifact
- changes: [docs/**/*] - changes: [docs/**/*]
image: $CI_REGISTRY/funkwhale/ci/python-funkwhale-api:3.11 image: $CI_REGISTRY/funkwhale/ci/python-funkwhale-api:3.13
services: services:
- postgres:15-alpine - postgres:15-alpine
- redis:7-alpine - redis:7-alpine
cache: *api_cache cache: *api_cache
variables: variables:
DATABASE_URL: "postgresql://postgres@postgres/postgres" DATABASE_URL: 'postgresql://postgres@postgres/postgres'
FUNKWHALE_URL: "https://funkwhale.ci" FUNKWHALE_URL: 'https://funkwhale.ci'
DJANGO_SETTINGS_MODULE: config.settings.local DJANGO_SETTINGS_MODULE: config.settings.local
POSTGRES_HOST_AUTH_METHOD: trust POSTGRES_HOST_AUTH_METHOD: trust
CACHE_URL: "redis://redis:6379/0" CACHE_URL: 'redis://redis:6379/0'
API_TYPE: "v1" API_TYPE: 'v1'
before_script: before_script:
- cd api - cd api
- make install - make install
- poetry run funkwhale-manage migrate - poetry run funkwhale-manage migrate
script: script:
- poetry run funkwhale-manage spectacular --file ../docs/schema.yml - poetry run funkwhale-manage spectacular --file ../docs/schema.yml
- diff ../docs/schema.yml ./funkwhale_api/common/schema.yml || (
echo "Schema files do not match! run sudo docker compose run --rm
api funkwhale-manage spectacular > ./api/funkwhale_api/common/schema.yml" &&
exit 1
)
artifacts: artifacts:
expire_in: 2 weeks expire_in: 2 weeks
paths: paths:
...@@ -394,11 +417,14 @@ build_front: ...@@ -394,11 +417,14 @@ build_front:
- if: $CI_COMMIT_BRANCH =~ /(stable|develop)/ - if: $CI_COMMIT_BRANCH =~ /(stable|develop)/
- changes: [front/**/*] - changes: [front/**/*]
image: $CI_REGISTRY/funkwhale/ci/node-python:18 image: $CI_REGISTRY/funkwhale/ci/node-python:22
variables: variables:
<<: *keep_git_files_permissions <<: *keep_git_files_permissions
NODE_OPTIONS: --max-old-space-size=4096 NODE_OPTIONS: --max-old-space-size=4096
cache: *front_cache cache:
- *yarn_cache
- *node_cache
- *lint_cache
before_script: before_script:
- cd front - cd front
- yarn install --frozen-lockfile - yarn install --frozen-lockfile
...@@ -490,8 +516,8 @@ docker: ...@@ -490,8 +516,8 @@ docker:
variables: variables:
BUILD_ARGS: > BUILD_ARGS: >
--set *.platform=linux/amd64,linux/arm64,linux/arm/v7 --set *.platform=linux/amd64,linux/arm64,linux/arm/v7
--set *.cache-from=type=registry,ref=$DOCKER_CACHE_IMAGE:$CI_COMMIT_BRANCH,oci-mediatypes=false --set *.cache-from=type=registry,ref=$DOCKER_CACHE_IMAGE:$CI_COMMIT_BRANCH
--set *.cache-to=type=registry,ref=$DOCKER_CACHE_IMAGE:$CI_COMMIT_BRANCH,mode=max,oci-mediatypes=false --set *.cache-to=type=registry,ref=$DOCKER_CACHE_IMAGE:$CI_COMMIT_BRANCH,mode=max
--push --push
- if: $CI_PIPELINE_SOURCE == "merge_request_event" && $CI_PROJECT_NAMESPACE == "funkwhale" - if: $CI_PIPELINE_SOURCE == "merge_request_event" && $CI_PROJECT_NAMESPACE == "funkwhale"
...@@ -499,7 +525,7 @@ docker: ...@@ -499,7 +525,7 @@ docker:
variables: variables:
BUILD_ARGS: > BUILD_ARGS: >
--set *.platform=linux/amd64 --set *.platform=linux/amd64
--set *.cache-from=type=registry,ref=$DOCKER_CACHE_IMAGE:$CI_MERGE_REQUEST_TARGET_BRANCH_NAME,oci-mediatypes=false --set *.cache-from=type=registry,ref=$DOCKER_CACHE_IMAGE:$CI_MERGE_REQUEST_TARGET_BRANCH_NAME
image: $CI_REGISTRY/funkwhale/ci/docker:20 image: $CI_REGISTRY/funkwhale/ci/docker:20
services: services:
...@@ -508,7 +534,7 @@ docker: ...@@ -508,7 +534,7 @@ docker:
<<: *keep_git_files_permissions <<: *keep_git_files_permissions
DOCKER_HOST: tcp://docker:2375/ DOCKER_HOST: tcp://docker:2375/
DOCKER_DRIVER: overlay2 DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: "" DOCKER_TLS_CERTDIR: ''
BUILDKIT_PROGRESS: plain BUILDKIT_PROGRESS: plain
DOCKER_CACHE_IMAGE: $CI_REGISTRY/funkwhale/funkwhale/cache DOCKER_CACHE_IMAGE: $CI_REGISTRY/funkwhale/funkwhale/cache
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
"group:monorepos", "group:monorepos",
"group:recommended" "group:recommended"
], ],
"baseBranches": ["stable", "develop"], "baseBranches": ["develop"],
"branchConcurrentLimit": 2, "branchConcurrentLimit": 2,
"prConcurrentLimit": 1, "prConcurrentLimit": 1,
"rangeStrategy": "pin", "rangeStrategy": "pin",
...@@ -55,19 +55,19 @@ ...@@ -55,19 +55,19 @@
}, },
{ {
"groupName": "vueuse", "groupName": "vueuse",
"matchPackageNames": ["/^@vueuse/.*/"] "matchDepNames": ["/^@vueuse/.*/"]
}, },
{ {
"matchPackageNames": ["channels", "channels-redis", "daphne"], "matchDepNames": ["channels", "channels-redis", "daphne"],
"groupName": "channels" "groupName": "channels"
}, },
{ {
"matchPackageNames": ["node"], "matchDepNames": ["node"],
"allowedVersions": "/\\d+[02468]$/" "allowedVersions": "/\\d+[02468]$/"
}, },
{ {
"matchFileNames": ["deploy/docker-compose.yml"], "matchFileNames": ["deploy/docker-compose.yml"],
"matchPackageNames": ["postgres"], "matchDepNames": ["postgres"],
"postUpgradeTasks": { "postUpgradeTasks": {
"commands": [ "commands": [
"echo 'Upgrade Postgres to version {{ newVersion }}. [Make sure to migrate!](https://docs.funkwhale.audio/administrator_documentation/upgrade_docs/docker.html#upgrade-the-postgres-container)' > changes/changelog.d/postgres.update" "echo 'Upgrade Postgres to version {{ newVersion }}. [Make sure to migrate!](https://docs.funkwhale.audio/administrator_documentation/upgrade_docs/docker.html#upgrade-the-postgres-container)' > changes/changelog.d/postgres.update"
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
} }
}, },
{ {
"matchPackageNames": ["python"], "matchDepNames": ["python"],
"rangeStrategy": "widen" "rangeStrategy": "widen"
} }
] ]
......
version: "3" version: '3'
services: services:
postgres: postgres:
image: postgres:15-alpine image: postgres:15-alpine
environment: environment:
- "POSTGRES_HOST_AUTH_METHOD=trust" - 'POSTGRES_HOST_AUTH_METHOD=trust'
volumes: volumes:
- "../data/postgres:/var/lib/postgresql/data" - '../data/postgres:/var/lib/postgresql/data'
ports: ports:
- 5432:5432 - 5432:5432
redis: redis:
image: redis:7-alpine image: redis:7-alpine
volumes: volumes:
- "../data/redis:/data" - '../data/redis:/data'
ports: ports:
- 6379:6379 - 6379:6379
...@@ -26,14 +26,14 @@ services: ...@@ -26,14 +26,14 @@ services:
extra_hosts: extra_hosts:
- host.docker.internal:host-gateway - host.docker.internal:host-gateway
environment: environment:
- "NGINX_MAX_BODY_SIZE=100M" - 'NGINX_MAX_BODY_SIZE=100M'
- "FUNKWHALE_API_IP=host.docker.internal" - 'FUNKWHALE_API_IP=host.docker.internal'
- "FUNKWHALE_API_HOST=host.docker.internal" - 'FUNKWHALE_API_HOST=host.docker.internal'
- "FUNKWHALE_API_PORT=5000" - 'FUNKWHALE_API_PORT=5000'
- "FUNKWHALE_FRONT_IP=host.docker.internal" - 'FUNKWHALE_FRONT_IP=host.docker.internal'
- "FUNKWHALE_FRONT_PORT=8080" - 'FUNKWHALE_FRONT_PORT=8080'
- "FUNKWHALE_HOSTNAME=${FUNKWHALE_HOSTNAME-host.docker.internal}" - 'FUNKWHALE_HOSTNAME=${FUNKWHALE_HOSTNAME-host.docker.internal}'
- "FUNKWHALE_PROTOCOL=https" - 'FUNKWHALE_PROTOCOL=https'
volumes: volumes:
- ../data/media:/workspace/funkwhale/data/media:ro - ../data/media:/workspace/funkwhale/data/media:ro
- ../data/music:/music:ro - ../data/music:/music:ro
......
...@@ -6,6 +6,13 @@ repos: ...@@ -6,6 +6,13 @@ repos:
rev: v4.4.0 rev: v4.4.0
hooks: hooks:
- id: check-added-large-files - id: check-added-large-files
exclude: |
(?x)(
^api/funkwhale_api/common/schema.yml|
^api/tests/music/test_coverart.ogg|
^front/src/generated/types.ts
)
- id: check-case-conflict - id: check-case-conflict
- id: check-executables-have-shebangs - id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable - id: check-shebang-scripts-are-executable
...@@ -62,6 +69,7 @@ repos: ...@@ -62,6 +69,7 @@ repos:
hooks: hooks:
- id: prettier - id: prettier
files: \.(md|yml|yaml|json)$ files: \.(md|yml|yaml|json)$
exclude: 'api/funkwhale_api/common/schema.yml'
- repo: https://github.com/codespell-project/codespell - repo: https://github.com/codespell-project/codespell
rev: v2.2.6 rev: v2.2.6
......
{
"bracketSameLine": false,
"bracketSpacing": true,
"embeddedLanguageFormatting": "off",
"htmlWhitespaceSensitivity": "strict",
"printWidth": 160,
"semi": false,
"singleAttributePerLine": true,
"singleQuote": true,
"trailingComma": "none",
"tabWidth": 2,
"useTabs": false,
"overrides": [
{
"files": "*.html",
"options": {
"singleAttributePerLine": false
}
},
{
"files": "*.json",
"options": {
"parser": "json",
"printWidth": 80
}
}
]
}
...@@ -9,6 +9,102 @@ This changelog is viewable on the web at https://docs.funkwhale.audio/changelog. ...@@ -9,6 +9,102 @@ This changelog is viewable on the web at https://docs.funkwhale.audio/changelog.
<!-- towncrier --> <!-- towncrier -->
## 2.0.0-alpha.2 (2025-06-10)
Upgrade instructions are available at https://docs.funkwhale.audio/administrator/upgrade/index.html
Enhancements:
- Make playlist detail page reactive to plugin upload updates (#2464)
- Only refresh_nodeinfo_known_nodes for Funkwhale instances (#2442)
Bugfixes:
- Fixed database migrations for trackfavorite, playlist and playlisttrack
## 2.0.0-alpha.1 (2025-05-23)
Carefully read [this blog post](https://blog.funkwhale.audio/2025-funkwhale-2-news.html) before upgrading. This alpha release might break your db.
Upgrade instructions are available at https://docs.funkwhale.audio/administrator/upgrade/index.html
Features:
- Add a command to create playlists from folder structure (#2223)
- Add Musicbrainz genres to funkwhale tag table and allow Musicbrainz tag sync (#2143)
- Add support for deprecated COVERART fields in ogg files.
- Add support for Python 3.12
- Allow specifying more parameters on fs-import API endpoint
- Build desktop app with Tauri
- Drop libraries in favor of playlist (#2366)
- Entering an input in the global search in the sidebar opens up a modal that show all possible results at once with collapseable sections for each category, including federated searches for other users, channels and rss feeds. (#2910)
- Extend Subsonic API with OpenSubsonic support (#2270)
- Generate mock test server from openapi schema
- Implement Subsonic getArtistInfo2 response
- Improve mobile design (#2090)
- Improve visuals & layout (#2091)
- Playlist federation (#1458)
- Quality filter for content frontend (#1469)
- Quality filters backend (#2275)
- Support multiples artists for tracks and albums (#1568)
- Use playlists to privately share audio files (#2417)
- User follow with listening and track favorite activities (#1810)
Enhancements:
- Add cli command to prune non mbid content from db (#2083)
- Add favorite and listening sync ith Listenbrainz (#2079)
- Add tests for track cache
- Allow special characters in tags (#2009)
- disable some linter rule to avoid noise on the api lint process (#2346)
- Drop python 3.8 and 3.9 (#2282)
- Migrate frontend to api V2 (#2324)
- Optimize radios queryset to support large tables (#2450)
- Publish releases from CI job
- Subsonic getAlbumInfo, getAlbumInfo2 and getTopSongs endpoints (#2392)
- Support setting CELERY_TASK_TIME_LIMIT from environment
- Update dj-rest-auth to 5.0.2 and django-allauth to 0.55.2
- Update django to version 4.2
Refactoring:
- Add compatibility for lru-cache v10
Bugfixes:
- ActivityStreams compliance: duration (#1566)
- Docker mac compatibility, dynamic DNS + Debian image (#2337)
- Federation API returns a 404 response when an actor is not found
- fix fakedata generation regression from multiartist (#2343)
- Fix schema generation to allow propre types in front (#2404)
- Fix third party upload triggers and plugin example (#2405)
- Fixed the exceptions caught in two places in the getCoverArt subsonic API (#2122)
- regression:multiple albums with same name and artsit creating during import (#2365)
- Resolve forbidden tags due to filter database error (#2325)
- Resolve Radio playing fails when unauthenticated (#2319)
Documentation:
- Add API v2 overview.
- Add genre tags spec.
- Add import group details to content upload spec (#2268)
- add listenings-favorites-sync-with-lb spec
- Added explanation of AWS_CUSTOM_DOMAIN and AWS_S3_URL_PROTOCOL.
- Added new upload process spec
- Added user deletion spec
- Fixed the sample Apache configuration
- Playlist federation spec
- update federation doc with the new artist credit object (#2335)
Other:
- Use Alpine 3.19 as base for docker images
Deprecation:
- The "funkwhaleVersion" field in Subsonic responses is deprecated. Clients
should use the OpenSubsonic field "serverVersion" instead.
## 1.4.0 (2023-12-12) ## 1.4.0 (2023-12-12)
Upgrade instructions are available at https://docs.funkwhale.audio/administrator/upgrade/index.html Upgrade instructions are available at https://docs.funkwhale.audio/administrator/upgrade/index.html
......
...@@ -42,7 +42,12 @@ RUN set -eux; \ ...@@ -42,7 +42,12 @@ RUN set -eux; \
py3-pillow \ py3-pillow \
py3-psycopg2 \ py3-psycopg2 \
py3-watchfiles \ py3-watchfiles \
python3-dev python3-dev \
gfortran \
libgfortran \
openblas-dev \
py3-scipy \
py3-scikit-learn;
# Create virtual env # Create virtual env
RUN python3 -m venv --system-site-packages /venv RUN python3 -m venv --system-site-packages /venv
...@@ -53,19 +58,28 @@ COPY --from=requirements /dev-requirements.txt /dev-requirements.txt ...@@ -53,19 +58,28 @@ COPY --from=requirements /dev-requirements.txt /dev-requirements.txt
RUN --mount=type=cache,target=~/.cache/pip; \ RUN --mount=type=cache,target=~/.cache/pip; \
set -eux; \ set -eux; \
pip3 install --upgrade pip; \ pip3 install --upgrade pip;
pip3 install setuptools wheel; \
RUN --mount=type=cache,target=~/.cache/pip; \
set -eux; \
pip3 install setuptools wheel;
RUN --mount=type=cache,target=~/.cache/pip; \
set -eux; \
# Currently we are unable to relieably build rust-based packages on armv7. This # Currently we are unable to relieably build rust-based packages on armv7. This
# is why we need to use the packages shipped by Alpine Linux. # is why we need to use the packages shipped by Alpine Linux.
# Since poetry does not allow in-place dependency pinning, we need # Since poetry does not allow in-place dependency pinning, we need
# to install the deps using pip. # to install the deps using pip.
grep -Ev 'cryptography|lxml|pillow|psycopg2|watchfiles' /requirements.txt \ grep -Ev 'cryptography|lxml|pillow|psycopg2|watchfiles|scipy|scikit-learn' /requirements.txt \
| pip3 install -r /dev/stdin \ | pip3 install -r /dev/stdin \
cryptography \ cryptography \
lxml \ lxml \
pillow \ pillow \
psycopg2 \ psycopg2 \
watchfiles watchfiles \
scipy \
scikit-learn;
ARG install_dev_deps=0 ARG install_dev_deps=0
RUN --mount=type=cache,target=~/.cache/pip; \ RUN --mount=type=cache,target=~/.cache/pip; \
...@@ -102,6 +116,8 @@ RUN set -eux; \ ...@@ -102,6 +116,8 @@ RUN set -eux; \
py3-pillow \ py3-pillow \
py3-psycopg2 \ py3-psycopg2 \
py3-watchfiles \ py3-watchfiles \
py3-scipy \
py3-scikit-learn \
python3 \ python3 \
tzdata tzdata
...@@ -111,6 +127,7 @@ ENV PATH="/venv/bin:$PATH" ...@@ -111,6 +127,7 @@ ENV PATH="/venv/bin:$PATH"
COPY . /app COPY . /app
WORKDIR /app WORKDIR /app
RUN apk add --no-cache gfortran
RUN --mount=type=cache,target=~/.cache/pip; \ RUN --mount=type=cache,target=~/.cache/pip; \
set -eux; \ set -eux; \
pip3 install --no-deps --editable . pip3 install --no-deps --editable .
......
FROM python:3.13-slim AS builder FROM python:3.13-slim-bookworm AS builder
ARG POETRY_VERSION=1.8 ARG POETRY_VERSION=1.8
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
...@@ -39,7 +38,7 @@ RUN python3 -m venv --system-site-packages ${VIRTUAL_ENV} && . ${VIRTUAL_ENV}/bi ...@@ -39,7 +38,7 @@ RUN python3 -m venv --system-site-packages ${VIRTUAL_ENV} && . ${VIRTUAL_ENV}/bi
RUN --mount=type=cache,target=/opt/.cache \ RUN --mount=type=cache,target=/opt/.cache \
poetry install --no-root --extras typesense poetry install --no-root --extras typesense
FROM python:3.13-slim AS runtime FROM python:3.13-slim-bookworm AS runtime
ARG POETRY_VERSION=1.8 ARG POETRY_VERSION=1.8
......
...@@ -556,7 +556,15 @@ The path where static files are collected. ...@@ -556,7 +556,15 @@ The path where static files are collected.
""" """
# See: https://docs.djangoproject.com/en/dev/ref/settings/#static-url # See: https://docs.djangoproject.com/en/dev/ref/settings/#static-url
STATIC_URL = env("STATIC_URL", default=FUNKWHALE_URL + "/staticfiles/") STATIC_URL = env("STATIC_URL", default=FUNKWHALE_URL + "/staticfiles/")
DEFAULT_FILE_STORAGE = "funkwhale_api.common.storage.ASCIIFileSystemStorage" STORAGES = {
"default": {
"BACKEND": "funkwhale_api.common.storage.ASCIIFileSystemStorage",
},
"staticfiles": {
"BACKEND": "django.contrib.staticfiles.storage.StaticFilesStorage",
},
}
PROXY_MEDIA = env.bool("PROXY_MEDIA", default=True) PROXY_MEDIA = env.bool("PROXY_MEDIA", default=True)
""" """
...@@ -655,7 +663,7 @@ if AWS_ACCESS_KEY_ID: ...@@ -655,7 +663,7 @@ if AWS_ACCESS_KEY_ID:
A directory in your S3 bucket where you store files. A directory in your S3 bucket where you store files.
Use this if you plan to share the bucket between services. Use this if you plan to share the bucket between services.
""" """
DEFAULT_FILE_STORAGE = "funkwhale_api.common.storage.ASCIIS3Boto3Storage" STORAGES["default"]["BACKEND"] = "funkwhale_api.common.storage.ASCIIS3Boto3Storage"
# See: # See:
...@@ -916,7 +924,7 @@ Example: ...@@ -916,7 +924,7 @@ Example:
# Your common stuff: Below this line define 3rd party library settings # Your common stuff: Below this line define 3rd party library settings
CELERY_TASK_DEFAULT_RATE_LIMIT = 1 CELERY_TASK_DEFAULT_RATE_LIMIT = 1
CELERY_TASK_TIME_LIMIT = 300 CELERY_TASK_TIME_LIMIT = env.int("CELERY_TASK_TIME_LIMIT", default=300)
CELERY_BEAT_SCHEDULE = { CELERY_BEAT_SCHEDULE = {
"audio.fetch_rss_feeds": { "audio.fetch_rss_feeds": {
"task": "audio.fetch_rss_feeds", "task": "audio.fetch_rss_feeds",
...@@ -1229,6 +1237,8 @@ Example: ...@@ -1229,6 +1237,8 @@ Example:
- ``signup=5/d,password-reset=2/d,anonymous-reports=5/d`` - ``signup=5/d,password-reset=2/d,anonymous-reports=5/d``
""" """
API_AUTHENTICATION_REQUIRED = env.bool("API_AUTHENTICATION_REQUIRED", default=True)
"""used by APIAutenticationRequired to allow or not access without authentication"""
BROWSABLE_API_ENABLED = env.bool("BROWSABLE_API_ENABLED", default=False) BROWSABLE_API_ENABLED = env.bool("BROWSABLE_API_ENABLED", default=False)
if BROWSABLE_API_ENABLED: if BROWSABLE_API_ENABLED:
...@@ -1398,6 +1408,7 @@ VERSATILEIMAGEFIELD_RENDITION_KEY_SETS = { ...@@ -1398,6 +1408,7 @@ VERSATILEIMAGEFIELD_RENDITION_KEY_SETS = {
], ],
"attachment_square": [ "attachment_square": [
("original", "url"), ("original", "url"),
("small_square_crop", "crop__50x50"),
("medium_square_crop", "crop__200x200"), ("medium_square_crop", "crop__200x200"),
("large_square_crop", "crop__600x600"), ("large_square_crop", "crop__600x600"),
], ],
...@@ -1534,3 +1545,10 @@ Typesense hostname. Defaults to `localhost` on non-Docker deployments and to `ty ...@@ -1534,3 +1545,10 @@ Typesense hostname. Defaults to `localhost` on non-Docker deployments and to `ty
Docker deployments. Docker deployments.
""" """
TYPESENSE_NUM_TYPO = env("TYPESENSE_NUM_TYPO", default=5) TYPESENSE_NUM_TYPO = env("TYPESENSE_NUM_TYPO", default=5)
"""
Max tracks to be downloaded when the THIRD_PARTY_UPLOAD plugin hook is triggered.
Each api request to playlist tracks or radio tracks trigger the hook if tracks upload are missing.
If your instance is big your ip might get rate limited.
"""
THIRD_PARTY_UPLOAD_MAX_UPLOADS = env.int("THIRD_PARTY_UPLOAD_MAX_UPLOADS", default=10)
...@@ -154,4 +154,4 @@ REST_FRAMEWORK.update( ...@@ -154,4 +154,4 @@ REST_FRAMEWORK.update(
) )
# allows makemigrations and superuser creation # allows makemigrations and superuser creation
FORCE = env("FORCE", default=1) FORCE = env("FORCE", default=True)
...@@ -41,10 +41,6 @@ SECRET_KEY = env("DJANGO_SECRET_KEY") ...@@ -41,10 +41,6 @@ SECRET_KEY = env("DJANGO_SECRET_KEY")
# SESSION_COOKIE_HTTPONLY = True # SESSION_COOKIE_HTTPONLY = True
# SECURE_SSL_REDIRECT = env.bool("DJANGO_SECURE_SSL_REDIRECT", default=True) # SECURE_SSL_REDIRECT = env.bool("DJANGO_SECURE_SSL_REDIRECT", default=True)
# Static Assets
# ------------------------
STATICFILES_STORAGE = "django.contrib.staticfiles.storage.StaticFilesStorage"
# TEMPLATE CONFIGURATION # TEMPLATE CONFIGURATION
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
# See: # See:
......
import os
os.environ.setdefault("FUNKWHALE_URL", "http://funkwhale.dev")
from .common import * # noqa
DEBUG = True
SECRET_KEY = "a_super_secret_key!"
TYPESENSE_API_KEY = "apikey"
...@@ -37,7 +37,7 @@ class ChannelFilter(moderation_filters.HiddenContentFilterSet): ...@@ -37,7 +37,7 @@ class ChannelFilter(moderation_filters.HiddenContentFilterSet):
# tuple-mapping retains order # tuple-mapping retains order
fields=( fields=(
("creation_date", "creation_date"), ("creation_date", "creation_date"),
("artist_credit__artist__modification_date", "modification_date"), ("artist__modification_date", "modification_date"),
("?", "random"), ("?", "random"),
) )
) )
......
...@@ -7,6 +7,7 @@ import uuid ...@@ -7,6 +7,7 @@ import uuid
import feedparser import feedparser
import requests import requests
from django.conf import settings from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from django.db import transaction from django.db import transaction
from django.db.models import Q from django.db.models import Q
from django.templatetags.static import static from django.templatetags.static import static
...@@ -256,13 +257,40 @@ class SimpleChannelArtistSerializer(serializers.Serializer): ...@@ -256,13 +257,40 @@ class SimpleChannelArtistSerializer(serializers.Serializer):
return getattr(o, "_tracks_count", 0) return getattr(o, "_tracks_count", 0)
# same has federation.api_serializer but needed here to avoid circular imports
class FullActorSerializer(serializers.Serializer):
fid = serializers.URLField()
url = serializers.URLField()
domain = serializers.CharField(source="domain_id")
creation_date = serializers.DateTimeField()
last_fetch_date = serializers.DateTimeField()
name = serializers.CharField()
preferred_username = serializers.CharField()
full_username = serializers.CharField()
type = serializers.CharField()
is_local = serializers.BooleanField()
is_channel = serializers.SerializerMethodField()
manually_approves_followers = serializers.BooleanField()
user = users_serializers.UserBasicSerializer()
summary = common_serializers.ContentSerializer(source="summary_obj")
icon = common_serializers.AttachmentSerializer(source="attachment_icon")
@extend_schema_field(OpenApiTypes.BOOL)
def get_is_channel(self, o):
try:
return bool(o.channel)
except ObjectDoesNotExist:
return False
class ChannelSerializer(serializers.ModelSerializer): class ChannelSerializer(serializers.ModelSerializer):
artist = SimpleChannelArtistSerializer() artist = SimpleChannelArtistSerializer()
actor = serializers.SerializerMethodField() actor = serializers.SerializerMethodField()
downloads_count = serializers.SerializerMethodField() downloads_count = serializers.SerializerMethodField()
attributed_to = federation_serializers.APIActorSerializer() attributed_to = FullActorSerializer()
rss_url = serializers.CharField(source="get_rss_url") rss_url = serializers.CharField(source="get_rss_url")
url = serializers.SerializerMethodField() url = serializers.SerializerMethodField()
subscriptions_count = serializers.SerializerMethodField()
class Meta: class Meta:
model = models.Channel model = models.Channel
...@@ -276,6 +304,7 @@ class ChannelSerializer(serializers.ModelSerializer): ...@@ -276,6 +304,7 @@ class ChannelSerializer(serializers.ModelSerializer):
"rss_url", "rss_url",
"url", "url",
"downloads_count", "downloads_count",
"subscriptions_count",
] ]
def to_representation(self, obj): def to_representation(self, obj):
...@@ -284,6 +313,7 @@ class ChannelSerializer(serializers.ModelSerializer): ...@@ -284,6 +313,7 @@ class ChannelSerializer(serializers.ModelSerializer):
data["subscriptions_count"] = self.get_subscriptions_count(obj) data["subscriptions_count"] = self.get_subscriptions_count(obj)
return data return data
@extend_schema_field(OpenApiTypes.INT)
def get_subscriptions_count(self, obj) -> int: def get_subscriptions_count(self, obj) -> int:
return obj.actor.received_follows.exclude(approved=False).count() return obj.actor.received_follows.exclude(approved=False).count()
......
...@@ -2,10 +2,12 @@ from django import http ...@@ -2,10 +2,12 @@ from django import http
from django.db import transaction from django.db import transaction
from django.db.models import Count, Prefetch, Q, Sum from django.db.models import Count, Prefetch, Q, Sum
from django.utils import timezone from django.utils import timezone
from drf_spectacular.utils import extend_schema, extend_schema_view from drf_spectacular.utils import extend_schema, extend_schema_view, inline_serializer
from rest_framework import decorators, exceptions, mixins from rest_framework import decorators, exceptions, mixins
from rest_framework import permissions as rest_permissions from rest_framework import permissions as rest_permissions
from rest_framework import response, viewsets from rest_framework import response
from rest_framework import serializers as rest_serializers
from rest_framework import viewsets
from funkwhale_api.common import locales, permissions, preferences from funkwhale_api.common import locales, permissions, preferences
from funkwhale_api.common import utils as common_utils from funkwhale_api.common import utils as common_utils
...@@ -210,6 +212,32 @@ class ChannelViewSet( ...@@ -210,6 +212,32 @@ class ChannelViewSet(
data = serializers.rss_serialize_channel_full(channel=object, uploads=uploads) data = serializers.rss_serialize_channel_full(channel=object, uploads=uploads)
return response.Response(data, status=200) return response.Response(data, status=200)
@extend_schema(
responses=inline_serializer(
name="MetedataChoicesSerializer",
fields={
"language": rest_serializers.ListField(
child=inline_serializer(
name="LanguageItem",
fields={
"value": rest_serializers.CharField(),
"label": rest_serializers.CharField(),
},
)
),
"itunes_category": rest_serializers.ListField(
child=inline_serializer(
name="iTunesCategoryItem",
fields={
"value": rest_serializers.CharField(),
"label": rest_serializers.CharField(),
"children": rest_serializers.CharField(),
},
)
),
},
)
)
@decorators.action( @decorators.action(
methods=["get"], methods=["get"],
detail=False, detail=False,
......
...@@ -19,6 +19,10 @@ class JsonAuthConsumer(JsonWebsocketConsumer): ...@@ -19,6 +19,10 @@ class JsonAuthConsumer(JsonWebsocketConsumer):
channels.group_add(group, self.channel_name) channels.group_add(group, self.channel_name)
def disconnect(self, close_code): def disconnect(self, close_code):
if self.scope.get("user", False) and self.scope.get("user").pk is not None:
groups = self.scope["user"].get_channels_groups() + self.groups groups = self.scope["user"].get_channels_groups() + self.groups
else:
groups = self.groups
for group in groups: for group in groups:
channels.group_discard(group, self.channel_name) channels.group_discard(group, self.channel_name)
from django.conf import settings
from dynamic_preferences import types from dynamic_preferences import types
from dynamic_preferences.registries import global_preferences_registry from dynamic_preferences.registries import global_preferences_registry
...@@ -9,7 +10,7 @@ class APIAutenticationRequired(types.BooleanPreference): ...@@ -9,7 +10,7 @@ class APIAutenticationRequired(types.BooleanPreference):
section = common section = common
name = "api_authentication_required" name = "api_authentication_required"
verbose_name = "API Requires authentication" verbose_name = "API Requires authentication"
default = True default = settings.API_AUTHENTICATION_REQUIRED
help_text = ( help_text = (
"If disabled, anonymous users will be able to query the API " "If disabled, anonymous users will be able to query the API "
"and access music data (as well as other data exposed in the API " "and access music data (as well as other data exposed in the API "
......
...@@ -31,6 +31,7 @@ def privacy_level_query(user, lookup_field="privacy_level", user_field="user"): ...@@ -31,6 +31,7 @@ def privacy_level_query(user, lookup_field="privacy_level", user_field="user"):
} }
) )
# Federated TrackFavorite don't have an user associated with the trackfavorite.actor # Federated TrackFavorite don't have an user associated with the trackfavorite.actor
# to do : if we implement the followers privacy_level this will become a problem
no_user_query = models.Q(**{f"{user_field}__isnull": True}) no_user_query = models.Q(**{f"{user_field}__isnull": True})
return ( return (
......