1package config23import (4 "bytes"5 "text/template"6)78var configFileTmpl = template.Must(template.New("config").Parse(`# Soft Serve Server configurations910# The name of the server.11# This is the name that will be displayed in the UI.12name: "{{ .Name }}"1314# Logging configuration.15log:16 # Log format to use. Valid values are "json", "logfmt", and "text".17 format: "{{ .Log.Format }}"18 # Time format for the log "timestamp" field.19 # Should be described in Golang's time format.20 time_format: "{{ .Log.TimeFormat }}"21 # Path to the log file. Leave empty to write to stderr.22 #path: "{{ .Log.Path }}"2324# The SSH server configuration.25ssh:26 # Enable SSH.27 enabled: {{ .SSH.Enabled }}2829 # The address on which the SSH server will listen.30 listen_addr: "{{ .SSH.ListenAddr }}"3132 # The public URL of the SSH server.33 # This is the address that will be used to clone repositories.34 public_url: "{{ .SSH.PublicURL }}"3536 # The path to the SSH server's private key.37 key_path: {{ .SSH.KeyPath }}3839 # The path to the server's client private key. This key will be used to40 # authenticate the server to make git requests to ssh remotes.41 client_key_path: {{ .SSH.ClientKeyPath }}4243 # The maximum number of seconds a connection can take.44 # A value of 0 means no timeout.45 max_timeout: {{ .SSH.MaxTimeout }}4647 # The number of seconds a connection can be idle before it is closed.48 # A value of 0 means no timeout.49 idle_timeout: {{ .SSH.IdleTimeout }}5051# The Git daemon configuration.52git:53 # Enable the Git daemon.54 enabled: {{ .Git.Enabled }}5556 # The address on which the Git daemon will listen.57 listen_addr: "{{ .Git.ListenAddr }}"5859 # The public URL of the Git daemon server.60 # This is the address that will be used to clone repositories.61 public_url: "{{ .Git.PublicURL }}"6263 # The maximum number of seconds a connection can take.64 # A value of 0 means no timeout.65 max_timeout: {{ .Git.MaxTimeout }}6667 # The number of seconds a connection can be idle before it is closed.68 idle_timeout: {{ .Git.IdleTimeout }}6970 # The maximum number of concurrent connections.71 max_connections: {{ .Git.MaxConnections }}7273# The HTTP server configuration.74http:75 # Enable the HTTP server.76 enabled: {{ .HTTP.Enabled }}7778 # The address on which the HTTP server will listen.79 listen_addr: "{{ .HTTP.ListenAddr }}"8081 # The path to the TLS private key.82 tls_key_path: {{ .HTTP.TLSKeyPath }}8384 # The path to the TLS certificate.85 tls_cert_path: {{ .HTTP.TLSCertPath }}8687 # The public URL of the HTTP server.88 # This is the address that will be used to clone repositories.89 # Make sure to use https:// if you are using TLS.90 public_url: "{{ .HTTP.PublicURL }}"9192# The stats server configuration.93stats:94 # Enable the stats server.95 enabled: {{ .Stats.Enabled }}9697 # The address on which the stats server will listen.98 listen_addr: "{{ .Stats.ListenAddr }}"99100# The database configuration.101db:102 # The database driver to use.103 # Valid values are "sqlite" and "postgres".104 driver: "{{ .DB.Driver }}"105 # The database data source name.106 # This is driver specific and can be a file path or connection string.107 # Make sure foreign key support is enabled when using SQLite.108 data_source: "{{ .DB.DataSource }}"109110# Git LFS configuration.111lfs:112 # Enable Git LFS.113 enabled: {{ .LFS.Enabled }}114 # Enable Git SSH transfer.115 ssh_enabled: {{ .LFS.SSHEnabled }}116117# Cron job configuration118jobs:119 mirror_pull: "{{ .Jobs.MirrorPull }}"120121# Additional admin keys.122#initial_admin_keys:123# - "ssh-rsa AAAAB3NzaC1yc2..."124`))125126func newConfigFile(cfg *Config) string {127 var b bytes.Buffer128 configFileTmpl.Execute(&b, cfg) // nolint: errcheck129 return b.String()130}