Documentation
¶
Overview ¶
Package cloudinit provides cloud-init script generation for worker provisioning.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Generate ¶
Generate creates a cloud-config YAML for cloud-init based worker setup. Both DigitalOcean and Hetzner support this format natively. SSH key is injected by the cloud provider at creation time; we harden SSH (port 2222, pubkey-only) so the app can reach workers from App Platform where port 22 is blocked.
func GenerateEnvFileContent ¶
GenerateEnvFileContent generates the .env file content for a worker.
func GenerateSetupScript ¶
GenerateSetupScript generates a setup script for manual provisioning via SSH.
func GenerateUpdateCommand ¶
GenerateUpdateCommand generates the SSH command to update worker configuration.
Types ¶
type Config ¶
type Config struct {
// DatabaseURL is the PostgreSQL connection string.
DatabaseURL string
// HashIDSalt is the salt for encoding job IDs.
HashIDSalt string
// Concurrency is the number of worker containers to run on this host.
Concurrency int
// MaxJobsPerCycle is the number of jobs to process before restarting.
MaxJobsPerCycle int
// FastMode enables the stealth HTTP scraping mode.
FastMode bool
// Proxies is a comma-separated list of proxy URLs.
Proxies string
// RegistryURL is the container registry URL (e.g., "ghcr.io", "registry.digitalocean.com/myregistry").
RegistryURL string
// RegistryUsername is the username for registry authentication.
RegistryUsername string
// RegistryToken is the token/password for registry authentication.
RegistryToken string
// Image is the full image reference (e.g., "ghcr.io/gosom/google-maps-scraper-pro:latest").
Image string
}
Config contains the configuration for generating a cloud-init script.