This is mainly a rant post.

I have to use Zscaler on my work PC. I use Sway (Moved from Gnome -> i3 -> sway).

Whenever Zscaler is launched, I used to get a weird error “proxy server not found” but it continued to work otherwise. Now at my company, we used a proxy at one time but we shifted to a no-proxy connection recently.

So I checked all my environment variables, output of set command. Everything was fine. People said it could be because of some weird compliance issue, or kernel etc etc. After a week or so, I gave up on debugging it because most of my work was fine with the 50% functional Zscaler.

One day, I opened Gnome instead of Sway to check something else, and saw that my proxy was on. This is the proxy set in Gnome Settings, not environment file.

I initially dismissed this finding because I thought Gnome is not active during sway so it should not affect it. But then i remembered it’s possible to access the gnome settings using gsettings from any distro.

I switched to Sway, and sure enough, when I ran gsettings get org.gnome.system.proxy.http host, I could see the proxy IP. I set it to null and behold! Zscaler was working perfectly.

I’m like “Who the hell designs software like this? The application should read the environment variables, not Gnome variables!”

Anyway, this was just a reminder to software makers to kindly follow the norms. Don’t design your software for one Distro. Follow the guidelines as mentioned in freedesktop.

  • mina86@lemmy.wtf
    link
    fedilink
    English
    arrow-up
    13
    ·
    19 hours ago

    This is not a legitimate issue. It’s like complaining that wget reads proxy settings from /etc/wgetrc. It’s absolutely proper for programs to read system- or user-level configuration if the configuration is not specified via environment variables or command line options.

    The typical setting hierarchy goes something like:

    • command line options,
    • environment variables,
    • user-level configuration files and finally
    • system-level configuration files.
    • Aceivan [they/them]@hexbear.net
      link
      fedilink
      English
      arrow-up
      5
      ·
      18 hours ago

      ehhhhhh no its a genuine issue to honor gnome settings when gnome isn’t running IMO. That isn’t the correct system/user configuration to load if you’re running under sway…

  • I hear your frustration. It can be annoying. There’s a reason for it, and that’s because environment variables are limited in their use by scoping: they’re only inherited from the parent to children, and they’re pass-by-value. This means that, from a child process, you can’t influence the variables for any other sibling, or the parent. There’s no way to propagate environment variables to anyone except new children you fork.

    This is a significant limitation. There is no work around using only environment variables. It’s a large part of why applications store scalar values in files: it’s (almost) the only environmentally agnostic way to propagate information to other processes.

    Herbstluftwm has herbstclient getenv and setenv, because ostensibly every user process is a child of the window manager, and it’s a convenient way to communicate scalar changes between processes. tmux has similar commands; in both cases, the source of truth is the parent application, not the environment. gsettings is just Gnome’s version; KDE has it’s own version. I’d be surprised if Sway didn’t.

    Environment variables are great, but they’re limited, and they are simply unsuitable for purposes. They’re also insecure: anyone with the right permissions can read them from /proc. The consequence is that it can be difficult to track down where settings are stored, especially if you’re still using some component of a desktop, which tend to manage all of their settings internally.

    We do have a global solution for Linux: the kernel keyring. It’s secure, and global. It is not, however, automatically persisted, although desktops could easily persist and restore values from the keyring when they shut down or start up. Every desktop I know just keeps it’s own version of what’s essentially the Windows registry.

    It’s a mess.

  • dblsaiko@discuss.tchncs.de
    link
    fedilink
    arrow-up
    14
    ·
    24 hours ago

    This is not a distro-specific thing, but a desktop-specific one. It was probably written for Gnome primarily.

    Not sure how other software that reads this setting handles it, but imo doing it correctly it should only look at it if the current desktop is Gnome. Plasma has a setting like this too, which probably works similarly.

  • A_norny_mousse@feddit.org
    link
    fedilink
    arrow-up
    6
    ·
    edit-2
    20 hours ago

    Before any commenter rushes to condemn the Chaos That Is Linux, please check out OP’s posting history to get a clearer picture of their credibility.

    (and like they themselves stated, this is a rant and not a PSA)

    • Xanza@lemm.ee
      link
      fedilink
      English
      arrow-up
      3
      ·
      13 hours ago

      I don’t think it’s wrong to bitch about the standards fragmentation in linux. For better or worse, it’s a serious issue within linux. Apple, for example has a closed ecosystem which is bad, but they have great ecosystem cohesion which is great for app development and reliable interaction between applications. IMO the cohesion to standards is one of the only good things iOS has going for it.

  • Aceivan [they/them]@hexbear.net
    link
    fedilink
    English
    arrow-up
    3
    ·
    edit-2
    18 hours ago

    It’s an issue but its a pretty niche one. Even software that works great on most distros might misbehave when you have multiple desktop environments installed. And http_proxy use doesn’t appear to be standardized by freedesktop, LSB, etc. Though it is pretty well adhered to: https://about.gitlab.com/blog/2021/01/27/we-need-to-talk-no-proxy/

    So yeah, I agree with the spirit of this but its tough to follow the standard when there is no standard

  • SayCyberOnceMore@feddit.uk
    link
    fedilink
    English
    arrow-up
    6
    ·
    23 hours ago

    Firstly, I agree with your main point.

    Just an open thought: I wonder if zscalar are using settings in a heirarchy, ie if no env var is set, then check Gnome - just in case the user’s only making changes there…? Dunno…

    • xavier666@lemm.eeOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      23 hours ago

      That is a good point. But I remember launching the application from the terminal where I explicitly set the env variables as null. Still it didn’t work.

      • A_norny_mousse@feddit.org
        link
        fedilink
        arrow-up
        1
        ·
        20 hours ago

        That’s kindof the opposite of what the previous commenter said. Have you tried explicitely setting the env var to a value different than what’s in gsettings?

        What env var are we talking about btw?

        And what freedesktop spec? AFAIK they do not deal much in env vars apart from XDG_*

  • aberrate_junior_beatnik (he/him)@midwest.social
    link
    fedilink
    English
    arrow-up
    5
    ·
    23 hours ago

    Follow the guidelines as mentioned in freedesktop

    Which guidelines are you talking about? Searching for “proxy” and “environment variables” didn’t pull up anything I saw that would be relevant in this case. I’ve been using linux for a couple of decades now and I’m not sure what rule is being broken here.

    It sounds like you didn’t have a proxy set in your environment variables, but you did have one set through another means. It’s somewhat standard practice to have fall-through settings, where if settings aren’t set in one place, a program looks in another place, then maybe another, etc. Now admittedly it would be nice to have a way to disable functionality entirely, but usually that kind of thing happens with command line flags.

    I get that it’s frustrating to deal with a problem like this, but ultimately your environment was misconfigured, and that’s going to break some software.

  • webghost0101@sopuli.xyz
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    22 hours ago

    I am not sure whos advocate i am being here but theres class of vibe coding enthusiasts that get heavily demotivated by being told to do things a certain way.

    The trade of for this chaos is. At least they how to code and participate in open source projects and once in a full moon some creative actually designs something nova and inspiring.

    • xavier666@lemm.eeOP
      link
      fedilink
      English
      arrow-up
      5
      ·
      edit-2
      23 hours ago

      In my university (where we used proxy), we had a saying “it’s always DNS proxy”