funkwhale/docs/administrator/manage-script/users.md

346 wiersze
5.7 KiB
Markdown
Czysty Zwykły widok Historia

# Manage users
2022-07-01 09:02:29 +00:00
The `funkwhale-manage` command line interface includes commands for user management. Use these commands to automate managing users from the command line.
2022-07-01 09:02:29 +00:00
All users-related commands are available under the `funkwhale-manage fw users` namespace.
2022-07-01 09:02:29 +00:00
## Create users
You can create users with the `funkwhale-manage` command line interface. There are different ways to create users depending on what approach you want to take.
2022-07-01 09:02:29 +00:00
### Create a user interactively
2022-07-23 13:32:35 +00:00
::::{tab-set}
:::{tab-item} Debian
:sync: debian
2022-07-01 09:02:29 +00:00
2022-10-26 20:19:16 +00:00
```{code-block} sh
venv/bin/funkwhale-manage fw users create
2022-07-01 09:02:29 +00:00
```
2022-07-23 13:32:35 +00:00
:::
2022-07-01 09:02:29 +00:00
2022-07-23 13:32:35 +00:00
:::{tab-item} Docker
:sync: docker
2022-07-01 09:02:29 +00:00
2022-10-26 20:19:16 +00:00
```{code-block} sh
sudo docker compose run --rm api funkwhale-manage fw users create
2022-07-01 09:02:29 +00:00
```
2022-07-23 13:32:35 +00:00
:::
::::
2022-07-01 09:02:29 +00:00
### Create a user with a random password
2022-07-23 13:32:35 +00:00
::::{tab-set}
:::{tab-item} Debian
:sync: debian
2022-07-01 09:02:29 +00:00
2022-10-26 20:19:16 +00:00
```{code-block} sh
venv/bin/funkwhale-manage fw users create --username <username> --email <user email> -p ""
2022-07-01 09:02:29 +00:00
```
2022-07-23 13:32:35 +00:00
:::
2022-07-01 09:02:29 +00:00
2022-07-23 13:32:35 +00:00
:::{tab-item} Docker
:sync: docker
2022-07-01 09:02:29 +00:00
2022-10-26 20:19:16 +00:00
```{code-block} sh
sudo docker compose run --rm api funkwhale-manage fw users create --username <username> --email <user email> -p ""
2022-07-01 09:02:29 +00:00
```
2022-07-23 13:32:35 +00:00
:::
::::
2022-07-01 09:02:29 +00:00
### Create a user with a password set from an environment variable
2022-07-23 13:32:35 +00:00
::::{tab-set}
:::{tab-item} Debian
:sync: debian
2022-07-01 09:02:29 +00:00
2022-10-26 20:19:16 +00:00
```{code-block} sh
2022-07-01 09:02:29 +00:00
export FUNKWHALE_CLI_USER_PASSWORD=<password>
venv/bin/funkwhale-manage fw users create --username <username> --email <user email>
2022-07-01 09:02:29 +00:00
```
2022-07-23 13:32:35 +00:00
:::
2022-07-01 09:02:29 +00:00
2022-07-23 13:32:35 +00:00
:::{tab-item} Docker
:sync: docker
2022-07-01 09:02:29 +00:00
2022-10-26 20:19:16 +00:00
```{code-block} sh
2022-07-01 09:02:29 +00:00
export FUNKWHALE_CLI_USER_PASSWORD=<password>
sudo docker compose run --rm api funkwhale-manage fw users create --username <username> --email <user email>
2022-07-01 09:02:29 +00:00
```
2022-07-23 13:32:35 +00:00
:::
::::
2022-07-01 09:02:29 +00:00
There are extra options for user configuration, such as quota and {term}`permissions`. Check the command help for more options.
2022-07-23 13:32:35 +00:00
::::{tab-set}
:::{tab-item} Debian
:sync: debian
2022-07-01 09:02:29 +00:00
2022-10-26 20:19:16 +00:00
```{code-block} sh
venv/bin/funkwhale-manage fw users --help
2022-07-01 09:02:29 +00:00
```
2022-07-23 13:32:35 +00:00
:::
2022-07-01 09:02:29 +00:00
2022-07-23 13:32:35 +00:00
:::{tab-item} Docker
:sync: docker
2022-07-01 09:02:29 +00:00
2022-10-26 20:19:16 +00:00
```{code-block} sh
sudo docker compose run --rm api funkwhale-manage fw users --help
2022-07-01 09:02:29 +00:00
```
2022-07-23 13:32:35 +00:00
:::
::::
2022-07-01 09:02:29 +00:00
## Update users
You can update user accounts using the `funkwhale-manage` command line interface. Update commands are available under the `funkwhale-manage fw users set` namespace.
2022-07-01 09:02:29 +00:00
### Set upload quota for a user
2022-07-23 13:32:35 +00:00
::::{tab-set}
:::{tab-item} Debian
:sync: debian
2022-07-01 09:02:29 +00:00
2022-10-26 20:19:16 +00:00
```{code-block} sh
venv/bin/funkwhale-manage fw users set --upload-quota 500 <user>
2022-07-01 09:02:29 +00:00
```
2022-07-23 13:32:35 +00:00
:::
2022-07-01 09:02:29 +00:00
2022-07-23 13:32:35 +00:00
:::{tab-item} Docker
:sync: docker
2022-07-01 09:02:29 +00:00
2022-10-26 20:19:16 +00:00
```{code-block} sh
sudo docker compose run --rm api funkwhale-manage fw users set --upload-quota 500 <user>
2022-07-01 09:02:29 +00:00
```
2022-07-23 13:32:35 +00:00
:::
::::
2022-07-01 09:02:29 +00:00
### Make users staff members
2022-07-23 13:32:35 +00:00
::::{tab-set}
:::{tab-item} Debian
:sync: debian
2022-07-01 09:02:29 +00:00
2022-10-26 20:19:16 +00:00
```{code-block} sh
venv/bin/funkwhale-manage fw users set --staff --superuser <user 1> <user 2>
2022-07-01 09:02:29 +00:00
```
2022-07-23 13:32:35 +00:00
:::
2022-07-01 09:02:29 +00:00
2022-07-23 13:32:35 +00:00
:::{tab-item} Docker
:sync: docker
2022-07-01 09:02:29 +00:00
2022-10-26 20:19:16 +00:00
```{code-block} sh
sudo docker compose run --rm api funkwhale-manage fw users set --staff --superuser <user 1> <user 2>
2022-07-01 09:02:29 +00:00
```
2022-07-23 13:32:35 +00:00
:::
::::
2022-07-01 09:02:29 +00:00
### Remove a user's staff privileges
2022-07-23 13:32:35 +00:00
::::{tab-set}
:::{tab-item} Debian
:sync: debian
2022-07-01 09:02:29 +00:00
2022-10-26 20:19:16 +00:00
```{code-block} sh
venv/bin/funkwhale-manage fw users set --no-staff --no-superuser <user>
2022-07-01 09:02:29 +00:00
```
2022-07-23 13:32:35 +00:00
:::
2022-07-01 09:02:29 +00:00
2022-07-23 13:32:35 +00:00
:::{tab-item} Docker
:sync: docker
2022-07-01 09:02:29 +00:00
2022-10-26 20:19:16 +00:00
```{code-block} sh
sudo docker compose run --rm api funkwhale-manage fw users set --no-staff --no-superuser <user>
2022-07-01 09:02:29 +00:00
```
2022-07-23 13:32:35 +00:00
:::
::::
2022-07-01 09:02:29 +00:00
### Give a user moderation permissions
2022-07-23 13:32:35 +00:00
::::{tab-set}
:::{tab-item} Debian
:sync: debian
2022-07-01 09:02:29 +00:00
2022-10-26 20:19:16 +00:00
```{code-block} sh
venv/bin/funkwhale-manage fw users set --permission-moderation <user>
2022-07-01 09:02:29 +00:00
```
2022-07-23 13:32:35 +00:00
:::
2022-07-01 09:02:29 +00:00
2022-07-23 13:32:35 +00:00
:::{tab-item} Docker
:sync: docker
2022-07-01 09:02:29 +00:00
2022-10-26 20:19:16 +00:00
```{code-block} sh
sudo docker compose run --rm api funkwhale-manage fw users set --permission-moderation <user>
2022-07-01 09:02:29 +00:00
```
2022-07-23 13:32:35 +00:00
:::
::::
2022-07-01 09:02:29 +00:00
### Reset a user's password
2022-07-23 13:32:35 +00:00
::::{tab-set}
:::{tab-item} Debian
:sync: debian
2022-07-01 09:02:29 +00:00
2022-10-26 20:19:16 +00:00
```{code-block} sh
venv/bin/funkwhale-manage fw users set --password "<password>" <user>
2022-07-01 09:02:29 +00:00
```
2022-07-23 13:32:35 +00:00
:::
2022-07-01 09:02:29 +00:00
2022-07-23 13:32:35 +00:00
:::{tab-item} Docker
:sync: docker
2022-07-01 09:02:29 +00:00
2022-10-26 20:19:16 +00:00
```{code-block} sh
sudo docker compose run --rm api funkwhale-manage fw users set --password "<password>" <user>
2022-07-01 09:02:29 +00:00
```
2022-07-23 13:32:35 +00:00
:::
::::
2022-07-01 09:02:29 +00:00
### Reset a user's password using an environment variable
2022-07-23 13:32:35 +00:00
::::{tab-set}
:::{tab-item} Debian
:sync: debian
2022-07-01 09:02:29 +00:00
2022-10-26 20:19:16 +00:00
```{code-block} sh
2022-07-01 09:02:29 +00:00
export FUNKWHALE_CLI_USER_UPDATE_PASSWORD=<password>
venv/bin/funkwhale-manage fw users set <user>
2022-07-01 09:02:29 +00:00
```
2022-07-23 13:32:35 +00:00
:::
2022-07-01 09:02:29 +00:00
2022-07-23 13:32:35 +00:00
:::{tab-item} Docker
:sync: docker
2022-07-01 09:02:29 +00:00
2022-10-26 20:19:16 +00:00
```{code-block} sh
2022-07-01 09:02:29 +00:00
export FUNKWHALE_CLI_USER_UPDATE_PASSWORD=<password>
sudo docker compose run --rm api funkwhale-manage fw users set <user>
2022-07-01 09:02:29 +00:00
```
2022-07-23 13:32:35 +00:00
:::
::::
2022-07-01 09:02:29 +00:00
There are extra options for updating users. Check the command help for more options.
2022-07-23 13:32:35 +00:00
::::{tab-set}
:::{tab-item} Debian
:sync: debian
2022-07-01 09:02:29 +00:00
2022-10-26 20:19:16 +00:00
```{code-block} sh
venv/bin/funkwhale-manage fw users set --help
2022-07-01 09:02:29 +00:00
```
2022-07-23 13:32:35 +00:00
:::
2022-07-01 09:02:29 +00:00
2022-07-23 13:32:35 +00:00
:::{tab-item} Docker
:sync: docker
2022-07-01 09:02:29 +00:00
2022-10-26 20:19:16 +00:00
```{code-block} sh
sudo docker compose run --rm api funkwhale-manage fw users set --help
2022-07-01 09:02:29 +00:00
```
2022-07-23 13:32:35 +00:00
:::
::::
2022-07-01 09:02:29 +00:00
## Delete users
### Delete a user's account but leave a reference to them in the database
This prevents the same username being used in future.
2022-07-23 13:32:35 +00:00
::::{tab-set}
:::{tab-item} Debian
:sync: debian
2022-07-01 09:02:29 +00:00
2022-10-26 20:19:16 +00:00
```{code-block} py
venv/bin/funkwhale-manage fw users rm <user>
2022-07-01 09:02:29 +00:00
```
2022-07-23 13:32:35 +00:00
:::
2022-07-01 09:02:29 +00:00
2022-07-23 13:32:35 +00:00
:::{tab-item} Docker
:sync: docker
2022-07-01 09:02:29 +00:00
2022-10-26 20:19:16 +00:00
```{code-block} py
sudo docker compose run --rm api funkwhale-manage fw users rm <user>
2022-07-01 09:02:29 +00:00
```
2022-07-23 13:32:35 +00:00
:::
::::
2022-07-01 09:02:29 +00:00
### Delete a user's account, including all references in the database
This means the username can be reused.
2022-07-23 13:32:35 +00:00
::::{tab-set}
:::{tab-item} Debian
:sync: debian
2022-07-01 09:02:29 +00:00
2022-10-26 20:19:16 +00:00
```{code-block} py
venv/bin/funkwhale-manage fw users rm --hard <user>
2022-07-01 09:02:29 +00:00
```
2022-07-23 13:32:35 +00:00
:::
2022-07-01 09:02:29 +00:00
2022-07-23 13:32:35 +00:00
:::{tab-item} Docker
:sync: docker
2022-07-01 09:02:29 +00:00
2022-10-26 20:19:16 +00:00
```{code-block} py
sudo docker compose run --rm api funkwhale-manage fw users rm --hard <user>
2022-07-01 09:02:29 +00:00
```
2022-07-23 13:32:35 +00:00
:::
::::
2022-07-01 09:02:29 +00:00
There are extra options for deleting users. Check the command help for more options.
2022-07-23 13:32:35 +00:00
::::{tab-set}
:::{tab-item} Debian
:sync: debian
2022-07-01 09:02:29 +00:00
2022-10-26 20:19:16 +00:00
```{code-block} sh
venv/bin/funkwhale-manage fw users rm --help
2022-07-01 09:02:29 +00:00
```
2022-07-23 13:32:35 +00:00
:::
2022-07-01 09:02:29 +00:00
2022-07-23 13:32:35 +00:00
:::{tab-item} Docker
:sync: docker
2022-07-01 09:02:29 +00:00
2022-10-26 20:19:16 +00:00
```{code-block} sh
sudo docker compose run --rm api funkwhale-manage fw users rm --help
2022-07-01 09:02:29 +00:00
```
2022-07-23 13:32:35 +00:00
:::
::::