diff --git a/docs/administrator_documentation/configuration_docs/change_url.md b/docs/administrator_documentation/configuration_docs/change_url.md index 6592e68c9..719aa5f3a 100644 --- a/docs/administrator_documentation/configuration_docs/change_url.md +++ b/docs/administrator_documentation/configuration_docs/change_url.md @@ -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 funkwhale-manage fix_federation_ids https://old-url https://new-url --no-dry-run --no-input + sudo 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/env_file.md b/docs/administrator_documentation/configuration_docs/env_file.md index 589e9061d..3b976d81e 100644 --- a/docs/administrator_documentation/configuration_docs/env_file.md +++ b/docs/administrator_documentation/configuration_docs/env_file.md @@ -19,7 +19,7 @@ sudo systemctl restart funkwhale.target :sync: docker ```{code-block} sh -docker-compose restart +sudo docker compose restart ``` ::: diff --git a/docs/administrator_documentation/configuration_docs/mrf.md b/docs/administrator_documentation/configuration_docs/mrf.md index 65b99a747..5564dba92 100644 --- a/docs/administrator_documentation/configuration_docs/mrf.md +++ b/docs/administrator_documentation/configuration_docs/mrf.md @@ -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 funkwhale-manage mrf_check --list + sudo docker compose run --rm api funkwhale-manage mrf_check --list ``` ::: @@ -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 funkwhale-manage mrf_check inbox - -p blocked_follow_domains + echo $MRF_MESSAGE | sudo docker compose run --rm api 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 funkwhale-manage mrf_check inbox - -p blocked_follow_domains + echo $MRF_MESSAGE | sudo docker compose run --rm api funkwhale-manage mrf_check inbox - -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 funkwhale-manage mrf_check inbox $ACTIVITY_UUID -p blocked_follow_domains + echo $MRF_MESSAGE | sudo docker compose run --rm api funkwhale-manage mrf_check inbox $ACTIVITY_UUID -p blocked_follow_domains ``` @@ -199,7 +199,7 @@ venv/bin/funkwhale-manage mrf_check --help :sync: docker ```{code-block} sh -docker-compose run --rm api funkwhale-manage mrf_check --help +sudo docker compose run --rm api funkwhale-manage mrf_check --help ``` ::: diff --git a/docs/administrator_documentation/configuration_docs/object_storage.md b/docs/administrator_documentation/configuration_docs/object_storage.md index df45f7a85..3c39136a5 100644 --- a/docs/administrator_documentation/configuration_docs/object_storage.md +++ b/docs/administrator_documentation/configuration_docs/object_storage.md @@ -158,7 +158,7 @@ Serving files from an object store requires some changes to the reverse proxy. :sync: docker ```{code-block} sh - docker-compose restart + sudo docker compose restart sudo systemctl restart nginx ``` diff --git a/docs/administrator_documentation/configuration_docs/optimize.md b/docs/administrator_documentation/configuration_docs/optimize.md index 210683230..f9afe579d 100644 --- a/docs/administrator_documentation/configuration_docs/optimize.md +++ b/docs/administrator_documentation/configuration_docs/optimize.md @@ -60,7 +60,7 @@ Celery uses a `prefork` pool by default. This enables the server to process many 2. Restart Celery. ```{code-block} sh - docker-compose restart celerybeat + sudo docker compose restart celerybeat ``` ::: diff --git a/docs/administrator_documentation/import_docs/index.md b/docs/administrator_documentation/import_docs/index.md index c33a98451..a1b8bf02d 100644 --- a/docs/administrator_documentation/import_docs/index.md +++ b/docs/administrator_documentation/import_docs/index.md @@ -24,7 +24,7 @@ venv/bin/funkwhale-manage import_files --help :sync: docker ```{code-block} sh -docker-compose run --rm api funkwhale-manage import_files --help +sudo docker compose run --rm api funkwhale-manage import_files --help ``` ::: @@ -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 funkwhale-manage import_files $LIBRARY_ID "/srv/funkwhale/data/music/nfsshare/" --recursive --noinput --in-place + sudo 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. @@ -250,7 +250,7 @@ venv/bin/funkwhale-manage import_files $LIBRARY_ID "/srv/funkwhale/data/music/nf :sync: docker ```{code-block} sh -docker-compose run --rm api funkwhale-manage import_files $LIBRARY_ID "/srv/funkwhale/data/music/nfsshare/" --recursive --noinput --in-place --watch +sudo docker compose run --rm api funkwhale-manage import_files $LIBRARY_ID "/srv/funkwhale/data/music/nfsshare/" --recursive --noinput --in-place --watch ``` ::: @@ -281,7 +281,7 @@ venv/bin/funkwhale-manage import_files $LIBRARY_ID "/srv/funkwhale/data/music/nf :sync: docker ```{code-block} sh -docker-compose run --rm api funkwhale-manage import_files $LIBRARY_ID "/srv/funkwhale/data/music/nfsshare/" --recursive --noinput --in-place --watch --prune +sudo 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/docker.md b/docs/administrator_documentation/installation_docs/docker.md index c916fa52e..0b425b2be 100644 --- a/docs/administrator_documentation/installation_docs/docker.md +++ b/docs/administrator_documentation/installation_docs/docker.md @@ -1,6 +1,6 @@ # Install Funkwhale using Docker -Funkwhale is available as a containerized application. This enables you to run each service in containers rather than install them on your server. You can run Funkwhale using [Docker](https://docker.com) and Docker-Compose. +Funkwhale is available as a containerized application. This enables you to run each service in containers rather than install them on your server. You can run Funkwhale using [Docker](https://docker.com). ```{note} This guide assumes you are using a [Debian](https://debian.org)-based system. @@ -18,7 +18,7 @@ This guide assumes you are using a [Debian](https://debian.org)-based system. export FUNKWHALE_VERSION={sub-ref}`version` ``` -- Install [Docker](https://docs.docker.com/engine/install/) and [Docker Compose](https://docs.docker.com/compose/install/). +- Install [Docker](https://docs.docker.com/engine/install/) and the [compose plugin](https://docs.docker.com/compose/install/linux/#install-using-the-repository). - Install `curl`. ```{code-block} sh @@ -32,11 +32,9 @@ It's good practice to create a user on your server for Funkwhale administration. 1. Create the `funkwhale` user and set its shell to `bash` and its home directory to `/srv/funkwhale`. -```{code-block} sh -sudo useradd --system --shell /bin/bash --create-home --home-dir /srv/funkwhale funkwhale -``` - -2. Follow the [Docker post-installation steps](https://docs.docker.com/engine/install/linux-postinstall/) to give the `funkwhale` user the ability to use Docker without `sudo`. + ```{code-block} sh + sudo useradd --system --shell /bin/bash --create-home --home-dir /srv/funkwhale funkwhale + ``` ````{note} To perform any tasks as the `funkwhale` user, prefix your commands with `sudo -u funkwhale`. @@ -69,7 +67,7 @@ That's it! You've created your `funkwhale` user. cd /srv/funkwhale ``` -3. Download the `docker-compose` template. This contains information about the containers and how they work together. +3. Download the `docker compose` template. This contains information about the containers and how they work together. ```{code-block} sh curl -L -o /srv/funkwhale/docker-compose.yml "https://dev.funkwhale.audio/funkwhale/funkwhale/raw/${FUNKWHALE_VERSION}/deploy/docker-compose.yml" @@ -128,19 +126,19 @@ Once you've filled in your environment file, you can set up Funkwhale. Follow th ```{code-block} sh cd /srv/funkwhale - docker-compose pull + sudo docker compose pull ``` 2. Bring up the database container so you can run the database migrations. ```{code-block} sh - docker-compose up -d postgres + sudo docker compose up -d postgres ``` 3. Run the database migrations. ```{code-block} sh - docker-compose run --rm api funkwhale-manage migrate + sudo docker compose run --rm api funkwhale-manage migrate ``` ````{note} @@ -156,13 +154,13 @@ 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 funkwhale-manage createsuperuser + sudo docker compose run --rm api funkwhale-manage createsuperuser ``` 5. Launch all the containers to bring up your pod. ```{code-block} sh - docker-compose up -d + sudo docker compose up -d ``` That's it! Your Funkwhale pod is now up and running. @@ -255,7 +253,7 @@ The frontend container ships default Nginx templates which serve content to the 6. Bring the `front` container up again to pick up the changes. ```{code-block} sh - docker-compose up -d front + sudo docker compose up -d front ``` That's it! The container mounts your custom nginx files and uses its values to serve Funkwhale content. To revert to the default values, comment out the volumes by adding a `#` in front of them and bring the `front` container back up. @@ -267,8 +265,8 @@ To enable your users to connect to your pod securely, you need to set up {abbr}` 1. Install certbot ```{code-block} sh - apt-get update - apt-get install certbot python3-certbot-nginx + sudo apt-get update + sudo apt-get install certbot python3-certbot-nginx ``` 2. Run certbot diff --git a/docs/administrator_documentation/installation_docs/migrate.md b/docs/administrator_documentation/installation_docs/migrate.md index 36aa8e670..f3d343c3b 100644 --- a/docs/administrator_documentation/installation_docs/migrate.md +++ b/docs/administrator_documentation/installation_docs/migrate.md @@ -62,7 +62,7 @@ On your {term}`destination server`, follow the [installation guide](docker.md). Once you have finished the installation, stop the Funkwhale services. These shouldn't be running when you copy your existing data over. ```{code-block} sh -docker-compose stop +sudo docker compose stop ``` ::: @@ -87,7 +87,7 @@ sudo -u postgres -H pg_dump funkwhale > /srv/funkwhale/dump.sql :sync: docker ```{code-block} sh -docker-compose exec postgres pg_dumpall -c -U postgres > dump.sql +sudo docker compose exec postgres pg_dumpall -c -U postgres > dump.sql ``` ::: @@ -157,19 +157,19 @@ You need to initialize the postgres container on your {term}`destination server` CREATE USER funkwhale; \ GRANT ALL PRIVILEGES ON DATABASE funkwhale TO funkwhale;" > init.sql # Create an init.sql file with the correct permissions - docker-compose run --rm postgres psql -U postgres -d postgres < "init.sql" # Import the init.sql file + sudo docker compose run --rm postgres psql -U postgres -d postgres < "init.sql" # Import the init.sql file ``` 2. Import your database backup. ```{code-block} sh - docker-compose run --rm postgres psql -U postgres -d postgres < "dump.sql" + sudo docker compose run --rm postgres psql -U postgres -d postgres < "dump.sql" ``` 3. When the import finishes, run the `funkwhale-manage migrate` command to set up the database. ```{code-block} sh - docker-compose run --rm api funkwhale-manage migrate + sudo docker compose run --rm api funkwhale-manage migrate ``` ::: @@ -198,7 +198,7 @@ sudo systemctl start funkwhale.target :sync: docker ```{code-block} sh -docker-compose up -d +sudo docker compose up -d ``` ::: diff --git a/docs/administrator_documentation/manage_script/create_library.md b/docs/administrator_documentation/manage_script/create_library.md index 75ac3034b..ccabf49b9 100644 --- a/docs/administrator_documentation/manage_script/create_library.md +++ b/docs/administrator_documentation/manage_script/create_library.md @@ -47,7 +47,7 @@ venv/bin/funkwhale-manage create_library username1 --name="Library 1" --privacy- :sync: docker ```{code-block} sh -docker-compose run --rm api funkwhale-manage create_library username1 --name="Library 1" --privacy-level="everyone" +sudo docker compose run --rm api funkwhale-manage create_library username1 --name="Library 1" --privacy-level="everyone" ``` ::: @@ -79,7 +79,7 @@ venv/bin/funkwhale-manage create_library username1 :sync: docker ```{code-block} sh -docker-compose run --rm api funkwhale-manage create_library username1 +sudo docker compose run --rm api funkwhale-manage create_library username1 ``` ::: @@ -111,7 +111,7 @@ venv/bin/funkwhale-manage create_library username1 --name="Library 1" --privacy- :sync: docker ```{code-block} sh -docker-compose run --rm api funkwhale-manage create_library username1 --name="Library 1" --privacy-level="everyone" +sudo 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 6bd2ae673..531271d82 100644 --- a/docs/administrator_documentation/manage_script/database.md +++ b/docs/administrator_documentation/manage_script/database.md @@ -25,7 +25,7 @@ venv/bin/funkwhale-manage check_inplace_files :sync: docker ```{code-block} sh -docker-compose run --rm api funkwhale-manage check_inplace_files +sudo 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 db1ee68a8..2b56ff295 100644 --- a/docs/administrator_documentation/manage_script/fix_uploads.md +++ b/docs/administrator_documentation/manage_script/fix_uploads.md @@ -23,7 +23,7 @@ venv/bin/funkwhale-manage fix_uploads --mimetype :sync: docker ```{code-block} sh -docker-compose run --rm api funkwhale-manage fix_uploads --mimetype +sudo docker compose run --rm api funkwhale-manage fix_uploads --mimetype ``` ::: @@ -48,7 +48,7 @@ venv/bin/funkwhale-manage fix_uploads --audio-data :sync: docker ```{code-block} sh -docker-compose run --rm api funkwhale-manage fix_uploads --audio-data +sudo docker compose run --rm api funkwhale-manage fix_uploads --audio-data ``` ::: @@ -73,7 +73,7 @@ venv/bin/funkwhale-manage fix_uploads --size :sync: docker ```{code-block} sh -docker-compose run --rm api funkwhale-manage fix_uploads --size +sudo docker compose run --rm api funkwhale-manage fix_uploads --size ``` ::: @@ -98,7 +98,7 @@ venv/bin/funkwhale-manage fix_uploads --checksum :sync: docker ```{code-block} sh -docker-compose run --rm api funkwhale-manage fix_uploads --checksum +sudo docker compose run --rm api funkwhale-manage fix_uploads --checksum ``` ::: @@ -123,7 +123,7 @@ venv/bin/funkwhale-manage fix_uploads --batch-size 500 :sync: docker ```{code-block} sh -docker-compose run --rm api funkwhale-manage fix_uploads --batch-size 500 +sudo docker compose run --rm api funkwhale-manage fix_uploads --batch-size 500 ``` ::: diff --git a/docs/administrator_documentation/manage_script/library.md b/docs/administrator_documentation/manage_script/library.md index 19629ac4a..44ff9fbd2 100644 --- a/docs/administrator_documentation/manage_script/library.md +++ b/docs/administrator_documentation/manage_script/library.md @@ -29,7 +29,7 @@ venv/bin/funkwhale-manage prune_library --tracks :sync: docker ```bash -docker-compose run --rm api funkwhale-manage prune_library --tracks +sudo docker compose run --rm api funkwhale-manage prune_library --tracks ``` ::: @@ -52,7 +52,7 @@ venv/bin/funkwhale-manage prune_library --albums :sync: docker ```{code-block} sh -docker-compose run --rm api funkwhale-manage prune_library --albums +sudo docker compose run --rm api funkwhale-manage prune_library --albums ``` ::: @@ -75,7 +75,7 @@ venv/bin/funkwhale-manage prune_library --artists :sync: docker ```{code-block} sh -docker-compose run --rm api funkwhale-manage prune_library --artists +sudo docker compose run --rm api funkwhale-manage prune_library --artists ``` ::: @@ -98,7 +98,7 @@ venv/bin/funkwhale-manage prune_library --tracks --albums --artists :sync: docker ```{code-block} sh -docker-compose run --rm api funkwhale-manage prune_library --tracks --albums --artists +sudo docker compose run --rm api funkwhale-manage prune_library --tracks --albums --artists ``` ::: @@ -121,7 +121,7 @@ venv/bin/funkwhale-manage prune_library --help :sync: docker ```{code-block} sh -docker-compose run --rm api funkwhale-manage prune_library --help +sudo 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 825ab6f3d..91e772b8a 100644 --- a/docs/administrator_documentation/manage_script/tags.md +++ b/docs/administrator_documentation/manage_script/tags.md @@ -45,7 +45,7 @@ To add tags to untagged albums: 3. Run the `funkwhale-manage` command line interface to generate tags for untagged albums. ```{code-block} sh - docker-compose run --rm api funkwhale-manage fw albums add-tags-from-tracks + sudo docker compose run --rm api funkwhale-manage fw albums add-tags-from-tracks ``` ::: @@ -88,7 +88,7 @@ To add tags to untagged artists: 3. Run the `funkwhale-manage` command line interface to generate tags for untagged artists. ```{code-block} sh - docker-compose run --rm api funkwhale-manage fw artists add-tags-from-tracks + sudo 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 a80d0d402..01c223736 100644 --- a/docs/administrator_documentation/manage_script/thumbnails.md +++ b/docs/administrator_documentation/manage_script/thumbnails.md @@ -53,7 +53,7 @@ To generate new thumbnails: 4. Run the `funkwhale-manage` command line interface to regenerate the thumbnails. ```{code-block} sh - docker-compose run --rm api funkwhale-manage fw media generate-thumbnails + sudo 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 cd925c4df..e525a6bb0 100644 --- a/docs/administrator_documentation/manage_script/users.md +++ b/docs/administrator_documentation/manage_script/users.md @@ -25,7 +25,7 @@ venv/bin/funkwhale-manage fw users create :sync: docker ```{code-block} sh -docker-compose run --rm api funkwhale-manage fw users create +sudo docker compose run --rm api funkwhale-manage fw users create ``` ::: @@ -48,7 +48,7 @@ venv/bin/funkwhale-manage fw users create --username --email --email -p "" +sudo docker compose run --rm api funkwhale-manage fw users create --username --email -p "" ``` ::: @@ -73,7 +73,7 @@ venv/bin/funkwhale-manage fw users create --username --email -docker-compose run --rm api funkwhale-manage fw users create --username --email +sudo docker compose run --rm api funkwhale-manage fw users create --username --email ``` ::: @@ -96,7 +96,7 @@ venv/bin/funkwhale-manage fw users --help :sync: docker ```{code-block} sh -docker-compose run --rm api funkwhale-manage fw users --help +sudo docker compose run --rm api funkwhale-manage fw users --help ``` ::: @@ -123,7 +123,7 @@ venv/bin/funkwhale-manage fw users set --upload-quota 500 :sync: docker ```{code-block} sh -docker-compose run --rm api funkwhale-manage fw users set --upload-quota 500 +sudo docker compose run --rm api funkwhale-manage fw users set --upload-quota 500 ``` ::: @@ -146,7 +146,7 @@ venv/bin/funkwhale-manage fw users set --staff --superuser :sync: docker ```{code-block} sh -docker-compose run --rm api funkwhale-manage fw users set --staff --superuser +sudo docker compose run --rm api funkwhale-manage fw users set --staff --superuser ``` ::: @@ -169,7 +169,7 @@ venv/bin/funkwhale-manage fw users set --no-staff --no-superuser :sync: docker ```{code-block} sh -docker-compose run --rm api funkwhale-manage fw users set --no-staff --no-superuser +sudo docker compose run --rm api funkwhale-manage fw users set --no-staff --no-superuser ``` ::: @@ -192,7 +192,7 @@ venv/bin/funkwhale-manage fw users set --permission-moderation :sync: docker ```{code-block} sh -docker-compose run --rm api funkwhale-manage fw users set --permission-moderation +sudo docker compose run --rm api funkwhale-manage fw users set --permission-moderation ``` ::: @@ -215,7 +215,7 @@ venv/bin/funkwhale-manage fw users set --password "" :sync: docker ```{code-block} sh -docker-compose run --rm api funkwhale-manage fw users set --password "" +sudo docker compose run --rm api funkwhale-manage fw users set --password "" ``` ::: @@ -240,7 +240,7 @@ venv/bin/funkwhale-manage fw users set ```{code-block} sh export FUNKWHALE_CLI_USER_UPDATE_PASSWORD= -docker-compose run --rm api funkwhale-manage fw users set +sudo docker compose run --rm api funkwhale-manage fw users set ``` ::: @@ -263,7 +263,7 @@ venv/bin/funkwhale-manage fw users set --help :sync: docker ```{code-block} sh -docker-compose run --rm api funkwhale-manage fw users set --help +sudo docker compose run --rm api funkwhale-manage fw users set --help ``` ::: @@ -290,7 +290,7 @@ venv/bin/funkwhale-manage fw users rm :sync: docker ```{code-block} py -docker-compose run --rm api funkwhale-manage fw users rm +sudo docker compose run --rm api funkwhale-manage fw users rm ``` ::: @@ -315,7 +315,7 @@ venv/bin/funkwhale-manage fw users rm --hard :sync: docker ```{code-block} py -docker-compose run --rm api funkwhale-manage fw users rm --hard +sudo docker compose run --rm api funkwhale-manage fw users rm --hard ``` ::: @@ -338,7 +338,7 @@ venv/bin/funkwhale-manage fw users rm --help :sync: docker ```{code-block} sh -docker-compose run --rm api funkwhale-manage fw users rm --help +sudo 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 fb1753422..435582267 100644 --- a/docs/administrator_documentation/migration_guide/index.md +++ b/docs/administrator_documentation/migration_guide/index.md @@ -35,7 +35,7 @@ Follow this guide to migrate a mono-container installation to a multi-container 1. Create a backup of your Funkwhale database. We will import this into the new postgres container later. ```{code-block} sh - docker-compose exec funkwhale /usr/bin/pg_dumpall -U funkwhale > db_dump.sql + sudo docker compose exec funkwhale /usr/bin/pg_dumpall -U funkwhale > db_dump.sql ``` ## Stop your Funkwhale instance @@ -43,7 +43,7 @@ Follow this guide to migrate a mono-container installation to a multi-container 1. Stop all Funkwhale services. This ensures that no data is changed while you migrate your instance. ```{code-block} sh - docker-compose down + sudo docker compose down ``` ## Prepare the multi-container setup @@ -113,19 +113,19 @@ Check the file and remove any duplicated settings after copying. 1. Start up your new database container. ```{code-block} sh - docker-compose up -d postgres + sudo docker compose up -d postgres ``` 2. Import your database dump into the new container. ```{code-block} sh - cat db_dump.sql | docker-compose exec -T postgres psql -U postgres + cat db_dump.sql | sudo docker compose exec -T postgres psql -U postgres ``` 3. Run the database migrations. ```{code-block} sh - docker-compose run --rm api funkwhale-manage migrate + sudo docker compose run --rm api funkwhale-manage migrate ``` ## Start your Funkwhale instance @@ -133,5 +133,5 @@ Check the file and remove any duplicated settings after copying. Once you have imported your database and run migrations, you can start all containers. ```{code-block} sh -docker-compose up -d +sudo docker compose up -d ``` diff --git a/docs/administrator_documentation/troubleshooting/backend.md b/docs/administrator_documentation/troubleshooting/backend.md index d7796153c..130eff622 100644 --- a/docs/administrator_documentation/troubleshooting/backend.md +++ b/docs/administrator_documentation/troubleshooting/backend.md @@ -47,7 +47,7 @@ journalctl -xn -u funkwhale-server :sync: docker ```{code-block} sh -docker-compose logs -f --tail=50 api # Follow the last 50 messages +sudo docker compose logs -f --tail=50 api # Follow the last 50 messages ``` ::: @@ -70,7 +70,7 @@ journalctl -xn -u funkwhale-worker :sync: docker ```{code-block} sh -docker-compose logs -f --tail=50 celery # Follow the last 50 messages +sudo docker compose logs -f --tail=50 celery # Follow the last 50 messages ``` ::: @@ -150,7 +150,7 @@ If your Funkwhale server uses more memory than expected, you can check the footp :sync: docker ```{code-block} sh - docker-compose restart + sudo docker compose restart ``` ::: @@ -189,7 +189,7 @@ To disable memory tracing: :sync: docker ```{code-block} sh - docker-compose restart + sudo docker compose restart ``` ::: diff --git a/docs/administrator_documentation/uninstall_docs/docker.md b/docs/administrator_documentation/uninstall_docs/docker.md index ab9a5a355..7453b7899 100644 --- a/docs/administrator_documentation/uninstall_docs/docker.md +++ b/docs/administrator_documentation/uninstall_docs/docker.md @@ -24,7 +24,7 @@ Before you remove any data, you need to stop the Funkwhale containers. 2. Stop the containers ```{code-block} sh - docker-compose down + sudo docker compose down ``` ## Remove the reverse proxy @@ -80,7 +80,7 @@ This action is __irreversible__. Make sure you have [backed up your data](../upg Once you have stopped the containers, you can delete all containers and associated volumes. ```{code-block} sh -docker-compose rm -fsv +sudo docker compose rm -fsv ``` ## Remove the Funkwhale directory diff --git a/docs/administrator_documentation/upgrade_docs/backup.md b/docs/administrator_documentation/upgrade_docs/backup.md index 54c70d0b1..6ef6eb0a7 100644 --- a/docs/administrator_documentation/upgrade_docs/backup.md +++ b/docs/administrator_documentation/upgrade_docs/backup.md @@ -19,7 +19,7 @@ Before performing big changes, we recommend you back up your database and media :sync: docker ```{code-block} sh - docker-compose exec postgres pg_dumpall -c -U postgres > dump_`date +%d-%m-%Y"_"%H_%M_%S`.sql + sudo docker compose exec postgres pg_dumpall -c -U postgres > dump_`date +%d-%m-%Y"_"%H_%M_%S`.sql ``` ::: @@ -126,13 +126,13 @@ To restore your database, do the following: 1. Restore your database backup. ```{code-block} sh - docker-compose run --rm -T postgres psql -U postgres postgres < "/path/to/your/backup/dump.sql" + sudo docker compose run --rm -T postgres psql -U postgres postgres < "/path/to/your/backup/dump.sql" ``` 2. Run the `funkwhale-manage migrate` command to set up the database. ```{code-block} sh - docker-compose run --rm api funkwhale-manage migrate + sudo 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 972274c8e..3379b7a68 100644 --- a/docs/administrator_documentation/upgrade_docs/docker.md +++ b/docs/administrator_documentation/upgrade_docs/docker.md @@ -29,28 +29,35 @@ If you installed Funkwhale following the [Docker guide](../installation_docs/doc nano .env ``` -6. Load the configuration from your `.env` file. +6. Log in as `su` to load the configuration from your `.env` file. ```{code-block} sh + sudo su source .env ``` 7. Pull the updated containers. ```{code-block} sh - docker-compose pull + docker compose pull ``` 8. Apply the database migrations. ```{code-block} sh - docker-compose run --rm api funkwhale-manage migrate + docker compose run --rm api funkwhale-manage migrate ``` 9. Relaunch your containers. ```{code-block} sh - docker-compose up -d + docker compose up -d + ``` + +10. Exit the root shell. + + ```{code-block} sh + exit ``` That’s it! You’ve updated your Funkwhale pod. You should now see the new version running in your web browser. @@ -76,13 +83,13 @@ To upgrade postgres on Docker we use the [`postgres-upgrade`](https://hub.docker 3. Stop the postgres container. This means no data changes while you are upgrading. ```{code-block} sh - docker-compose stop postgres + sudo docker compose stop postgres ``` 4. Run the migration using the `postgres-upgrade` container. This creates a new version of the database in the `/srv/funkwhale/data/postgres-new` directory. ```{code-block} sh - docker run --rm \ + sudo -E docker run --rm \ -v $(pwd)/data/postgres:/var/lib/postgresql/${OLD_POSTGRES}/data \ -v $(pwd)/data/postgres-new:/var/lib/postgresql/${NEW_POSTGRES}/data \ tianon/postgres-upgrade:${OLD_POSTGRES}-to-${NEW_POSTGRES} @@ -104,13 +111,13 @@ To upgrade postgres on Docker we use the [`postgres-upgrade`](https://hub.docker 7. Pull the new postgres version. ```{code-block} sh - docker-compose pull + sudo docker compose pull ``` 8. Restart your containers. ```{code-block} sh - docker-compose up -d + sudo docker compose up -d ``` That's it! Your Funkwhale pod is now running the new version of postgres. The old database is available in `/srv/funkwhale/data/postgres-old`. You can back this up and remove it from your server once you've confirmed everything is working. diff --git a/docs/contributor_documentation/documentation.md b/docs/contributor_documentation/documentation.md index 35120e862..7589d786e 100644 --- a/docs/contributor_documentation/documentation.md +++ b/docs/contributor_documentation/documentation.md @@ -47,19 +47,19 @@ We provide a docker container for our documentation to make it easy to work on d 2. Create a dummy federation network ```{code-block} sh - docker network create federation + sudo docker network create federation ``` 3. Build the container ```{code-block} sh - docker-compose -f dev.yml build docs + sudo docker compose -f dev.yml build docs ``` 4. Run the container ```{code-block} sh - docker-compose -f dev.yml up docs + sudo docker compose -f dev.yml up docs ``` A real-time preview of the documentation is available on `http://0.0.0.1:8001` diff --git a/docs/developer_documentation/contribute/api.md b/docs/developer_documentation/contribute/api.md index af7e0ba74..bd85f86df 100644 --- a/docs/developer_documentation/contribute/api.md +++ b/docs/developer_documentation/contribute/api.md @@ -36,7 +36,7 @@ Try to keep your tests small and focused. Each test should test a single functio Test files must target a module and follow the `funkwhale_api` directory structure. If you write tests for `funkwhale_api/myapp/views.py`, you should put them in `tests/myapp/test_views.py`. ``` -We provide utilities and fixtures to make writing tests as easy as possible. You can see the list of available fixtures by running `docker-compose -f dev.yml run --rm api pytest --fixtures`. +We provide utilities and fixtures to make writing tests as easy as possible. You can see the list of available fixtures by running `sudo docker compose -f dev.yml run --rm api pytest --fixtures`. ### Factories @@ -134,17 +134,17 @@ def test_downgrade_not_superuser_skips_email(factories, mocker): You can run all tests in the pytest suite with the following command: ```sh -docker-compose -f dev.yml run --rm api pytest +sudo docker compose -f dev.yml run --rm api pytest ``` Run a specific test file by calling pytest against it: ```sh -docker-compose -f dev.yml run --rm api pytest tests/music/test_models.py +sudo docker compose -f dev.yml run --rm api pytest tests/music/test_models.py ``` You can check the full list of options by passing the `-h` flag: ```sh -docker-compose -f dev.yml run --rm api pytest -h +sudo docker compose -f dev.yml run --rm api pytest -h ``` diff --git a/docs/developer_documentation/contribute/frontend.md b/docs/developer_documentation/contribute/frontend.md index ccd64b65d..c962bd955 100644 --- a/docs/developer_documentation/contribute/frontend.md +++ b/docs/developer_documentation/contribute/frontend.md @@ -26,11 +26,11 @@ The Funkwhale frontend contains some tests to catch errors before changes go liv To run the test suite, run the following command: ```sh -docker-compose -f dev.yml run --rm front yarn test:unit +sudo docker compose -f dev.yml run --rm front yarn test:unit ``` To run tests as you make changes, launch the test suite with the `-w` flag: ```sh -docker-compose -f dev.yml run --rm front yarn test:unit -w +sudo docker compose -f dev.yml run --rm front yarn test:unit -w ``` diff --git a/docs/developer_documentation/plugins/install.md b/docs/developer_documentation/plugins/install.md index aab94ef08..12bc0cd19 100644 --- a/docs/developer_documentation/plugins/install.md +++ b/docs/developer_documentation/plugins/install.md @@ -40,7 +40,7 @@ You can install third-party plugins using the `funkwhale-manage` command line in :::{tab-item} Docker ```{code-block} shell - docker-compose run --rm api funkwhale-manage fw plugins install https://plugin_url.zip + sudo 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 68365cefe..b6fd48edd 100644 --- a/docs/developer_documentation/setup/docker.md +++ b/docs/developer_documentation/setup/docker.md @@ -3,7 +3,7 @@ Funkwhale can be run in Docker containers for local development. You can work on any part of the Funkwhale codebase and run the container setup to test your changes. To work with Docker: 1. [Install Docker](https://docs.docker.com/install) -2. [Install docker-compose](https://docs.docker.com/compose/install) +2. [Install docker compose](https://docs.docker.com/compose/install) 3. Clone the Funkwhale repository to your system. The `develop` branch is checked out by default ::::{tab-set} @@ -32,7 +32,7 @@ Funkwhale can be run in Docker containers for local development. You can work on ````{note} -Funkwhale provides a `dev.yml` file that contains the required docker-compose setup. You need to pass the `-f dev.yml` flag you run docker-compose commands to ensure it uses this file. If you don't want to add this each time, you can export it as a `COMPOSE_FILE` variable: +Funkwhale provides a `dev.yml` file that contains the required docker compose setup. You need to pass the `-f dev.yml` flag you run docker compose commands to ensure it uses this file. If you don't want to add this each time, you can export it as a `COMPOSE_FILE` variable: ```sh export COMPOSE_FILE=dev.yml @@ -58,13 +58,13 @@ To set up your Docker environment: 3. Create a network for federation support ```sh - docker network create federation + sudo docker network create federation ``` Once you've set everything up, you need to build the containers. Run this command any time there are upstream changes or dependency changes to ensure you're up-to-date. ```sh -docker-compose -f dev.yml build +sudo docker compose -f dev.yml build ``` ## Set up the database @@ -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 `funkwhale-manage migrate` command: ```sh -docker-compose -f dev.yml run --rm api funkwhale-manage migrate +sudo 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 funkwhale-manage createsuperuser + sudo 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 funkwhale-manage shell -i python + echo $command | sudo docker compose -f dev.yml run --rm -T api funkwhale-manage shell -i python ``` ## Manage services @@ -102,13 +102,13 @@ Once you have set up your containers, bring them up to start working on them. 1. Compile the translations: ```sh - docker-compose -f dev.yml run --rm front yarn run i18n-compile + sudo docker compose -f dev.yml run --rm front yarn run i18n-compile ``` 2. Launch all services: ```sh - docker-compose -f dev.yml up front api nginx celeryworker + sudo docker compose -f dev.yml up front api nginx celeryworker ``` This gives you access to the following: @@ -120,13 +120,13 @@ This gives you access to the following: Once you're done with the containers, you can stop them all: ```sh -docker-compose -f dev.yml stop +sudo docker compose -f dev.yml stop ``` If you want to destroy your containers, run the following: ```sh -docker-compose -f dev.yml down -v +sudo docker compose -f dev.yml down -v ``` ## Set up federation support @@ -186,7 +186,7 @@ To run a reverse proxy for your app: 2. Launch traefik using the bundled configuration: ```sh - docker-compose -f docker/traefik.yml up -d + sudo docker compose -f docker/traefik.yml up -d ``` 3. Set up as many different projects as you need. Make sure the `COMPOSE_PROJECT_NAME` and `VUE_PORT` variables are unique per instance @@ -194,9 +194,9 @@ 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 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 + sudo docker compose -f dev.yml run --rm api funkwhale-manage migrate + sudo docker compose -f dev.yml run --rm api funkwhale-manage createsuperuser + sudo docker compose -f dev.yml up nginx api front nginx api celeryworker ``` You can access your project at `https://{COMPOSE_PROJECT_NAME}.funkwhale.test`.