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