Add per-user download directory
This commit is contained in:
parent
1532b2a8c8
commit
6b5bf4ced1
@ -5,7 +5,6 @@ port = 80
|
||||
hexIP = false
|
||||
verify_certificates = true
|
||||
|
||||
download_folder = ""
|
||||
autoget = false
|
||||
|
||||
# Defaults for the client connect form
|
||||
|
@ -13,8 +13,7 @@ type Config struct {
|
||||
Port string
|
||||
Dev bool
|
||||
HexIP bool
|
||||
VerifyCertificates bool `mapstructure:"verify_certificates"`
|
||||
DownloadFolder string `mapstructure:"download_folder"`
|
||||
VerifyCertificates bool `mapstructure:"verify_certificates"`
|
||||
Autoget bool
|
||||
Headers map[string]string
|
||||
Defaults Defaults
|
||||
|
@ -70,7 +70,7 @@ func connectIRC(server *storage.Server, state *State, srcIP []byte) *irc.Client
|
||||
}
|
||||
}
|
||||
|
||||
i.DownloadFolder = cfg.DownloadFolder
|
||||
i.DownloadFolder = storage.Path.Downloads(state.user.Username)
|
||||
i.Autoget = cfg.Autoget
|
||||
|
||||
state.setIRC(server.Host, i)
|
||||
|
@ -52,6 +52,10 @@ func (d directory) Key(username string) string {
|
||||
return filepath.Join(d.User(username), "key.pem")
|
||||
}
|
||||
|
||||
func (d directory) Downloads(username string) string {
|
||||
return filepath.Join(d.User(username), "downloads")
|
||||
}
|
||||
|
||||
func (d directory) Config() string {
|
||||
return filepath.Join(d.ConfigRoot(), "config.toml")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user