code: func loadConfig(arg string) (*serverinit.Config, error) {
  	if strings.HasPrefix(arg, "http://") || strings.HasPrefix(arg, "https://") {
  		contents, err := slurpURL(arg, 256<<10)
  		if err != nil {
  			return nil, err
  		}
  		return serverinit.Load(contents)
  	}
  	var absPath string
  	switch {
  	case arg == "":
  		absPath = osutil.UserServerConfigPath()
  		_, err := wkfs.Stat(absPath)
  		if err == nil {
  			break
  		}
  		if !os.IsNotExist(err) {
  			return nil, err
  		}
  		conf, err := serverinit.DefaultEnvConfig()
  		if err != nil || conf != nil {
  			return conf, err
  		}
  		configDir, err := osutil.PerkeepConfigDir()
  		if err != nil {
  			return nil, err
  		}
  		if err := wkfs.MkdirAll(configDir, 0700); err != nil {
  			return nil, err
  		}
  		log.Printf("Generating template config file %s", absPath)
  		if err := serverinit.WriteDefaultConfigFile(absPath, sqlite.CompiledIn()); err != nil {
  			return nil, err
  		}
  	case filepath.IsAbs(arg):
  		absPath = arg
  	default:
  		configDir, err := osutil.PerkeepConfigDir()
  		if err != nil {
  			return nil, err
  		}
  		absPath = filepath.Join(configDir, arg)
  	}
  	return serverinit.LoadFile(absPath)
  }
docs: // loadConfig returns the server's parsed config file, locating it using the provided arg.
  //
  // The arg may be of the form:
  // - empty, to mean automatic (will write a default high-level config if
  //   no cloud config is available)
  // - a filepath absolute or relative to the user's configuration directory,
  // - a URL