Standardize code blocks

This commit is contained in:
Ciarán Ainsworth 2022-10-26 22:19:16 +02:00 committed by Georg Krause
parent fa1417c4f6
commit 5dfc2c341d
28 changed files with 323 additions and 323 deletions

View File

@ -27,7 +27,7 @@ Running `fix_federation_ids` with the `--no-dry-run` flag is irreversible. Make
:::{tab-item} Debian :::{tab-item} Debian
:sync: debian :sync: debian
```{code} bash ```{code-block} sh
poetry run python manage.py fix_federation_ids https://old-url https://new-url --no-dry-run --no-input poetry run python manage.py fix_federation_ids https://old-url https://new-url --no-dry-run --no-input
``` ```
@ -36,7 +36,7 @@ Running `fix_federation_ids` with the `--no-dry-run` flag is irreversible. Make
:::{tab-item} Docker :::{tab-item} Docker
:sync: docker :sync: docker
```{code} bash ```{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 python manage.py fix_federation_ids https://old-url https://new-url --no-dry-run --no-input
``` ```
@ -76,7 +76,7 @@ Running `fix_federation_ids` with the `--no-dry-run` flag is irreversible. Make
:::{tab-item} Nginx :::{tab-item} Nginx
:sync: nginx :sync: nginx
```{code} bash ```{code-block} sh
sudo systemctl restart nginx sudo systemctl restart nginx
``` ```
@ -85,7 +85,7 @@ Running `fix_federation_ids` with the `--no-dry-run` flag is irreversible. Make
:::{tab-item} Apache :::{tab-item} Apache
:sync: apache :sync: apache
```{code} bash ```{code-block} sh
sudo systemctl restart apache2 sudo systemctl restart apache2
``` ```

View File

@ -9,7 +9,7 @@ You need to restart your Funkwhale services after changing your `.env` file.
:::{tab-item} Debian :::{tab-item} Debian
:sync: debian :sync: debian
```{code} bash ```{code-block} sh
sudo systemctl restart funkwhale.target sudo systemctl restart funkwhale.target
``` ```
@ -18,7 +18,7 @@ You need to restart your Funkwhale services after changing your `.env` file.
:::{tab-item} Docker :::{tab-item} Docker
:sync: docker :sync: docker
```{code} bash ```{code-block} sh
docker-compose restart docker-compose restart
``` ```

View File

@ -11,19 +11,19 @@ To customize your Funkwhale pod, you need to serve a {file}`settings.json` file
1. SSH into your Funkwhale server. 1. SSH into your Funkwhale server.
2. Navigate to your `/srv/funkwhale` folder 2. Navigate to your `/srv/funkwhale` folder
```{code} bash ```{code-block} sh
cd /srv/funkwhale cd /srv/funkwhale
``` ```
3. Create a new `custom` directory for your file. 3. Create a new `custom` directory for your file.
```{code} bash ```{code-block} sh
mkdir custom mkdir custom
``` ```
4. Create a new config file and populate it with placeholder settings. 4. Create a new config file and populate it with placeholder settings.
```{code} bash ```{code-block} sh
cat <<EOF > custom/settings.json cat <<EOF > custom/settings.json
{ {
"additionalStylesheets": [], "additionalStylesheets": [],
@ -67,7 +67,7 @@ Once you've created your {file}`settings.json` file you need to configure your r
Add the following snippet to your {file}`/etc/nginx/sites-available/funkwhale.conf` config file: Add the following snippet to your {file}`/etc/nginx/sites-available/funkwhale.conf` config file:
```{code} text ```{code-block} text
location /settings.json { location /settings.json {
alias /srv/funkwhale/custom; alias /srv/funkwhale/custom;
} }
@ -80,7 +80,7 @@ location /settings.json {
Add the following snippet to your webserver configuration: Add the following snippet to your webserver configuration:
```{code} text ```{code-block} text
Alias /settings.json /srv/funkwhale/custom/settings.json Alias /settings.json /srv/funkwhale/custom/settings.json
``` ```
@ -95,13 +95,13 @@ You can use a custom stylesheet to theme your Funkwhale pod. To do this:
1. Navigate to your {file}`/srv/funkwhale/custom` directory. 1. Navigate to your {file}`/srv/funkwhale/custom` directory.
```{code} bash ```{code-block} sh
cd /srv/funkwhale/custom cd /srv/funkwhale/custom
``` ```
2. Copy your CSS file to this directory, or create a new one. 2. Copy your CSS file to this directory, or create a new one.
```{code} bash ```{code-block} sh
# A basic CSS file. Turns the pod's background red. # A basic CSS file. Turns the pod's background red.
cat <<EOF > custom.css cat <<EOF > custom.css
@ -113,7 +113,7 @@ You can use a custom stylesheet to theme your Funkwhale pod. To do this:
3. Add the location of your CSS file to the `additionalStylesheets` parameter in your {file}`settings.json` file. 3. Add the location of your CSS file to the `additionalStylesheets` parameter in your {file}`settings.json` file.
```{code} bash ```{code-block} sh
nano settings.json nano settings.json
# Add ["/front/custom/custom.css"] to the additionalStylesheets parameter # Add ["/front/custom/custom.css"] to the additionalStylesheets parameter
@ -133,7 +133,7 @@ You can use a custom stylesheet to theme your Funkwhale pod. To do this:
Add the following to your {file}`/etc/nginx/sites-available/funkwhale.conf` file: Add the following to your {file}`/etc/nginx/sites-available/funkwhale.conf` file:
```{code} text ```{code-block} text
location /custom { location /custom {
alias /srv/funkwhale/custom; alias /srv/funkwhale/custom;
} }
@ -146,7 +146,7 @@ You can use a custom stylesheet to theme your Funkwhale pod. To do this:
Add the following to your webserver configuration file. Add the following to your webserver configuration file.
```{code} text ```{code-block} text
Alias /custom /srv/funkwhale/custom Alias /custom /srv/funkwhale/custom
<Directory "/srv/funkwhale/custom"> <Directory "/srv/funkwhale/custom">

View File

@ -27,7 +27,7 @@ MRF policies are written as Python 3 functions that take at least one `payload`
In the example below we write a policy that discards all Follow requests from listed domains: In the example below we write a policy that discards all Follow requests from listed domains:
```{code} py ```{code-block} py
import urllib.parse import urllib.parse
from funkwhale_api.moderation import mrf from funkwhale_api.moderation import mrf
@ -54,7 +54,7 @@ def blocked_follow_domains_policy(payload, **kwargs):
You need to store this code in a Funkwhale plugin. To create one, execute the following: You need to store this code in a Funkwhale plugin. To create one, execute the following:
```{code} bash ```{code-block} sh
# Plugin names can only contain ASCII letters, numbers and underscores. # Plugin names can only contain ASCII letters, numbers and underscores.
export PLUGIN_NAME="myplugin" export PLUGIN_NAME="myplugin"
@ -89,7 +89,7 @@ To make the job of writing and debugging MRF policies easier, we provide a manag
:::{tab-item} Debian :::{tab-item} Debian
:sync: debian :sync: debian
```{code} bash ```{code-block} sh
poetry run python manage.py mrf_check --list poetry run python manage.py mrf_check --list
``` ```
@ -98,7 +98,7 @@ To make the job of writing and debugging MRF policies easier, we provide a manag
:::{tab-item} Docker :::{tab-item} Docker
:sync: docker :sync: docker
```{code} bash ```{code-block} sh
docker-compose run --rm api python manage.py mrf_check --list docker-compose run --rm api python manage.py mrf_check --list
``` ```
@ -112,7 +112,7 @@ To make the job of writing and debugging MRF policies easier, we provide a manag
:::{tab-item} Debian :::{tab-item} Debian
:sync: debian :sync: debian
```{code} bash ```{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 python manage.py mrf_check inbox - -p blocked_follow_domains
``` ```
@ -122,7 +122,7 @@ To make the job of writing and debugging MRF policies easier, we provide a manag
:::{tab-item} Docker :::{tab-item} Docker
:sync: docker :sync: docker
```{code} bash ```{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 python manage.py mrf_check inbox - -p blocked_follow_domains
``` ```
@ -136,7 +136,7 @@ To make the job of writing and debugging MRF policies easier, we provide a manag
:::{tab-item} Debian :::{tab-item} Debian
:sync: debian :sync: debian
```{code} bash ```{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 python manage.py mrf_check inbox - -p blocked_follow_domains
``` ```
@ -146,7 +146,7 @@ To make the job of writing and debugging MRF policies easier, we provide a manag
:::{tab-item} Docker :::{tab-item} Docker
:sync: docker :sync: docker
```{code} bash ```{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 python manage.py mrf_check inbox - -p blocked_follow_domains
``` ```
@ -161,7 +161,7 @@ To make the job of writing and debugging MRF policies easier, we provide a manag
:::{tab-item} Debian :::{tab-item} Debian
:sync: debian :sync: debian
```{code} bash ```{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 python manage.py mrf_check inbox $ACTIVITY_UUID -p blocked_follow_domains
``` ```
@ -171,7 +171,7 @@ To make the job of writing and debugging MRF policies easier, we provide a manag
:::{tab-item} Docker :::{tab-item} Docker
:sync: docker :sync: docker
```{code} bash ```{code-block} sh
export ACTIVITY_UUID="06208aea-c687-4e8b-aefd-22f1c3f76039" export ACTIVITY_UUID="06208aea-c687-4e8b-aefd-22f1c3f76039"
@ -189,7 +189,7 @@ There are extra options for testing MRF policies. Check the command help for mor
:::{tab-item} Debian :::{tab-item} Debian
:sync: debian :sync: debian
```{code} bash ```{code-block} sh
poetry run python manage.py mrf_check --help poetry run python manage.py mrf_check --help
``` ```
@ -198,7 +198,7 @@ There are extra options for testing MRF policies. Check the command help for mor
:::{tab-item} Docker :::{tab-item} Docker
:sync: docker :sync: docker
```{code} ```{code-block} sh
docker-compose run --rm api python manage.py mrf_check --help docker-compose run --rm api python manage.py mrf_check --help
``` ```

View File

@ -13,7 +13,7 @@ Before you begin, you need to secure your object store. Many S3-compatible store
To prevent listing content, add the following policy to your S3-compatible object store. To prevent listing content, add the following policy to your S3-compatible object store.
```{code} json ```{code-block} json
{ {
"Version": "2012-10-17", "Version": "2012-10-17",
"Statement": [ "Statement": [
@ -38,7 +38,7 @@ To prevent listing content, add the following policy to your S3-compatible objec
If you're using `awscli`, you can store this policy in a `/tmp/policy` file and apply it using the following command: If you're using `awscli`, you can store this policy in a `/tmp/policy` file and apply it using the following command:
```{code} bash ```{code-block} sh
aws s3api put-bucket-policy --bucket <yourbucketname> --policy file:///tmp/policy aws s3api put-bucket-policy --bucket <yourbucketname> --policy file:///tmp/policy
``` ```
@ -93,7 +93,7 @@ Serving files from an object store requires some changes to the reverse proxy.
:::{tab-item} Debian :::{tab-item} Debian
:sync: debian :sync: debian
```{code} bash ```{code-block} sh
sudo nano /etc/nginx/sites-available/funkwhale.template sudo nano /etc/nginx/sites-available/funkwhale.template
``` ```
@ -102,7 +102,7 @@ Serving files from an object store requires some changes to the reverse proxy.
:::{tab-item} Docker :::{tab-item} Docker
:sync: docker :sync: docker
```{code} bash ```{code-block} sh
nano /srv/funkwhale/nginx/funkwhale.template nano /srv/funkwhale/nginx/funkwhale.template
``` ```
@ -111,7 +111,7 @@ Serving files from an object store requires some changes to the reverse proxy.
2. Comment out the `location /_protected/media/` block by adding a `#` to the start of each line. 2. Comment out the `location /_protected/media/` block by adding a `#` to the start of each line.
```{code} ```{code-block} text
# location /_protected/media/ { # location /_protected/media/ {
# internal; # internal;
# alias ${MEDIA_ROOT}; # alias ${MEDIA_ROOT};
@ -120,7 +120,7 @@ Serving files from an object store requires some changes to the reverse proxy.
3. Uncomment the `location ~ /_protected/media/(.+)` block by removing the `#` from the start of each line. 3. Uncomment the `location ~ /_protected/media/(.+)` block by removing the `#` from the start of each line.
```{code} ```{code-block} text
location ~ /_protected/media/(.+) { location ~ /_protected/media/(.+) {
internal; internal;
proxy_set_header Authorization ""; proxy_set_header Authorization "";
@ -130,13 +130,13 @@ Serving files from an object store requires some changes to the reverse proxy.
4. Add your S3 store URL to the `img-src` and `media-src` headers. 4. Add your S3 store URL to the `img-src` and `media-src` headers.
```{code} ```{code-block} text
add_header Content-Security-Policy "...img-src 'self' https://<your-s3-URL> data:;...media-src https://<your-s3-URL> 'self' data:"; add_header Content-Security-Policy "...img-src 'self' https://<your-s3-URL> data:;...media-src https://<your-s3-URL> 'self' data:";
``` ```
5. Test your Nginx configuration. 5. Test your Nginx configuration.
```{code} bash ```{code-block} sh
sudo nginx -t sudo nginx -t
``` ```
@ -147,7 +147,7 @@ Serving files from an object store requires some changes to the reverse proxy.
:::{tab-item} Debian :::{tab-item} Debian
:sync: debian :sync: debian
```{code} bash ```{code-block} sh
sudo systemctl restart funkwhale.target sudo systemctl restart funkwhale.target
sudo systemctl restart nginx sudo systemctl restart nginx
``` ```
@ -157,7 +157,7 @@ Serving files from an object store requires some changes to the reverse proxy.
:::{tab-item} Docker :::{tab-item} Docker
:sync: docker :sync: docker
```{code} bash ```{code-block} sh
docker-compose restart docker-compose restart
sudo systemctl restart nginx sudo systemctl restart nginx
``` ```
@ -173,13 +173,13 @@ That's it! Files are now uploaded to and stored from your S3 bucket.
You may see the following error when streaming music from your S3-compatible store: You may see the following error when streaming music from your S3-compatible store:
```{code} ```{code-block} text
[error] 2832#2832: *1 no resolver defined to resolve [address] client: [IP], server: [servername], request: "GET API request", host: "[your_domain]", referrer: "[your_domain/library]" [error] 2832#2832: *1 no resolver defined to resolve [address] client: [IP], server: [servername], request: "GET API request", host: "[your_domain]", referrer: "[your_domain/library]"
``` ```
This happens when the Nginx config is unable to use your servers DNS resolver. We're still looking into this issue. You can work around this by adding a resolver to the `location ~/_protected/media/(.+)` block. This happens when the Nginx config is unable to use your servers DNS resolver. We're still looking into this issue. You can work around this by adding a resolver to the `location ~/_protected/media/(.+)` block.
```{code} ```{code-block} text
location ~ /_protected/media/(.+) { location ~ /_protected/media/(.+) {
resolver 1.1.1.1; resolver 1.1.1.1;
internal; internal;

View File

@ -23,19 +23,19 @@ Celery uses a `prefork` pool by default. This enables the server to process many
1. Open your `funkwhale-worker` unit file in an editor. 1. Open your `funkwhale-worker` unit file in an editor.
```{code} bash ```{code-block} sh
sudo nano /etc/systemd/system/funkwhale-worker.service sudo nano /etc/systemd/system/funkwhale-worker.service
``` ```
2. Add the `--pool=solo` flag to the `ExecStart` line of your unit file. 2. Add the `--pool=solo` flag to the `ExecStart` line of your unit file.
```{code} text ```{code-block} text
ExecStart=/srv/funkwhale/.local/bin/poetry run celery -A --pool=solo funkwhale_api.taskapp worker -l INFO --concurrency=${CELERYD_CONCURRENCY} ExecStart=/srv/funkwhale/.local/bin/poetry run celery -A --pool=solo funkwhale_api.taskapp worker -l INFO --concurrency=${CELERYD_CONCURRENCY}
``` ```
3. Restart the Celery service. 3. Restart the Celery service.
```{code} bash ```{code-block} sh
sudo systemctl restart funkwhale-worker.service sudo systemctl restart funkwhale-worker.service
``` ```
@ -46,7 +46,7 @@ Celery uses a `prefork` pool by default. This enables the server to process many
1. Add the `--pool=solo` flag to the `celerybeat` command in `docker-compose.yml`. 1. Add the `--pool=solo` flag to the `celerybeat` command in `docker-compose.yml`.
```{code} yaml ```{code-block} yaml
celerybeat: celerybeat:
command: celery -A --pool=solo funkwhale_api.taskapp beat --pidfile= -l INFO command: celery -A --pool=solo funkwhale_api.taskapp beat --pidfile= -l INFO
@ -54,7 +54,7 @@ Celery uses a `prefork` pool by default. This enables the server to process many
2. Restart Celery. 2. Restart Celery.
```{code} bash ```{code-block} sh
docker-compose restart celerybeat docker-compose restart celerybeat
``` ```

View File

@ -14,7 +14,7 @@ To see a full list of options, run the command with the `--help` flag.
:::{tab-item} Debian :::{tab-item} Debian
:sync: debian :sync: debian
```{code} bash ```{code-block} sh
poetry run python manage.py import_files --help poetry run python manage.py import_files --help
``` ```
@ -23,7 +23,7 @@ poetry run python manage.py import_files --help
:::{tab-item} Docker :::{tab-item} Docker
:sync: docker :sync: docker
```{code} bash ```{code-block} sh
docker-compose run --rm api python manage.py import_files --help docker-compose run --rm api python manage.py import_files --help
``` ```
@ -52,7 +52,7 @@ If you don't have music on your server, you can download creative commons music
3. Run the shell script against the music list to download the tracks. 3. Run the shell script against the music list to download the tracks.
```{code} bash ```{code-block} sh
./download-tracks.sh music.txt ./download-tracks.sh music.txt
``` ```
@ -78,19 +78,19 @@ Once you have your library ID, you can copy content from your server and import
1. Log in to your server and navigate to your Funkwhale directory. 1. Log in to your server and navigate to your Funkwhale directory.
```{code} bash ```{code-block} sh
cd /srv/funkwhale cd /srv/funkwhale
``` ```
2. Export your library ID to reference it later. In this example, the library ID is "769a2bc3". Replace this with your library ID. 2. Export your library ID to reference it later. In this example, the library ID is "769a2bc3". Replace this with your library ID.
```{code} bash ```{code-block} sh
export LIBRARY_ID="769a2bc3" export LIBRARY_ID="769a2bc3"
``` ```
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} bash ```{code-block} sh
poetry run python manage.py import_files $LIBRARY_ID "data/music" --recursive --noinput poetry run python manage.py import_files $LIBRARY_ID "data/music" --recursive --noinput
``` ```
@ -111,7 +111,7 @@ We recommend you symbolically link your music directories to `/srv/funkwhale/dat
To link your storage directory to the Funkwhale store, use the `ln -s` command. For example, if you have an NFS share at `/media/nfsshare`, you can link it to a folder like this: To link your storage directory to the Funkwhale store, use the `ln -s` command. For example, if you have an NFS share at `/media/nfsshare`, you can link it to a folder like this:
```{code} bash ```{code-block} sh
ln -s ln -s /media/mynfsshare /srv/funkwhale/data/music/nfsshare ln -s ln -s /media/mynfsshare /srv/funkwhale/data/music/nfsshare
``` ```
@ -124,7 +124,7 @@ You can then run the `import_files` command against `/srv/funkwhale/data/music/n
On a Docker install you can use bind mounts to reference your storage directory. To do this, you need to add the directory to the `api` and `celeryworker` blocks in your `docker-compose.yml` file. For example, if you have an NFS share at `/media/nfsshare`, you can add the following to your `docker-compose.yml` file: On a Docker install you can use bind mounts to reference your storage directory. To do this, you need to add the directory to the `api` and `celeryworker` blocks in your `docker-compose.yml` file. For example, if you have an NFS share at `/media/nfsshare`, you can add the following to your `docker-compose.yml` file:
```{code} yaml ```{code-block} yaml
celeryworker: celeryworker:
volumes: volumes:
- ./data/music:/music:ro - ./data/music:/music:ro
@ -160,20 +160,20 @@ To use the in-place import method, follow these steps:
1. Log in to your server and navigate to your Funkwhale directory. 1. Log in to your server and navigate to your Funkwhale directory.
```{code} bash ```{code-block} sh
cd /srv/funkwhale cd /srv/funkwhale
``` ```
2. Add your storage location to your `.env` file if you don't want to link it to the Funkwhale store. See the [in-place import configuration variables](../configuration_docs/env_file.md#in-place-import-configuration) for more information. 2. Add your storage location to your `.env` file if you don't want to link it to the Funkwhale store. See the [in-place import configuration variables](../configuration_docs/env_file.md#in-place-import-configuration) for more information.
3. Export your library ID to reference it later. In this example, the library ID is "769a2bc3". Replace this with your library ID. 3. Export your library ID to reference it later. In this example, the library ID is "769a2bc3". Replace this with your library ID.
```{code} bash ```{code-block} sh
export LIBRARY_ID="769a2bc3" export LIBRARY_ID="769a2bc3"
``` ```
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} bash ```{code-block} sh
poetry run python manage.py import_files $LIBRARY_ID "/srv/funkwhale/data/music/nfsshare/" --recursive --noinput --in-place poetry run python manage.py import_files $LIBRARY_ID "/srv/funkwhale/data/music/nfsshare/" --recursive --noinput --in-place
``` ```
@ -187,7 +187,7 @@ Funkwhale imports the music in your storage directory into the specified library
1. Add your storage location to your `.env` file if you don't want to bind it to the Funkwhale store. See the [in-place import configuration variables](../configuration_docs/env_file.md#in-place-import-configuration) for more information. 1. Add your storage location to your `.env` file if you don't want to bind it to the Funkwhale store. See the [in-place import configuration variables](../configuration_docs/env_file.md#in-place-import-configuration) for more information.
2. Run your import command against your music storage directory: 2. Run your import command against your music storage directory:
```{code} bash ```{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 python manage.py import_files $LIBRARY_ID "/srv/funkwhale/data/music/nfsshare/" --recursive --noinput --in-place
``` ```
@ -215,7 +215,7 @@ The `--watch` flag performs the following actions when it detects a change:
- File metadata updated updates the track metadata in the database. - File metadata updated updates the track metadata in the database.
- File deleted removes the file from the database. - File deleted removes the file from the database.
:::dropdown} Watched metadata :::{dropdown} Watched metadata
The `import_files --watch` command watches for changes to the following metadata fields: The `import_files --watch` command watches for changes to the following metadata fields:
@ -240,7 +240,7 @@ The `import_files --watch` command watches for changes to the following metadata
:::{tab-item} Debian :::{tab-item} Debian
:sync: debian :sync: debian
```{code} bash ```{code-block} sh
poetry run python manage.py import_files $LIBRARY_ID "/srv/funkwhale/data/music/nfsshare/" --recursive --noinput --in-place --watch poetry run python manage.py import_files $LIBRARY_ID "/srv/funkwhale/data/music/nfsshare/" --recursive --noinput --in-place --watch
``` ```
@ -249,7 +249,7 @@ poetry run python manage.py import_files $LIBRARY_ID "/srv/funkwhale/data/music/
:::{tab-item} Docker :::{tab-item} Docker
:sync: docker :sync: docker
```{code} bash ```{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 python manage.py import_files $LIBRARY_ID "/srv/funkwhale/data/music/nfsshare/" --recursive --noinput --in-place --watch
``` ```
@ -271,7 +271,7 @@ You can use the `--prune` flag with the `--watch` flag. This means Funkwhale rem
:::{tab-item} Debian :::{tab-item} Debian
:sync: debian :sync: debian
```{code} bash ```{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 python manage.py import_files $LIBRARY_ID "/srv/funkwhale/data/music/nfsshare/" --recursive --noinput --in-place --watch --prune
``` ```
@ -280,7 +280,7 @@ poetry run python manage.py import_files $LIBRARY_ID "/srv/funkwhale/data/music/
:::{tab-item} Docker :::{tab-item} Docker
:sync: docker :sync: docker
```{code} bash ```{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 python manage.py import_files $LIBRARY_ID "/srv/funkwhale/data/music/nfsshare/" --recursive --noinput --in-place --watch --prune
``` ```

View File

@ -17,7 +17,7 @@ We support [Debian](https://debian.org) and Debian-based Linux distributions. Fo
- Install `curl` - Install `curl`
```{code} bash ```{code-block} sh
sudo apt update # update apt cache sudo apt update # update apt cache
sudo apt install curl sudo apt install curl
``` ```
@ -26,7 +26,7 @@ We support [Debian](https://debian.org) and Debian-based Linux distributions. Fo
To install Funkwhale on your server, you first need to install its dependencies. We provide all dependencies in a single file to enable you to install everything at once. You can pass the information from this file to `apt` using the following command: To install Funkwhale on your server, you first need to install its dependencies. We provide all dependencies in a single file to enable you to install everything at once. You can pass the information from this file to `apt` using the following command:
```{code} bash ```{code-block} sh
sudo apt install $(curl https://dev.funkwhale.audio/funkwhale/funkwhale/-/raw/$FUNKWHALE_VERSION/deploy/requirements.apt) sudo apt install $(curl https://dev.funkwhale.audio/funkwhale/funkwhale/-/raw/$FUNKWHALE_VERSION/deploy/requirements.apt)
``` ```
@ -40,19 +40,19 @@ 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`. 1. Create the `funkwhale` user and set its shell to `bash` and its home directory to `/srv/funkwhale`.
```{code} bash ```{code-block} sh
sudo useradd -r -s /usr/bin/bash -d /srv/funkwhale -m funkwhale sudo useradd -r -s /usr/bin/bash -d /srv/funkwhale -m funkwhale
``` ```
2. Create a password for the user. You need to do this so that you can use this user to perform database administration. 2. Create a password for the user. You need to do this so that you can use this user to perform database administration.
```{code} bash ```{code-block} sh
sudo passwd funkwhale sudo passwd funkwhale
``` ```
3. Finally, give the user `sudo` privileges. You need to do this so that the user can run administrative tasks. 3. Finally, give the user `sudo` privileges. You need to do this so that the user can run administrative tasks.
```{code} ```{code-block} sh
usermod -aG sudo funkwhale usermod -aG sudo funkwhale
``` ```
@ -66,20 +66,20 @@ Once you've created your `funkwhale` user you can download the Funkwhale softwar
1. Log in to your `funkwhale` account and go to the `/srv/funkwhale` directory. 1. Log in to your `funkwhale` account and go to the `/srv/funkwhale` directory.
```{code} bash ```{code-block} sh
cd /srv/funkwhale cd /srv/funkwhale
su funkwhale su funkwhale
``` ```
2. Create the directories for Funkwhale. 2. Create the directories for Funkwhale.
```{code} bash ```{code-block} sh
mkdir -p config api data/static data/media data/music front mkdir -p config api data/static data/media data/music front
``` ```
That's it! Your directory structure should look like this: That's it! Your directory structure should look like this:
```{code} ```{code-block} text
. .
├── config # config / environment files ├── config # config / environment files
├── api # the Funkwhale API ├── api # the Funkwhale API
@ -96,7 +96,7 @@ Once you've created the directory structure you can download Funkwhale. Funkwhal
1. Download the API. 1. Download the API.
```{code} bash ```{code-block} sh
curl -L -o "api-$FUNKWHALE_VERSION.zip" "https://dev.funkwhale.audio/funkwhale/funkwhale/-/jobs/artifacts/$FUNKWHALE_VERSION/download?job=build_api" curl -L -o "api-$FUNKWHALE_VERSION.zip" "https://dev.funkwhale.audio/funkwhale/funkwhale/-/jobs/artifacts/$FUNKWHALE_VERSION/download?job=build_api"
unzip "api-$FUNKWHALE_VERSION.zip" -d extracted unzip "api-$FUNKWHALE_VERSION.zip" -d extracted
mv extracted/api/* api/ mv extracted/api/* api/
@ -105,7 +105,7 @@ Once you've created the directory structure you can download Funkwhale. Funkwhal
2. Download the frontend 2. Download the frontend
```{code} bash ```{code-block} sh
curl -L -o "front-$FUNKWHALE_VERSION.zip" "https://dev.funkwhale.audio/funkwhale/funkwhale/-/jobs/artifacts/$FUNKWHALE_VERSION/download?job=build_front" curl -L -o "front-$FUNKWHALE_VERSION.zip" "https://dev.funkwhale.audio/funkwhale/funkwhale/-/jobs/artifacts/$FUNKWHALE_VERSION/download?job=build_front"
unzip "front-$FUNKWHALE_VERSION.zip" -d extracted unzip "front-$FUNKWHALE_VERSION.zip" -d extracted
mv extracted/front . mv extracted/front .
@ -120,20 +120,20 @@ The Funkwhale API is written in Python. You need to install the API's dependenci
1. Install Poetry. Follow the steps in this wizard to set it up. 1. Install Poetry. Follow the steps in this wizard to set it up.
```{code} bash ```{code-block} sh
curl -sSL https://install.python-poetry.org | python3 - curl -sSL https://install.python-poetry.org | python3 -
``` ```
2. Add Poetry to your `$PATH`. This allows you to use `poetry` commands. 2. Add Poetry to your `$PATH`. This allows you to use `poetry` commands.
```{code} bash ```{code-block} sh
export "PATH=$HOME/.local/bin:$PATH" >> ~/.bashrc export "PATH=$HOME/.local/bin:$PATH" >> ~/.bashrc
echo 'export "PATH=$HOME/.local/bin:$PATH"' >> ~/.bashrc echo 'export "PATH=$HOME/.local/bin:$PATH"' >> ~/.bashrc
``` ```
3. Set up poetry in your `/srv/funkwhale/api` directory. 3. Set up poetry in your `/srv/funkwhale/api` directory.
```{code} bash ```{code-block} sh
cd /srv/funkwhale/api cd /srv/funkwhale/api
poetry install poetry install
``` ```
@ -146,25 +146,25 @@ The environment file contains options you can use to control your Funkwhale pod.
1. Download the `.env` template to your `/srv/funkwhale/config` directory. 1. Download the `.env` template to your `/srv/funkwhale/config` directory.
```{code} bash ```{code-block} sh
curl -L -o /srv/funkwhale/config/.env "https://dev.funkwhale.audio/funkwhale/funkwhale/raw/$FUNKWHALE_VERSION/deploy/env.prod.sample" curl -L -o /srv/funkwhale/config/.env "https://dev.funkwhale.audio/funkwhale/funkwhale/raw/$FUNKWHALE_VERSION/deploy/env.prod.sample"
``` ```
2. Generate a secret key for Django. This keeps your Funkwhale data secure. Do not share this key with anybody. 2. Generate a secret key for Django. This keeps your Funkwhale data secure. Do not share this key with anybody.
```{code} bash ```{code-block} sh
openssl rand -base64 45 openssl rand -base64 45
``` ```
3. Reduce the permissions on your `.env` file to `600`. This means that only the `funkwhale` user can read and write this file. 3. Reduce the permissions on your `.env` file to `600`. This means that only the `funkwhale` user can read and write this file.
```{code} bash ```{code-block} sh
chmod 600 /srv/funkwhale/config/.env chmod 600 /srv/funkwhale/config/.env
``` ```
4. Open the `.env` file in a text editor. For this example, we will use `nano`. 4. Open the `.env` file in a text editor. For this example, we will use `nano`.
```{code} bash ```{code-block} sh
nano /srv/funkwhale/config/.env nano /srv/funkwhale/config/.env
``` ```
@ -172,13 +172,13 @@ The environment file contains options you can use to control your Funkwhale pod.
- Paste the secret key in the `DJANGO_SECRET_KEY` field. - Paste the secret key in the `DJANGO_SECRET_KEY` field.
- Populate the `DATABASE_URL` field: - Populate the `DATABASE_URL` field:
```{code} ```{code-block} text
DATABASE_URL=postgresql://funkwhale@:5432/funkwhale DATABASE_URL=postgresql://funkwhale@:5432/funkwhale
``` ```
- Populate the `CACHE_URL` field: - Populate the `CACHE_URL` field:
```{code} ```{code-block} text
CACHE_URL=redis://127.0.0.1:6379/0 CACHE_URL=redis://127.0.0.1:6379/0
``` ```
@ -194,45 +194,45 @@ Funkwhale uses a [PostgreSQL](https://www.postgresql.org/) database to store inf
1. Install PostgreSQL and the `postgresql-contrib` package. This package contains extra features that Funkwhale uses. 1. Install PostgreSQL and the `postgresql-contrib` package. This package contains extra features that Funkwhale uses.
```{code} bash ```{code-block} sh
sudo apt-get install postgresql postgresql-contrib sudo apt-get install postgresql postgresql-contrib
``` ```
2. Once you've installed PostgreSQL, launch a `psql` shell as the `postgres` user to set up your database. 2. Once you've installed PostgreSQL, launch a `psql` shell as the `postgres` user to set up your database.
```{code} bash ```{code-block} sh
sudo -u postgres psql sudo -u postgres psql
``` ```
3. Create your Funkwhale database. 3. Create your Funkwhale database.
```{code} psql ```{code-block} psql
CREATE DATABASE funkwhale WITH ENCODING 'utf8'; CREATE DATABASE funkwhale WITH ENCODING 'utf8';
``` ```
4. Create a user for Funkwhale. This user needs all privileges so it can manage the database. 4. Create a user for Funkwhale. This user needs all privileges so it can manage the database.
```{code} psql ```{code-block} psql
CREATE USER funkwhale; CREATE USER funkwhale;
GRANT ALL PRIVILEGES ON DATABASE funkwhale TO funkwhale; GRANT ALL PRIVILEGES ON DATABASE funkwhale TO funkwhale;
``` ```
5. Once you're finished, exit the shell 5. Once you're finished, exit the shell
```{code} psql ```{code-block} psql
exit exit
``` ```
6. Run the following commands to create extra extensions for the `funkwhale` database. 6. Run the following commands to create extra extensions for the `funkwhale` database.
```{code} bash ```{code-block} sh
sudo -u postgres psql funkwhale -c 'CREATE EXTENSION "unaccent";' sudo -u postgres psql funkwhale -c 'CREATE EXTENSION "unaccent";'
sudo -u postgres psql funkwhale -c 'CREATE EXTENSION "citext";' 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 `manage.py` script to create the database structure.
```{code} bash ```{code-block} sh
cd /srv/funkwhale/api cd /srv/funkwhale/api
poetry run python manage.py migrate poetry run python manage.py migrate
``` ```
@ -240,7 +240,7 @@ Funkwhale uses a [PostgreSQL](https://www.postgresql.org/) database to store inf
````{note} ````{note}
You may see the following warning when applying migrations: You may see the following warning when applying migrations:
```{code} ```{code-block} text
"Your models have changes that are not yet reflected in a migration, and so won't be applied." "Your models have changes that are not yet reflected in a migration, and so won't be applied."
``` ```
@ -261,7 +261,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} bash ```{code-block} sh
poetry run python manage.py createsuperuser poetry run python manage.py createsuperuser
``` ```
@ -271,7 +271,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} bash ```{code-block} sh
poetry run python manage.py collectstatic poetry run python manage.py collectstatic
``` ```
@ -281,7 +281,7 @@ Funkwhale uses [systemd](https://www.freedesktop.org/wiki/Software/systemd/) to
1. Download the sample unit files from Funkwhale. 1. Download the sample unit files from Funkwhale.
```{code} bash ```{code-block} sh
sudo curl -L -o "/etc/systemd/system/funkwhale.target" "https://dev.funkwhale.audio/funkwhale/funkwhale/raw/$FUNKWHALE_VERSION/deploy/funkwhale.target" sudo curl -L -o "/etc/systemd/system/funkwhale.target" "https://dev.funkwhale.audio/funkwhale/funkwhale/raw/$FUNKWHALE_VERSION/deploy/funkwhale.target"
sudo curl -L -o "/etc/systemd/system/funkwhale-server.service" "https://dev.funkwhale.audio/funkwhale/funkwhale/raw/$FUNKWHALE_VERSION/deploy/funkwhale-server.service" sudo curl -L -o "/etc/systemd/system/funkwhale-server.service" "https://dev.funkwhale.audio/funkwhale/funkwhale/raw/$FUNKWHALE_VERSION/deploy/funkwhale-server.service"
sudo curl -L -o "/etc/systemd/system/funkwhale-worker.service" "https://dev.funkwhale.audio/funkwhale/funkwhale/raw/$FUNKWHALE_VERSION/deploy/funkwhale-worker.service" sudo curl -L -o "/etc/systemd/system/funkwhale-worker.service" "https://dev.funkwhale.audio/funkwhale/funkwhale/raw/$FUNKWHALE_VERSION/deploy/funkwhale-worker.service"
@ -290,19 +290,19 @@ Funkwhale uses [systemd](https://www.freedesktop.org/wiki/Software/systemd/) to
2. Reload systemd to register the new services. 2. Reload systemd to register the new services.
```{code} bash ```{code-block} sh
sudo systemctl daemon-reload sudo systemctl daemon-reload
``` ```
3. Start all Funkwhale services. 3. Start all Funkwhale services.
```{code} bash ```{code-block} sh
sudo systemctl start funkwhale.target sudo systemctl start funkwhale.target
``` ```
4. Enable the services. Systemd can then start the services after a reboot. 4. Enable the services. Systemd can then start the services after a reboot.
```{code} bash ```{code-block} sh
sudo systemctl enable --now funkwhale.target sudo systemctl enable --now funkwhale.target
``` ```
@ -314,21 +314,21 @@ Funkwhale uses a reverse proxy to serve content to users. We use [Nginx](https:/
1. Install Nginx. 1. Install Nginx.
```{code} bash ```{code-block} sh
sudo apt-get update sudo apt-get update
sudo apt-get install nginx sudo apt-get install nginx
``` ```
2. Download the Nginx templates from Funkwhale. 2. Download the Nginx templates from Funkwhale.
```{code} bash ```{code-block} sh
sudo curl -L -o /etc/nginx/funkwhale_proxy.conf "https://dev.funkwhale.audio/funkwhale/funkwhale/raw/$FUNKWHALE_VERSION/deploy/funkwhale_proxy.conf" sudo curl -L -o /etc/nginx/funkwhale_proxy.conf "https://dev.funkwhale.audio/funkwhale/funkwhale/raw/$FUNKWHALE_VERSION/deploy/funkwhale_proxy.conf"
sudo curl -L -o /etc/nginx/sites-available/funkwhale.template "https://dev.funkwhale.audio/funkwhale/funkwhale/raw/$FUNKWHALE_VERSION/deploy/nginx.template" sudo curl -L -o /etc/nginx/sites-available/funkwhale.template "https://dev.funkwhale.audio/funkwhale/funkwhale/raw/$FUNKWHALE_VERSION/deploy/nginx.template"
``` ```
3. Create an Nginx template with details from your `.env` file. 3. Create an Nginx template with details from your `.env` file.
```{code} bash ```{code-block} sh
# Log in to a root shell. # Log in to a root shell.
sudo su sudo su
@ -351,7 +351,7 @@ Funkwhale uses a reverse proxy to serve content to users. We use [Nginx](https:/
That's it! You've created your Nginx file. Run the following command to check the `.env` details populated correctly. That's it! You've created your Nginx file. Run the following command to check the `.env` details populated correctly.
```{code} bash ```{code-block} sh
grep '${' /etc/nginx/sites-enabled/funkwhale.conf grep '${' /etc/nginx/sites-enabled/funkwhale.conf
``` ```
@ -361,31 +361,31 @@ To enable your users to connect to your pod securely, you need to set up {abbr}`
1. Log in as the superuser account to run these commands. 1. Log in as the superuser account to run these commands.
```{code} bash ```{code-block} sh
su su
``` ```
2. Create the `/etc/certs` folder to store the certificates. 2. Create the `/etc/certs` folder to store the certificates.
```{code} bash ```{code-block} sh
mkdir /etc/certs mkdir /etc/certs
``` ```
3. Download and run `acme.sh`. Replace `my@example.com` with your email address. 3. Download and run `acme.sh`. Replace `my@example.com` with your email address.
```{code} bash ```{code-block} sh
curl https://get.acme.sh | sh -s email=my@example.com curl https://get.acme.sh | sh -s email=my@example.com
``` ```
4. Generate a certificate. Replace `example.com` with your Funkwhale pod name. Use `/srv/funkwhale/front` as your web root folder. 4. Generate a certificate. Replace `example.com` with your Funkwhale pod name. Use `/srv/funkwhale/front` as your web root folder.
```{code} bash ```{code-block} sh
acme.sh --issue -d example.com -w /srv/funkwhale/front acme.sh --issue -d example.com -w /srv/funkwhale/front
``` ```
5. Install the certificate to your Nginx config. Replace `example.com` with your Funkwhale pod name. 5. Install the certificate to your Nginx config. Replace `example.com` with your Funkwhale pod name.
```{code} bash ```{code-block} sh
acme.sh --install-cert -d example.com \ acme.sh --install-cert -d example.com \
--key-file /etc/certs/key.pem \ --key-file /etc/certs/key.pem \
--fullchain-file /etc/certs/cert.pem \ --fullchain-file /etc/certs/cert.pem \

View File

@ -21,7 +21,7 @@ This guide assumes you are using a [Debian](https://debian.org)-based system.
- 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 [Docker Compose](https://docs.docker.com/compose/install/).
- Install `curl`. - Install `curl`.
```{code} bash ```{code-block} sh
sudo apt update # update apt cache sudo apt update # update apt cache
sudo apt install curl sudo apt install curl
``` ```
@ -30,19 +30,19 @@ This guide assumes you are using a [Debian](https://debian.org)-based system.
1. Create the project directory structure. 1. Create the project directory structure.
```{code} bash ```{code-block} sh
mkdir /srv/funkwhale /srv/funkwhale/nginx mkdir /srv/funkwhale /srv/funkwhale/nginx
``` ```
2. Navigate to the project directory 2. Navigate to the project directory
```{code} bash ```{code-block} sh
cd /srv/funkwhale 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} bash ```{code-block} sh
curl -L -o /srv/funkwhale/docker-compose.yml "https://dev.funkwhale.audio/funkwhale/funkwhale/raw/${FUNKWHALE_VERSION}/deploy/docker-compose.yml" curl -L -o /srv/funkwhale/docker-compose.yml "https://dev.funkwhale.audio/funkwhale/funkwhale/raw/${FUNKWHALE_VERSION}/deploy/docker-compose.yml"
``` ```
@ -54,31 +54,31 @@ The environment file contains options you can use to control your Funkwhale pod.
1. Download the `.env` template to your `/srv/funkwhale` directory. 1. Download the `.env` template to your `/srv/funkwhale` directory.
```{code} bash ```{code-block} sh
curl -L -o /srv/funkwhale/.env "https://dev.funkwhale.audio/funkwhale/funkwhale/raw/${FUNKWHALE_VERSION}/deploy/env.prod.sample" curl -L -o /srv/funkwhale/.env "https://dev.funkwhale.audio/funkwhale/funkwhale/raw/${FUNKWHALE_VERSION}/deploy/env.prod.sample"
``` ```
2. Update `FUNKWHALE_VERSION` in the `.env` file to the `$FUNKWHALE_VERSION` variable you set earlier. 2. Update `FUNKWHALE_VERSION` in the `.env` file to the `$FUNKWHALE_VERSION` variable you set earlier.
```{code} bash ```{code-block} sh
sed -i "s/FUNKWHALE_VERSION=latest/FUNKWHALE_VERSION=$FUNKWHALE_VERSION/" .env sed -i "s/FUNKWHALE_VERSION=latest/FUNKWHALE_VERSION=$FUNKWHALE_VERSION/" .env
``` ```
3. Reduce the permissions on your `.env` file to `600`. This means that only your user can read and write this file. 3. Reduce the permissions on your `.env` file to `600`. This means that only your user can read and write this file.
```{code} bash ```{code-block} sh
chmod 600 /srv/funkwhale/.env chmod 600 /srv/funkwhale/.env
``` ```
4. Generate a secret key for Django. This keeps your Funkwhale data secure. Do not share this key with anybody. 4. Generate a secret key for Django. This keeps your Funkwhale data secure. Do not share this key with anybody.
```{code} bash ```{code-block} sh
openssl rand -base64 45 openssl rand -base64 45
``` ```
5. Open the `.env` file in a text editor. For this example, we will use `nano`. 5. Open the `.env` file in a text editor. For this example, we will use `nano`.
```{code} bash ```{code-block} sh
nano /srv/funkwhale/.env nano /srv/funkwhale/.env
``` ```
@ -96,27 +96,27 @@ Once you've filled in your environment file, you can set up Funkwhale. Follow th
1. Pull the containers to download all the required services. 1. Pull the containers to download all the required services.
```{code} bash ```{code-block} sh
cd /srv/funkwhale cd /srv/funkwhale
docker-compose pull docker-compose pull
``` ```
2. Bring up the database container so you can run the database migrations. 2. Bring up the database container so you can run the database migrations.
```{code} bash ```{code-block} sh
docker-compose up -d postgres docker-compose up -d postgres
``` ```
3. Run the database migrations. 3. Run the database migrations.
```{code} bash ```{code-block} sh
docker-compose run --rm api python manage.py migrate docker-compose run --rm api python manage.py migrate
``` ```
````{note} ````{note}
You may see the following warning when applying migrations: You may see the following warning when applying migrations:
```{code} ```{code-block} text
"Your models have changes that are not yet reflected in a migration, and so won't be applied." "Your models have changes that are not yet reflected in a migration, and so won't be applied."
``` ```
@ -125,13 +125,13 @@ Once you've filled in your environment file, you can set up Funkwhale. Follow th
4. Create your superuser. 4. Create your superuser.
```{code} bash ```{code-block} sh
docker-compose run --rm api python manage.py createsuperuser docker-compose run --rm api python manage.py createsuperuser
``` ```
5. Launch all the containers to bring up your pod. 5. Launch all the containers to bring up your pod.
```{code} bash ```{code-block} sh
docker-compose up -d docker-compose up -d
``` ```
@ -143,21 +143,21 @@ Funkwhale uses a reverse proxy to serve content to users. We use [Nginx](https:/
1. Install Nginx. 1. Install Nginx.
```{code} bash ```{code-block} sh
sudo apt-get update sudo apt-get update
sudo apt-get install nginx sudo apt-get install nginx
``` ```
2. Download the Nginx templates from Funkwhale. 2. Download the Nginx templates from Funkwhale.
```{code} bash ```{code-block} sh
sudo curl -L -o /etc/nginx/funkwhale_proxy.conf "https://dev.funkwhale.audio/funkwhale/funkwhale/raw/$FUNKWHALE_VERSION/deploy/funkwhale_proxy.conf" sudo curl -L -o /etc/nginx/funkwhale_proxy.conf "https://dev.funkwhale.audio/funkwhale/funkwhale/raw/$FUNKWHALE_VERSION/deploy/funkwhale_proxy.conf"
sudo curl -L -o /etc/nginx/sites-available/funkwhale.template "https://dev.funkwhale.audio/funkwhale/funkwhale/raw/$FUNKWHALE_VERSION/deploy/docker.proxy.template" sudo curl -L -o /etc/nginx/sites-available/funkwhale.template "https://dev.funkwhale.audio/funkwhale/funkwhale/raw/$FUNKWHALE_VERSION/deploy/docker.proxy.template"
``` ```
3. Create an Nginx template with details from your `.env` file. 3. Create an Nginx template with details from your `.env` file.
```{code} bash ```{code-block} sh
# Log in to a root shell. # Log in to a root shell.
sudo su sudo su
@ -180,7 +180,7 @@ Funkwhale uses a reverse proxy to serve content to users. We use [Nginx](https:/
That's it! You've created your Nginx file. Run the following command to check the `.env` details populated correctly. That's it! You've created your Nginx file. Run the following command to check the `.env` details populated correctly.
```{code} bash ```{code-block} sh
grep '${' /etc/nginx/sites-enabled/funkwhale.conf grep '${' /etc/nginx/sites-enabled/funkwhale.conf
``` ```
@ -190,31 +190,31 @@ To enable your users to connect to your pod securely, you need to set up {abbr}`
1. Log in as the superuser account to run these commands. 1. Log in as the superuser account to run these commands.
```{code} bash ```{code-block} sh
su su
``` ```
2. Create the `/etc/certs` folder to store the certificates. 2. Create the `/etc/certs` folder to store the certificates.
```{code} bash ```{code-block} sh
mkdir /etc/certs mkdir /etc/certs
``` ```
3. Download and run `acme.sh`. Replace `my@example.com` with your email address. 3. Download and run `acme.sh`. Replace `my@example.com` with your email address.
```{code} bash ```{code-block} sh
curl https://get.acme.sh | sh -s email=my@example.com curl https://get.acme.sh | sh -s email=my@example.com
``` ```
4. Generate a certificate. Replace `example.com` with your Funkwhale pod name. Use `/srv/funkwhale/front` as your web root folder. 4. Generate a certificate. Replace `example.com` with your Funkwhale pod name. Use `/srv/funkwhale/front` as your web root folder.
```{code} bash ```{code-block} sh
acme.sh --issue -d example.com -w /srv/funkwhale/front acme.sh --issue -d example.com -w /srv/funkwhale/front
``` ```
5. Install the certificate to your Nginx config. Replace `example.com` with your Funkwhale pod name. 5. Install the certificate to your Nginx config. Replace `example.com` with your Funkwhale pod name.
```{code} bash ```{code-block} sh
acme.sh --install-cert -d example.com \ acme.sh --install-cert -d example.com \
--key-file /etc/certs/key.pem \ --key-file /etc/certs/key.pem \
--fullchain-file /etc/certs/cert.pem \ --fullchain-file /etc/certs/cert.pem \

View File

@ -45,7 +45,7 @@ On your {term}`destination server`, follow the [installation guide](debian.md).
Once you have finished the installation, stop the Funkwhale services. These shouldn't be running when you copy your existing data over. Once you have finished the installation, stop the Funkwhale services. These shouldn't be running when you copy your existing data over.
```{code} bash ```{code-block} sh
sudo systemctl stop funkwhale.target sudo systemctl stop funkwhale.target
``` ```
@ -61,7 +61,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. Once you have finished the installation, stop the Funkwhale services. These shouldn't be running when you copy your existing data over.
```{code} bash ```{code-block} sh
docker-compose stop docker-compose stop
``` ```
@ -77,7 +77,7 @@ You need to create a database backup on your {term}`original server` so that you
:::{tab-item} Debian :::{tab-item} Debian
:sync: debian :sync: debian
```{code} bash ```{code-block} sh
sudo -u postgres -H pg_dump funkwhale > /srv/funkwhale/dump.sql sudo -u postgres -H pg_dump funkwhale > /srv/funkwhale/dump.sql
``` ```
@ -86,7 +86,7 @@ sudo -u postgres -H pg_dump funkwhale > /srv/funkwhale/dump.sql
:::{tab-item} Docker :::{tab-item} Docker
:sync: docker :sync: docker
```{code} bash ```{code-block} sh
docker-compose exec postgres pg_dumpall -c -U postgres > dump.sql docker-compose exec postgres pg_dumpall -c -U postgres > dump.sql
``` ```
@ -107,14 +107,14 @@ To do this:
1. Log in to your {term}`destination server`. 1. Log in to your {term}`destination server`.
2. Export your server hostname or IP address and your user name on the server. In this example, the IP address is `123.123.123.123` and the username is `funkwhale`. 2. Export your server hostname or IP address and your user name on the server. In this example, the IP address is `123.123.123.123` and the username is `funkwhale`.
```{code} bash ```{code-block} sh
export ORIGIN="123.123.123.123" export ORIGIN="123.123.123.123"
export USERNAME="funkwhale" export USERNAME="funkwhale"
``` ```
3. Use `rsync` to copy the information to your {term}`destination server`. 3. Use `rsync` to copy the information to your {term}`destination server`.
```{code} bash ```{code-block} sh
rsync -a $username@$origin:/srv/funkwhale/data/media/ /srv/funkwhale/data/media/ rsync -a #Copy the media folder rsync -a $username@$origin:/srv/funkwhale/data/media/ /srv/funkwhale/data/media/ rsync -a #Copy the media folder
$username@$origin:/srv/funkwhale/data/music/ /srv/funkwhale/data/music/ rsync -a # Copy the music folder $username@$origin:/srv/funkwhale/data/music/ /srv/funkwhale/data/music/ rsync -a # Copy the music folder
$username@$origin:/srv/funkwhale/config/.env /srv/funkwhale/config/ rsync -a # Copy the .env file $username@$origin:/srv/funkwhale/config/.env /srv/funkwhale/config/ rsync -a # Copy the .env file
@ -132,13 +132,13 @@ When you've copied everything to the {term}`destination server`, you need to imp
Run the following on your {term}`destination server`: Run the following on your {term}`destination server`:
```{code} bash ```{code-block} sh
sudo psql -d funkwhale dump.sql 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 `manage.py migrate` command to set up the database.
```{code} bash ```{code-block} sh
cd /srv/funkwhale/api cd /srv/funkwhale/api
poetry run python manage.py migrate poetry run python manage.py migrate
``` ```
@ -152,7 +152,7 @@ You need to initialize the postgres container on your {term}`destination server`
1. Export the permissions and create an `init.sql` database dump. 1. Export the permissions and create an `init.sql` database dump.
```{code} bash ```{code-block} sh
echo "CREATE DATABASE "funkwhale" WITH ENCODING 'utf8'; \ echo "CREATE DATABASE "funkwhale" WITH ENCODING 'utf8'; \
CREATE USER funkwhale; \ CREATE USER funkwhale; \
GRANT ALL PRIVILEGES ON DATABASE funkwhale TO funkwhale;" > init.sql # Create an init.sql file with the correct permissions GRANT ALL PRIVILEGES ON DATABASE funkwhale TO funkwhale;" > init.sql # Create an init.sql file with the correct permissions
@ -162,13 +162,13 @@ You need to initialize the postgres container on your {term}`destination server`
2. Import your database backup. 2. Import your database backup.
```{code} bash ```{code-block} sh
docker-compose run --rm postgres psql -U postgres -d postgres < "dump.sql" 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 `manage.py migrate` command to set up the database.
```{code} bash ```{code-block} sh
docker-compose run --rm api python manage.py migrate docker-compose run --rm api python manage.py migrate
``` ```
@ -188,7 +188,7 @@ Once you confirm DNS points to your {term}`destination server`, start the Funkwh
:::{tab-item} Debian :::{tab-item} Debian
:sync: debian :sync: debian
```{code} bash ```{code-block} sh
sudo systemctl start funkwhale.target sudo systemctl start funkwhale.target
``` ```
@ -197,7 +197,7 @@ sudo systemctl start funkwhale.target
:::{tab-item} Docker :::{tab-item} Docker
:sync: docker :sync: docker
```{code} bash ```{code-block} sh
docker-compose up -d docker-compose up -d
``` ```

View File

@ -11,7 +11,7 @@ The quick install script is the easiest way to install Funkwhale. Run this scrip
To download the quick install script, install `curl`: To download the quick install script, install `curl`:
```{code} bash ```{code-block} sh
sudo apt update # update the apt cache sudo apt update # update the apt cache
sudo apt install curl sudo apt install curl
``` ```
@ -20,7 +20,7 @@ sudo apt install curl
Now that you have `curl` installed, download and run the quick install script: Now that you have `curl` installed, download and run the quick install script:
```{code} bash ```{code-block} sh
sudo sh -c "$(curl -sSL https://get.funkwhale.audio/)" sudo sh -c "$(curl -sSL https://get.funkwhale.audio/)"
``` ```

View File

@ -37,7 +37,7 @@ Use the following command to create a new library with a custom name and privacy
:::{tab-item} Debian :::{tab-item} Debian
:sync: debian :sync: debian
```{code-block} bash ```{code-block} sh
poetry run python manage.py create_library username1 --name="Library 1" --privacy-level="everyone" poetry run python manage.py create_library username1 --name="Library 1" --privacy-level="everyone"
``` ```
@ -46,7 +46,7 @@ poetry run python manage.py create_library username1 --name="Library 1" --privac
:::{tab-item} Docker :::{tab-item} Docker
:sync: docker :sync: docker
```{code-block} bash ```{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 python manage.py create_library username1 --name="Library 1" --privacy-level="everyone"
``` ```
@ -56,7 +56,7 @@ docker-compose run --rm api python manage.py create_library username1 --name="Li
### Returns ### Returns
```{code-block} text-output ```{code-block} text
Created library Library 1 for user username1 with UUID 436da05b-8cb1-4a4d-b870-4a3b235d8517 Created library Library 1 for user username1 with UUID 436da05b-8cb1-4a4d-b870-4a3b235d8517
``` ```
@ -69,7 +69,7 @@ You can create a library using only a username. The script substitutes default v
:::{tab-item} Debian :::{tab-item} Debian
:sync: debian :sync: debian
```{code-block} bash ```{code-block} sh
poetry run python manage.py create_library username1 poetry run python manage.py create_library username1
``` ```
@ -78,7 +78,7 @@ poetry run python manage.py create_library username1
:::{tab-item} Docker :::{tab-item} Docker
:sync: docker :sync: docker
```{code-block} bash ```{code-block} sh
docker-compose run --rm api python manage.py create_library username1 docker-compose run --rm api python manage.py create_library username1
``` ```
@ -88,7 +88,7 @@ docker-compose run --rm api python manage.py create_library username1
### Returns ### Returns
```{code-block} text-output ```{code-block} text
Created library default for user username1 with UUID 436da05b-8cb1-4a4d-b870-4a3b235d8517 Created library default for user username1 with UUID 436da05b-8cb1-4a4d-b870-4a3b235d8517
``` ```
@ -101,7 +101,7 @@ If a library with the same name already exists for the given user, the script wi
:::{tab-item} Debian :::{tab-item} Debian
:sync: debian :sync: debian
```{code-block} bash ```{code-block} sh
poetry run python manage.py create_library username1 --name="Library 1" --privacy-level="everyone" poetry run python manage.py create_library username1 --name="Library 1" --privacy-level="everyone"
``` ```
@ -110,7 +110,7 @@ poetry run python manage.py create_library username1 --name="Library 1" --privac
:::{tab-item} Docker :::{tab-item} Docker
:sync: docker :sync: docker
```{code-block} bash ```{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 python manage.py create_library username1 --name="Library 1" --privacy-level="everyone"
``` ```
@ -120,6 +120,6 @@ docker-compose run --rm api python manage.py create_library username1 --name="Li
### Returns ### Returns
```{code-block} text-output ```{code-block} text
Found existing library Library 1 for user username1 with UUID 436da05b-8cb1-4a4d-b870-4a3b235d8517 Found existing library Library 1 for user username1 with UUID 436da05b-8cb1-4a4d-b870-4a3b235d8517
``` ```

View File

@ -15,7 +15,7 @@ To ensure you don't remove data by accident, this command runs in dry run mode b
:::{tab-item} Debian :::{tab-item} Debian
:sync: debian :sync: debian
```{code} bash ```{code-block} sh
poetry run python manage.py check_inplace_files poetry run python manage.py check_inplace_files
``` ```
@ -24,7 +24,7 @@ poetry run python manage.py check_inplace_files
:::{tab-item} Docker :::{tab-item} Docker
:sync: docker :sync: docker
```{code} bash ```{code-block} sh
docker-compose run --rm api python manage.py check_inplace_files docker-compose run --rm api python manage.py check_inplace_files
``` ```

View File

@ -13,7 +13,7 @@ Check and fix file mimetypes with the `--mimetype` flag. This helps prevent issu
:::{tab-item} Debian :::{tab-item} Debian
:sync: debian :sync: debian
```{code} bash ```{code-block} sh
poetry run python manage.py fix_uploads --mimetype poetry run python manage.py fix_uploads --mimetype
``` ```
@ -22,7 +22,7 @@ poetry run python manage.py fix_uploads --mimetype
:::{tab-item} Docker :::{tab-item} Docker
:sync: docker :sync: docker
```{code} bash ```{code-block} sh
docker-compose run --rm api python manage.py fix_uploads --mimetype docker-compose run --rm api python manage.py fix_uploads --mimetype
``` ```
@ -38,7 +38,7 @@ Check and fix bitrate and duration with the `--audio-data` flag. This process ca
:::{tab-item} Debian :::{tab-item} Debian
:sync: debian :sync: debian
```{code} bash ```{code-block} sh
poetry run python manage.py fix_uploads --audio-data poetry run python manage.py fix_uploads --audio-data
``` ```
@ -47,7 +47,7 @@ poetry run python manage.py fix_uploads --audio-data
:::{tab-item} Docker :::{tab-item} Docker
:sync: docker :sync: docker
```{code} bash ```{code-block} sh
docker-compose run --rm api python manage.py fix_uploads --audio-data docker-compose run --rm api python manage.py fix_uploads --audio-data
``` ```
@ -63,7 +63,7 @@ Check and fix the file size with the `--size` flag.
:::{tab-item} Debian :::{tab-item} Debian
:sync: debian :sync: debian
```{code} bash ```{code-block} sh
poetry run python manage.py fix_uploads --size poetry run python manage.py fix_uploads --size
``` ```
@ -72,7 +72,7 @@ poetry run python manage.py fix_uploads --size
:::{tab-item} Docker :::{tab-item} Docker
:sync: docker :sync: docker
```{code} bash ```{code-block} sh
docker-compose run --rm api python manage.py fix_uploads --size docker-compose run --rm api python manage.py fix_uploads --size
``` ```
@ -88,7 +88,7 @@ Check and fix file checksums with the `--checksum` flag.
:::{tab-item} Debian :::{tab-item} Debian
:sync: debian :sync: debian
```{code} bash ```{code-block} sh
poetry run python manage.py fix_uploads --checksum poetry run python manage.py fix_uploads --checksum
``` ```
@ -97,7 +97,7 @@ poetry run python manage.py fix_uploads --checksum
:::{tab-item} Docker :::{tab-item} Docker
:sync: docker :sync: docker
```{code} bash ```{code-block} sh
docker-compose run --rm api python manage.py fix_uploads --checksum docker-compose run --rm api python manage.py fix_uploads --checksum
``` ```
@ -113,7 +113,7 @@ Choose the batch size you want to process with the `--batch-size` or -`s` flag.
:::{tab-item} Debian :::{tab-item} Debian
:sync: debian :sync: debian
```{code} bash ```{code-block} sh
poetry run python manage.py fix_uploads --batch-size 500 poetry run python manage.py fix_uploads --batch-size 500
``` ```
@ -122,7 +122,7 @@ poetry run python manage.py fix_uploads --batch-size 500
:::{tab-item} Docker :::{tab-item} Docker
:sync: docker :sync: docker
```{code} bash ```{code-block} sh
docker-compose run --rm api python manage.py fix_uploads --batch-size 500 docker-compose run --rm api python manage.py fix_uploads --batch-size 500
``` ```

View File

@ -42,7 +42,7 @@ docker-compose run --rm api python manage.py prune_library --tracks
:::{tab-item} Debian :::{tab-item} Debian
:sync: debian :sync: debian
```{code} bash ```{code-block} sh
poetry run python manage.py prune_library --albums poetry run python manage.py prune_library --albums
``` ```
@ -51,7 +51,7 @@ poetry run python manage.py prune_library --albums
:::{tab-item} Docker :::{tab-item} Docker
:sync: docker :sync: docker
```{code} bash ```{code-block} sh
docker-compose run --rm api python manage.py prune_library --albums docker-compose run --rm api python manage.py prune_library --albums
``` ```
@ -65,7 +65,7 @@ docker-compose run --rm api python manage.py prune_library --albums
:::{tab-item} Debian :::{tab-item} Debian
:sync: debian :sync: debian
```{code} bash ```{code-block} sh
poetry run python manage.py prune_library --artists poetry run python manage.py prune_library --artists
``` ```
@ -74,7 +74,7 @@ poetry run python manage.py prune_library --artists
:::{tab-item} Docker :::{tab-item} Docker
:sync: docker :sync: docker
```{code} bash ```{code-block} sh
docker-compose run --rm api python manage.py prune_library --artists docker-compose run --rm api python manage.py prune_library --artists
``` ```
@ -88,7 +88,7 @@ docker-compose run --rm api python manage.py prune_library --artists
:::{tab-item} Debian :::{tab-item} Debian
:sync: debian :sync: debian
```{code} bash ```{code-block} sh
poetry run python manage.py prune_library --tracks --albums --artists poetry run python manage.py prune_library --tracks --albums --artists
``` ```
@ -97,7 +97,7 @@ poetry run python manage.py prune_library --tracks --albums --artists
:::{tab-item} Docker :::{tab-item} Docker
:sync: docker :sync: docker
```{code} bash ```{code-block} sh
docker-compose run --rm api python manage.py prune_library --tracks --albums --artists docker-compose run --rm api python manage.py prune_library --tracks --albums --artists
``` ```
@ -111,7 +111,7 @@ There are extra options for pruning your database. Check the command help for mo
:::{tab-item} Debian :::{tab-item} Debian
:sync: debian :sync: debian
```{code} bash ```{code-block} sh
poetry run python manage.py prune_library --help poetry run python manage.py prune_library --help
``` ```
@ -120,7 +120,7 @@ poetry run python manage.py prune_library --help
:::{tab-item} Docker :::{tab-item} Docker
:sync: docker :sync: docker
```{code} bash ```{code-block} sh
docker-compose run --rm api python manage.py prune_library --help docker-compose run --rm api python manage.py prune_library --help
``` ```

View File

@ -20,13 +20,13 @@ To add tags to untagged albums:
1. SSH into your Funkwhale server. 1. SSH into your Funkwhale server.
2. Navigate to the Funkwhale directory. 2. Navigate to the Funkwhale directory.
```{code} bash ```{code-block} sh
cd /srv/funkwhale cd /srv/funkwhale
``` ```
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} bash ```{code-block} sh
poetry run python manage.py fw albums add-tags-from-tracks poetry run python manage.py fw albums add-tags-from-tracks
``` ```
@ -38,13 +38,13 @@ To add tags to untagged albums:
1. SSH into your Funkwhale server. 1. SSH into your Funkwhale server.
2. Navigate to the Funkwhale directory. 2. Navigate to the Funkwhale directory.
```{code} bash ```{code-block} sh
cd /srv/funkwhale cd /srv/funkwhale
``` ```
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} bash ```{code-block} sh
docker-compose run --rm api python manage.py fw albums add-tags-from-tracks docker-compose run --rm api python manage.py fw albums add-tags-from-tracks
``` ```
@ -63,13 +63,13 @@ To add tags to untagged artists:
1. SSH into your Funkwhale server. 1. SSH into your Funkwhale server.
2. Navigate to the Funkwhale directory. 2. Navigate to the Funkwhale directory.
```{code} bash ```{code-block} sh
cd /srv/funkwhale cd /srv/funkwhale
``` ```
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} bash ```{code-block} sh
poetry run python manage.py fw artists add-tags-from-tracks poetry run python manage.py fw artists add-tags-from-tracks
``` ```
@ -81,13 +81,13 @@ To add tags to untagged artists:
1. SSH into your Funkwhale server. 1. SSH into your Funkwhale server.
2. Navigate to the Funkwhale directory. 2. Navigate to the Funkwhale directory.
```{code} bash ```{code-block} sh
cd /srv/funkwhale cd /srv/funkwhale
``` ```
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} bash ```{code-block} sh
docker-compose run --rm api python manage.py fw artists add-tags-from-tracks docker-compose run --rm api python manage.py fw artists add-tags-from-tracks
``` ```

View File

@ -16,19 +16,19 @@ To generate new thumbnails:
1. SSH into your Funkwhale server. 1. SSH into your Funkwhale server.
2. Navigate to your Funkwhale directory. 2. Navigate to your Funkwhale directory.
```{code} bash ```{code-block} sh
cd /srv/funkwhale cd /srv/funkwhale
``` ```
3. Delete the `__sized__` directory inside your `MEDIA_ROOT` directory. By default this is `/srv/funkwhale/data/media`. This directory contains the current thumbnails. 3. Delete the `__sized__` directory inside your `MEDIA_ROOT` directory. By default this is `/srv/funkwhale/data/media`. This directory contains the current thumbnails.
```{code} bash ```{code-block} sh
rm -r __sized__/ rm -r __sized__/
``` ```
4. Run the `manage.py` script to regenerate the thumbnails. 4. Run the `manage.py` script to regenerate the thumbnails.
```{code} bash ```{code-block} sh
poetry run python manage.py fw media generate-thumbnails poetry run python manage.py fw media generate-thumbnails
``` ```
@ -40,19 +40,19 @@ To generate new thumbnails:
1. SSH into your Funkwhale server. 1. SSH into your Funkwhale server.
2. Navigate to your Funkwhale directory. 2. Navigate to your Funkwhale directory.
```{code} bash ```{code-block} sh
cd /srv/funkwhale/ cd /srv/funkwhale/
``` ```
3. Delete the `__sized__` directory inside your `MEDIA_ROOT` directory. By default this is `/srv/funkwhale/data/media`. This directory contains the current thumbnails. 3. Delete the `__sized__` directory inside your `MEDIA_ROOT` directory. By default this is `/srv/funkwhale/data/media`. This directory contains the current thumbnails.
```{code} bash ```{code-block} sh
rm -r data/media/__sized__/ rm -r data/media/__sized__/
``` ```
4. Run the `manage.py` script to regenerate the thumbnails. 4. Run the `manage.py` script to regenerate the thumbnails.
```{code} bash ```{code-block} sh
docker-compose run --rm api python manage.py fw media generate-thumbnails docker-compose run --rm api python manage.py fw media generate-thumbnails
``` ```

View File

@ -15,7 +15,7 @@ You can create users with the {file}`manage.py` script. There are different ways
:::{tab-item} Debian :::{tab-item} Debian
:sync: debian :sync: debian
```{code} bash ```{code-block} sh
poetry run python manage.py fw users create poetry run python manage.py fw users create
``` ```
@ -24,7 +24,7 @@ poetry run python manage.py fw users create
:::{tab-item} Docker :::{tab-item} Docker
:sync: docker :sync: docker
```{code} bash ```{code-block} sh
docker-compose run --rm api python manage.py fw users create docker-compose run --rm api python manage.py fw users create
``` ```
@ -38,7 +38,7 @@ docker-compose run --rm api python manage.py fw users create
:::{tab-item} Debian :::{tab-item} Debian
:sync: debian :sync: debian
```{code} bash ```{code-block} sh
poetry run python manage.py fw users create --username <username> --email <user email> -p "" poetry run python manage.py fw users create --username <username> --email <user email> -p ""
``` ```
@ -47,7 +47,7 @@ poetry run python manage.py fw users create --username <username> --email <user
:::{tab-item} Docker :::{tab-item} Docker
:sync: docker :sync: docker
```{code} bash ```{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 python manage.py fw users create --username <username> --email <user email> -p ""
``` ```
@ -61,7 +61,7 @@ docker-compose run --rm api python manage.py fw users create --username <usernam
:::{tab-item} Debian :::{tab-item} Debian
:sync: debian :sync: debian
```{code} bash ```{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 python manage.py fw users create --username <username> --email <user email>
``` ```
@ -71,7 +71,7 @@ poetry run python manage.py fw users create --username <username> --email <user
:::{tab-item} Docker :::{tab-item} Docker
:sync: docker :sync: docker
```{code} bash ```{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 python manage.py fw users create --username <username> --email <user email>
``` ```
@ -86,7 +86,7 @@ There are extra options for user configuration, such as quota and {term}`permiss
:::{tab-item} Debian :::{tab-item} Debian
:sync: debian :sync: debian
```{code} bash ```{code-block} sh
poetry run python manage.py fw users --help poetry run python manage.py fw users --help
``` ```
@ -95,7 +95,7 @@ poetry run python manage.py fw users --help
:::{tab-item} Docker :::{tab-item} Docker
:sync: docker :sync: docker
```{code} bash ```{code-block} sh
docker-compose run --rm api python manage.py fw users --help docker-compose run --rm api python manage.py fw users --help
``` ```
@ -113,7 +113,7 @@ You can update user accounts using the {file}`manage.py` script. Update commands
:::{tab-item} Debian :::{tab-item} Debian
:sync: debian :sync: debian
```{code} bash ```{code-block} sh
poetry run python manage.py fw users set --upload-quota 500 <user> poetry run python manage.py fw users set --upload-quota 500 <user>
``` ```
@ -122,7 +122,7 @@ poetry run python manage.py fw users set --upload-quota 500 <user>
:::{tab-item} Docker :::{tab-item} Docker
:sync: docker :sync: docker
```{code} bash ```{code-block} sh
docker-compose run --rm api python manage.py fw users set --upload-quota 500 <user> docker-compose run --rm api python manage.py fw users set --upload-quota 500 <user>
``` ```
@ -136,7 +136,7 @@ docker-compose run --rm api python manage.py fw users set --upload-quota 500 <us
:::{tab-item} Debian :::{tab-item} Debian
:sync: debian :sync: debian
```{code} bash ```{code-block} sh
poetry run python manage.py fw users set --staff --superuser <user 1> <user 2> poetry run python manage.py fw users set --staff --superuser <user 1> <user 2>
``` ```
@ -145,7 +145,7 @@ poetry run python manage.py fw users set --staff --superuser <user 1> <user 2>
:::{tab-item} Docker :::{tab-item} Docker
:sync: docker :sync: docker
```{code} bash ```{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 python manage.py fw users set --staff --superuser <user 1> <user 2>
``` ```
@ -159,7 +159,7 @@ docker-compose run --rm api python manage.py fw users set --staff --superuser <u
:::{tab-item} Debian :::{tab-item} Debian
:sync: debian :sync: debian
```{code} bash ```{code-block} sh
poetry run python manage.py fw users set --no-staff --no-superuser <user> poetry run python manage.py fw users set --no-staff --no-superuser <user>
``` ```
@ -168,7 +168,7 @@ poetry run python manage.py fw users set --no-staff --no-superuser <user>
:::{tab-item} Docker :::{tab-item} Docker
:sync: docker :sync: docker
```{code} bash ```{code-block} sh
docker-compose run --rm api python manage.py fw users set --no-staff --no-superuser <user> docker-compose run --rm api python manage.py fw users set --no-staff --no-superuser <user>
``` ```
@ -182,7 +182,7 @@ docker-compose run --rm api python manage.py fw users set --no-staff --no-superu
:::{tab-item} Debian :::{tab-item} Debian
:sync: debian :sync: debian
```{code} bash ```{code-block} sh
poetry run python manage.py fw users set --permission-moderation <user> poetry run python manage.py fw users set --permission-moderation <user>
``` ```
@ -191,7 +191,7 @@ poetry run python manage.py fw users set --permission-moderation <user>
:::{tab-item} Docker :::{tab-item} Docker
:sync: docker :sync: docker
```{code} bash ```{code-block} sh
docker-compose run --rm api python manage.py fw users set --permission-moderation <user> docker-compose run --rm api python manage.py fw users set --permission-moderation <user>
``` ```
@ -205,7 +205,7 @@ docker-compose run --rm api python manage.py fw users set --permission-moderatio
:::{tab-item} Debian :::{tab-item} Debian
:sync: debian :sync: debian
```{code} bash ```{code-block} sh
poetry run python manage.py fw users set --password "<password>" <user> poetry run python manage.py fw users set --password "<password>" <user>
``` ```
@ -214,7 +214,7 @@ poetry run python manage.py fw users set --password "<password>" <user>
:::{tab-item} Docker :::{tab-item} Docker
:sync: docker :sync: docker
```{code} bash ```{code-block} sh
docker-compose run --rm api python manage.py fw users set --password "<password>" <user> docker-compose run --rm api python manage.py fw users set --password "<password>" <user>
``` ```
@ -228,7 +228,7 @@ docker-compose run --rm api python manage.py fw users set --password "<password>
:::{tab-item} Debian :::{tab-item} Debian
:sync: debian :sync: debian
```{code} bash ```{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 python manage.py fw users set <user>
``` ```
@ -238,7 +238,7 @@ poetry run python manage.py fw users set <user>
:::{tab-item} Docker :::{tab-item} Docker
:sync: docker :sync: docker
```{code} bash ```{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 python manage.py fw users set <user>
``` ```
@ -253,7 +253,7 @@ There are extra options for updating users. Check the command help for more opti
:::{tab-item} Debian :::{tab-item} Debian
:sync: debian :sync: debian
```{code} bash ```{code-block} sh
poetry run python manage.py fw users set --help poetry run python manage.py fw users set --help
``` ```
@ -262,7 +262,7 @@ poetry run python manage.py fw users set --help
:::{tab-item} Docker :::{tab-item} Docker
:sync: docker :sync: docker
```{code} bash ```{code-block} sh
docker-compose run --rm api python manage.py fw users set --help docker-compose run --rm api python manage.py fw users set --help
``` ```
@ -280,7 +280,7 @@ This prevents the same username being used in future.
:::{tab-item} Debian :::{tab-item} Debian
:sync: debian :sync: debian
```{code} py ```{code-block} py
poetry run python manage.py fw users rm <user> poetry run python manage.py fw users rm <user>
``` ```
@ -289,7 +289,7 @@ poetry run python manage.py fw users rm <user>
:::{tab-item} Docker :::{tab-item} Docker
:sync: docker :sync: docker
```{code} py ```{code-block} py
docker-compose run --rm api python manage.py fw users rm <user> docker-compose run --rm api python manage.py fw users rm <user>
``` ```
@ -305,7 +305,7 @@ This means the username can be reused.
:::{tab-item} Debian :::{tab-item} Debian
:sync: debian :sync: debian
```{code} py ```{code-block} py
poetry run python manage.py fw users rm --hard <user> poetry run python manage.py fw users rm --hard <user>
``` ```
@ -314,7 +314,7 @@ poetry run python manage.py fw users rm --hard <user>
:::{tab-item} Docker :::{tab-item} Docker
:sync: docker :sync: docker
```{code} py ```{code-block} py
docker-compose run --rm api python manage.py fw users rm --hard <user> docker-compose run --rm api python manage.py fw users rm --hard <user>
``` ```
@ -328,7 +328,7 @@ There are extra options for deleting users. Check the command help for more opti
:::{tab-item} Debian :::{tab-item} Debian
:sync: debian :sync: debian
```{code} bash ```{code-block} sh
poetry run python manage.py fw users rm --help poetry run python manage.py fw users rm --help
``` ```
@ -337,7 +337,7 @@ poetry run python manage.py fw users rm --help
:::{tab-item} Docker :::{tab-item} Docker
:sync: docker :sync: docker
```{code} bash ```{code-block} sh
docker-compose run --rm api python manage.py fw users rm --help docker-compose run --rm api python manage.py fw users rm --help
``` ```

View File

@ -13,20 +13,20 @@ Follow this guide to migrate a mono-container installation to a multi-container
1. Before you begin, log in as your `funkwhale` user 1. Before you begin, log in as your `funkwhale` user
```{code} bash ```{code-block} sh
sudo -u funkwhale -H bash sudo -u funkwhale -H bash
``` ```
2. Create a full backup of your `/srv/funkwhale` directory. 2. Create a full backup of your `/srv/funkwhale` directory.
```{code} bash ```{code-block} sh
cd /srv/ cd /srv/
sudo cp funkwhale funkwhale.bak sudo cp funkwhale funkwhale.bak
``` ```
3. Go to the original `/srv/funkwhale` folder to run the migration. 3. Go to the original `/srv/funkwhale` folder to run the migration.
```{code} bash ```{code-block} sh
cd /srv/funkwhale cd /srv/funkwhale
``` ```
@ -34,7 +34,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. 1. Create a backup of your Funkwhale database. We will import this into the new postgres container later.
```{code} bash ```{code-block} sh
docker-compose exec funkwhale /usr/bin/pg_dumpall -U funkwhale > db_dump.sql docker-compose exec funkwhale /usr/bin/pg_dumpall -U funkwhale > db_dump.sql
``` ```
@ -42,7 +42,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. 1. Stop all Funkwhale services. This ensures that no data is changed while you migrate your instance.
```{code} bash ```{code-block} sh
docker-compose down docker-compose down
``` ```
@ -56,13 +56,13 @@ Follow this guide to migrate a mono-container installation to a multi-container
2. Take a backup of your current `docker-compose.yml` file. 2. Take a backup of your current `docker-compose.yml` file.
```{code} bash ```{code-block} sh
mv docker-compose.yml docker-compose.yml.bak mv docker-compose.yml docker-compose.yml.bak
``` ```
3. Download the required template files. 3. Download the required template files.
```{code} bash ```{code-block} sh
curl -L -o docker-compose.yml "https://dev.funkwhale.audio/funkwhale/funkwhale/raw/${FUNKWHALE_VERSION}/deploy/docker-compose.yml" curl -L -o docker-compose.yml "https://dev.funkwhale.audio/funkwhale/funkwhale/raw/${FUNKWHALE_VERSION}/deploy/docker-compose.yml"
curl -L -o nginx/funkwhale.template "https://dev.funkwhale.audio/funkwhale/funkwhale/raw/${FUNKWHALE_VERSION}/deploy/docker.nginx.template" curl -L -o nginx/funkwhale.template "https://dev.funkwhale.audio/funkwhale/funkwhale/raw/${FUNKWHALE_VERSION}/deploy/docker.nginx.template"
curl -L -o nginx/funkwhale_proxy.conf "https://dev.funkwhale.audio/funkwhale/funkwhale/raw/${FUNKWHALE_VERSION}/deploy/docker.funkwhale_proxy.conf" curl -L -o nginx/funkwhale_proxy.conf "https://dev.funkwhale.audio/funkwhale/funkwhale/raw/${FUNKWHALE_VERSION}/deploy/docker.funkwhale_proxy.conf"
@ -72,37 +72,37 @@ Follow this guide to migrate a mono-container installation to a multi-container
1. Take a backup of your current `.env` file. 1. Take a backup of your current `.env` file.
```{code} bash ```{code-block} sh
mv .env .env.bak mv .env .env.bak
``` ```
2. Download the `.env` file template. 2. Download the `.env` file template.
```{code} bash ```{code-block} sh
curl -L -o .env "https://dev.funkwhale.audio/funkwhale/funkwhale/raw/${FUNKWHALE_VERSION}/deploy/env.prod.sample" curl -L -o .env "https://dev.funkwhale.audio/funkwhale/funkwhale/raw/${FUNKWHALE_VERSION}/deploy/env.prod.sample"
``` ```
3. Change the permissions on your `.env` file. 3. Change the permissions on your `.env` file.
```{code} bash ```{code-block} sh
chmod 600 .env chmod 600 .env
``` ```
4. Replace the version number in your new `.env` file. 4. Replace the version number in your new `.env` file.
```{code} bash ```{code-block} sh
sed -i "s/FUNKWHALE_VERSION=latest/FUNKWHALE_VERSION=$FUNKWHALE_VERSION/" .env sed -i "s/FUNKWHALE_VERSION=latest/FUNKWHALE_VERSION=$FUNKWHALE_VERSION/" .env
``` ```
5. Copy the settings from your old `.env` file to your new `.env` file. 5. Copy the settings from your old `.env` file to your new `.env` file.
```{code} bash ```{code-block} sh
cat .env.bak >> .env cat .env.bak >> .env
``` ```
6. Update the database URL in your new `.env` file. 6. Update the database URL in your new `.env` file.
```{code} bash ```{code-block} sh
echo "DATABASE_URL=postgresql://funkwhale@postgres:5432/funkwhale" >> .env echo "DATABASE_URL=postgresql://funkwhale@postgres:5432/funkwhale" >> .env
``` ```
@ -112,19 +112,19 @@ Check the file and remove any duplicated settings after copying.
1. Start up your new database container. 1. Start up your new database container.
```{code} bash ```{code-block} sh
docker-compose up -d postgres docker-compose up -d postgres
``` ```
2. Import your database dump into the new container. 2. Import your database dump into the new container.
```{code} bash ```{code-block} sh
cat db_dump.sql | docker-compose exec -T postgres psql -U postgres cat db_dump.sql | docker-compose exec -T postgres psql -U postgres
``` ```
3. Run the database migrations. 3. Run the database migrations.
```{code} bash ```{code-block} sh
docker-compose run --rm api python manage.py migrate docker-compose run --rm api python manage.py migrate
``` ```
@ -132,6 +132,6 @@ Check the file and remove any duplicated settings after copying.
Once you have imported your database and run migrations, you can start all containers. Once you have imported your database and run migrations, you can start all containers.
```{code} bash ```{code-block} sh
docker-compose up -d docker-compose up -d
``` ```

View File

@ -13,7 +13,7 @@ If you have access to the Funkwhale backend, you can use logs to get more inform
:::{tab-item} Nginx :::{tab-item} Nginx
:sync: nginx :sync: nginx
```{code} bash ```{code-block} sh
sudo tail -f /var/log/nginx/access.log # Follow the access log sudo tail -f /var/log/nginx/access.log # Follow the access log
sudo tail -f /var/log/nginx/error.log # Follow the error log sudo tail -f /var/log/nginx/error.log # Follow the error log
``` ```
@ -23,7 +23,7 @@ If you have access to the Funkwhale backend, you can use logs to get more inform
:::{tab-item} Apache2 :::{tab-item} Apache2
:sync: apache2 :sync: apache2
```{code} bash ```{code-block} sh
sudo tail -f /var/log/apache/access.log # Follow the access log sudo tail -f /var/log/apache/access.log # Follow the access log
sudo tail -f /var/log/apache/error.log # Follow the error log sudo tail -f /var/log/apache/error.log # Follow the error log
``` ```
@ -37,7 +37,7 @@ If you have access to the Funkwhale backend, you can use logs to get more inform
:::{tab-item} Debian :::{tab-item} Debian
:sync: debian :sync: debian
```{code} bash ```{code-block} sh
journalctl -xn -u funkwhale-server journalctl -xn -u funkwhale-server
``` ```
@ -46,7 +46,7 @@ If you have access to the Funkwhale backend, you can use logs to get more inform
:::{tab-item} Docker :::{tab-item} Docker
:sync: docker :sync: docker
```{code} bash ```{code-block} sh
docker-compose logs -f --tail=50 api # Follow the last 50 messages docker-compose logs -f --tail=50 api # Follow the last 50 messages
``` ```
@ -60,7 +60,7 @@ If you have access to the Funkwhale backend, you can use logs to get more inform
:::{tab-item} Debian :::{tab-item} Debian
:sync: debian :sync: debian
```{code} bash ```{code-block} sh
journalctl -xn -u funkwhale-worker journalctl -xn -u funkwhale-worker
``` ```
@ -69,7 +69,7 @@ If you have access to the Funkwhale backend, you can use logs to get more inform
:::{tab-item} Docker :::{tab-item} Docker
:sync: docker :sync: docker
```{code} bash ```{code-block} sh
docker-compose logs -f --tail=50 celery # Follow the last 50 messages docker-compose logs -f --tail=50 celery # Follow the last 50 messages
``` ```
@ -123,13 +123,13 @@ If your Funkwhale server uses more memory than expected, you can check the footp
1. Add the middleware to your `.env` file. 1. Add the middleware to your `.env` file.
```{code} ```{code-block} text
ADDITIONAL_MIDDLEWARES_BEFORE=funkwhale_api.common.middleware.PymallocMiddleware ADDITIONAL_MIDDLEWARES_BEFORE=funkwhale_api.common.middleware.PymallocMiddleware
``` ```
2. Enable memory tracing in your `.env` file. 2. Enable memory tracing in your `.env` file.
```{code} ```{code-block} text
PYTHONTRACEMALLOC=1 PYTHONTRACEMALLOC=1
``` ```
@ -140,7 +140,7 @@ If your Funkwhale server uses more memory than expected, you can check the footp
:::{tab-item} Debian :::{tab-item} Debian
:sync: debian :sync: debian
```{code} bash ```{code-block} sh
sudo systemctl restart funkwhale.target sudo systemctl restart funkwhale.target
``` ```
@ -149,7 +149,7 @@ If your Funkwhale server uses more memory than expected, you can check the footp
:::{tab-item} Docker :::{tab-item} Docker
:sync: docker :sync: docker
```{code} bash ```{code-block} sh
docker-compose restart docker-compose restart
``` ```
@ -162,13 +162,13 @@ To disable memory tracing:
1. Remove the middleware from your `.env` file. 1. Remove the middleware from your `.env` file.
```{code} ```{code-block} text
# ADDITIONAL_MIDDLEWARES_BEFORE=funkwhale_api.common.middleware.PymallocMiddleware # ADDITIONAL_MIDDLEWARES_BEFORE=funkwhale_api.common.middleware.PymallocMiddleware
``` ```
2. Disable memory tracing in your `.env` file. 2. Disable memory tracing in your `.env` file.
```{code} ```{code-block} text
PYTHONTRACEMALLOC=0 PYTHONTRACEMALLOC=0
``` ```
@ -179,7 +179,7 @@ To disable memory tracing:
:::{tab-item} Debian :::{tab-item} Debian
:sync: debian :sync: debian
```{code} bash ```{code-block} sh
sudo systemctl restart funkwhale.target sudo systemctl restart funkwhale.target
``` ```
@ -188,7 +188,7 @@ To disable memory tracing:
:::{tab-item} Docker :::{tab-item} Docker
:sync: docker :sync: docker
```{code} bash ```{code-block} sh
docker-compose restart docker-compose restart
``` ```

View File

@ -17,13 +17,13 @@ Before you uninstall anything from your server, you need to stop the Funkwhale s
1. Stop all systemd services listed under the `funkwhale` target 1. Stop all systemd services listed under the `funkwhale` target
```{code} bash ```{code-block} sh
sudo systemctl stop funkwhale.target sudo systemctl stop funkwhale.target
``` ```
2. Disable all systemd services to prevent launch at startup. 2. Disable all systemd services to prevent launch at startup.
```{code} bash ```{code-block} sh
sudo systemctl disable funkwhale-server sudo systemctl disable funkwhale-server
sudo systemctl disable funkwhale-worker sudo systemctl disable funkwhale-worker
sudo systemctl disable funkwhale-beat sudo systemctl disable funkwhale-beat
@ -31,7 +31,7 @@ Before you uninstall anything from your server, you need to stop the Funkwhale s
3. Remove the service files. 3. Remove the service files.
```{code} bash ```{code-block} sh
sudo rm /etc/systemd/system/funkwhale-server.service sudo rm /etc/systemd/system/funkwhale-server.service
sudo rm /etc/systemd/system/funkwhale-worker.service sudo rm /etc/systemd/system/funkwhale-worker.service
sudo rm /etc/systemd/system/funkwhale-beat.service sudo rm /etc/systemd/system/funkwhale-beat.service
@ -40,7 +40,7 @@ Before you uninstall anything from your server, you need to stop the Funkwhale s
4. Reload all services to pick up the changes. 4. Reload all services to pick up the changes.
```{code} bash ```{code-block} sh
sudo systemctl daemon-reload sudo systemctl daemon-reload
sudo systemctl reset-failed sudo systemctl reset-failed
``` ```
@ -56,7 +56,7 @@ To stop serving Funkwhale from your web server, you need to remove your reverse
1. Remove the configuration files from your web host. 1. Remove the configuration files from your web host.
```{code} bash ```{code-block} sh
sudo rm /etc/nginx/sites-enabled/funkwhale.conf sudo rm /etc/nginx/sites-enabled/funkwhale.conf
sudo rm /etc/nginx/sites-available/funkwhale.conf sudo rm /etc/nginx/sites-available/funkwhale.conf
sudo rm /etc/nginx/funkwhale_proxy.conf sudo rm /etc/nginx/funkwhale_proxy.conf
@ -64,7 +64,7 @@ To stop serving Funkwhale from your web server, you need to remove your reverse
2. Reload the web server. 2. Reload the web server.
```{code} bash ```{code-block} sh
sudo systemctl reload nginx sudo systemctl reload nginx
``` ```
@ -75,14 +75,14 @@ To stop serving Funkwhale from your web server, you need to remove your reverse
1. Remove the configuration files from your web host. 1. Remove the configuration files from your web host.
```{code} bash ```{code-block} sh
sudo rm /etc/apache2/sites-enabled/funkwhale.conf sudo rm /etc/apache2/sites-enabled/funkwhale.conf
sudo rm /etc/apache2/sites-available/funkwhale.conf sudo rm /etc/apache2/sites-available/funkwhale.conf
``` ```
2. Reload the web server. 2. Reload the web server.
```{code} bash ```{code-block} sh
sudo service apache2 restart sudo service apache2 restart
``` ```
@ -99,19 +99,19 @@ Once you have stopped the Funkwhale services, you can remove the Funkwhale datab
1. Navigate to your Funkwhale directory. 1. Navigate to your Funkwhale directory.
```{code} bash ```{code-block} sh
cd /srv/funkwhale cd /srv/funkwhale
``` ```
2. Delete the Funkwhale database. 2. Delete the Funkwhale database.
```{code} bash ```{code-block} sh
sudo -u postgres psql -c 'DROP DATABASE funkwhale;' sudo -u postgres psql -c 'DROP DATABASE funkwhale;'
``` ```
3. Delete the Funkwhale user. 3. Delete the Funkwhale user.
```{code} bash ```{code-block} sh
sudo -u postgres psql -c 'DROP USER funkwhale;' sudo -u postgres psql -c 'DROP USER funkwhale;'
``` ```
@ -123,7 +123,7 @@ This action deletes the `/srv/funkwhale/` directory. Make sure you have [backed
Once you have removed the database, you can delete the `funkwhale` user and all associated data. Once you have removed the database, you can delete the `funkwhale` user and all associated data.
```{code} bash ```{code-block} sh
sudo userdel -r funkwhale sudo userdel -r funkwhale
``` ```
@ -138,7 +138,7 @@ Funkwhale uses the following dependencies on your server:
:::{tab-item} Apt :::{tab-item} Apt
:sync: apt :sync: apt
```{code} txt ```{code-block} text
build-essential build-essential
curl curl

View File

@ -17,13 +17,13 @@ Before you remove any data, you need to stop the Funkwhale containers.
1. Navigate to your Funkwhale directory. 1. Navigate to your Funkwhale directory.
```{code} bash ```{code-block} sh
cd /srv/funkwhale cd /srv/funkwhale
``` ```
2. Stop the containers 2. Stop the containers
```{code} bash ```{code-block} sh
docker-compose down docker-compose down
``` ```
@ -38,7 +38,7 @@ To stop serving Funkwhale from your web server, you need to remove your reverse
1. Remove the configuration files from your web host. 1. Remove the configuration files from your web host.
```{code} bash ```{code-block} sh
sudo rm /etc/nginx/sites-enabled/funkwhale.conf sudo rm /etc/nginx/sites-enabled/funkwhale.conf
sudo rm /etc/nginx/sites-available/funkwhale.conf sudo rm /etc/nginx/sites-available/funkwhale.conf
sudo rm /etc/nginx/funkwhale_proxy.conf sudo rm /etc/nginx/funkwhale_proxy.conf
@ -46,7 +46,7 @@ To stop serving Funkwhale from your web server, you need to remove your reverse
2. Reload the web server. 2. Reload the web server.
```{code} bash ```{code-block} sh
sudo systemctl reload nginx sudo systemctl reload nginx
``` ```
@ -57,14 +57,14 @@ To stop serving Funkwhale from your web server, you need to remove your reverse
1. Remove the configuration files from your web host. 1. Remove the configuration files from your web host.
```{code} bash ```{code-block} sh
sudo rm /etc/apache2/sites-enabled/funkwhale.conf sudo rm /etc/apache2/sites-enabled/funkwhale.conf
sudo rm /etc/apache2/sites-available/funkwhale.conf sudo rm /etc/apache2/sites-available/funkwhale.conf
``` ```
2. Reload the web server. 2. Reload the web server.
```{code} bash ```{code-block} sh
sudo service apache2 restart sudo service apache2 restart
``` ```
@ -79,7 +79,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. Once you have stopped the containers, you can delete all containers and associated volumes.
```{code} bash ```{code-block} sh
docker-compose rm -fsv docker-compose rm -fsv
``` ```
@ -87,7 +87,7 @@ docker-compose rm -fsv
Once you have removed the containers and volumes, you can delete the Funkwhale directory. Once you have removed the containers and volumes, you can delete the Funkwhale directory.
```{code} bash ```{code-block} sh
sudo rm -rf /srv/funkwhale sudo rm -rf /srv/funkwhale
``` ```

View File

@ -17,13 +17,13 @@ Before you uninstall anything from your server, you need to stop the Funkwhale s
1. Stop all systemd services listed under the `funkwhale` target 1. Stop all systemd services listed under the `funkwhale` target
```{code} bash ```{code-block} sh
sudo systemctl stop funkwhale.target sudo systemctl stop funkwhale.target
``` ```
2. Disable all systemd services to prevent launch at startup. 2. Disable all systemd services to prevent launch at startup.
```{code} bash ```{code-block} sh
sudo systemctl disable funkwhale-server sudo systemctl disable funkwhale-server
sudo systemctl disable funkwhale-worker sudo systemctl disable funkwhale-worker
sudo systemctl disable funkwhale-beat sudo systemctl disable funkwhale-beat
@ -31,7 +31,7 @@ Before you uninstall anything from your server, you need to stop the Funkwhale s
3. Remove the service files. 3. Remove the service files.
```{code} bash ```{code-block} sh
sudo rm /etc/systemd/system/funkwhale-server.service sudo rm /etc/systemd/system/funkwhale-server.service
sudo rm /etc/systemd/system/funkwhale-worker.service sudo rm /etc/systemd/system/funkwhale-worker.service
sudo rm /etc/systemd/system/funkwhale-beat.service sudo rm /etc/systemd/system/funkwhale-beat.service
@ -40,7 +40,7 @@ Before you uninstall anything from your server, you need to stop the Funkwhale s
4. Reload all services to pick up the changes. 4. Reload all services to pick up the changes.
```{code} bash ```{code-block} sh
sudo systemctl daemon-reload sudo systemctl daemon-reload
sudo systemctl reset-failed sudo systemctl reset-failed
``` ```
@ -56,7 +56,7 @@ To stop serving Funkwhale from your web server, you need to remove your reverse
1. Remove the configuration files from your web host. 1. Remove the configuration files from your web host.
```{code} bash ```{code-block} sh
sudo rm /etc/nginx/sites-enabled/funkwhale.conf sudo rm /etc/nginx/sites-enabled/funkwhale.conf
sudo rm /etc/nginx/sites-available/funkwhale.conf sudo rm /etc/nginx/sites-available/funkwhale.conf
sudo rm /etc/nginx/funkwhale_proxy.conf sudo rm /etc/nginx/funkwhale_proxy.conf
@ -64,7 +64,7 @@ To stop serving Funkwhale from your web server, you need to remove your reverse
2. Reload the web server. 2. Reload the web server.
```{code} bash ```{code-block} sh
sudo systemctl reload nginx sudo systemctl reload nginx
``` ```
@ -75,14 +75,14 @@ To stop serving Funkwhale from your web server, you need to remove your reverse
1. Remove the configuration files from your web host. 1. Remove the configuration files from your web host.
```{code} bash ```{code-block} sh
sudo rm /etc/apache2/sites-enabled/funkwhale.conf sudo rm /etc/apache2/sites-enabled/funkwhale.conf
sudo rm /etc/apache2/sites-available/funkwhale.conf sudo rm /etc/apache2/sites-available/funkwhale.conf
``` ```
2. Reload the web server. 2. Reload the web server.
```{code} bash ```{code-block} sh
sudo service apache2 restart sudo service apache2 restart
``` ```
@ -99,19 +99,19 @@ Once you have stopped the Funkwhale services, you can remove the Funkwhale datab
1. Navigate to your Funkwhale directory. 1. Navigate to your Funkwhale directory.
```{code} bash ```{code-block} sh
cd /srv/funkwhale cd /srv/funkwhale
``` ```
2. Delete the Funkwhale database. 2. Delete the Funkwhale database.
```{code} bash ```{code-block} sh
sudo -u postgres psql -c 'DROP DATABASE funkwhale;' sudo -u postgres psql -c 'DROP DATABASE funkwhale;'
``` ```
3. Delete the Funkwhale user. 3. Delete the Funkwhale user.
```{code} bash ```{code-block} sh
sudo -u postgres psql -c 'DROP USER funkwhale;' sudo -u postgres psql -c 'DROP USER funkwhale;'
``` ```
@ -123,7 +123,7 @@ This action deletes the `/srv/funkwhale/` directory. Make sure you have [backed
Once you have removed the database, you can delete the `funkwhale` user and all associated data. Once you have removed the database, you can delete the `funkwhale` user and all associated data.
```{code} bash ```{code-block} sh
sudo userdel -r funkwhale sudo userdel -r funkwhale
``` ```
@ -138,7 +138,7 @@ The quick install script installs the following dependencies on your server:
:::{tab-item} Apt :::{tab-item} Apt
:sync: apt :sync: apt
```{code} txt ```{code-block} text
build-essential build-essential
curl curl

View File

@ -9,7 +9,7 @@ Before performing big changes, we recommend you back up your database and media
:::{tab-item} Debian :::{tab-item} Debian
:sync: debian :sync: debian
```{code} bash ```{code-block} sh
sudo -u postgres -H pg_dumpall -c funkwhale > /path/to/your/backup/dump_`date +%d-%m-%Y"_"%H_%M_%S`.sql sudo -u postgres -H pg_dumpall -c funkwhale > /path/to/your/backup/dump_`date +%d-%m-%Y"_"%H_%M_%S`.sql
``` ```
@ -18,7 +18,7 @@ Before performing big changes, we recommend you back up your database and media
:::{tab-item} Docker :::{tab-item} Docker
:sync: docker :sync: docker
```{code} bash ```{code-block} sh
docker-compose exec postgres pg_dumpall -c -U postgres > dump_`date +%d-%m-%Y"_"%H_%M_%S`.sql docker-compose exec postgres pg_dumpall -c -U postgres > dump_`date +%d-%m-%Y"_"%H_%M_%S`.sql
``` ```
@ -32,7 +32,7 @@ Before performing big changes, we recommend you back up your database and media
:::{tab-item} Debian :::{tab-item} Debian
:sync: debian :sync: debian
```{code} bash ```{code-block} sh
rsync -avzhP /srv/funkwhale/data/media /path/to/your/backup/media rsync -avzhP /srv/funkwhale/data/media /path/to/your/backup/media
rsync -avzhP /srv/funkwhale/data/music /path/to/your/backup/music rsync -avzhP /srv/funkwhale/data/music /path/to/your/backup/music
``` ```
@ -42,7 +42,7 @@ Before performing big changes, we recommend you back up your database and media
:::{tab-item} Docker :::{tab-item} Docker
:sync: docker :sync: docker
```{code} bash ```{code-block} sh
rsync -avzhP /srv/funkwhale/data/media /path/to/your/backup/media rsync -avzhP /srv/funkwhale/data/media /path/to/your/backup/media
rsync -avzhP /srv/funkwhale/data/music /path/to/your/backup/music rsync -avzhP /srv/funkwhale/data/music /path/to/your/backup/music
@ -58,7 +58,7 @@ Before performing big changes, we recommend you back up your database and media
:::{tab-item} Debian :::{tab-item} Debian
:sync: debian :sync: debian
```{code} bash ```{code-block} sh
rsync -avzhP /srv/funkwhale/config/.env /path/to/your/backup/.env rsync -avzhP /srv/funkwhale/config/.env /path/to/your/backup/.env
``` ```
@ -67,7 +67,7 @@ Before performing big changes, we recommend you back up your database and media
:::{tab-item} Docker :::{tab-item} Docker
:sync: docker :sync: docker
```{code} bash ```{code-block} sh
rsync -avzhP /srv/funkwhale/.env /path/to/your/backup/.env rsync -avzhP /srv/funkwhale/.env /path/to/your/backup/.env
``` ```
@ -84,14 +84,14 @@ To restart your files, do the following:
1. Rename your current file directories. 1. Rename your current file directories.
```{code} bash ```{code-block} sh
mv /srv/funkwhale/data/media /srv/funkwhale/data/media.bak mv /srv/funkwhale/data/media /srv/funkwhale/data/media.bak
mv /srv/funkwhale/data/music /srv/funkwhale/data/music.bak mv /srv/funkwhale/data/music /srv/funkwhale/data/music.bak
``` ```
2. Restore your backed-up files to the original directories. 2. Restore your backed-up files to the original directories.
```{code} bash ```{code-block} sh
mv /patht/to/your/backup/media /srv/funkwhale/data/media mv /patht/to/your/backup/media /srv/funkwhale/data/media
mv /path/to/your/backup/music /srv/funkwhale/data/music mv /path/to/your/backup/music /srv/funkwhale/data/music
``` ```
@ -107,13 +107,13 @@ To restore your database, do the following:
1. Restore your database backup: 1. Restore your database backup:
```{code} bash ```{code-block} sh
sudo -u postgres psql -f /path/to/your/backup/dump.sql funkwhale 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 `manage.py migrate` command to set up the database.
```{code} bash ```{code-block} sh
cd /srv/funkwhale/api cd /srv/funkwhale/api
poetry run python manage.py migrate poetry run python manage.py migrate
``` ```
@ -125,13 +125,13 @@ To restore your database, do the following:
1. Restore your database backup. 1. Restore your database backup.
```{code} bash ```{code-block} sh
docker-compose run --rm -T postgres psql -U postgres postgres < "/path/to/your/backup/dump.sql" 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 `manage.py migrate` command to set up the database.
```{code} bash ```{code-block} sh
docker-compose run --rm api python manage.py migrate docker-compose run --rm api python manage.py migrate
``` ```

View File

@ -12,13 +12,13 @@ To upgrade your virtualenv:
1. Change to your api directory. 1. Change to your api directory.
```{code-block} bash ```{code-block} sh
cd /srv/funkwhale/api cd /srv/funkwhale/api
``` ```
2. Rerun `poetry install` to reinstall your dependencies in a new virtualenv. 2. Rerun `poetry install` to reinstall your dependencies in a new virtualenv.
```{code-block} bash ```{code-block} sh
poetry install poetry install
``` ```
@ -29,19 +29,19 @@ To upgrade your virtualenv:
1. SSH into your server. 1. SSH into your server.
2. Log in as your `funkwhale` user. 2. Log in as your `funkwhale` user.
```{code} bash ```{code-block} sh
su funkwhale su funkwhale
``` ```
3. Navigate to your Funkwhale directory. 3. Navigate to your Funkwhale directory.
```{code} bash ```{code-block} sh
cd /srv/funkwhale cd /srv/funkwhale
``` ```
4. Stop the Funkwhale services. 4. Stop the Funkwhale services.
```{code} bash ```{code-block} sh
sudo systemctl stop funkwhale.target sudo systemctl stop funkwhale.target
``` ```
@ -53,25 +53,25 @@ To upgrade your virtualenv:
6. Download the API files for your chosen Funkwhale version. 6. Download the API files for your chosen Funkwhale version.
```{code} bash ```{code-block} sh
curl -L -o "api-$FUNKWHALE_VERSION.zip" "https://dev.funkwhale.audio/funkwhale/funkwhale/-/jobs/artifacts/$FUNKWHALE_VERSION/download?job=build_api" curl -L -o "api-$FUNKWHALE_VERSION.zip" "https://dev.funkwhale.audio/funkwhale/funkwhale/-/jobs/artifacts/$FUNKWHALE_VERSION/download?job=build_api"
``` ```
7. Extract the downloaded archive to a new directory. 7. Extract the downloaded archive to a new directory.
```{code} bash ```{code-block} sh
unzip "api-$FUNKWHALE_VERSION.zip" -o api_new unzip "api-$FUNKWHALE_VERSION.zip" -o api_new
``` ```
8. Remove the old `api` directory and move the extracted directory to the `api` directory. 8. Remove the old `api` directory and move the extracted directory to the `api` directory.
```{code} bash ```{code-block} sh
rm -rf api/ && mv api_new api rm -rf api/ && mv api_new api
``` ```
9. Remove the downloaded archive file. 9. Remove the downloaded archive file.
```{code} bash ```{code-block} sh
rm api-$FUNKWHALE_VERSION.zip rm api-$FUNKWHALE_VERSION.zip
``` ```
@ -81,37 +81,37 @@ Once you have downloaded the new files, you can update your Funkwhale instance.
1. Install or upgrade all OS dependencies using the dependencies script. 1. Install or upgrade all OS dependencies using the dependencies script.
```{code} bash ```{code-block} sh
sudo api/install_os_dependencies.sh install sudo api/install_os_dependencies.sh install
``` ```
2. Enter the `api` directory to run the following commands. 2. Enter the `api` directory to run the following commands.
```{code} bash ```{code-block} sh
cd api cd api
``` ```
3. Install all Python dependencies using `poetry`. 3. Install all Python dependencies using `poetry`.
```{code} bash ```{code-block} sh
poetry install poetry install
``` ```
4. Collect the new static files to serve. 4. Collect the new static files to serve.
```{code} bash ```{code-block} sh
poetry run python manage.py collectstatic --no-input poetry run python manage.py collectstatic --no-input
``` ```
5. Apply new database migrations. 5. Apply new database migrations.
```{code} bash ```{code-block} sh
poetry run python manage.py migrate poetry run python manage.py migrate
``` ```
6. Restart the Funkwhale services. 6. Restart the Funkwhale services.
```{code} bash ```{code-block} sh
sudo systemctl start funkwhale.target sudo systemctl start funkwhale.target
``` ```

View File

@ -7,13 +7,13 @@ If you installed Funkwhale following the [Docker guide](../installation_docs/doc
1. SSH into your server 1. SSH into your server
2. Log in as your `funkwhale` user. 2. Log in as your `funkwhale` user.
```{code} bash ```{code-block} sh
su funkwhale su funkwhale
``` ```
3. Navigate to your Funkwhale directory. 3. Navigate to your Funkwhale directory.
```{code} bash ```{code-block} sh
cd /srv/funkwhale cd /srv/funkwhale
``` ```
@ -25,31 +25,31 @@ If you installed Funkwhale following the [Docker guide](../installation_docs/doc
5. Change the version number in your `.env` file. Update this to the same version number you exported in step 4. 5. Change the version number in your `.env` file. Update this to the same version number you exported in step 4.
```{code} bash ```{code-block} sh
nano .env nano .env
``` ```
6. Load the configuration from your `.env` file. 6. Load the configuration from your `.env` file.
```{code} bash ```{code-block} sh
source .env source .env
``` ```
7. Pull the updated containers. 7. Pull the updated containers.
```{code} bash ```{code-block} sh
docker-compose pull docker-compose pull
``` ```
8. Apply the database migrations. 8. Apply the database migrations.
```{code} bash ```{code-block} sh
docker-compose run --rm api python manage.py migrate docker-compose run --rm api python manage.py migrate
``` ```
9. Relaunch your containers. 9. Relaunch your containers.
```{code} bash ```{code-block} sh
docker-compose up -d docker-compose up -d
``` ```
@ -63,25 +63,25 @@ To upgrade postgres on Docker we use the [`postgres-upgrade`](https://hub.docker
1. Export your current postgres version number. You can find this in your `docker-compose.yml` file. 1. Export your current postgres version number. You can find this in your `docker-compose.yml` file.
```{code} bash ```{code-block} sh
export OLD_POSTGRES=13 export OLD_POSTGRES=13
``` ```
2. Export the major version number you want to upgrade to. 2. Export the major version number you want to upgrade to.
```{code} bash ```{code-block} sh
export NEW_POSTGRES=14 export NEW_POSTGRES=14
``` ```
3. Stop the postgres container. This means no data changes while you are upgrading. 3. Stop the postgres container. This means no data changes while you are upgrading.
```{code} bash ```{code-block} sh
docker-compose stop postgres 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. 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} bash ```{code-block} sh
docker run --rm \ docker run --rm \
-v $(pwd)/data/postgres:/var/lib/postgresql/${OLD_POSTGRES}/data \ -v $(pwd)/data/postgres:/var/lib/postgresql/${OLD_POSTGRES}/data \
-v $(pwd)/data/postgres-new:/var/lib/postgresql/${NEW_POSTGRES}/data \ -v $(pwd)/data/postgres-new:/var/lib/postgresql/${NEW_POSTGRES}/data \
@ -90,26 +90,26 @@ To upgrade postgres on Docker we use the [`postgres-upgrade`](https://hub.docker
5. Re-add the access control rules required by Funkwhale. 5. Re-add the access control rules required by Funkwhale.
```{code} bash ```{code-block} sh
echo "host all all all trust" | sudo tee -a ./data/postgres-new/pg_hba.conf echo "host all all all trust" | sudo tee -a ./data/postgres-new/pg_hba.conf
``` ```
6. Swap your old database out with your new database. 6. Swap your old database out with your new database.
```{code} bash ```{code-block} sh
mv ./data/postgres ./data/postgres-old mv ./data/postgres ./data/postgres-old
mv ./data/postgres-new ./data/postgres mv ./data/postgres-new ./data/postgres
``` ```
7. Pull the new postgres version. 7. Pull the new postgres version.
```{code} bash ```{code-block} sh
docker-compose pull docker-compose pull
``` ```
8. Restart your containers. 8. Restart your containers.
```{code} bash ```{code-block} sh
docker-compose up -d docker-compose up -d
``` ```

View File

@ -99,7 +99,7 @@ Some common tasks the Celery worker handles are:
### Celery beat task scheduler ### Celery beat task scheduler
In addition to handling tasks from the API, the Celery worker also needs to handle some recurring tasks. To manage these, we implement a [Celery beat]() scheduler. The scheduler is responsible for triggering tasks on a schedule and adding messages to the [queue](#redis-cache-and-message-queue) so the worker can work through them. In addition to handling tasks from the API, the Celery worker also needs to handle some recurring tasks. To manage these, we implement a [Celery beat](https://docs.celeryq.dev/en/stable/reference/celery.apps.beat.html#celery.apps.beat.Beat) scheduler. The scheduler is responsible for triggering tasks on a schedule and adding messages to the [queue](#redis-cache-and-message-queue) so the worker can work through them.
Some common recurring tasks are: Some common recurring tasks are:

View File

@ -120,7 +120,7 @@ The `Accept` activity sends a positive response, such as confirming a [`Follow`
::::{dropdown} Supported on ::::{dropdown} Supported on
- [`Activity` objects](#activity) - `Activity` objects
:::: ::::