# See https://garagehq.deuxfleurs.fr/documentation/reference-manual/configuration/
# for a complete documentation of the available options.

# Hint: If you want to initialize a Garage cluster with just a single node, run:
#
# $ node_id=$(garage node id -q | cut -d@ -f1)
# $ garage layout assign -c1 -z garage $node_id
# $ garage layout apply --version 1
#

# The directory in which Garage will store its metadata.
metadata_dir = "/var/lib/garage/meta"

# The directory in which Garage will store the data blocks of objects.
data_dir = "/var/lib/garage/data"

# Whether to enable synchronous mode for the database engine or not.
#metadata_fsync = false

# Whether to fsync data blocks and their containing directory after they are
# saved to disk.
#data_fsync = false

# Whether to automatically run a scrub of the data directory approximately once
# per month. If you are already scrubbing at the filesystem level, you can set
# this option to true to disable automatic scrub.
#disable_scrub = false

# Garage is only built with "lmdb" on Alpine Linux since v3.19! If you're still
# using "sled", migrate it using 'garage-convert-db' package from Alpine v3.18.
#db_engine = "lmdb"

# The block size for stored objects.
#block_size = "1M"

# A limit on the total size of data blocks kept in RAM by S3 API nodes awaiting
# to be sent to storage nodes asynchronously.
#block_ram_buffer_max = "256MiB"

# The map size used by LMDB, which is the size of the virtual memory region
# used for mapping the database file. It's not bound by the physical RAM size
# of the machine running Garage.
#lmdb_map_size = "1T"

# This can be any positive integer smaller or equal the node count in your
# cluster. It must be the same in the configuration files of all nodes!
# If you're running a cluster of Garage nodes, change this to at least 2!
replication_factor = 1

# This determines the read and write behaviour of your cluster. Read the
# reference manual before changing!
#consistency_mode = "consistent"

# Zstd compression level to use for storing blocks. Defaults to 1.
#compression_level = 1

# The address and port on which to bind for inter-cluster communications.
# Hint: Change to 127.0.0.1:3901 if running a single node cluster.
rpc_bind_addr = "[::]:3901"

# If enabled, pre-bind all sockets for outgoing connections to the same IP
# address used for listening (rpc_bind_addr) before trying to connect to remote
# nodes.
#rpc_bind_outgoing = false

# The address and port that other nodes need to use to contact this node for
# RPC calls.
# rpc_public_addr = "127.0.0.1:3901"

# The secret key file that is shared between all nodes of the cluster in order
# to identify these nodes and allow them to communicate together. The key is a
# 32-byte hex-encoded random string.
# If this file doesn't exist, it will be automatically created with a random
# string on the service start.
rpc_secret_file = "/etc/garage/rpc_secret"

# A list of peer identifiers on which to contact other Garage peers of this
# cluster. Format: <node public key>@<node public IP or hostname>:<port>.
#bootstrap_peers = []

[s3_api]
# The IP and port on which to bind for accepting S3 API calls. This endpoint
# doesn't support TLS: a reverse proxy (e.g. nginx) should be used to provide it.
api_bind_addr = "[::]:3900"

# The region name.
s3_region = "garage"

# The optional suffix to access bucket using vhost-style in addition to
# path-style request.
root_domain = ""

[s3_web]
# The IP and port on which to bind for accepting HTTP requests to buckets
# configured for website access. This endpoint doesn't support TLS: a reverse
# proxy (e.g. nginx) should be used to provide it.
bind_addr = "127.0.0.1:3902"

# The optional suffix appended to bucket names for the corresponding HTTP Host.
root_domain = ""

[admin]
# If specified, Garage will bind an HTTP server to this port and address,
# on which it will listen to requests for administration features.
#api_bind_addr = ""

# The token for accessing all of the other administration endpoints.
# If not set, access to these endpoints is disabled entirely.
#admin_token = ""
# or read it from the file.
# admin_token_file = "/etc/garage/admin_token"

# The token for accessing the Metrics endpoint. If not set, the Metrics
# endpoint can be accessed without access control!
#metrics_token = ""
# or read it from the file.
# metrics_token_file = "/etc/garage/metrics_token"
