From 25443cfaabbc4f0a708f6f87e27bdf0bace2abf5 Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Sat, 20 Mar 2021 23:33:39 +0000 Subject: [PATCH] fup: add bucket-url flag for specifying storage This allows setting the persistent storage location to save files into. NOTE: defaults to mem:// for development purposes, which... is gonna be a bad time. --- web/fup/cmd/root.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/web/fup/cmd/root.go b/web/fup/cmd/root.go index 8cb85282ac..fb42df7654 100644 --- a/web/fup/cmd/root.go +++ b/web/fup/cmd/root.go @@ -13,6 +13,7 @@ import ( var ( cfgFile string + bucketURL string rootCmd = &cobra.Command{ Use: "fup", @@ -29,6 +30,8 @@ func init() { cobra.OnInitialize(initConfig) rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file") + rootCmd.PersistentFlags().StringVar(&bucketURL, "bucket-url", "mem://", "gocloud.dev-compatible URL to use for file storage") + viper.BindPFlag("storage.bucketURL", rootCmd.PersistentFlags().Lookup("bucket-url")) } func initConfig() {