fix: use versioned python3 instead of python

This commit is contained in:
jo 2023-01-13 15:22:05 +01:00
parent 95d8ab5dd4
commit efbdc027ab
No known key found for this signature in database
GPG Key ID: B2FEC9B22722B984
26 changed files with 122 additions and 122 deletions

View File

@ -91,7 +91,7 @@ review_docs:
- git switch stable && git pull - git switch stable && git pull
- git switch $CI_COMMIT_BRANCH && git pull - git switch $CI_COMMIT_BRANCH && git pull
script: script:
- poetry run python -m sphinx . $BUILD_PATH - poetry run python3 -m sphinx . $BUILD_PATH
cache: cache:
key: "$CI_PROJECT_ID__sphinx" key: "$CI_PROJECT_ID__sphinx"
paths: paths:
@ -260,9 +260,9 @@ build_openapi_schema:
- cd api - cd api
- pip3 install poetry - pip3 install poetry
- poetry install - poetry install
- poetry run python manage.py migrate - poetry run python3 manage.py migrate
script: script:
- poetry run python manage.py spectacular --file ../docs/schema.yml - poetry run python3 manage.py spectacular --file ../docs/schema.yml
artifacts: artifacts:
expire_in: 2 weeks expire_in: 2 weeks
paths: paths:

View File

@ -18,8 +18,8 @@ tasks:
gp ports await 5432 gp ports await 5432
poetry run python manage.py migrate poetry run python3 manage.py migrate
poetry run python manage.py gitpod init poetry run python3 manage.py gitpod init
command: | command: |
echo "MEDIA_URL=`gp url 8000`/media/" >> ../.gitpod/.env echo "MEDIA_URL=`gp url 8000`/media/" >> ../.gitpod/.env
echo "STATIC_URL=`gp url 8000`/staticfiles/" >> ../.gitpod/.env echo "STATIC_URL=`gp url 8000`/staticfiles/" >> ../.gitpod/.env
@ -28,8 +28,8 @@ tasks:
docker-compose up -d docker-compose up -d
gp ports await 5432 gp ports await 5432
poetry run python manage.py collectstatic --no-input poetry run python3 manage.py collectstatic --no-input
poetry run python manage.py gitpod dev poetry run python3 manage.py gitpod dev
- name: Celery Worker - name: Celery Worker
env: env:

View File

@ -41,7 +41,7 @@ RUN set -eux; \
python3-dev python3-dev
# create virtual env for next stage # 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 # emulate activation by prefixing PATH
ENV PATH="/venv/bin:/root/.local/bin:$PATH" VIRTUAL_ENV=/venv ENV PATH="/venv/bin:/root/.local/bin:$PATH" VIRTUAL_ENV=/venv

View File

@ -26,7 +26,7 @@ class Command(BaseCommand):
script = available_scripts[name] script = available_scripts[name]
except KeyError: except KeyError:
raise CommandError( 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) "list of available scripts".format(name)
) )
@ -43,7 +43,7 @@ class Command(BaseCommand):
def show_help(self): def show_help(self):
self.stdout.write("") self.stdout.write("")
self.stdout.write("Available scripts:") self.stdout.write("Available scripts:")
self.stdout.write("Launch with: python manage.py <script_name>") self.stdout.write("Launch with: python3 manage.py <script_name>")
available_scripts = self.get_scripts() available_scripts = self.get_scripts()
for name, script in sorted(available_scripts.items()): for name, script in sorted(available_scripts.items()):
self.stdout.write("") self.stdout.write("")

View File

@ -55,7 +55,7 @@ services:
install_dev_deps: 1 install_dev_deps: 1
image: funkwhale-api image: funkwhale-api
command: > 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/" && uvicorn --reload config.asgi:application --host 0.0.0.0 --port 5000 --reload-dir config/ --reload-dir=funkwhale_api/"
volumes: volumes:
- ./api:/app - ./api:/app
@ -158,7 +158,7 @@ services:
docs: docs:
build: docs build: docs
command: python serve.py command: python3 serve.py
volumes: volumes:
- ".:/app/" - ".:/app/"
ports: ports:

View File

@ -3,7 +3,7 @@
# You can set these variables from the command line. # You can set these variables from the command line.
SPHINXOPTS = SPHINXOPTS =
SPHINXBUILD = python -msphinx SPHINXBUILD = python3 -msphinx
SPHINXPROJ = funkwhale SPHINXPROJ = funkwhale
SOURCEDIR = . SOURCEDIR = .
BUILDDIR = _build BUILDDIR = _build

