Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var BuildSha string
View Source
var BuildTime string
View Source
var ReleaseVersion string
View Source
var UserAgent = "github.com/webhookdb/icalproxy"
Functions ¶
func BuildTTLMap ¶
Types ¶
type Config ¶
type Config struct {
// Protect endpoints behind an "Authorization: Apikey <value>" header.
ApiKey string `env:"API_KEY"`
DatabaseUrl string `env:"DATABASE_URL, default=postgres://ical:ical@localhost:18042/ical?sslmode=disable"`
DatabaseConnectionPoolUrl string `env:"DATABASE_CONNECTION_POOL_URL"`
Debug bool `env:"DEBUG"`
// The HTTP request timeout, to avoid hung goroutines.
// 0 is no timeout. If Heroku is detected and 0 is set, use 27s.
HttpRequestTimeout int `env:"HTTP_REQUEST_TIMEOUT, default=0"`
LogFile string `env:"LOG_FILE"`
LogFormat string `env:"LOG_FORMAT"`
LogLevel string `env:"LOG_LEVEL, default=info"`
Port int `env:"PORT, default=18041"`
// Parsed from ICAL_TTL_ vars.
// See README for details.
IcalTTLMap map[types.NormalizedHostname]types.TTL
// Number of feeds that are refreshed at a time before changes are committed to the database.
// Smaller pages will see more responsive updates, while larger pages may see better performance.
RefreshPageSize int `env:"REFRESH_PAGE_SIZE, default=100"`
// Seconds to wait for an origin server before timing out an ICalendar feed request.
// Only used for the refresh routine.
RefreshTimeout int `env:"REFRESH_TIMEOUT, default=30"`
// When requesting an ICS url, and it is not in the database or has an expired TTL,
// a request is made synchronously. Because this is a slow, blocking request,
// it should have a fast timeout. If that request times out, the URL is still added
// to the database so it can be synced by the refresher, in case it's just a slow URL.
RequestTimeout int `env:"REQUEST_TIMEOUT, default=7"`
// When requesting an ICS url, and hitting the 'fallback' mode when the database is not available,
// use this timeout. Generally this should be a touch less than the load balancer timeout.
// We want to avoid load balancer timeouts since they indicate operations issues,
// whereas a timeout here is an origin issue.
RequestMaxTimeout int `env:"REQUEST_MAX_TIMEOUT, default=25"`
// AWS or similar access key (Cloudflare R2, etc).
// If empty, use the default AWS config loading behavior.
S3AccessKeyId string `env:"S3_ACCESS_KEY_ID, default=testkey"`
// AWS or similar secret (R2, etc).
S3AccessKeySecret string `env:"S3_ACCESS_KEY_SECRET, default=testsecret"`
// Bucket to store feeds.
S3Bucket string `env:"S3_BUCKET, default=icalproxy-feeds"`
// Endpoint to reach S3, R2, etc.
// Only set if not empty (so it can be empty for S3, for example).
// If using Cloudflare R2, set to https://<account id>.r2.cloudflarestorage.com
S3Endpoint string `env:"S3_ENDPOINT, default=http://localhost:18043"`
// Key prefix to store feed files under.
S3Prefix string `env:"S3_PREFIX, default=icalproxy/feeds"`
SentryDSN string `env:"SENTRY_DSN"`
WebhookPageSize int `env:"WEBHOOK_PAGE_SIZE, default=100"`
WebhookUrl string `env:"WEBHOOK_URL"`
}
func LoadConfig ¶
Click to show internal directories.
Click to hide internal directories.