Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion lib/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,13 @@ func (cfg *Config) init() error {

cfg.SourcePath = filepath.Clean(cfg.SourcePath)

// Resolve symlinks
re, err := filepath.EvalSymlinks(cfg.SourcePath)
if err != nil {
return errors.New("failed to resolve symlink " + err.Error())
}
cfg.SourcePath = re

// Sanity check to prevent people from uploading their entire disk.
// The returned path from filepath.Clean ends in a slash only if it represents
// a root directory, such as "/" on Unix or `C:\` on Windows.
Expand Down Expand Up @@ -251,7 +258,7 @@ func (cfg *Config) init() error {
}

// load additional config (routes) from file if it exists.
err := cfg.loadFileConfig()
err = cfg.loadFileConfig()
if err != nil {
return fmt.Errorf("failed to load config from %s: %s", cfg.ConfigFile, err)
}
Expand Down