View File

@ -28,7 +28,7 @@ Running `fix_federation_ids` with the `--no-dry-run` flag is irreversible. Make
:sync: debian :sync: debian
```{code-block} sh ```{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 :sync: docker
```{code-block} sh ```{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
``` ```
::: :::

View File

@ -90,7 +90,7 @@ To make the job of writing and debugging MRF policies easier, we provide a manag
:sync: debian :sync: debian
```{code-block} sh ```{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 :sync: docker
```{code-block} sh ```{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 ```{code-block} sh
export MRF_MESSAGE='{"actor": "https://normal.domain/@alice", "type": "Create", "object": {"type": "Follow"}}' 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 ```{code-block} sh
export MRF_MESSAGE='{"actor": "https://normal.domain/@alice", "type": "Create", "object": {"type": "Follow"}}' 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 ```{code-block} sh
export MRF_MESSAGE='{"actor": "https://botdomain.org/@bob", "type": "Create", "object": {"type": "Follow"}}' 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 ```{code-block} sh
export MRF_MESSAGE='{"actor": "https://botdomain.org/@bob", "type": "Create", "object": {"type": "Follow"}}' 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 ```{code-block} sh
export ACTIVITY_UUID="06208aea-c687-4e8b-aefd-22f1c3f76039" 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" 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 :sync: debian
```{code-block} sh ```{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 :sync: docker
```{code-block} sh ```{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
``` ```
::: :::

View File

@ -15,7 +15,7 @@ To see a full list of options, run the command with the `--help` flag.
:sync: debian :sync: debian
```{code-block} sh ```{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 :sync: docker
```{code-block} sh ```{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. 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 ```{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. 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. 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 ```{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. 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: 2. Run your import command against your music storage directory:
```{code-block} sh ```{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. 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 :sync: debian
```{code-block} sh ```{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 :sync: docker
```{code-block} sh ```{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 :sync: debian
```{code-block} sh ```{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 :sync: docker
```{code-block} sh ```{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
``` ```
::: :::

View File

@ -244,7 +244,7 @@ Funkwhale uses a [PostgreSQL](https://www.postgresql.org/) database to store inf
```{code-block} sh ```{code-block} sh
cd /srv/funkwhale/api cd /srv/funkwhale/api
sudo -u funkwhale poetry run python manage.py migrate sudo -u funkwhale poetry run python3 manage.py migrate
``` ```
````{note} ````{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. 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 ```{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. 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. 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 ```{code-block} sh
sudo poetry run python manage.py collectstatic sudo poetry run python3 manage.py collectstatic
``` ```
## 8. Set up systemd unit files ## 8. Set up systemd unit files

View File

@ -140,7 +140,7 @@ Once you've filled in your environment file, you can set up Funkwhale. Follow th
3. Run the database migrations. 3. Run the database migrations.
```{code-block} sh ```{code-block} sh
docker-compose run --rm api python manage.py migrate docker-compose run --rm api python3 manage.py migrate
``` ```
````{note} ````{note}
@ -156,7 +156,7 @@ Once you've filled in your environment file, you can set up Funkwhale. Follow th
4. Create your superuser. 4. Create your superuser.
```{code-block} sh ```{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. 5. Launch all the containers to bring up your pod.

View File

@ -140,7 +140,7 @@ When the import finishes, run the `manage.py migrate` command to set up the data
```{code-block} sh ```{code-block} sh
cd /srv/funkwhale/api 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. 3. When the import finishes, run the `manage.py migrate` command to set up the database.
```{code-block} sh ```{code-block} sh
docker-compose run --rm api python manage.py migrate docker-compose run --rm api python3 manage.py migrate
``` ```
::: :::

View File

@ -38,7 +38,7 @@ Use the following command to create a new library with a custom name and privacy
:sync: debian :sync: debian
```{code-block} sh ```{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 :sync: docker
```{code-block} sh ```{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 :sync: debian
```{code-block} sh ```{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 :sync: docker
```{code-block} sh ```{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 :sync: debian
```{code-block} sh ```{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 :sync: docker
```{code-block} sh ```{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"
``` ```
::: :::

View File

@ -16,7 +16,7 @@ To ensure you don't remove data by accident, this command runs in dry run mode b
:sync: debian :sync: debian
```{code-block} sh ```{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 :sync: docker
```{code-block} sh ```{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
``` ```
::: :::

View File

@ -14,7 +14,7 @@ Check and fix file mimetypes with the `--mimetype` flag. This helps prevent issu
:sync: debian :sync: debian
```{code-block} sh ```{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 :sync: docker
```{code-block} sh ```{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 :sync: debian
```{code-block} sh ```{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 :sync: docker
```{code-block} sh ```{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 :sync: debian
```{code-block} sh ```{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 :sync: docker
```{code-block} sh ```{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 :sync: debian
```{code-block} sh ```{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 :sync: docker
```{code-block} sh ```{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 :sync: debian
```{code-block} sh ```{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 :sync: docker
```{code-block} sh ```{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
``` ```
::: :::

View File

@ -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. 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} ```{warning}
Running `prune_library` commands with the `--no-dry-run` flag is irreversible. Make sure you [back up your data](../upgrade_docs/backup.md). 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 :sync: debian
```bash ```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 :sync: docker
```bash ```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 :sync: debian
```{code-block} sh ```{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 :sync: docker
```{code-block} sh ```{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 :sync: debian
```{code-block} sh ```{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 :sync: docker
```{code-block} sh ```{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 :sync: debian
```{code-block} sh ```{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 :sync: docker
```{code-block} sh ```{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 :sync: debian
```{code-block} sh ```{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 :sync: docker
```{code-block} sh ```{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
``` ```
::: :::

View File

@ -27,7 +27,7 @@ To add tags to untagged albums:
3. Run the `manage.py` script to generate tags for untagged albums. 3. Run the `manage.py` script to generate tags for untagged albums.
```{code-block} sh ```{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. 3. Run the `manage.py` script to generate tags for untagged albums.
```{code-block} sh ```{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. 3. Run the `manage.py` script to generate tags for untagged artists.
```{code-block} sh ```{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. 3. Run the `manage.py` script to generate tags for untagged artists.
```{code-block} sh ```{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
``` ```
::: :::

View File

@ -29,7 +29,7 @@ To generate new thumbnails:
4. Run the `manage.py` script to regenerate the thumbnails. 4. Run the `manage.py` script to regenerate the thumbnails.
```{code-block} sh ```{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. 4. Run the `manage.py` script to regenerate the thumbnails.
```{code-block} sh ```{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
``` ```
::: :::

View File

@ -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. 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 ## Create users
@ -16,7 +16,7 @@ You can create users with the {file}`manage.py` script. There are different ways
:sync: debian :sync: debian
```{code-block} sh ```{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 :sync: docker
```{code-block} sh ```{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 :sync: debian
```{code-block} sh ```{code-block} sh
poetry run python manage.py fw users create --username <username> --email <user email> -p "" poetry run python3 manage.py fw users create --username <username> --email <user email> -p ""
``` ```
::: :::
@ -48,7 +48,7 @@ poetry run python manage.py fw users create --username <username> --email <user
:sync: docker :sync: docker
```{code-block} sh ```{code-block} sh
docker-compose run --rm api python manage.py fw users create --username <username> --email <user email> -p "" docker-compose run --rm api python3 manage.py fw users create --username <username> --email <user email> -p ""
``` ```
::: :::
@ -63,7 +63,7 @@ docker-compose run --rm api python manage.py fw users create --username <usernam
```{code-block} sh ```{code-block} sh
export FUNKWHALE_CLI_USER_PASSWORD=<password> export FUNKWHALE_CLI_USER_PASSWORD=<password>
poetry run python manage.py fw users create --username <username> --email <user email> poetry run python3 manage.py fw users create --username <username> --email <user email>
``` ```
::: :::
@ -73,7 +73,7 @@ poetry run python manage.py fw users create --username <username> --email <user
```{code-block} sh ```{code-block} sh
export FUNKWHALE_CLI_USER_PASSWORD=<password> export FUNKWHALE_CLI_USER_PASSWORD=<password>
docker-compose run --rm api python manage.py fw users create --username <username> --email <user email> docker-compose run --rm api python3 manage.py fw users create --username <username> --email <user email>
``` ```
::: :::
@ -87,7 +87,7 @@ There are extra options for user configuration, such as quota and {term}`permiss
:sync: debian :sync: debian
```{code-block} sh ```{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 :sync: docker
```{code-block} sh ```{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 ## 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 ### 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 :sync: debian
```{code-block} sh ```{code-block} sh
poetry run python manage.py fw users set --upload-quota 500 <user> poetry run python3 manage.py fw users set --upload-quota 500 <user>
``` ```
::: :::
@ -123,7 +123,7 @@ poetry run python manage.py fw users set --upload-quota 500 <user>
:sync: docker :sync: docker
```{code-block} sh ```{code-block} sh
docker-compose run --rm api python manage.py fw users set --upload-quota 500 <user> docker-compose run --rm api python3 manage.py fw users set --upload-quota 500 <user>
``` ```
::: :::
@ -137,7 +137,7 @@ docker-compose run --rm api python manage.py fw users set --upload-quota 500 <us
:sync: debian :sync: debian
```{code-block} sh ```{code-block} sh
poetry run python manage.py fw users set --staff --superuser <user 1> <user 2> poetry run python3 manage.py fw users set --staff --superuser <user 1> <user 2>
``` ```
::: :::
@ -146,7 +146,7 @@ poetry run python manage.py fw users set --staff --superuser <user 1> <user 2>
:sync: docker :sync: docker
```{code-block} sh ```{code-block} sh
docker-compose run --rm api python manage.py fw users set --staff --superuser <user 1> <user 2> docker-compose run --rm api python3 manage.py fw users set --staff --superuser <user 1> <user 2>
``` ```
::: :::
@ -160,7 +160,7 @@ docker-compose run --rm api python manage.py fw users set --staff --superuser <u
:sync: debian :sync: debian
```{code-block} sh ```{code-block} sh
poetry run python manage.py fw users set --no-staff --no-superuser <user> poetry run python3 manage.py fw users set --no-staff --no-superuser <user>
``` ```
::: :::
@ -169,7 +169,7 @@ poetry run python manage.py fw users set --no-staff --no-superuser <user>
:sync: docker :sync: docker
```{code-block} sh ```{code-block} sh
docker-compose run --rm api python manage.py fw users set --no-staff --no-superuser <user> docker-compose run --rm api python3 manage.py fw users set --no-staff --no-superuser <user>
``` ```
::: :::
@ -183,7 +183,7 @@ docker-compose run --rm api python manage.py fw users set --no-staff --no-superu
:sync: debian :sync: debian
```{code-block} sh ```{code-block} sh
poetry run python manage.py fw users set --permission-moderation <user> poetry run python3 manage.py fw users set --permission-moderation <user>
``` ```
::: :::
@ -192,7 +192,7 @@ poetry run python manage.py fw users set --permission-moderation <user>
:sync: docker :sync: docker
```{code-block} sh ```{code-block} sh
docker-compose run --rm api python manage.py fw users set --permission-moderation <user> docker-compose run --rm api python3 manage.py fw users set --permission-moderation <user>
``` ```
::: :::
@ -206,7 +206,7 @@ docker-compose run --rm api python manage.py fw users set --permission-moderatio
:sync: debian :sync: debian
```{code-block} sh ```{code-block} sh
poetry run python manage.py fw users set --password "<password>" <user> poetry run python3 manage.py fw users set --password "<password>" <user>
``` ```
::: :::
@ -215,7 +215,7 @@ poetry run python manage.py fw users set --password "<password>" <user>
:sync: docker :sync: docker
```{code-block} sh ```{code-block} sh
docker-compose run --rm api python manage.py fw users set --password "<password>" <user> docker-compose run --rm api python3 manage.py fw users set --password "<password>" <user>
``` ```
::: :::
@ -230,7 +230,7 @@ docker-compose run --rm api python manage.py fw users set --password "<password>
```{code-block} sh ```{code-block} sh
export FUNKWHALE_CLI_USER_UPDATE_PASSWORD=<password> export FUNKWHALE_CLI_USER_UPDATE_PASSWORD=<password>
poetry run python manage.py fw users set <user> poetry run python3 manage.py fw users set <user>
``` ```
::: :::
@ -240,7 +240,7 @@ poetry run python manage.py fw users set <user>
```{code-block} sh ```{code-block} sh
export FUNKWHALE_CLI_USER_UPDATE_PASSWORD=<password> export FUNKWHALE_CLI_USER_UPDATE_PASSWORD=<password>
docker-compose run --rm api python manage.py fw users set <user> docker-compose run --rm api python3 manage.py fw users set <user>
``` ```
::: :::
@ -254,7 +254,7 @@ There are extra options for updating users. Check the command help for more opti
:sync: debian :sync: debian
```{code-block} sh ```{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 :sync: docker
```{code-block} sh ```{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 :sync: debian
```{code-block} py ```{code-block} py
poetry run python manage.py fw users rm <user> poetry run python3 manage.py fw users rm <user>
``` ```
::: :::
@ -290,7 +290,7 @@ poetry run python manage.py fw users rm <user>
:sync: docker :sync: docker
```{code-block} py ```{code-block} py
docker-compose run --rm api python manage.py fw users rm <user> docker-compose run --rm api python3 manage.py fw users rm <user>
``` ```
::: :::
@ -306,7 +306,7 @@ This means the username can be reused.
:sync: debian :sync: debian
```{code-block} py ```{code-block} py
poetry run python manage.py fw users rm --hard <user> poetry run python3 manage.py fw users rm --hard <user>
``` ```
::: :::
@ -315,7 +315,7 @@ poetry run python manage.py fw users rm --hard <user>
:sync: docker :sync: docker
```{code-block} py ```{code-block} py
docker-compose run --rm api python manage.py fw users rm --hard <user> docker-compose run --rm api python3 manage.py fw users rm --hard <user>
``` ```
::: :::
@ -329,7 +329,7 @@ There are extra options for deleting users. Check the command help for more opti
:sync: debian :sync: debian
```{code-block} sh ```{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 :sync: docker
```{code-block} sh ```{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
``` ```
::: :::

View File

@ -125,7 +125,7 @@ Check the file and remove any duplicated settings after copying.
3. Run the database migrations. 3. Run the database migrations.
```{code-block} sh ```{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 ## Start your Funkwhale instance

View File

@ -115,7 +115,7 @@ To restore your database, do the following:
```{code-block} sh ```{code-block} sh
cd /srv/funkwhale/api 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. 2. Run the `manage.py migrate` command to set up the database.
```{code-block} sh ```{code-block} sh
docker-compose run --rm api python manage.py migrate docker-compose run --rm api python3 manage.py migrate
``` ```
::: :::

View File

@ -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. 4. Collect the new static files to serve.
```{code-block} sh ```{code-block} sh
poetry run python manage.py collectstatic --no-input poetry run python3 manage.py collectstatic --no-input
``` ```
5. Apply new database migrations. 5. Apply new database migrations.
```{code-block} sh ```{code-block} sh
poetry run python manage.py migrate poetry run python3 manage.py migrate
``` ```
6. Restart the Funkwhale services. 6. Restart the Funkwhale services.

View File

@ -44,7 +44,7 @@ If you installed Funkwhale following the [Docker guide](../installation_docs/doc
8. Apply the database migrations. 8. Apply the database migrations.
```{code-block} sh ```{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. 9. Relaunch your containers.

View File

@ -32,7 +32,7 @@ You can install third-party plugins using the `manage.py` script. To do this:
:::{tab-item} Debian :::{tab-item} Debian
```{code-block} shell ```{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 :::{tab-item} Docker
```{code-block} shell ```{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
``` ```
::: :::

View File

@ -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: Funkwhale relies on a postgresql database to store information. To set this up, you need to run the `manage.py migrate` command:
```sh ```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. 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: 1. Create a superuser so you can log in to your local app:
```sh ```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. 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 ```sh
artists=25 # Adds 25 fake artists artists=25 # Adds 25 fake artists
command="from funkwhale_api.music import fake_data; fake_data.create_data($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 ## Manage services
@ -194,8 +194,8 @@ To run a reverse proxy for your app:
```sh ```sh
export COMPOSE_PROJECT_NAME=node2 export COMPOSE_PROJECT_NAME=node2
export VUE_PORT=1234 # this has to be unique for each instance 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 python3 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 createsuperuser
docker-compose -f dev.yml up nginx api front nginx api celeryworker docker-compose -f dev.yml up nginx api front nginx api celeryworker
``` ```

View File

@ -1,10 +1,10 @@
#!/usr/bin/env python #!/usr/bin/env python3
from subprocess import call from subprocess import call
# initial make # initial make
call(["python", "-m", "sphinx", ".", "/tmp/_build"]) call(["python3", "-m", "sphinx", ".", "/tmp/_build"])
from livereload import Server, shell # noqa: E402 from livereload import Server, shell # noqa: E402
server = Server() 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") server.serve(root="/tmp/_build/", liveport=35730, port=8001, host="0.0.0.0")