mirror of
https://github.com/m1k1o/neko-rooms.git
synced 2026-11-03 07:01:35 -06:00
Merge branch 'master' into custom-labels
This commit is contained in:
@@ -17,6 +17,7 @@ type Room struct {
|
||||
|
||||
NAT1To1IPs []string
|
||||
NekoImages []string
|
||||
PathPrefix string
|
||||
Labels []string
|
||||
|
||||
StorageEnabled bool
|
||||
@@ -62,6 +63,11 @@ func (Room) Init(cmd *cobra.Command) error {
|
||||
return err
|
||||
}
|
||||
|
||||
cmd.PersistentFlags().String("path_prefix", "", "path prefix that is added to every room path")
|
||||
if err := viper.BindPFlag("path_prefix", cmd.PersistentFlags().Lookup("path_prefix")); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
cmd.PersistentFlags().StringSlice("labels", []string{}, "additional labels appended to every room")
|
||||
if err := viper.BindPFlag("labels", cmd.PersistentFlags().Lookup("labels")); err != nil {
|
||||
return err
|
||||
@@ -158,6 +164,7 @@ func (s *Room) Set() {
|
||||
|
||||
s.NAT1To1IPs = viper.GetStringSlice("nat1to1")
|
||||
s.NekoImages = viper.GetStringSlice("neko_images")
|
||||
s.PathPrefix = viper.GetString("path_prefix")
|
||||
s.Labels = viper.GetStringSlice("labels")
|
||||
|
||||
s.StorageEnabled = viper.GetBool("storage.enabled")
|
||||
|
||||
Reference in New Issue
Block a user