feat(server): Add filesystem storage backend config options

The filesystem storage backend can be enabled by setting
`NIXERY_STORAGE_BACKEND` to `filesystem` and `STORAGE_PATH` to a disk
location from which Nixery can serve files.
This commit is contained in:
Vincent Ambo 2019-10-28 18:19:06 +01:00 committed by Vincent Ambo
parent 167a0b3263
commit 790bce219c
3 changed files with 11 additions and 1 deletions

View file

@ -42,6 +42,7 @@ type Backend int
const (
GCS = iota
FileSystem
)
// Config holds the Nixery configuration options.
@ -64,6 +65,8 @@ func FromEnv() (Config, error) {
switch os.Getenv("NIXERY_STORAGE_BACKEND") {
case "gcs":
b = GCS
case "filesystem":
b = FileSystem
default:
log.WithField("values", []string{
"gcs",