[cli] Update gen docs + add docs/selfhost.md

This commit is contained in:
Neeraj Gupta 2024-03-13 11:31:56 +05:30 committed by Neeraj Gupta
parent 4325de6fde
commit 2711a227fc
16 changed files with 43 additions and 16 deletions

View file

@ -85,6 +85,6 @@ func init() {
_updateFreeUserStorage.Flags().StringP("admin-user", "a", "", "The email of the admin user. (required)")
_updateFreeUserStorage.Flags().StringP("user", "u", "", "The email of the user to update subscription for. (required)")
// add a flag with no value --no-limit
_updateFreeUserStorage.Flags().String("no-limit", "True", "Set the storage limit to 100TB unlimited with 100 year expiry")
_updateFreeUserStorage.Flags().String("no-limit", "True", "When true, sets 100TB as storage limit, and expiry to current date + 100 years")
_adminCmd.AddCommand(_userDetailsCmd, _disable2faCmd, _updateFreeUserStorage)
}

View file

@ -25,4 +25,4 @@ ente [flags]
* [ente export](ente_export.md) - Starts the export process
* [ente version](ente_version.md) - Prints the current version
###### Auto generated by spf13/cobra on 12-Mar-2024
###### Auto generated by spf13/cobra on 13-Mar-2024

View file

@ -16,4 +16,4 @@ Manage account settings
* [ente account list](ente_account_list.md) - list configured accounts
* [ente account update](ente_account_update.md) - Update an existing account's export directory
###### Auto generated by spf13/cobra on 12-Mar-2024
###### Auto generated by spf13/cobra on 13-Mar-2024

View file

@ -16,4 +16,4 @@ ente account add [flags]
* [ente account](ente_account.md) - Manage account settings
###### Auto generated by spf13/cobra on 12-Mar-2024
###### Auto generated by spf13/cobra on 13-Mar-2024

View file

@ -18,4 +18,4 @@ ente account get-token [flags]
* [ente account](ente_account.md) - Manage account settings
###### Auto generated by spf13/cobra on 12-Mar-2024
###### Auto generated by spf13/cobra on 13-Mar-2024

View file

@ -16,4 +16,4 @@ ente account list [flags]
* [ente account](ente_account.md) - Manage account settings
###### Auto generated by spf13/cobra on 12-Mar-2024
###### Auto generated by spf13/cobra on 13-Mar-2024

View file

@ -19,4 +19,4 @@ ente account update [flags]
* [ente account](ente_account.md) - Manage account settings
###### Auto generated by spf13/cobra on 12-Mar-2024
###### Auto generated by spf13/cobra on 13-Mar-2024

View file

@ -19,4 +19,4 @@ Commands for admin actions like disable or enabling 2fa, bumping up the storage
* [ente admin get-user-id](ente_admin_get-user-id.md) - Get user id
* [ente admin update-subscription](ente_admin_update-subscription.md) - Update subscription for the free user
###### Auto generated by spf13/cobra on 12-Mar-2024
###### Auto generated by spf13/cobra on 13-Mar-2024

View file

@ -18,4 +18,4 @@ ente admin disable-2fa [flags]
* [ente admin](ente_admin.md) - Commands for admin actions
###### Auto generated by spf13/cobra on 12-Mar-2024
###### Auto generated by spf13/cobra on 13-Mar-2024

View file

@ -18,4 +18,4 @@ ente admin get-user-id [flags]
* [ente admin](ente_admin.md) - Commands for admin actions
###### Auto generated by spf13/cobra on 12-Mar-2024
###### Auto generated by spf13/cobra on 13-Mar-2024

View file

@ -11,7 +11,7 @@ ente admin update-subscription [flags]
```
-a, --admin-user string The email of the admin user. (required)
-h, --help help for update-subscription
--no-limit string Set the storage limit to 100TB unlimited with 100 year expiry (default "True")
--no-limit string When true, sets 100TB as storage limit, and expiry to current date + 100 years (default "True")
-u, --user string The email of the user to update subscription for. (required)
```
@ -19,4 +19,4 @@ ente admin update-subscription [flags]
* [ente admin](ente_admin.md) - Commands for admin actions
###### Auto generated by spf13/cobra on 12-Mar-2024
###### Auto generated by spf13/cobra on 13-Mar-2024

View file

@ -13,4 +13,4 @@ Authenticator commands
* [ente](ente.md) - CLI tool for exporting your photos from ente.io
* [ente auth decrypt](ente_auth_decrypt.md) - Decrypt authenticator export
###### Auto generated by spf13/cobra on 12-Mar-2024
###### Auto generated by spf13/cobra on 13-Mar-2024

View file

@ -16,4 +16,4 @@ ente auth decrypt [input] [output] [flags]
* [ente auth](ente_auth.md) - Authenticator commands
###### Auto generated by spf13/cobra on 12-Mar-2024
###### Auto generated by spf13/cobra on 13-Mar-2024

View file

@ -16,4 +16,4 @@ ente export [flags]
* [ente](ente.md) - CLI tool for exporting your photos from ente.io
###### Auto generated by spf13/cobra on 12-Mar-2024
###### Auto generated by spf13/cobra on 13-Mar-2024

View file

@ -16,4 +16,4 @@ ente version [flags]
* [ente](ente.md) - CLI tool for exporting your photos from ente.io
###### Auto generated by spf13/cobra on 12-Mar-2024
###### Auto generated by spf13/cobra on 13-Mar-2024

27
cli/docs/selfhost.md Normal file
View file

@ -0,0 +1,27 @@
## Self Hosting
If you are self-hosting the server, you can still configure CLI to export data & perform basic admin actions.
To do this, first configure the CLI to point to your server.
Define a config.yaml and put it either in the same directory as CLI binary or path defined in env variable `ENTE_CLI_CONFIG_PATH`
```yaml
endpoint:
api: "http://localhost:8080"
```
You should be able to [add an account](https://github.com/ente-io/ente/blob/main/cli/docs/generated/ente_account_add.md), and subsequently increase the [storage and account validity](https://github.com/ente-io/ente/blob/main/cli/docs/generated/ente_admin_update-subscription.md) using the CLI.
For the admin actions, you first need to whitelist admin users. You can create `server/museum.yaml`, and whitelist add the admin userID `internal.admins`. See [local.yaml](https://github.com/ente-io/ente/blob/main/server/configurations/local.yaml#L211C1-L232C1) in the server source code for details about how to define this.
You can use [account list](https://github.com/ente-io/ente/blob/main/cli/docs/generated/ente_account_list.md) command to find the user id of any account.
```yaml
# ....
internal:
admins:
# - 1580559962386440
# ....
```