Initializing SFP server
Availability
✅
❌
From
December 24
The sfp server init
command initializes a new SFP server tenant with all necessary configurations, services, and secret management. This command sets up the complete infrastructure required for running an SFP server instance.
Usage
Flags
-t, --tenant
Yes
Name of the tenant. Must contain only lowercase letters, numbers, and hyphens
-m, --mode
No
Environment mode: dev
or prod
(default: dev
)
-f, --force
No
Force initialization even if tenant already exists
-i, --interactive
No
Enable/disable interactive mode for configuration (default: true)
-d, --domain
No
Custom domain for the server. Required in prod mode
--worker-counts
No
Comma-separated worker counts for critical,normal,batch (default: "1,1,1")
--secrets-provider
No
Secret management provider to use (default: "infisical")
Secret Provider Options
The command supports multiple secret management providers, each with its own configuration flags:
Infisical
--infisical-token
: Authentication token for Infisical
Azure Key Vault
--keyvault-url
: URL of the Azure Key Vault--keyvault-tenant-id
: Azure tenant ID--keyvault-client-id
: Azure client ID--keyvault-client-secret
: Azure client secret
AWS Secrets Manager
--aws-region
: AWS region--aws-access-key-id
: AWS access key ID--aws-secret-access-key
: AWS secret access key
HashiCorp Vault
--vault-url
: URL of the HashiCorp Vault--vault-token
: Authentication token for Vault
Examples
Initialize a development server:
Initialize a production server with Infisical:
Initialize with Azure Key Vault:
Initialize with custom worker configuration:
Behavior
Directory Structure: Creates a structured directory layout under
./sfp-server/tenants/<tenant-name>
containing:Configuration files
Secret management setup
Docker compose files
Service configurations
Environment Setup:
Development Mode: Sets up local development environment with default configurations
Production Mode: Configures production-ready setup with specified domain and secret management
Services Configuration:
Configures Docker services
Sets up database schema and migrations
Initializes worker processes
Configures reverse proxy (Caddy)
Secret Management:
Integrates with specified secrets provider
Sets up secure storage and access patterns
Configures necessary authentication
Error Handling
The command will fail with appropriate error messages in the following scenarios:
Invalid tenant name format
Missing required provider-specific configuration
Existing tenant without force flag
Invalid worker count format
Failed service initialization
Post-Initialization
After successful initialization, the command outputs:
Tenant URL and access details
Available management commands
Service status information
You can manage the initialized server using other sfp server
commands:
Note: For production deployments, ensure you have configured your domain DNS settings and have necessary SSL certificates before initialization.
Warning: The
--force
flag will overwrite existing configurations. Use with caution in production environments.
Last updated