feat: fix proxy compatibility and establish TUI foundation
This commit is contained in:
@@ -168,7 +168,9 @@ func ResolveConfiguration(environment profile.IdentityEnvironment) (Configuratio
|
||||
if stateDir == "" {
|
||||
stateDir = filepath.Join(owner.HomeDir, ".local", "state")
|
||||
}
|
||||
configDir := filepath.Dir(profileConfiguration.Path)
|
||||
// Profile storage lives below <XDG_CONFIG_HOME>/proxyctl, while gsettings
|
||||
// must receive the XDG base itself or dconf opens a proxyctl-private database.
|
||||
configDir := filepath.Dir(filepath.Dir(profileConfiguration.Path))
|
||||
dataDir := filepath.Join(owner.HomeDir, ".local", "share")
|
||||
if value, ok := environment.LookupEnv("XDG_DATA_HOME"); ok && filepath.IsAbs(value) && (!invoking || pathWithin(value, owner.HomeDir)) {
|
||||
dataDir = value
|
||||
@@ -691,7 +693,7 @@ func translate(input profile.Profile) (settings, error) {
|
||||
if err != nil {
|
||||
return settings{}, err
|
||||
}
|
||||
result := settings{Mode: "manual"}
|
||||
result := settings{Mode: "manual", IgnoreHosts: []string{}}
|
||||
if p.Mode == profile.SingleMode {
|
||||
if result.SocksHost, result.SocksPort, _, _, err = endpoint(p.SingleURL, "Single proxy URL", "socks5", false); err != nil {
|
||||
return settings{}, err
|
||||
@@ -874,6 +876,9 @@ func parseQuoted(raw string) (string, int, error) {
|
||||
|
||||
func parseStrings(raw string) ([]string, error) {
|
||||
raw = strings.TrimSpace(raw)
|
||||
// GVariant prints an empty string array with its otherwise-inferable type
|
||||
// annotation ("@as []") on some gsettings versions.
|
||||
raw = strings.TrimSpace(strings.TrimPrefix(raw, "@as"))
|
||||
if len(raw) < 2 || raw[0] != '[' || raw[len(raw)-1] != ']' {
|
||||
return nil, fmt.Errorf("invalid gsettings string array %q", raw)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user