diff --git a/apps/docs/content/references/zsc.mdx b/apps/docs/content/references/zsc.mdx index 677ca34d..cf170f75 100644 --- a/apps/docs/content/references/zsc.mdx +++ b/apps/docs/content/references/zsc.mdx @@ -69,7 +69,7 @@ zsc backup-create ``` #### Required parameters -- `stackName`: Name of the stack to backup +- ``: Name of the stack to backup #### Available flags - `-h, --help`: Help for the backup-create command @@ -113,128 +113,6 @@ zsc cdn purge example.com "/images/" ::: --- -### object-storage - -Manages object storage operations for backups and restores. - -```sh -zsc object-storage [command] -``` - -#### Available flags -- `-h, --help`: Help for the object-storage command - -When using `--storage objectstorage`, the command requires the following environment variables to be defined: - -* `objectstorage_apiUrl` - API URL of the object storage service -* `objectstorage_accessKeyId` - Access key ID for authentication -* `objectstorage_secretAccessKey` - Secret access key for authentication -* `objectstorage_bucketName` - Name of the bucket to use - -These environment variables will be automatically available if the object storage service has `envIsolation: none` configured, or if the entire project has `envIsolation: none` set. Otherwise, you need to explicitly reference these environment variables in your `zerops.yaml` file. - -#### Sub-commands - -#### Common parameters -All sub-commands share these parameters: -- `--storage`: Name of the object storage service -- `--name`: Name of the backup in storage -- `--silent`, `-s`: Suppresses command output (default: false) -- `--no-fail`: Prevents command failure with exit code 1 (default: false) - -**list** - Lists all available backups in the specified storage -```sh -zsc object-storage list --storage --name -``` - -**backup** - Creates a backup of specified directories to object storage -```sh -zsc object-storage backup [...] --storage --name [options] -``` -Additional options: -- `--truncateCount`: If greater than 0, truncate operation is performed after successful backup, keeping the specified number of most recent backups (default: 0) - -**restore** - Restores a backup from object storage -```sh -zsc object-storage restore [] --storage --name [options] -``` -Additional options: -- `--dryRun`: Simulates restore operation without performing actual changes -- `--overwrite`: Allows overwriting existing files during restore -- `--index`: Specifies which backup to restore. Non-negative values count from newest (0 = newest, 1 = second newest), negative values count from oldest (-1 = oldest, -2 = second oldest) (default: 0) -- `--ignore-non-existing`: Prevents command failure if backup doesn't exist - -**truncate** - Removes old backups, keeping only the most recent ones -```sh -zsc object-storage truncate --storage --name [options] -``` -Additional options: -- `--dryRun`: Simulates truncate operation without performing actual deletions (default: false) -- `--truncateCount`: Number of most recent backups to keep (default: 5) - -#### Examples -```sh -# List all backups -zsc object-storage list --storage objectstorage --name daily-backup - -# Create a backup with retention -zsc object-storage backup /var/www --storage objectstorage --name web-backup --truncateCount 5 - -# Restore with dry run preview -zsc object-storage restore --storage objectstorage --name database-backup --dryRun - -# Clean up old backups -zsc object-storage truncate --storage objectstorage --name logs-backup --truncateCount 3 -``` - -#### Example usage in `zerops.yaml` -```yaml -zerops: - - setup: app - run: - initCommands: - - "zsc object-storage restore --storage objectstorage --name $ZEROPS_StackName --ignore-non-existing ./data/" - crontab: - - timing: "*/10 * * * *" - command: "zsc object-storage backup --storage objectstorage --name $ZEROPS_StackName --truncateCount 5 ./data/" - allContainers: false -``` - ---- - -### shared-storage - -Manages shared storage volumes for persistent data storage. - -```sh -zsc shared-storage [command] -``` - -#### Available sub-commands -- `mount`: Mounts the shared storage -- `unmount`: Unmounts the shared storage -- `wait`: Waits for readiness of the storage mount - -#### Available flags -- `-h, --help`: Help for the shared-storage command - -#### Examples -```sh -# View shared-storage help -zsc shared-storage --help - -# Mount a shared storage volume -zsc shared-storage mount - -# Unmount a shared storage volume -zsc shared-storage unmount - -# Wait for a storage mount to be ready -zsc shared-storage wait -``` - ---- - ### crontab Manages scheduled tasks that are defined in your zerops.yaml configuration. @@ -312,7 +190,7 @@ zsc install [flags] ``` #### Required parameters -- `baseName`: The technology and version to install - see the full list of supported [base environments](/zerops-yaml/base-list). +- ``: The technology and version to install - see the full list of supported [base environments](/zerops-yaml/base-list). #### Available flags - `--buildBase `: Build base (default "php@8.4") @@ -386,6 +264,103 @@ zerops: --- +### object-storage + +Manages object storage operations for backups and restores. + +```sh +zsc object-storage [command] +``` + +#### Available flags +- `-h, --help`: Help for the object-storage command + +When using an object storage service, the command requires the following environment variables to be defined: + +* `objectstorage_apiUrl` - API URL of the object storage service +* `objectstorage_accessKeyId` - Access key ID for authentication +* `objectstorage_secretAccessKey` - Secret access key for authentication +* `objectstorage_bucketName` - Name of the bucket to use + +These environment variables will be automatically available if the object storage service has `envIsolation: none` configured, or if the entire project has `envIsolation: none` set. Otherwise, you need to explicitly reference these environment variables in your `zerops.yaml` file. + +#### Sub-commands + +#### Common parameters +All sub-commands share these parameters: +- `--storage `: Name of the object storage service +- `--name `: Name of the backup in storage +- `--silent`, `-s`: Suppresses command output (default: false) +- `--no-fail`: Prevents command failure with exit code 1 (default: false) + +**list** - Lists all available backups in the specified storage +```sh +zsc object-storage list --storage --name +``` + +**backup** - Creates a backup of specified directories to object storage +```sh +zsc object-storage backup [...] --storage --name [options] +``` +Arguments: +- ``: One or more directories to back up (at least one required) + +Additional options: +- `--truncate-count `: Number of most recent backups to keep after successful backup (default: 0) +- `-C, --change-directory `: Change to directory before operation + +**restore** - Restores a backup from object storage to specified or original locations +```sh +zsc object-storage restore --storage --name [options] +``` +Arguments: +- ``: Directory to restore to. If omitted, files are restored to their original locations + +Additional options: +- `--dryRun`: Simulates restore operation without performing actual changes +- `--overwrite`: Allows overwriting existing files during restore +- `--index `: Specifies which backup to restore. Non-negative values count from newest (0 = newest, 1 = second newest), negative values count from oldest (-1 = oldest, -2 = second oldest) (default: 0) +- `--ignore-non-existing`: Prevents command failure if backup does not exist +- `--strip-components `: Strip NUMBER leading components from file names on extraction + +**truncate** - Removes old backups, keeping only the most recent ones +```sh +zsc object-storage truncate --storage --name [options] +``` +Additional options: +- `--dryRun`: Simulates truncate operation without performing actual deletions (default: false) +- `--truncate-count `: Number of most recent backups to keep (default: 5) + +#### Examples +```sh +# List all backups +zsc object-storage list --storage objectstorage --name daily-backup + +# Create a backup with retention +zsc object-storage backup /var/www --storage objectstorage --name web-backup --truncate-count 5 + +# Restore with dry run preview +zsc object-storage restore --storage objectstorage --name database-backup --dryRun + +# Clean up old backups +zsc object-storage truncate --storage objectstorage --name logs-backup --truncate-count 3 +``` + +#### Example usage in `zerops.yaml` +```yaml +zerops: + - setup: app + run: + initCommands: + - "zsc object-storage restore --storage objectstorage --name $ZEROPS_StackName --ignore-non-existing ./data/" + crontab: + - timing: "*/10 * * * *" + command: "zsc object-storage backup --storage objectstorage --name $ZEROPS_StackName --truncate-count 5 ./data/" + allContainers: false +``` + +--- + ### resources Displays the current resource scaling configuration for the container. @@ -461,33 +436,6 @@ The container will scale down automatically if resources are not utilized, or if --- -### test - -Run diagnostic tests to verify connectivity and service availability. - -```sh -zsc test tcp : [flags] -``` - -#### Required parameters -- `:`: Host and port to test connectivity to - -#### Available flags -- `--timeout `: Maximum test duration (default: 30s) -- `--dialTimeout `: Single attempt timeout (default: 2s) -- `-4`: Force IPv4 -- `-6`: Force IPv6 -- `-h, --help`: Help for the test tcp command - -#### Example -```sh -# Test TCP connection to a host -zsc test tcp api.zerops:80 -zsc test tcp database:5432 --timeout 1m -``` - ---- - ### setSecretEnv Securely update environment variables containing sensitive information. @@ -497,8 +445,8 @@ zsc setSecretEnv ``` #### Arguments -- `key`: The name of the environment variable to set -- `content`: The new value for the variable, or `-` to read from stdin +- ``: The name of the environment variable to set +- ``: The new value for the variable, or `-` to read from stdin #### Available flags - `-h, --help`: Help for the setSecretEnv command @@ -521,6 +469,66 @@ Secret environment variables are encrypted at rest and securely distributed to y --- +### shared-storage + +Manages shared storage volumes for persistent data storage. + +```sh +zsc shared-storage [command] +``` + +#### Available sub-commands +- `mount`: Mounts the shared storage +- `unmount`: Unmounts the shared storage +- `wait`: Waits for readiness of the storage mount + +#### Available flags +- `-h, --help`: Help for the shared-storage command + +#### Examples +```sh +# View shared-storage help +zsc shared-storage --help + +# Mount a shared storage volume +zsc shared-storage mount + +# Unmount a shared storage volume +zsc shared-storage unmount + +# Wait for a storage mount to be ready +zsc shared-storage wait +``` + +--- + +### test + +Run diagnostic tests to verify connectivity and service availability. + +```sh +zsc test tcp : [flags] +``` + +#### Required parameters +- `:`: Host and port to test connectivity to + +#### Available flags +- `--timeout `: Maximum test duration (default: 30s) +- `--dialTimeout `: Single attempt timeout (default: 2s) +- `-4`: Force IPv4 +- `-6`: Force IPv6 +- `-h, --help`: Help for the test tcp command + +#### Example +```sh +# Test TCP connection to a host +zsc test tcp api.zerops:80 +zsc test tcp database:5432 --timeout 1m +``` + +--- + ### version Displays the current version of Zsc CLI. diff --git a/apps/docs/static/llms-full.txt b/apps/docs/static/llms-full.txt index eed2a0fa..930b74bf 100644 --- a/apps/docs/static/llms-full.txt +++ b/apps/docs/static/llms-full.txt @@ -22401,7 +22401,7 @@ Creates a backup of any specified stack in your project. zsc backup-create ``` #### Required parameters -- `stackName`: Name of the stack to backup +- ``: Name of the stack to backup #### Available flags - `-h, --help`: Help for the backup-create command #### Example @@ -22434,99 +22434,6 @@ zsc cdn purge example.com "/images/" - Currently, the purge command only works for the [Static Mode](/features/cdn#static-mode) CDN ::: --- -### object-storage -Manages object storage operations for backups and restores. -```sh -zsc object-storage [command] -``` -#### Available flags -- `-h, --help`: Help for the object-storage command -When using `--storage objectstorage`, the command requires the following environment variables to be defined: -* `objectstorage_apiUrl` - API URL of the object storage service -* `objectstorage_accessKeyId` - Access key ID for authentication -* `objectstorage_secretAccessKey` - Secret access key for authentication -* `objectstorage_bucketName` - Name of the bucket to use -These environment variables will be automatically available if the object storage service has `envIsolation: none` configured, or if the entire project has `envIsolation: none` set. Otherwise, you need to explicitly reference these environment variables in your `zerops.yaml` file. -#### Sub-commands -#### Common parameters -All sub-commands share these parameters: -- `--storage`: Name of the object storage service -- `--name`: Name of the backup in storage -- `--silent`, `-s`: Suppresses command output (default: false) -- `--no-fail`: Prevents command failure with exit code 1 (default: false) -**list** - Lists all available backups in the specified storage -```sh -zsc object-storage list --storage --name -``` -**backup** - Creates a backup of specified directories to object storage -```sh -zsc object-storage backup [...] --storage --name [options] -``` -Additional options: -- `--truncateCount`: If greater than 0, truncate operation is performed after successful backup, keeping the specified number of most recent backups (default: 0) -**restore** - Restores a backup from object storage -```sh -zsc object-storage restore [] --storage --name [options] -``` -Additional options: -- `--dryRun`: Simulates restore operation without performing actual changes -- `--overwrite`: Allows overwriting existing files during restore -- `--index`: Specifies which backup to restore. Non-negative values count from newest (0 = newest, 1 = second newest), negative values count from oldest (-1 = oldest, -2 = second oldest) (default: 0) -- `--ignore-non-existing`: Prevents command failure if backup doesn't exist -**truncate** - Removes old backups, keeping only the most recent ones -```sh -zsc object-storage truncate --storage --name [options] -``` -Additional options: -- `--dryRun`: Simulates truncate operation without performing actual deletions (default: false) -- `--truncateCount`: Number of most recent backups to keep (default: 5) -#### Examples -```sh -# List all backups -zsc object-storage list --storage objectstorage --name daily-backup -# Create a backup with retention -zsc object-storage backup /var/www --storage objectstorage --name web-backup --truncateCount 5 -# Restore with dry run preview -zsc object-storage restore --storage objectstorage --name database-backup --dryRun -# Clean up old backups -zsc object-storage truncate --storage objectstorage --name logs-backup --truncateCount 3 -``` -#### Example usage in `zerops.yaml` -```yaml -zerops: - - setup: app - run: - initCommands: - - "zsc object-storage restore --storage objectstorage --name $ZEROPS_StackName --ignore-non-existing ./data/" - crontab: - - timing: "*/10 * * * *" - command: "zsc object-storage backup --storage objectstorage --name $ZEROPS_StackName --truncateCount 5 ./data/" - allContainers: false -``` ---- -### shared-storage -Manages shared storage volumes for persistent data storage. -```sh -zsc shared-storage [command] -``` -#### Available sub-commands -- `mount`: Mounts the shared storage -- `unmount`: Unmounts the shared storage -- `wait`: Waits for readiness of the storage mount -#### Available flags -- `-h, --help`: Help for the shared-storage command -#### Examples -```sh -# View shared-storage help -zsc shared-storage --help -# Mount a shared storage volume -zsc shared-storage mount -# Unmount a shared storage volume -zsc shared-storage unmount -# Wait for a storage mount to be ready -zsc shared-storage wait -``` ---- ### crontab Manages scheduled tasks that are defined in your zerops.yaml configuration. ```sh @@ -22580,7 +22487,7 @@ Run install commands for the specified base technology in your runtime container zsc install [flags] ``` #### Required parameters -- `baseName`: The technology and version to install - see the full list of supported [base environments](/zerops-yaml/base-list). +- ``: The technology and version to install - see the full list of supported [base environments](/zerops-yaml/base-list). #### Available flags - `--buildBase `: Build base (default "php@8.4") - `--buildOs `: Build os (default "alpine") @@ -22641,6 +22548,82 @@ zerops: http: true ``` --- +### object-storage +Manages object storage operations for backups and restores. +```sh +zsc object-storage [command] +``` +#### Available flags +- `-h, --help`: Help for the object-storage command +When using an object storage service, the command requires the following environment variables to be defined: +* `objectstorage_apiUrl` - API URL of the object storage service +* `objectstorage_accessKeyId` - Access key ID for authentication +* `objectstorage_secretAccessKey` - Secret access key for authentication +* `objectstorage_bucketName` - Name of the bucket to use +These environment variables will be automatically available if the object storage service has `envIsolation: none` configured, or if the entire project has `envIsolation: none` set. Otherwise, you need to explicitly reference these environment variables in your `zerops.yaml` file. +#### Sub-commands +#### Common parameters +All sub-commands share these parameters: +- `--storage `: Name of the object storage service +- `--name `: Name of the backup in storage +- `--silent`, `-s`: Suppresses command output (default: false) +- `--no-fail`: Prevents command failure with exit code 1 (default: false) +**list** - Lists all available backups in the specified storage +```sh +zsc object-storage list --storage --name +``` +**backup** - Creates a backup of specified directories to object storage +```sh +zsc object-storage backup [...] --storage --name [options] +``` +Arguments: +- ``: One or more directories to back up (at least one required) +Additional options: +- `--truncate-count `: Number of most recent backups to keep after successful backup (default: 0) +- `-C, --change-directory `: Change to directory before operation +**restore** - Restores a backup from object storage to specified or original locations +```sh +zsc object-storage restore --storage --name [options] +``` +Arguments: +- ``: Directory to restore to. If omitted, files are restored to their original locations +Additional options: +- `--dryRun`: Simulates restore operation without performing actual changes +- `--overwrite`: Allows overwriting existing files during restore +- `--index `: Specifies which backup to restore. Non-negative values count from newest (0 = newest, 1 = second newest), negative values count from oldest (-1 = oldest, -2 = second oldest) (default: 0) +- `--ignore-non-existing`: Prevents command failure if backup does not exist +- `--strip-components `: Strip NUMBER leading components from file names on extraction +**truncate** - Removes old backups, keeping only the most recent ones +```sh +zsc object-storage truncate --storage --name [options] +``` +Additional options: +- `--dryRun`: Simulates truncate operation without performing actual deletions (default: false) +- `--truncate-count `: Number of most recent backups to keep (default: 5) +#### Examples +```sh +# List all backups +zsc object-storage list --storage objectstorage --name daily-backup +# Create a backup with retention +zsc object-storage backup /var/www --storage objectstorage --name web-backup --truncate-count 5 +# Restore with dry run preview +zsc object-storage restore --storage objectstorage --name database-backup --dryRun +# Clean up old backups +zsc object-storage truncate --storage objectstorage --name logs-backup --truncate-count 3 +``` +#### Example usage in `zerops.yaml` +```yaml +zerops: + - setup: app + run: + initCommands: + - "zsc object-storage restore --storage objectstorage --name $ZEROPS_StackName --ignore-non-existing ./data/" + crontab: + - timing: "*/10 * * * *" + command: "zsc object-storage backup --storage objectstorage --name $ZEROPS_StackName --truncate-count 5 ./data/" + allContainers: false +``` +--- ### resources Displays the current resource scaling configuration for the container. ```sh @@ -22699,34 +22682,14 @@ If there are insufficient resources on the current server, the container might b The container will scale down automatically if resources are not utilized, or if the scale command duration expires. ::: --- -### test -Run diagnostic tests to verify connectivity and service availability. -```sh -zsc test tcp : [flags] -``` -#### Required parameters -- `:`: Host and port to test connectivity to -#### Available flags -- `--timeout `: Maximum test duration (default: 30s) -- `--dialTimeout `: Single attempt timeout (default: 2s) -- `-4`: Force IPv4 -- `-6`: Force IPv6 -- `-h, --help`: Help for the test tcp command -#### Example -```sh -# Test TCP connection to a host -zsc test tcp api.zerops:80 -zsc test tcp database:5432 --timeout 1m -``` ---- ### setSecretEnv Securely update environment variables containing sensitive information. ```sh zsc setSecretEnv ``` #### Arguments -- `key`: The name of the environment variable to set -- `content`: The new value for the variable, or `-` to read from stdin +- ``: The name of the environment variable to set +- ``: The new value for the variable, or `-` to read from stdin #### Available flags - `-h, --help`: Help for the setSecretEnv command #### Examples @@ -22742,6 +22705,49 @@ cat api_key.txt | zsc setSecretEnv API_KEY - Secret environment variables are encrypted at rest and securely distributed to your containers. Use this command for storing sensitive configuration like API keys, tokens, and passwords. ::: --- +### shared-storage +Manages shared storage volumes for persistent data storage. +```sh +zsc shared-storage [command] +``` +#### Available sub-commands +- `mount`: Mounts the shared storage +- `unmount`: Unmounts the shared storage +- `wait`: Waits for readiness of the storage mount +#### Available flags +- `-h, --help`: Help for the shared-storage command +#### Examples +```sh +# View shared-storage help +zsc shared-storage --help +# Mount a shared storage volume +zsc shared-storage mount +# Unmount a shared storage volume +zsc shared-storage unmount +# Wait for a storage mount to be ready +zsc shared-storage wait +``` +--- +### test +Run diagnostic tests to verify connectivity and service availability. +```sh +zsc test tcp : [flags] +``` +#### Required parameters +- `:`: Host and port to test connectivity to +#### Available flags +- `--timeout `: Maximum test duration (default: 30s) +- `--dialTimeout `: Single attempt timeout (default: 2s) +- `-4`: Force IPv4 +- `-6`: Force IPv6 +- `-h, --help`: Help for the test tcp command +#### Example +```sh +# Test TCP connection to a host +zsc test tcp api.zerops:80 +zsc test tcp database:5432 --timeout 1m +``` +--- ### version Displays the current version of Zsc CLI. ```sh