From efbdc027ab327ef8bb9e7383f76b0390640a48ca Mon Sep 17 00:00:00 2001 From: jo Date: Fri, 13 Jan 2023 15:22:05 +0100 Subject: [PATCH] fix: use versioned python3 instead of python --- .gitlab-ci.yml | 6 +- .gitpod.yml | 8 +-- api/Dockerfile | 2 +- .../common/management/commands/script.py | 4 +- dev.yml | 4 +- docs/Makefile | 2 +- .../configuration_docs/change_url.md | 4 +- .../configuration_docs/mrf.md | 20 +++---- .../import_docs/index.md | 18 +++--- .../installation_docs/debian.md | 6 +- .../installation_docs/docker.md | 4 +- .../installation_docs/migrate.md | 4 +- .../manage_script/create_library.md | 12 ++-- .../manage_script/database.md | 4 +- .../manage_script/fix_uploads.md | 20 +++---- .../manage_script/library.md | 22 +++---- .../manage_script/tags.md | 8 +-- .../manage_script/thumbnails.md | 4 +- .../manage_script/users.md | 60 +++++++++---------- .../migration_guide/index.md | 2 +- .../upgrade_docs/backup.md | 4 +- .../upgrade_docs/debian.md | 4 +- .../upgrade_docs/docker.md | 2 +- .../plugins/install.md | 4 +- docs/developer_documentation/setup/docker.md | 10 ++-- docs/serve.py | 6 +- 26 files changed, 122 insertions(+), 122 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fe284a56e..a86bb33a6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -91,7 +91,7 @@ review_docs: - git switch stable && git pull - git switch $CI_COMMIT_BRANCH && git pull script: - - poetry run python -m sphinx . $BUILD_PATH + - poetry run python3 -m sphinx . $BUILD_PATH cache: key: "$CI_PROJECT_ID__sphinx" paths: @@ -260,9 +260,9 @@ build_openapi_schema: - cd api - pip3 install poetry - poetry install - - poetry run python manage.py migrate + - poetry run python3 manage.py migrate script: - - poetry run python manage.py spectacular --file ../docs/schema.yml + - poetry run python3 manage.py spectacular --file ../docs/schema.yml artifacts: expire_in: 2 weeks paths: diff --git a/.gitpod.yml b/.gitpod.yml index 3e1042c16..3b9274352 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -18,8 +18,8 @@ tasks: gp ports await 5432 - poetry run python manage.py migrate - poetry run python manage.py gitpod init + poetry run python3 manage.py migrate + poetry run python3 manage.py gitpod init command: | echo "MEDIA_URL=`gp url 8000`/media/" >> ../.gitpod/.env echo "STATIC_URL=`gp url 8000`/staticfiles/" >> ../.gitpod/.env @@ -28,8 +28,8 @@ tasks: docker-compose up -d gp ports await 5432 - poetry run python manage.py collectstatic --no-input - poetry run python manage.py gitpod dev + poetry run python3 manage.py collectstatic --no-input + poetry run python3 manage.py gitpod dev - name: Celery Worker env: diff --git a/api/Dockerfile b/api/Dockerfile index 5fb8b41fe..f3dfbab96 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -41,7 +41,7 @@ RUN set -eux; \ python3-dev # create virtual env for next stage -RUN python -m venv --system-site-packages /venv +RUN python3 -m venv --system-site-packages /venv # emulate activation by prefixing PATH ENV PATH="/venv/bin:/root/.local/bin:$PATH" VIRTUAL_ENV=/venv diff --git a/api/funkwhale_api/common/management/commands/script.py b/api/funkwhale_api/common/management/commands/script.py index 7f674f2f0..9f375ac9e 100644 --- a/api/funkwhale_api/common/management/commands/script.py +++ b/api/funkwhale_api/common/management/commands/script.py @@ -26,7 +26,7 @@ class Command(BaseCommand): script = available_scripts[name] except KeyError: raise CommandError( - "{} is not a valid script. Run python manage.py script for a " + "{} is not a valid script. Run python3 manage.py script for a " "list of available scripts".format(name) ) @@ -43,7 +43,7 @@ class Command(BaseCommand): def show_help(self): self.stdout.write("") self.stdout.write("Available scripts:") - self.stdout.write("Launch with: python manage.py ") + self.stdout.write("Launch with: python3 manage.py ") available_scripts = self.get_scripts() for name, script in sorted(available_scripts.items()): self.stdout.write("") diff --git a/dev.yml b/dev.yml index 9e336ddd4..3429f4d7b 100644 --- a/dev.yml +++ b/dev.yml @@ -55,7 +55,7 @@ services: install_dev_deps: 1 image: funkwhale-api command: > - bash -c "python manage.py collectstatic --no-input + bash -c "python3 manage.py collectstatic --no-input && uvicorn --reload config.asgi:application --host 0.0.0.0 --port 5000 --reload-dir config/ --reload-dir=funkwhale_api/" volumes: - ./api:/app @@ -158,7 +158,7 @@ services: docs: build: docs - command: python serve.py + command: python3 serve.py volumes: - ".:/app/" ports: diff --git a/docs/Makefile b/docs/Makefile index e87d7aea0..083dae580 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -3,7 +3,7 @@ # You can set these variables from the command line. SPHINXOPTS = -SPHINXBUILD = python -msphinx +SPHINXBUILD = python3 -msphinx SPHINXPROJ = funkwhale SOURCEDIR = . BUILDDIR = _build diff --git a/docs/administrator_documentation/configuration_docs/change_url.md b/docs/administrator_documentation/configuration_docs/change_url.md index 76730d098..f37c76819 100644 --- a/docs/administrator_documentation/configuration_docs/change_url.md +++ b/docs/administrator_documentation/configuration_docs/change_url.md @@ -28,7 +28,7 @@ Running `fix_federation_ids` with the `--no-dry-run` flag is irreversible. Make :sync: debian ```{code-block} sh - poetry run python manage.py fix_federation_ids https://old-url https://new-url --no-dry-run --no-input + poetry run python3 manage.py fix_federation_ids https://old-url https://new-url --no-dry-run --no-input ``` ::: @@ -37,7 +37,7 @@ Running `fix_federation_ids` with the `--no-dry-run` flag is irreversible. Make :sync: docker ```{code-block} sh - docker-compose run --rm api python manage.py fix_federation_ids https://old-url https://new-url --no-dry-run --no-input + docker-compose run --rm api python3 manage.py fix_federation_ids https://old-url https://new-url --no-dry-run --no-input ``` ::: diff --git a/docs/administrator_documentation/configuration_docs/mrf.md b/docs/administrator_documentation/configuration_docs/mrf.md index 219a152e3..4fb1edef4 100644 --- a/docs/administrator_documentation/configuration_docs/mrf.md +++ b/docs/administrator_documentation/configuration_docs/mrf.md @@ -90,7 +90,7 @@ To make the job of writing and debugging MRF policies easier, we provide a manag :sync: debian ```{code-block} sh - poetry run python manage.py mrf_check --list + poetry run python3 manage.py mrf_check --list ``` ::: @@ -99,7 +99,7 @@ To make the job of writing and debugging MRF policies easier, we provide a manag :sync: docker ```{code-block} sh - docker-compose run --rm api python manage.py mrf_check --list + docker-compose run --rm api python3 manage.py mrf_check --list ``` ::: @@ -114,7 +114,7 @@ To make the job of writing and debugging MRF policies easier, we provide a manag ```{code-block} sh export MRF_MESSAGE='{"actor": "https://normal.domain/@alice", "type": "Create", "object": {"type": "Follow"}}' - echo $MRF_MESSAGE | poetry run python manage.py mrf_check inbox - -p blocked_follow_domains + echo $MRF_MESSAGE | poetry run python3 manage.py mrf_check inbox - -p blocked_follow_domains ``` ::: @@ -124,7 +124,7 @@ To make the job of writing and debugging MRF policies easier, we provide a manag ```{code-block} sh export MRF_MESSAGE='{"actor": "https://normal.domain/@alice", "type": "Create", "object": {"type": "Follow"}}' - echo $MRF_MESSAGE | docker-compose run --rm api python manage.py mrf_check inbox - -p blocked_follow_domains + echo $MRF_MESSAGE | docker-compose run --rm api python3 manage.py mrf_check inbox - -p blocked_follow_domains ``` :::: @@ -138,7 +138,7 @@ To make the job of writing and debugging MRF policies easier, we provide a manag ```{code-block} sh export MRF_MESSAGE='{"actor": "https://botdomain.org/@bob", "type": "Create", "object": {"type": "Follow"}}' - echo $MRF_MESSAGE | poetry run python manage.py mrf_check inbox - -p blocked_follow_domains + echo $MRF_MESSAGE | poetry run python3 manage.py mrf_check inbox - -p blocked_follow_domains ``` ::: @@ -148,7 +148,7 @@ To make the job of writing and debugging MRF policies easier, we provide a manag ```{code-block} sh export MRF_MESSAGE='{"actor": "https://botdomain.org/@bob", "type": "Create", "object": {"type": "Follow"}}' - echo $MRF_MESSAGE | docker-compose run --rm api python manage.py mrf_check inbox - -p blocked_follow_domains + echo $MRF_MESSAGE | docker-compose run --rm api python3 manage.py mrf_check inbox - -p blocked_follow_domains ``` ::: @@ -163,7 +163,7 @@ To make the job of writing and debugging MRF policies easier, we provide a manag ```{code-block} sh export ACTIVITY_UUID="06208aea-c687-4e8b-aefd-22f1c3f76039" - echo $MRF_MESSAGE | poetry run python manage.py mrf_check inbox $ACTIVITY_UUID -p blocked_follow_domains + echo $MRF_MESSAGE | poetry run python3 manage.py mrf_check inbox $ACTIVITY_UUID -p blocked_follow_domains ``` ::: @@ -175,7 +175,7 @@ To make the job of writing and debugging MRF policies easier, we provide a manag export ACTIVITY_UUID="06208aea-c687-4e8b-aefd-22f1c3f76039" - echo $MRF_MESSAGE | docker-compose run --rm api python manage.py mrf_check inbox $ACTIVITY_UUID -p blocked_follow_domains + echo $MRF_MESSAGE | docker-compose run --rm api python3 manage.py mrf_check inbox $ACTIVITY_UUID -p blocked_follow_domains ``` @@ -190,7 +190,7 @@ There are extra options for testing MRF policies. Check the command help for mor :sync: debian ```{code-block} sh -poetry run python manage.py mrf_check --help +poetry run python3 manage.py mrf_check --help ``` ::: @@ -199,7 +199,7 @@ poetry run python manage.py mrf_check --help :sync: docker ```{code-block} sh -docker-compose run --rm api python manage.py mrf_check --help +docker-compose run --rm api python3 manage.py mrf_check --help ``` ::: diff --git a/docs/administrator_documentation/import_docs/index.md b/docs/administrator_documentation/import_docs/index.md index 994bd50df..3dae459ff 100644 --- a/docs/administrator_documentation/import_docs/index.md +++ b/docs/administrator_documentation/import_docs/index.md @@ -15,7 +15,7 @@ To see a full list of options, run the command with the `--help` flag. :sync: debian ```{code-block} sh -poetry run python manage.py import_files --help +poetry run python3 manage.py import_files --help ``` ::: @@ -24,7 +24,7 @@ poetry run python manage.py import_files --help :sync: docker ```{code-block} sh -docker-compose run --rm api python manage.py import_files --help +docker-compose run --rm api python3 manage.py import_files --help ``` ::: @@ -91,7 +91,7 @@ Once you have your library ID, you can copy content from your server and import 3. Run the `import_files` command to copy your files. In this example, the music is stored in `data/music`. Replace this with your music directory. ```{code-block} sh - poetry run python manage.py import_files $LIBRARY_ID "data/music" --recursive --noinput + poetry run python3 manage.py import_files $LIBRARY_ID "data/music" --recursive --noinput ``` Funkwhale copies your files to your media store. @@ -174,7 +174,7 @@ To use the in-place import method, follow these steps: 4. Run your import command against your music storage directory. In this example, the storage directory is `/srv/funkwhale/data/music/nfsshare`. Replace this with your storage directory. ```{code-block} sh - poetry run python manage.py import_files $LIBRARY_ID "/srv/funkwhale/data/music/nfsshare/" --recursive --noinput --in-place + poetry run python3 manage.py import_files $LIBRARY_ID "/srv/funkwhale/data/music/nfsshare/" --recursive --noinput --in-place ``` Funkwhale imports the music in your storage directory into the specified library. @@ -188,7 +188,7 @@ Funkwhale imports the music in your storage directory into the specified library 2. Run your import command against your music storage directory: ```{code-block} sh - docker-compose run --rm api python manage.py import_files $LIBRARY_ID "/srv/funkwhale/data/music/nfsshare/" --recursive --noinput --in-place + docker-compose run --rm api python3 manage.py import_files $LIBRARY_ID "/srv/funkwhale/data/music/nfsshare/" --recursive --noinput --in-place ``` Funkwhale imports the music in your storage directory into the specified library. @@ -241,7 +241,7 @@ The `import_files --watch` command watches for changes to the following metadata :sync: debian ```{code-block} sh -poetry run python manage.py import_files $LIBRARY_ID "/srv/funkwhale/data/music/nfsshare/" --recursive --noinput --in-place --watch +poetry run python3 manage.py import_files $LIBRARY_ID "/srv/funkwhale/data/music/nfsshare/" --recursive --noinput --in-place --watch ``` ::: @@ -250,7 +250,7 @@ poetry run python manage.py import_files $LIBRARY_ID "/srv/funkwhale/data/music/ :sync: docker ```{code-block} sh -docker-compose run --rm api python manage.py import_files $LIBRARY_ID "/srv/funkwhale/data/music/nfsshare/" --recursive --noinput --in-place --watch +docker-compose run --rm api python3 manage.py import_files $LIBRARY_ID "/srv/funkwhale/data/music/nfsshare/" --recursive --noinput --in-place --watch ``` ::: @@ -272,7 +272,7 @@ You can use the `--prune` flag with the `--watch` flag. This means Funkwhale rem :sync: debian ```{code-block} sh -poetry run python manage.py import_files $LIBRARY_ID "/srv/funkwhale/data/music/nfsshare/" --recursive --noinput --in-place --watch --prune +poetry run python3 manage.py import_files $LIBRARY_ID "/srv/funkwhale/data/music/nfsshare/" --recursive --noinput --in-place --watch --prune ``` ::: @@ -281,7 +281,7 @@ poetry run python manage.py import_files $LIBRARY_ID "/srv/funkwhale/data/music/ :sync: docker ```{code-block} sh -docker-compose run --rm api python manage.py import_files $LIBRARY_ID "/srv/funkwhale/data/music/nfsshare/" --recursive --noinput --in-place --watch --prune +docker-compose run --rm api python3 manage.py import_files $LIBRARY_ID "/srv/funkwhale/data/music/nfsshare/" --recursive --noinput --in-place --watch --prune ``` ::: diff --git a/docs/administrator_documentation/installation_docs/debian.md b/docs/administrator_documentation/installation_docs/debian.md index 2fdd157e3..98a00945b 100644 --- a/docs/administrator_documentation/installation_docs/debian.md +++ b/docs/administrator_documentation/installation_docs/debian.md @@ -244,7 +244,7 @@ Funkwhale uses a [PostgreSQL](https://www.postgresql.org/) database to store inf ```{code-block} sh cd /srv/funkwhale/api - sudo -u funkwhale poetry run python manage.py migrate + sudo -u funkwhale poetry run python3 manage.py migrate ``` ````{note} @@ -272,7 +272,7 @@ You can create several superusers. To start using Funkwhale, you need to create a superuser for your pod. This user has all the permissions needed to administrate the pod. Follow these steps to create a superuser. ```{code-block} sh -sudo -u funkwhale poetry run python manage.py createsuperuser +sudo -u funkwhale poetry run python3 manage.py createsuperuser ``` That's it! You can log in as this user when you finish setting up Funkwhale. @@ -282,7 +282,7 @@ That's it! You can log in as this user when you finish setting up Funkwhale. Funkwhale uses several static assets to serve its frontend. Use `manage.py` to collect these files so that the webserver can serve them. ```{code-block} sh -sudo poetry run python manage.py collectstatic +sudo poetry run python3 manage.py collectstatic ``` ## 8. Set up systemd unit files diff --git a/docs/administrator_documentation/installation_docs/docker.md b/docs/administrator_documentation/installation_docs/docker.md index 1de38a1a5..19ca62007 100644 --- a/docs/administrator_documentation/installation_docs/docker.md +++ b/docs/administrator_documentation/installation_docs/docker.md @@ -140,7 +140,7 @@ Once you've filled in your environment file, you can set up Funkwhale. Follow th 3. Run the database migrations. ```{code-block} sh - docker-compose run --rm api python manage.py migrate + docker-compose run --rm api python3 manage.py migrate ``` ````{note} @@ -156,7 +156,7 @@ Once you've filled in your environment file, you can set up Funkwhale. Follow th 4. Create your superuser. ```{code-block} sh - docker-compose run --rm api python manage.py createsuperuser + docker-compose run --rm api python3 manage.py createsuperuser ``` 5. Launch all the containers to bring up your pod. diff --git a/docs/administrator_documentation/installation_docs/migrate.md b/docs/administrator_documentation/installation_docs/migrate.md index 6a4815a6a..368ef8d61 100644 --- a/docs/administrator_documentation/installation_docs/migrate.md +++ b/docs/administrator_documentation/installation_docs/migrate.md @@ -140,7 +140,7 @@ When the import finishes, run the `manage.py migrate` command to set up the data ```{code-block} sh cd /srv/funkwhale/api -poetry run python manage.py migrate +poetry run python3 manage.py migrate ``` ::: @@ -169,7 +169,7 @@ You need to initialize the postgres container on your {term}`destination server` 3. When the import finishes, run the `manage.py migrate` command to set up the database. ```{code-block} sh - docker-compose run --rm api python manage.py migrate + docker-compose run --rm api python3 manage.py migrate ``` ::: diff --git a/docs/administrator_documentation/manage_script/create_library.md b/docs/administrator_documentation/manage_script/create_library.md index ed2ea0486..ea207d809 100644 --- a/docs/administrator_documentation/manage_script/create_library.md +++ b/docs/administrator_documentation/manage_script/create_library.md @@ -38,7 +38,7 @@ Use the following command to create a new library with a custom name and privacy :sync: debian ```{code-block} sh -poetry run python manage.py create_library username1 --name="Library 1" --privacy-level="everyone" +poetry run python3 manage.py create_library username1 --name="Library 1" --privacy-level="everyone" ``` ::: @@ -47,7 +47,7 @@ poetry run python manage.py create_library username1 --name="Library 1" --privac :sync: docker ```{code-block} sh -docker-compose run --rm api python manage.py create_library username1 --name="Library 1" --privacy-level="everyone" +docker-compose run --rm api python3 manage.py create_library username1 --name="Library 1" --privacy-level="everyone" ``` ::: @@ -70,7 +70,7 @@ You can create a library using only a username. The script substitutes default v :sync: debian ```{code-block} sh -poetry run python manage.py create_library username1 +poetry run python3 manage.py create_library username1 ``` ::: @@ -79,7 +79,7 @@ poetry run python manage.py create_library username1 :sync: docker ```{code-block} sh -docker-compose run --rm api python manage.py create_library username1 +docker-compose run --rm api python3 manage.py create_library username1 ``` ::: @@ -102,7 +102,7 @@ If a library with the same name already exists for the given user, the script wi :sync: debian ```{code-block} sh -poetry run python manage.py create_library username1 --name="Library 1" --privacy-level="everyone" +poetry run python3 manage.py create_library username1 --name="Library 1" --privacy-level="everyone" ``` ::: @@ -111,7 +111,7 @@ poetry run python manage.py create_library username1 --name="Library 1" --privac :sync: docker ```{code-block} sh -docker-compose run --rm api python manage.py create_library username1 --name="Library 1" --privacy-level="everyone" +docker-compose run --rm api python3 manage.py create_library username1 --name="Library 1" --privacy-level="everyone" ``` ::: diff --git a/docs/administrator_documentation/manage_script/database.md b/docs/administrator_documentation/manage_script/database.md index 04575c0c0..17d35b893 100644 --- a/docs/administrator_documentation/manage_script/database.md +++ b/docs/administrator_documentation/manage_script/database.md @@ -16,7 +16,7 @@ To ensure you don't remove data by accident, this command runs in dry run mode b :sync: debian ```{code-block} sh -poetry run python manage.py check_inplace_files +poetry run python3 manage.py check_inplace_files ``` ::: @@ -25,7 +25,7 @@ poetry run python manage.py check_inplace_files :sync: docker ```{code-block} sh -docker-compose run --rm api python manage.py check_inplace_files +docker-compose run --rm api python3 manage.py check_inplace_files ``` ::: diff --git a/docs/administrator_documentation/manage_script/fix_uploads.md b/docs/administrator_documentation/manage_script/fix_uploads.md index a3e532bd9..5d6b9f403 100644 --- a/docs/administrator_documentation/manage_script/fix_uploads.md +++ b/docs/administrator_documentation/manage_script/fix_uploads.md @@ -14,7 +14,7 @@ Check and fix file mimetypes with the `--mimetype` flag. This helps prevent issu :sync: debian ```{code-block} sh -poetry run python manage.py fix_uploads --mimetype +poetry run python3 manage.py fix_uploads --mimetype ``` ::: @@ -23,7 +23,7 @@ poetry run python manage.py fix_uploads --mimetype :sync: docker ```{code-block} sh -docker-compose run --rm api python manage.py fix_uploads --mimetype +docker-compose run --rm api python3 manage.py fix_uploads --mimetype ``` ::: @@ -39,7 +39,7 @@ Check and fix bitrate and duration with the `--audio-data` flag. This process ca :sync: debian ```{code-block} sh -poetry run python manage.py fix_uploads --audio-data +poetry run python3 manage.py fix_uploads --audio-data ``` ::: @@ -48,7 +48,7 @@ poetry run python manage.py fix_uploads --audio-data :sync: docker ```{code-block} sh -docker-compose run --rm api python manage.py fix_uploads --audio-data +docker-compose run --rm api python3 manage.py fix_uploads --audio-data ``` ::: @@ -64,7 +64,7 @@ Check and fix the file size with the `--size` flag. :sync: debian ```{code-block} sh -poetry run python manage.py fix_uploads --size +poetry run python3 manage.py fix_uploads --size ``` ::: @@ -73,7 +73,7 @@ poetry run python manage.py fix_uploads --size :sync: docker ```{code-block} sh -docker-compose run --rm api python manage.py fix_uploads --size +docker-compose run --rm api python3 manage.py fix_uploads --size ``` ::: @@ -89,7 +89,7 @@ Check and fix file checksums with the `--checksum` flag. :sync: debian ```{code-block} sh -poetry run python manage.py fix_uploads --checksum +poetry run python3 manage.py fix_uploads --checksum ``` ::: @@ -98,7 +98,7 @@ poetry run python manage.py fix_uploads --checksum :sync: docker ```{code-block} sh -docker-compose run --rm api python manage.py fix_uploads --checksum +docker-compose run --rm api python3 manage.py fix_uploads --checksum ``` ::: @@ -114,7 +114,7 @@ Choose the batch size you want to process with the `--batch-size` or -`s` flag. :sync: debian ```{code-block} sh -poetry run python manage.py fix_uploads --batch-size 500 +poetry run python3 manage.py fix_uploads --batch-size 500 ``` ::: @@ -123,7 +123,7 @@ poetry run python manage.py fix_uploads --batch-size 500 :sync: docker ```{code-block} sh -docker-compose run --rm api python manage.py fix_uploads --batch-size 500 +docker-compose run --rm api python3 manage.py fix_uploads --batch-size 500 ``` ::: diff --git a/docs/administrator_documentation/manage_script/library.md b/docs/administrator_documentation/manage_script/library.md index 6c1710167..30b2a999a 100644 --- a/docs/administrator_documentation/manage_script/library.md +++ b/docs/administrator_documentation/manage_script/library.md @@ -4,7 +4,7 @@ Funkwhale doesn't delete data objects from the database when you delete a file. Sometimes you may want to clear out dangling metadata. For example, if you import a lot of files with incorrect tags and then delete them. -To help with this, the {file}`manage.py` script includes commands to prune dangling metadata from your database. All prune commands are available under the python manage.py prune_library namespace. To ensure you don't remove data by accident, all commands run in dry run mode by default. Run commands with the `--no-dry-run` flag to perform the pruning action. +To help with this, the {file}`manage.py` script includes commands to prune dangling metadata from your database. All prune commands are available under the python3 manage.py prune_library namespace. To ensure you don't remove data by accident, all commands run in dry run mode by default. Run commands with the `--no-dry-run` flag to perform the pruning action. ```{warning} Running `prune_library` commands with the `--no-dry-run` flag is irreversible. Make sure you [back up your data](../upgrade_docs/backup.md). @@ -20,7 +20,7 @@ Running `prune_library` commands with the `--no-dry-run` flag is irreversible. M :sync: debian ```bash -poetry run python manage.py prune_library --tracks +poetry run python3 manage.py prune_library --tracks ``` ::: @@ -29,7 +29,7 @@ poetry run python manage.py prune_library --tracks :sync: docker ```bash -docker-compose run --rm api python manage.py prune_library --tracks +docker-compose run --rm api python3 manage.py prune_library --tracks ``` ::: @@ -43,7 +43,7 @@ docker-compose run --rm api python manage.py prune_library --tracks :sync: debian ```{code-block} sh -poetry run python manage.py prune_library --albums +poetry run python3 manage.py prune_library --albums ``` ::: @@ -52,7 +52,7 @@ poetry run python manage.py prune_library --albums :sync: docker ```{code-block} sh -docker-compose run --rm api python manage.py prune_library --albums +docker-compose run --rm api python3 manage.py prune_library --albums ``` ::: @@ -66,7 +66,7 @@ docker-compose run --rm api python manage.py prune_library --albums :sync: debian ```{code-block} sh -poetry run python manage.py prune_library --artists +poetry run python3 manage.py prune_library --artists ``` ::: @@ -75,7 +75,7 @@ poetry run python manage.py prune_library --artists :sync: docker ```{code-block} sh -docker-compose run --rm api python manage.py prune_library --artists +docker-compose run --rm api python3 manage.py prune_library --artists ``` ::: @@ -89,7 +89,7 @@ docker-compose run --rm api python manage.py prune_library --artists :sync: debian ```{code-block} sh -poetry run python manage.py prune_library --tracks --albums --artists +poetry run python3 manage.py prune_library --tracks --albums --artists ``` ::: @@ -98,7 +98,7 @@ poetry run python manage.py prune_library --tracks --albums --artists :sync: docker ```{code-block} sh -docker-compose run --rm api python manage.py prune_library --tracks --albums --artists +docker-compose run --rm api python3 manage.py prune_library --tracks --albums --artists ``` ::: @@ -112,7 +112,7 @@ There are extra options for pruning your database. Check the command help for mo :sync: debian ```{code-block} sh -poetry run python manage.py prune_library --help +poetry run python3 manage.py prune_library --help ``` ::: @@ -121,7 +121,7 @@ poetry run python manage.py prune_library --help :sync: docker ```{code-block} sh -docker-compose run --rm api python manage.py prune_library --help +docker-compose run --rm api python3 manage.py prune_library --help ``` ::: diff --git a/docs/administrator_documentation/manage_script/tags.md b/docs/administrator_documentation/manage_script/tags.md index 4f02a3077..87092ac72 100644 --- a/docs/administrator_documentation/manage_script/tags.md +++ b/docs/administrator_documentation/manage_script/tags.md @@ -27,7 +27,7 @@ To add tags to untagged albums: 3. Run the `manage.py` script to generate tags for untagged albums. ```{code-block} sh - poetry run python manage.py fw albums add-tags-from-tracks + poetry run python3 manage.py fw albums add-tags-from-tracks ``` ::: @@ -45,7 +45,7 @@ To add tags to untagged albums: 3. Run the `manage.py` script to generate tags for untagged albums. ```{code-block} sh - docker-compose run --rm api python manage.py fw albums add-tags-from-tracks + docker-compose run --rm api python3 manage.py fw albums add-tags-from-tracks ``` ::: @@ -70,7 +70,7 @@ To add tags to untagged artists: 3. Run the `manage.py` script to generate tags for untagged artists. ```{code-block} sh - poetry run python manage.py fw artists add-tags-from-tracks + poetry run python3 manage.py fw artists add-tags-from-tracks ``` ::: @@ -88,7 +88,7 @@ To add tags to untagged artists: 3. Run the `manage.py` script to generate tags for untagged artists. ```{code-block} sh - docker-compose run --rm api python manage.py fw artists add-tags-from-tracks + docker-compose run --rm api python3 manage.py fw artists add-tags-from-tracks ``` ::: diff --git a/docs/administrator_documentation/manage_script/thumbnails.md b/docs/administrator_documentation/manage_script/thumbnails.md index 3dcc35b40..1689b31d6 100644 --- a/docs/administrator_documentation/manage_script/thumbnails.md +++ b/docs/administrator_documentation/manage_script/thumbnails.md @@ -29,7 +29,7 @@ To generate new thumbnails: 4. Run the `manage.py` script to regenerate the thumbnails. ```{code-block} sh - poetry run python manage.py fw media generate-thumbnails + poetry run python3 manage.py fw media generate-thumbnails ``` ::: @@ -53,7 +53,7 @@ To generate new thumbnails: 4. Run the `manage.py` script to regenerate the thumbnails. ```{code-block} sh - docker-compose run --rm api python manage.py fw media generate-thumbnails + docker-compose run --rm api python3 manage.py fw media generate-thumbnails ``` ::: diff --git a/docs/administrator_documentation/manage_script/users.md b/docs/administrator_documentation/manage_script/users.md index 16bdfdd3d..41e82b899 100644 --- a/docs/administrator_documentation/manage_script/users.md +++ b/docs/administrator_documentation/manage_script/users.md @@ -2,7 +2,7 @@ The {file}`manage.py` script includes commands for user management. Use these commands to automate managing users from the command line. -All users-related commands are available under the `python manage.py fw users` namespace. +All users-related commands are available under the `python3 manage.py fw users` namespace. ## Create users @@ -16,7 +16,7 @@ You can create users with the {file}`manage.py` script. There are different ways :sync: debian ```{code-block} sh -poetry run python manage.py fw users create +poetry run python3 manage.py fw users create ``` ::: @@ -25,7 +25,7 @@ poetry run python manage.py fw users create :sync: docker ```{code-block} sh -docker-compose run --rm api python manage.py fw users create +docker-compose run --rm api python3 manage.py fw users create ``` ::: @@ -39,7 +39,7 @@ docker-compose run --rm api python manage.py fw users create :sync: debian ```{code-block} sh -poetry run python manage.py fw users create --username --email -p "" +poetry run python3 manage.py fw users create --username --email -p "" ``` ::: @@ -48,7 +48,7 @@ poetry run python manage.py fw users create --username --email --email -p "" +docker-compose run --rm api python3 manage.py fw users create --username --email -p "" ``` ::: @@ -63,7 +63,7 @@ docker-compose run --rm api python manage.py fw users create --username -poetry run python manage.py fw users create --username --email +poetry run python3 manage.py fw users create --username --email ``` ::: @@ -73,7 +73,7 @@ poetry run python manage.py fw users create --username --email -docker-compose run --rm api python manage.py fw users create --username --email +docker-compose run --rm api python3 manage.py fw users create --username --email ``` ::: @@ -87,7 +87,7 @@ There are extra options for user configuration, such as quota and {term}`permiss :sync: debian ```{code-block} sh -poetry run python manage.py fw users --help +poetry run python3 manage.py fw users --help ``` ::: @@ -96,7 +96,7 @@ poetry run python manage.py fw users --help :sync: docker ```{code-block} sh -docker-compose run --rm api python manage.py fw users --help +docker-compose run --rm api python3 manage.py fw users --help ``` ::: @@ -104,7 +104,7 @@ docker-compose run --rm api python manage.py fw users --help ## Update users -You can update user accounts using the {file}`manage.py` script. Update commands are available under the `python manage.py fw users set` namespace. +You can update user accounts using the {file}`manage.py` script. Update commands are available under the `python3 manage.py fw users set` namespace. ### Set upload quota for a user @@ -114,7 +114,7 @@ You can update user accounts using the {file}`manage.py` script. Update commands :sync: debian ```{code-block} sh -poetry run python manage.py fw users set --upload-quota 500 +poetry run python3 manage.py fw users set --upload-quota 500 ``` ::: @@ -123,7 +123,7 @@ poetry run python manage.py fw users set --upload-quota 500 :sync: docker ```{code-block} sh -docker-compose run --rm api python manage.py fw users set --upload-quota 500 +docker-compose run --rm api python3 manage.py fw users set --upload-quota 500 ``` ::: @@ -137,7 +137,7 @@ docker-compose run --rm api python manage.py fw users set --upload-quota 500 +poetry run python3 manage.py fw users set --staff --superuser ``` ::: @@ -146,7 +146,7 @@ poetry run python manage.py fw users set --staff --superuser :sync: docker ```{code-block} sh -docker-compose run --rm api python manage.py fw users set --staff --superuser +docker-compose run --rm api python3 manage.py fw users set --staff --superuser ``` ::: @@ -160,7 +160,7 @@ docker-compose run --rm api python manage.py fw users set --staff --superuser +poetry run python3 manage.py fw users set --no-staff --no-superuser ``` ::: @@ -169,7 +169,7 @@ poetry run python manage.py fw users set --no-staff --no-superuser :sync: docker ```{code-block} sh -docker-compose run --rm api python manage.py fw users set --no-staff --no-superuser +docker-compose run --rm api python3 manage.py fw users set --no-staff --no-superuser ``` ::: @@ -183,7 +183,7 @@ docker-compose run --rm api python manage.py fw users set --no-staff --no-superu :sync: debian ```{code-block} sh -poetry run python manage.py fw users set --permission-moderation +poetry run python3 manage.py fw users set --permission-moderation ``` ::: @@ -192,7 +192,7 @@ poetry run python manage.py fw users set --permission-moderation :sync: docker ```{code-block} sh -docker-compose run --rm api python manage.py fw users set --permission-moderation +docker-compose run --rm api python3 manage.py fw users set --permission-moderation ``` ::: @@ -206,7 +206,7 @@ docker-compose run --rm api python manage.py fw users set --permission-moderatio :sync: debian ```{code-block} sh -poetry run python manage.py fw users set --password "" +poetry run python3 manage.py fw users set --password "" ``` ::: @@ -215,7 +215,7 @@ poetry run python manage.py fw users set --password "" :sync: docker ```{code-block} sh -docker-compose run --rm api python manage.py fw users set --password "" +docker-compose run --rm api python3 manage.py fw users set --password "" ``` ::: @@ -230,7 +230,7 @@ docker-compose run --rm api python manage.py fw users set --password " ```{code-block} sh export FUNKWHALE_CLI_USER_UPDATE_PASSWORD= -poetry run python manage.py fw users set +poetry run python3 manage.py fw users set ``` ::: @@ -240,7 +240,7 @@ poetry run python manage.py fw users set ```{code-block} sh export FUNKWHALE_CLI_USER_UPDATE_PASSWORD= -docker-compose run --rm api python manage.py fw users set +docker-compose run --rm api python3 manage.py fw users set ``` ::: @@ -254,7 +254,7 @@ There are extra options for updating users. Check the command help for more opti :sync: debian ```{code-block} sh -poetry run python manage.py fw users set --help +poetry run python3 manage.py fw users set --help ``` ::: @@ -263,7 +263,7 @@ poetry run python manage.py fw users set --help :sync: docker ```{code-block} sh -docker-compose run --rm api python manage.py fw users set --help +docker-compose run --rm api python3 manage.py fw users set --help ``` ::: @@ -281,7 +281,7 @@ This prevents the same username being used in future. :sync: debian ```{code-block} py -poetry run python manage.py fw users rm +poetry run python3 manage.py fw users rm ``` ::: @@ -290,7 +290,7 @@ poetry run python manage.py fw users rm :sync: docker ```{code-block} py -docker-compose run --rm api python manage.py fw users rm +docker-compose run --rm api python3 manage.py fw users rm ``` ::: @@ -306,7 +306,7 @@ This means the username can be reused. :sync: debian ```{code-block} py -poetry run python manage.py fw users rm --hard +poetry run python3 manage.py fw users rm --hard ``` ::: @@ -315,7 +315,7 @@ poetry run python manage.py fw users rm --hard :sync: docker ```{code-block} py -docker-compose run --rm api python manage.py fw users rm --hard +docker-compose run --rm api python3 manage.py fw users rm --hard ``` ::: @@ -329,7 +329,7 @@ There are extra options for deleting users. Check the command help for more opti :sync: debian ```{code-block} sh -poetry run python manage.py fw users rm --help +poetry run python3 manage.py fw users rm --help ``` ::: @@ -338,7 +338,7 @@ poetry run python manage.py fw users rm --help :sync: docker ```{code-block} sh -docker-compose run --rm api python manage.py fw users rm --help +docker-compose run --rm api python3 manage.py fw users rm --help ``` ::: diff --git a/docs/administrator_documentation/migration_guide/index.md b/docs/administrator_documentation/migration_guide/index.md index 090ce0a46..9ed840a08 100644 --- a/docs/administrator_documentation/migration_guide/index.md +++ b/docs/administrator_documentation/migration_guide/index.md @@ -125,7 +125,7 @@ Check the file and remove any duplicated settings after copying. 3. Run the database migrations. ```{code-block} sh - docker-compose run --rm api python manage.py migrate + docker-compose run --rm api python3 manage.py migrate ``` ## Start your Funkwhale instance diff --git a/docs/administrator_documentation/upgrade_docs/backup.md b/docs/administrator_documentation/upgrade_docs/backup.md index f2bdc9453..9b2ad3873 100644 --- a/docs/administrator_documentation/upgrade_docs/backup.md +++ b/docs/administrator_documentation/upgrade_docs/backup.md @@ -115,7 +115,7 @@ To restore your database, do the following: ```{code-block} sh cd /srv/funkwhale/api - poetry run python manage.py migrate + poetry run python3 manage.py migrate ``` ::: @@ -132,7 +132,7 @@ To restore your database, do the following: 2. Run the `manage.py migrate` command to set up the database. ```{code-block} sh - docker-compose run --rm api python manage.py migrate + docker-compose run --rm api python3 manage.py migrate ``` ::: diff --git a/docs/administrator_documentation/upgrade_docs/debian.md b/docs/administrator_documentation/upgrade_docs/debian.md index f05f75b58..d03c662fe 100644 --- a/docs/administrator_documentation/upgrade_docs/debian.md +++ b/docs/administrator_documentation/upgrade_docs/debian.md @@ -100,13 +100,13 @@ Once you have downloaded the new files, you can update your Funkwhale instance. 4. Collect the new static files to serve. ```{code-block} sh - poetry run python manage.py collectstatic --no-input + poetry run python3 manage.py collectstatic --no-input ``` 5. Apply new database migrations. ```{code-block} sh - poetry run python manage.py migrate + poetry run python3 manage.py migrate ``` 6. Restart the Funkwhale services. diff --git a/docs/administrator_documentation/upgrade_docs/docker.md b/docs/administrator_documentation/upgrade_docs/docker.md index 6a158627c..cea478144 100644 --- a/docs/administrator_documentation/upgrade_docs/docker.md +++ b/docs/administrator_documentation/upgrade_docs/docker.md @@ -44,7 +44,7 @@ If you installed Funkwhale following the [Docker guide](../installation_docs/doc 8. Apply the database migrations. ```{code-block} sh - docker-compose run --rm api python manage.py migrate + docker-compose run --rm api python3 manage.py migrate ``` 9. Relaunch your containers. diff --git a/docs/developer_documentation/plugins/install.md b/docs/developer_documentation/plugins/install.md index 4f50c50ca..23291efa9 100644 --- a/docs/developer_documentation/plugins/install.md +++ b/docs/developer_documentation/plugins/install.md @@ -32,7 +32,7 @@ You can install third-party plugins using the `manage.py` script. To do this: :::{tab-item} Debian ```{code-block} shell - python manage.py fw plugins install https://plugin_url.zip + python3 manage.py fw plugins install https://plugin_url.zip ``` ::: @@ -40,7 +40,7 @@ You can install third-party plugins using the `manage.py` script. To do this: :::{tab-item} Docker ```{code-block} shell - docker-compose run --rm api python manage.py fw plugins install https://plugin_url.zip + docker-compose run --rm api python3 manage.py fw plugins install https://plugin_url.zip ``` ::: diff --git a/docs/developer_documentation/setup/docker.md b/docs/developer_documentation/setup/docker.md index bdb3a816e..697294605 100644 --- a/docs/developer_documentation/setup/docker.md +++ b/docs/developer_documentation/setup/docker.md @@ -72,7 +72,7 @@ docker-compose -f dev.yml build Funkwhale relies on a postgresql database to store information. To set this up, you need to run the `manage.py migrate` command: ```sh -docker-compose -f dev.yml run --rm api python manage.py migrate +docker-compose -f dev.yml run --rm api python3 manage.py migrate ``` This command creates all the required tables. You need to run this whenever there are changes to the API schema. You can run this at any time without causing issues. @@ -84,7 +84,7 @@ You need to create some local data to mimic a production environment. 1. Create a superuser so you can log in to your local app: ```sh - docker-compose -f dev.yml run --rm api python manage.py createsuperuser + docker-compose -f dev.yml run --rm api python3 manage.py createsuperuser ``` 2. Add some fake data to populate the database. The following command creates 25 artists with random albums, tracks, and metadata. @@ -92,7 +92,7 @@ You need to create some local data to mimic a production environment. ```sh artists=25 # Adds 25 fake artists command="from funkwhale_api.music import fake_data; fake_data.create_data($artists)" - echo $command | docker-compose -f dev.yml run --rm -T api python manage.py shell -i python + echo $command | docker-compose -f dev.yml run --rm -T api python3 manage.py shell -i python ``` ## Manage services @@ -194,8 +194,8 @@ To run a reverse proxy for your app: ```sh export COMPOSE_PROJECT_NAME=node2 export VUE_PORT=1234 # this has to be unique for each instance - docker-compose -f dev.yml run --rm api python manage.py migrate - docker-compose -f dev.yml run --rm api python manage.py createsuperuser + docker-compose -f dev.yml run --rm api python3 manage.py migrate + docker-compose -f dev.yml run --rm api python3 manage.py createsuperuser docker-compose -f dev.yml up nginx api front nginx api celeryworker ``` diff --git a/docs/serve.py b/docs/serve.py index b952f060f..3c4132a7f 100755 --- a/docs/serve.py +++ b/docs/serve.py @@ -1,10 +1,10 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from subprocess import call # initial make -call(["python", "-m", "sphinx", ".", "/tmp/_build"]) +call(["python3", "-m", "sphinx", ".", "/tmp/_build"]) from livereload import Server, shell # noqa: E402 server = Server() -server.watch("..", shell("python -m sphinx . /tmp/_build")) +server.watch("..", shell("python3 -m sphinx . /tmp/_build")) server.serve(root="/tmp/_build/", liveport=35730, port=8001, host="0.0.0.0")