cloudinit

package
v1.20.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 22, 2026 License: MIT Imports: 2 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

func Generate(cfg Config) string

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

func GenerateEnvFileContent(cfg Config) string

GenerateEnvFileContent generates the .env file content for a worker.

func GenerateSetupScript

func GenerateSetupScript(cfg Config) string

GenerateSetupScript generates a setup script for manual provisioning via SSH.

func GenerateUpdateCommand

func GenerateUpdateCommand(cfg Config) string

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL