diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a86bb33a6..836071be3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -260,9 +260,9 @@ build_openapi_schema: - cd api - pip3 install poetry - poetry install - - poetry run python3 manage.py migrate + - poetry run funkwhale-manage migrate script: - - poetry run python3 manage.py spectacular --file ../docs/schema.yml + - poetry run funkwhale-manage spectacular --file ../docs/schema.yml artifacts: expire_in: 2 weeks paths: diff --git a/.gitpod.yml b/.gitpod.yml index 3b9274352..b634d541c 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -18,8 +18,8 @@ tasks: gp ports await 5432 - poetry run python3 manage.py migrate - poetry run python3 manage.py gitpod init + poetry run funkwhale-manage migrate + poetry run funkwhale-manage 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 python3 manage.py collectstatic --no-input - poetry run python3 manage.py gitpod dev + poetry run funkwhale-manage collectstatic --no-input + poetry run funkwhale-manage gitpod dev - name: Celery Worker env: diff --git a/api/compose/django/server.sh b/api/compose/django/server.sh index 8343a58b0..044e584e2 100755 --- a/api/compose/django/server.sh +++ b/api/compose/django/server.sh @@ -2,8 +2,8 @@ set -eux -python3 /app/manage.py collectstatic --noinput -python3 /app/manage.py migrate +funkwhale-manage collectstatic --noinput +funkwhale-manage migrate # shellcheck disable=SC2086 gunicorn config.asgi:application \ diff --git a/api/funkwhale_api/common/management/commands/script.py b/api/funkwhale_api/common/management/commands/script.py index 9f375ac9e..be94e4eab 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 python3 manage.py script for a " + "{} is not a valid script. Run funkwhale-manage 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: python3 manage.py ") + self.stdout.write("Launch with: funkwhale-manage ") available_scripts = self.get_scripts() for name, script in sorted(available_scripts.items()): self.stdout.write("") diff --git a/changes/changelog.d/prefer-using-the-funkwhale-manage-entrypoint.enhancement b/changes/changelog.d/prefer-using-the-funkwhale-manage-entrypoint.enhancement new file mode 100644 index 000000000..00ac652a5 --- /dev/null +++ b/changes/changelog.d/prefer-using-the-funkwhale-manage-entrypoint.enhancement @@ -0,0 +1 @@ +Prefer using the funkwhale-manage entrypoint diff --git a/dev.yml b/dev.yml index 3429f4d7b..c4fae3aac 100644 --- a/dev.yml +++ b/dev.yml @@ -55,7 +55,7 @@ services: install_dev_deps: 1 image: funkwhale-api command: > - bash -c "python3 manage.py collectstatic --no-input + bash -c "funkwhale-manage 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 diff --git a/docs/administrator_documentation/configuration_docs/change_url.md b/docs/administrator_documentation/configuration_docs/change_url.md index f37c76819..6592e68c9 100644 --- a/docs/administrator_documentation/configuration_docs/change_url.md +++ b/docs/administrator_documentation/configuration_docs/change_url.md @@ -10,7 +10,7 @@ Your instance URL is your pod's unique identifier in the {term}`fediverse`. If y - The instance URL in your webserver config. - Any references to the old URL in your database. -To clean the database, the {file}`manage.py` script contains a `fix_federation_ids` command. +To clean the database, the `funkwhale-manage` command line interface contains a `fix_federation_ids` command. ```{warning} Running `fix_federation_ids` with the `--no-dry-run` flag is irreversible. Make sure you [back up your data](../upgrade_docs/backup.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 python3 manage.py fix_federation_ids https://old-url https://new-url --no-dry-run --no-input + venv/bin/funkwhale-manage 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 python3 manage.py fix_federation_ids https://old-url https://new-url --no-dry-run --no-input + docker-compose run --rm api funkwhale-manage 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 4fb1edef4..65b99a747 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 python3 manage.py mrf_check --list + venv/bin/funkwhale-manage 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 python3 manage.py mrf_check --list + docker-compose run --rm api funkwhale-manage 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 python3 manage.py mrf_check inbox - -p blocked_follow_domains + echo $MRF_MESSAGE | venv/bin/funkwhale-manage 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 python3 manage.py mrf_check inbox - -p blocked_follow_domains + echo $MRF_MESSAGE | docker-compose run --rm api funkwhale-manage 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 python3 manage.py mrf_check inbox - -p blocked_follow_domains + echo $MRF_MESSAGE | venv/bin/funkwhale-manage 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 python3 manage.py mrf_check inbox - -p blocked_follow_domains + echo $MRF_MESSAGE | docker-compose run --rm api funkwhale-manage 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 python3 manage.py mrf_check inbox $ACTIVITY_UUID -p blocked_follow_domains + echo $MRF_MESSAGE | venv/bin/funkwhale-manage 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 python3 manage.py mrf_check inbox $ACTIVITY_UUID -p blocked_follow_domains + echo $MRF_MESSAGE | docker-compose run --rm api funkwhale-manage 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 python3 manage.py mrf_check --help +venv/bin/funkwhale-manage mrf_check --help ``` ::: @@ -199,7 +199,7 @@ poetry run python3 manage.py mrf_check --help :sync: docker ```{code-block} sh -docker-compose run --rm api python3 manage.py mrf_check --help +docker-compose run --rm api funkwhale-manage mrf_check --help ``` ::: diff --git a/docs/administrator_documentation/import_docs/index.md b/docs/administrator_documentation/import_docs/index.md index 3dae459ff..c33a98451 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 python3 manage.py import_files --help +venv/bin/funkwhale-manage import_files --help ``` ::: @@ -24,7 +24,7 @@ poetry run python3 manage.py import_files --help :sync: docker ```{code-block} sh -docker-compose run --rm api python3 manage.py import_files --help +docker-compose run --rm api funkwhale-manage 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 python3 manage.py import_files $LIBRARY_ID "data/music" --recursive --noinput + venv/bin/funkwhale-manage 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 python3 manage.py import_files $LIBRARY_ID "/srv/funkwhale/data/music/nfsshare/" --recursive --noinput --in-place + venv/bin/funkwhale-manage 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 python3 manage.py import_files $LIBRARY_ID "/srv/funkwhale/data/music/nfsshare/" --recursive --noinput --in-place + docker-compose run --rm api funkwhale-manage 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 python3 manage.py import_files $LIBRARY_ID "/srv/funkwhale/data/music/nfsshare/" --recursive --noinput --in-place --watch +venv/bin/funkwhale-manage import_files $LIBRARY_ID "/srv/funkwhale/data/music/nfsshare/" --recursive --noinput --in-place --watch ``` ::: @@ -250,7 +250,7 @@ poetry run python3 manage.py import_files $LIBRARY_ID "/srv/funkwhale/data/music :sync: docker ```{code-block} sh -docker-compose run --rm api python3 manage.py import_files $LIBRARY_ID "/srv/funkwhale/data/music/nfsshare/" --recursive --noinput --in-place --watch +docker-compose run --rm api funkwhale-manage 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 python3 manage.py import_files $LIBRARY_ID "/srv/funkwhale/data/music/nfsshare/" --recursive --noinput --in-place --watch --prune +venv/bin/funkwhale-manage import_files $LIBRARY_ID "/srv/funkwhale/data/music/nfsshare/" --recursive --noinput --in-place --watch --prune ``` ::: @@ -281,7 +281,7 @@ poetry run python3 manage.py import_files $LIBRARY_ID "/srv/funkwhale/data/music :sync: docker ```{code-block} sh -docker-compose run --rm api python3 manage.py import_files $LIBRARY_ID "/srv/funkwhale/data/music/nfsshare/" --recursive --noinput --in-place --watch --prune +docker-compose run --rm api funkwhale-manage 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 a3bbb9e31..475982c21 100644 --- a/docs/administrator_documentation/installation_docs/debian.md +++ b/docs/administrator_documentation/installation_docs/debian.md @@ -234,11 +234,11 @@ Funkwhale uses a [PostgreSQL](https://www.postgresql.org/) database to store inf sudo -u postgres psql funkwhale -c 'CREATE EXTENSION "citext";' ``` -7. Your database is ready to be populated! Use the `manage.py` script to create the database structure. +7. Your database is ready to be populated! Use the `funkwhale-manage` command line interface to create the database structure. ```{code-block} sh - cd /srv/funkwhale/api - sudo -u funkwhale poetry run python3 manage.py migrate + cd /srv/funkwhale + sudo -u funkwhale venv/bin/funkwhale-manage migrate ``` ````{note} @@ -255,7 +255,7 @@ That's it! You've finished setting up your database. ## 7. Set up Funkwhale -Once you have got your database up and running, you can get Funkwhale ready to launch. Use the built-in `manage.py` script to get things ready. +Once you have got your database up and running, you can get Funkwhale ready to launch. Use the built-in `funkwhale-manage` command line interface to get things ready. ### Create a superuser for your pod @@ -266,17 +266,17 @@ 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 python3 manage.py createsuperuser +sudo -u funkwhale venv/bin/funkwhale-manage createsuperuser ``` That's it! You can log in as this user when you finish setting up Funkwhale. ### Collect static files -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 the `funkwhale-manage` command line interface to collect these files so that the webserver can serve them. ```{code-block} sh -sudo poetry run python3 manage.py collectstatic +sudo venv/bin/funkwhale-manage 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 19ca62007..e5504262e 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 python3 manage.py migrate + docker-compose run --rm api funkwhale-manage 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 python3 manage.py createsuperuser + docker-compose run --rm api funkwhale-manage 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 368ef8d61..36aa8e670 100644 --- a/docs/administrator_documentation/installation_docs/migrate.md +++ b/docs/administrator_documentation/installation_docs/migrate.md @@ -40,7 +40,7 @@ Before you move your data, you need to install Funkwhale on your {term}`destinat On your {term}`destination server`, follow the [installation guide](debian.md). Skip the following steps: - Don't enable the `unaccent` and `citext` extensions when you set up the database. -- Don't run the `manage.py migrate` command to migrate the database. +- Don't run the `funkwhale-manage migrate` command to migrate the database. - Don't create a superuser. Once you have finished the installation, stop the Funkwhale services. These shouldn't be running when you copy your existing data over. @@ -56,7 +56,7 @@ sudo systemctl stop funkwhale.target On your {term}`destination server`, follow the [installation guide](docker.md). Skip the following steps: -- Don't run the `manage.py migrate` command to migrate the database. +- Don't run the `funkwhale-manage migrate` command to migrate the database. - Don't create a superuser. Once you have finished the installation, stop the Funkwhale services. These shouldn't be running when you copy your existing data over. @@ -136,11 +136,11 @@ Run the following on your {term}`destination server`: sudo psql -d funkwhale dump.sql ``` -When the import finishes, run the `manage.py migrate` command to set up the database. +When the import finishes, run the `funkwhale-manage migrate` command to set up the database. ```{code-block} sh -cd /srv/funkwhale/api -poetry run python3 manage.py migrate +cd /srv/funkwhale +venv/bin/funkwhale-manage migrate ``` ::: @@ -166,10 +166,10 @@ You need to initialize the postgres container on your {term}`destination server` docker-compose run --rm postgres psql -U postgres -d postgres < "dump.sql" ``` -3. When the import finishes, run the `manage.py migrate` command to set up the database. +3. When the import finishes, run the `funkwhale-manage migrate` command to set up the database. ```{code-block} sh - docker-compose run --rm api python3 manage.py migrate + docker-compose run --rm api funkwhale-manage migrate ``` ::: diff --git a/docs/administrator_documentation/manage_script/create_library.md b/docs/administrator_documentation/manage_script/create_library.md index ea207d809..75ac3034b 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 python3 manage.py create_library username1 --name="Library 1" --privacy-level="everyone" +venv/bin/funkwhale-manage create_library username1 --name="Library 1" --privacy-level="everyone" ``` ::: @@ -47,7 +47,7 @@ poetry run python3 manage.py create_library username1 --name="Library 1" --priva :sync: docker ```{code-block} sh -docker-compose run --rm api python3 manage.py create_library username1 --name="Library 1" --privacy-level="everyone" +docker-compose run --rm api funkwhale-manage 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 python3 manage.py create_library username1 +venv/bin/funkwhale-manage create_library username1 ``` ::: @@ -79,7 +79,7 @@ poetry run python3 manage.py create_library username1 :sync: docker ```{code-block} sh -docker-compose run --rm api python3 manage.py create_library username1 +docker-compose run --rm api funkwhale-manage 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 python3 manage.py create_library username1 --name="Library 1" --privacy-level="everyone" +venv/bin/funkwhale-manage create_library username1 --name="Library 1" --privacy-level="everyone" ``` ::: @@ -111,7 +111,7 @@ poetry run python3 manage.py create_library username1 --name="Library 1" --priva :sync: docker ```{code-block} sh -docker-compose run --rm api python3 manage.py create_library username1 --name="Library 1" --privacy-level="everyone" +docker-compose run --rm api funkwhale-manage 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 17d35b893..6bd2ae673 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 python3 manage.py check_inplace_files +venv/bin/funkwhale-manage check_inplace_files ``` ::: @@ -25,7 +25,7 @@ poetry run python3 manage.py check_inplace_files :sync: docker ```{code-block} sh -docker-compose run --rm api python3 manage.py check_inplace_files +docker-compose run --rm api funkwhale-manage check_inplace_files ``` ::: diff --git a/docs/administrator_documentation/manage_script/fix_uploads.md b/docs/administrator_documentation/manage_script/fix_uploads.md index 5d6b9f403..db1ee68a8 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 python3 manage.py fix_uploads --mimetype +venv/bin/funkwhale-manage fix_uploads --mimetype ``` ::: @@ -23,7 +23,7 @@ poetry run python3 manage.py fix_uploads --mimetype :sync: docker ```{code-block} sh -docker-compose run --rm api python3 manage.py fix_uploads --mimetype +docker-compose run --rm api funkwhale-manage 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 python3 manage.py fix_uploads --audio-data +venv/bin/funkwhale-manage fix_uploads --audio-data ``` ::: @@ -48,7 +48,7 @@ poetry run python3 manage.py fix_uploads --audio-data :sync: docker ```{code-block} sh -docker-compose run --rm api python3 manage.py fix_uploads --audio-data +docker-compose run --rm api funkwhale-manage 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 python3 manage.py fix_uploads --size +venv/bin/funkwhale-manage fix_uploads --size ``` ::: @@ -73,7 +73,7 @@ poetry run python3 manage.py fix_uploads --size :sync: docker ```{code-block} sh -docker-compose run --rm api python3 manage.py fix_uploads --size +docker-compose run --rm api funkwhale-manage fix_uploads --size ``` ::: @@ -89,7 +89,7 @@ Check and fix file checksums with the `--checksum` flag. :sync: debian ```{code-block} sh -poetry run python3 manage.py fix_uploads --checksum +venv/bin/funkwhale-manage fix_uploads --checksum ``` ::: @@ -98,7 +98,7 @@ poetry run python3 manage.py fix_uploads --checksum :sync: docker ```{code-block} sh -docker-compose run --rm api python3 manage.py fix_uploads --checksum +docker-compose run --rm api funkwhale-manage 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 python3 manage.py fix_uploads --batch-size 500 +venv/bin/funkwhale-manage fix_uploads --batch-size 500 ``` ::: @@ -123,7 +123,7 @@ poetry run python3 manage.py fix_uploads --batch-size 500 :sync: docker ```{code-block} sh -docker-compose run --rm api python3 manage.py fix_uploads --batch-size 500 +docker-compose run --rm api funkwhale-manage fix_uploads --batch-size 500 ``` ::: diff --git a/docs/administrator_documentation/manage_script/index.md b/docs/administrator_documentation/manage_script/index.md index 5cbeeb245..9f8a7c2c7 100644 --- a/docs/administrator_documentation/manage_script/index.md +++ b/docs/administrator_documentation/manage_script/index.md @@ -1,6 +1,6 @@ -# Funkwhale management script +# Funkwhale management command line interface -Funkwhale includes a {file}`manage.py` script that can help you automate a lot of admin tasks. Check out the guides in this section for instructions on how to use this tool. +Funkwhale includes a `funkwhale-manage` command line interface that can help you automate a lot of admin tasks. Check out the guides in this section for instructions on how to use this tool. ```{toctree} --- diff --git a/docs/administrator_documentation/manage_script/library.md b/docs/administrator_documentation/manage_script/library.md index 30b2a999a..19629ac4a 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 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. +To help with this, the `funkwhale-manage` command line interface includes commands to prune dangling metadata from your database. All prune commands are available under the `funkwhale-manage 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 python3 manage.py prune_library --tracks +venv/bin/funkwhale-manage prune_library --tracks ``` ::: @@ -29,7 +29,7 @@ poetry run python3 manage.py prune_library --tracks :sync: docker ```bash -docker-compose run --rm api python3 manage.py prune_library --tracks +docker-compose run --rm api funkwhale-manage prune_library --tracks ``` ::: @@ -43,7 +43,7 @@ docker-compose run --rm api python3 manage.py prune_library --tracks :sync: debian ```{code-block} sh -poetry run python3 manage.py prune_library --albums +venv/bin/funkwhale-manage prune_library --albums ``` ::: @@ -52,7 +52,7 @@ poetry run python3 manage.py prune_library --albums :sync: docker ```{code-block} sh -docker-compose run --rm api python3 manage.py prune_library --albums +docker-compose run --rm api funkwhale-manage prune_library --albums ``` ::: @@ -66,7 +66,7 @@ docker-compose run --rm api python3 manage.py prune_library --albums :sync: debian ```{code-block} sh -poetry run python3 manage.py prune_library --artists +venv/bin/funkwhale-manage prune_library --artists ``` ::: @@ -75,7 +75,7 @@ poetry run python3 manage.py prune_library --artists :sync: docker ```{code-block} sh -docker-compose run --rm api python3 manage.py prune_library --artists +docker-compose run --rm api funkwhale-manage prune_library --artists ``` ::: @@ -89,7 +89,7 @@ docker-compose run --rm api python3 manage.py prune_library --artists :sync: debian ```{code-block} sh -poetry run python3 manage.py prune_library --tracks --albums --artists +venv/bin/funkwhale-manage prune_library --tracks --albums --artists ``` ::: @@ -98,7 +98,7 @@ poetry run python3 manage.py prune_library --tracks --albums --artists :sync: docker ```{code-block} sh -docker-compose run --rm api python3 manage.py prune_library --tracks --albums --artists +docker-compose run --rm api funkwhale-manage 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 python3 manage.py prune_library --help +venv/bin/funkwhale-manage prune_library --help ``` ::: @@ -121,7 +121,7 @@ poetry run python3 manage.py prune_library --help :sync: docker ```{code-block} sh -docker-compose run --rm api python3 manage.py prune_library --help +docker-compose run --rm api funkwhale-manage prune_library --help ``` ::: diff --git a/docs/administrator_documentation/manage_script/tags.md b/docs/administrator_documentation/manage_script/tags.md index 87092ac72..825ab6f3d 100644 --- a/docs/administrator_documentation/manage_script/tags.md +++ b/docs/administrator_documentation/manage_script/tags.md @@ -1,6 +1,6 @@ # Add artist and album tags from track metadata -Funkwhale extracts track tags from the file's metadata. Funkwhale applies these tags to the track's album and artist by running a check every few days. You can run the process at any time using the `manage.py` script. +Funkwhale extracts track tags from the file's metadata. Funkwhale applies these tags to the track's album and artist by running a check every few days. You can run the process at any time using the `funkwhale-manage` command line interface. The command performs the following actions: @@ -24,10 +24,10 @@ To add tags to untagged albums: cd /srv/funkwhale ``` -3. Run the `manage.py` script to generate tags for untagged albums. +3. Run the `funkwhale-manage` command line interface to generate tags for untagged albums. ```{code-block} sh - poetry run python3 manage.py fw albums add-tags-from-tracks + venv/bin/funkwhale-manage fw albums add-tags-from-tracks ``` ::: @@ -42,10 +42,10 @@ To add tags to untagged albums: cd /srv/funkwhale ``` -3. Run the `manage.py` script to generate tags for untagged albums. +3. Run the `funkwhale-manage` command line interface to generate tags for untagged albums. ```{code-block} sh - docker-compose run --rm api python3 manage.py fw albums add-tags-from-tracks + docker-compose run --rm api funkwhale-manage fw albums add-tags-from-tracks ``` ::: @@ -67,10 +67,10 @@ To add tags to untagged artists: cd /srv/funkwhale ``` -3. Run the `manage.py` script to generate tags for untagged artists. +3. Run the `funkwhale-manage` command line interface to generate tags for untagged artists. ```{code-block} sh - poetry run python3 manage.py fw artists add-tags-from-tracks + venv/bin/funkwhale-manage fw artists add-tags-from-tracks ``` ::: @@ -85,10 +85,10 @@ To add tags to untagged artists: cd /srv/funkwhale ``` -3. Run the `manage.py` script to generate tags for untagged artists. +3. Run the `funkwhale-manage` command line interface to generate tags for untagged artists. ```{code-block} sh - docker-compose run --rm api python3 manage.py fw artists add-tags-from-tracks + docker-compose run --rm api funkwhale-manage 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 1689b31d6..a80d0d402 100644 --- a/docs/administrator_documentation/manage_script/thumbnails.md +++ b/docs/administrator_documentation/manage_script/thumbnails.md @@ -1,6 +1,6 @@ # Regenerate thumbnails -We increased the quality of thumbnails from 70px to 95px in Funkwhale 1.0. This action removes visual artifacts that affect lower quality thumbnails. You can run the `manage.py` script to generate new thumbnails. If you want to keep thumbnails at their original quality, add `THUMBNAIL_JPEG_RESIZE_QUALITY=70` to your `.env` file. +We increased the quality of thumbnails from 70px to 95px in Funkwhale 1.0. This action removes visual artifacts that affect lower quality thumbnails. You can run the `funkwhale-manage` command line interface to generate new thumbnails. If you want to keep thumbnails at their original quality, add `THUMBNAIL_JPEG_RESIZE_QUALITY=70` to your `.env` file. ```{note} If you're using S3 storage, the `__sized__` folder is located in your S3 bucket. @@ -26,10 +26,10 @@ To generate new thumbnails: rm -r __sized__/ ``` -4. Run the `manage.py` script to regenerate the thumbnails. +4. Run the `funkwhale-manage` command line interface to regenerate the thumbnails. ```{code-block} sh - poetry run python3 manage.py fw media generate-thumbnails + venv/bin/funkwhale-manage fw media generate-thumbnails ``` ::: @@ -50,10 +50,10 @@ To generate new thumbnails: rm -r data/media/__sized__/ ``` -4. Run the `manage.py` script to regenerate the thumbnails. +4. Run the `funkwhale-manage` command line interface to regenerate the thumbnails. ```{code-block} sh - docker-compose run --rm api python3 manage.py fw media generate-thumbnails + docker-compose run --rm api funkwhale-manage fw media generate-thumbnails ``` ::: diff --git a/docs/administrator_documentation/manage_script/users.md b/docs/administrator_documentation/manage_script/users.md index 41e82b899..cd925c4df 100644 --- a/docs/administrator_documentation/manage_script/users.md +++ b/docs/administrator_documentation/manage_script/users.md @@ -1,12 +1,12 @@ -# Manage users with manage.py +# Manage users -The {file}`manage.py` script includes commands for user management. Use these commands to automate managing users from the command line. +The `funkwhale-manage` command line interface includes commands for user management. Use these commands to automate managing users from the command line. -All users-related commands are available under the `python3 manage.py fw users` namespace. +All users-related commands are available under the `funkwhale-manage fw users` namespace. ## Create users -You can create users with the {file}`manage.py` script. There are different ways to create users depending on what approach you want to take. +You can create users with the `funkwhale-manage` command line interface. There are different ways to create users depending on what approach you want to take. ### Create a user interactively @@ -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 python3 manage.py fw users create +venv/bin/funkwhale-manage fw users create ``` ::: @@ -25,7 +25,7 @@ poetry run python3 manage.py fw users create :sync: docker ```{code-block} sh -docker-compose run --rm api python3 manage.py fw users create +docker-compose run --rm api funkwhale-manage fw users create ``` ::: @@ -39,7 +39,7 @@ docker-compose run --rm api python3 manage.py fw users create :sync: debian ```{code-block} sh -poetry run python3 manage.py fw users create --username --email -p "" +venv/bin/funkwhale-manage fw users create --username --email -p "" ``` ::: @@ -48,7 +48,7 @@ poetry run python3 manage.py fw users create --username --email --email -p "" +docker-compose run --rm api funkwhale-manage fw users create --username --email -p "" ``` ::: @@ -63,7 +63,7 @@ docker-compose run --rm api python3 manage.py fw users create --username -poetry run python3 manage.py fw users create --username --email +venv/bin/funkwhale-manage fw users create --username --email ``` ::: @@ -73,7 +73,7 @@ poetry run python3 manage.py fw users create --username --email -docker-compose run --rm api python3 manage.py fw users create --username --email +docker-compose run --rm api funkwhale-manage 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 python3 manage.py fw users --help +venv/bin/funkwhale-manage fw users --help ``` ::: @@ -96,7 +96,7 @@ poetry run python3 manage.py fw users --help :sync: docker ```{code-block} sh -docker-compose run --rm api python3 manage.py fw users --help +docker-compose run --rm api funkwhale-manage fw users --help ``` ::: @@ -104,7 +104,7 @@ docker-compose run --rm api python3 manage.py fw users --help ## Update users -You can update user accounts using the {file}`manage.py` script. Update commands are available under the `python3 manage.py fw users set` namespace. +You can update user accounts using the `funkwhale-manage` command line interface. Update commands are available under the `funkwhale-manage 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 python3 manage.py fw users set --upload-quota 500 +venv/bin/funkwhale-manage fw users set --upload-quota 500 ``` ::: @@ -123,7 +123,7 @@ poetry run python3 manage.py fw users set --upload-quota 500 :sync: docker ```{code-block} sh -docker-compose run --rm api python3 manage.py fw users set --upload-quota 500 +docker-compose run --rm api funkwhale-manage fw users set --upload-quota 500 ``` ::: @@ -137,7 +137,7 @@ docker-compose run --rm api python3 manage.py fw users set --upload-quota 500 +venv/bin/funkwhale-manage fw users set --staff --superuser ``` ::: @@ -146,7 +146,7 @@ poetry run python3 manage.py fw users set --staff --superuser :sync: docker ```{code-block} sh -docker-compose run --rm api python3 manage.py fw users set --staff --superuser +docker-compose run --rm api funkwhale-manage fw users set --staff --superuser ``` ::: @@ -160,7 +160,7 @@ docker-compose run --rm api python3 manage.py fw users set --staff --superuser < :sync: debian ```{code-block} sh -poetry run python3 manage.py fw users set --no-staff --no-superuser +venv/bin/funkwhale-manage fw users set --no-staff --no-superuser ``` ::: @@ -169,7 +169,7 @@ poetry run python3 manage.py fw users set --no-staff --no-superuser :sync: docker ```{code-block} sh -docker-compose run --rm api python3 manage.py fw users set --no-staff --no-superuser +docker-compose run --rm api funkwhale-manage fw users set --no-staff --no-superuser ``` ::: @@ -183,7 +183,7 @@ docker-compose run --rm api python3 manage.py fw users set --no-staff --no-super :sync: debian ```{code-block} sh -poetry run python3 manage.py fw users set --permission-moderation +venv/bin/funkwhale-manage fw users set --permission-moderation ``` ::: @@ -192,7 +192,7 @@ poetry run python3 manage.py fw users set --permission-moderation :sync: docker ```{code-block} sh -docker-compose run --rm api python3 manage.py fw users set --permission-moderation +docker-compose run --rm api funkwhale-manage fw users set --permission-moderation ``` ::: @@ -206,7 +206,7 @@ docker-compose run --rm api python3 manage.py fw users set --permission-moderati :sync: debian ```{code-block} sh -poetry run python3 manage.py fw users set --password "" +venv/bin/funkwhale-manage fw users set --password "" ``` ::: @@ -215,7 +215,7 @@ poetry run python3 manage.py fw users set --password "" :sync: docker ```{code-block} sh -docker-compose run --rm api python3 manage.py fw users set --password "" +docker-compose run --rm api funkwhale-manage fw users set --password "" ``` ::: @@ -230,7 +230,7 @@ docker-compose run --rm api python3 manage.py fw users set --password " -poetry run python3 manage.py fw users set +venv/bin/funkwhale-manage fw users set ``` ::: @@ -240,7 +240,7 @@ poetry run python3 manage.py fw users set ```{code-block} sh export FUNKWHALE_CLI_USER_UPDATE_PASSWORD= -docker-compose run --rm api python3 manage.py fw users set +docker-compose run --rm api funkwhale-manage 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 python3 manage.py fw users set --help +venv/bin/funkwhale-manage fw users set --help ``` ::: @@ -263,7 +263,7 @@ poetry run python3 manage.py fw users set --help :sync: docker ```{code-block} sh -docker-compose run --rm api python3 manage.py fw users set --help +docker-compose run --rm api funkwhale-manage fw users set --help ``` ::: @@ -281,7 +281,7 @@ This prevents the same username being used in future. :sync: debian ```{code-block} py -poetry run python3 manage.py fw users rm +venv/bin/funkwhale-manage fw users rm ``` ::: @@ -290,7 +290,7 @@ poetry run python3 manage.py fw users rm :sync: docker ```{code-block} py -docker-compose run --rm api python3 manage.py fw users rm +docker-compose run --rm api funkwhale-manage fw users rm ``` ::: @@ -306,7 +306,7 @@ This means the username can be reused. :sync: debian ```{code-block} py -poetry run python3 manage.py fw users rm --hard +venv/bin/funkwhale-manage fw users rm --hard ``` ::: @@ -315,7 +315,7 @@ poetry run python3 manage.py fw users rm --hard :sync: docker ```{code-block} py -docker-compose run --rm api python3 manage.py fw users rm --hard +docker-compose run --rm api funkwhale-manage 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 python3 manage.py fw users rm --help +venv/bin/funkwhale-manage fw users rm --help ``` ::: @@ -338,7 +338,7 @@ poetry run python3 manage.py fw users rm --help :sync: docker ```{code-block} sh -docker-compose run --rm api python3 manage.py fw users rm --help +docker-compose run --rm api funkwhale-manage fw users rm --help ``` ::: diff --git a/docs/administrator_documentation/migration_guide/index.md b/docs/administrator_documentation/migration_guide/index.md index 9ed840a08..fb1753422 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 python3 manage.py migrate + docker-compose run --rm api funkwhale-manage migrate ``` ## Start your Funkwhale instance diff --git a/docs/administrator_documentation/upgrade_docs/backup.md b/docs/administrator_documentation/upgrade_docs/backup.md index 9b2ad3873..54c70d0b1 100644 --- a/docs/administrator_documentation/upgrade_docs/backup.md +++ b/docs/administrator_documentation/upgrade_docs/backup.md @@ -111,11 +111,11 @@ To restore your database, do the following: sudo -u postgres psql -f /path/to/your/backup/dump.sql funkwhale ``` -2. Run the `manage.py migrate` command to set up the database. +2. Run the `funkwhale-manage migrate` command to set up the database. ```{code-block} sh - cd /srv/funkwhale/api - poetry run python3 manage.py migrate + cd /srv/funkwhale + venv/bin/funkwhale-manage migrate ``` ::: @@ -129,10 +129,10 @@ To restore your database, do the following: docker-compose run --rm -T postgres psql -U postgres postgres < "/path/to/your/backup/dump.sql" ``` -2. Run the `manage.py migrate` command to set up the database. +2. Run the `funkwhale-manage migrate` command to set up the database. ```{code-block} sh - docker-compose run --rm api python3 manage.py migrate + docker-compose run --rm api funkwhale-manage migrate ``` ::: diff --git a/docs/administrator_documentation/upgrade_docs/docker.md b/docs/administrator_documentation/upgrade_docs/docker.md index cea478144..972274c8e 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 python3 manage.py migrate + docker-compose run --rm api funkwhale-manage migrate ``` 9. Relaunch your containers. diff --git a/docs/developer_documentation/plugins/install.md b/docs/developer_documentation/plugins/install.md index 23291efa9..aab94ef08 100644 --- a/docs/developer_documentation/plugins/install.md +++ b/docs/developer_documentation/plugins/install.md @@ -17,7 +17,7 @@ To install a plugin located on your server: ## Install a third-party plugin -You can install third-party plugins using the `manage.py` script. To do this: +You can install third-party plugins using the `funkwhale-manage` command line interface. To do this: 1. Add the plugin name to the `FUNKWHALE_PLUGINS` variable in your `.env` file @@ -25,14 +25,14 @@ You can install third-party plugins using the `manage.py` script. To do this: FUNKWHALE_PLUGINS=myplugin,anotherplugin ``` -2. Call the `manage.py` script with the location of the plugin archive +2. Call the `funkwhale-manage` command line interface with the location of the plugin archive :::: {tab-set} :::{tab-item} Debian ```{code-block} shell - python3 manage.py fw plugins install https://plugin_url.zip + venv/bin/funkwhale-manage 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 python3 manage.py fw plugins install https://plugin_url.zip + docker-compose run --rm api funkwhale-manage fw plugins install https://plugin_url.zip ``` ::: diff --git a/docs/developer_documentation/setup/docker.md b/docs/developer_documentation/setup/docker.md index 697294605..68365cefe 100644 --- a/docs/developer_documentation/setup/docker.md +++ b/docs/developer_documentation/setup/docker.md @@ -69,10 +69,10 @@ docker-compose -f dev.yml build ## Set up the database -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 `funkwhale-manage migrate` command: ```sh -docker-compose -f dev.yml run --rm api python3 manage.py migrate +docker-compose -f dev.yml run --rm api funkwhale-manage 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 python3 manage.py createsuperuser + docker-compose -f dev.yml run --rm api funkwhale-manage 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 python3 manage.py shell -i python + echo $command | docker-compose -f dev.yml run --rm -T api funkwhale-manage 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 python3 manage.py migrate - docker-compose -f dev.yml run --rm api python3 manage.py createsuperuser + docker-compose -f dev.yml run --rm api funkwhale-manage migrate + docker-compose -f dev.yml run --rm api funkwhale-manage createsuperuser docker-compose -f dev.yml up nginx api front nginx api celeryworker ```