Deploy on mac is trying to upgrade first and then install #750

Open
opened 2025-11-20 05:16:51 -05:00 by saavagebueno · 2 comments
Owner

Originally created by @ez1976 on GitHub (Mar 28, 2024).

Hi
Using JumpCloud i am trying to automate the Netbird app on MacOS
this seems to work just fine except the install of the package.
it seems that the default parameter is "upgrade" and only then "install"
meaning when i first deploy it on a MAC a pop up appears to select the application to upgrade (with "where is NetBird?" displayed)
once i close this window, the install proceed and finished just fine.

  1. first i download the package to the /tmp/netbird.pkg file
# Fetch the URL of the latest package file 
pkg_url=$(curl -sIL -o /dev/null -w '%{url_effective}' https://pkgs.netbird.io/macos/arm64) 

# Download the package file 
curl --silent -o /tmp/netbird.pkg "$pkg_url" 

# Get the currently logged-in user #
logged_in_user=$(stat -f "%Su" /dev/console) 

using @lixmal suggestion i added these lines

cat << EOF > /tmp/choice.xml
<?xml
 version="1.0" encoding="UTF-8"?>
<installer-gui-script minSpecVersion="1">
    <pkg-ref id="io.netbird.client_arm64"/>
    <choices-outline>
        <line choice="default">
            <line choice="upgrade">
                <pkg-ref id="io.netbird.client_arm64"/>
            </line>
            <line choice="install">
                <pkg-ref id="io.netbird.client_arm64"/>
            </line>
        </line>
    </choices-outline>
    <choice id="default" title="Install"/>
    <choice id="upgrade" title="Upgrade"/>
    <choice id="install" title="Install"/>
</installer-gui-script>
EOF
  1. install the package on the client
#curl -fsSL https://pkgs.netbird.io/install.sh | sh  # this installs the "NetBird ui" app which doesnt work good.
#installer -pkg "/tmp/netbird.pkg" -target /  ## this pop up the window
installer -pkg "/tmp/netbird.pkg" -target / -applyChoiceChangesXML /tmp/choice.xml

the -applyuChoiceChangesXML parameter seems to be the correct way but i get that the file is malformed.

the creation of the /etc/netbird/config.json file
and

cat << EOF > /etc/netbird/config.json
{
    "PrivateKey": "XXXXXXXXXXX=",
    "PreSharedKey": "",
    "ManagementURL": {
        "Scheme": "https",
        "Opaque": "",
        "User": null,
        "Host": "****.com:33073",
        "Path": "",
        "RawPath": "",
        "OmitHost": false,
        "ForceQuery": false,
        "RawQuery": "",
        "Fragment": "",
        "RawFragment": ""
    },
    "AdminURL": {
        "Scheme": "https",
        "Opaque": "",
        "User": null,
        "Host": "******.com:443",
        "Path": "",
        "RawPath": "",
        "OmitHost": false,
        "ForceQuery": false,
        "RawQuery": "",
        "Fragment": "",
        "RawFragment": ""
    },
    "WgIface": "wt0",
    "WgPort": 51820,
    "IFaceBlackList": [
        "wt0",
        "wt",
        "utun",
        "tun0",
        "zt",
        "ZeroTier",
        "wg",
        "ts",
        "Tailscale",
        "tailscale",
        "docker",
        "veth",
        "br-",
        "lo"
    ],
    "DisableIPv6Discovery": false,
    "RosenpassEnabled": false,
    "RosenpassPermissive": false,
    "ServerSSHAllowed": false,
    "SSHKey": "-----BEGIN PRIVATE KEY**********----END PRIVATE KEY-----\n",
    "NATExternalIPs": null,
    "CustomDNSAddress": "",
    "DisableAutoConnect": false
}
EOF

Run a command as the logged-in user


sudo -u "$logged_in_user" open -g "/Applications/Netbird UI.app"

the config.json and opening the app works just fine.
the only issue is the popup window

Originally created by @ez1976 on GitHub (Mar 28, 2024). Hi Using JumpCloud i am trying to automate the Netbird app on MacOS this seems to work just fine except the install of the package. it seems that the default parameter is "upgrade" and only then "install" meaning when i first deploy it on a MAC a pop up appears to select the application to upgrade (with "where is NetBird?" displayed) once i close this window, the install proceed and finished just fine. 1) first i download the package to the /tmp/netbird.pkg file ``` # Fetch the URL of the latest package file pkg_url=$(curl -sIL -o /dev/null -w '%{url_effective}' https://pkgs.netbird.io/macos/arm64) # Download the package file curl --silent -o /tmp/netbird.pkg "$pkg_url" # Get the currently logged-in user # logged_in_user=$(stat -f "%Su" /dev/console) ``` using @lixmal suggestion i added these lines ``` cat << EOF > /tmp/choice.xml <?xml version="1.0" encoding="UTF-8"?> <installer-gui-script minSpecVersion="1"> <pkg-ref id="io.netbird.client_arm64"/> <choices-outline> <line choice="default"> <line choice="upgrade"> <pkg-ref id="io.netbird.client_arm64"/> </line> <line choice="install"> <pkg-ref id="io.netbird.client_arm64"/> </line> </line> </choices-outline> <choice id="default" title="Install"/> <choice id="upgrade" title="Upgrade"/> <choice id="install" title="Install"/> </installer-gui-script> EOF ``` 2) install the package on the client ``` #curl -fsSL https://pkgs.netbird.io/install.sh | sh # this installs the "NetBird ui" app which doesnt work good. #installer -pkg "/tmp/netbird.pkg" -target / ## this pop up the window installer -pkg "/tmp/netbird.pkg" -target / -applyChoiceChangesXML /tmp/choice.xml ``` the -applyuChoiceChangesXML parameter seems to be the correct way but i get that the file is malformed. the creation of the /etc/netbird/config.json file and ``` cat << EOF > /etc/netbird/config.json { "PrivateKey": "XXXXXXXXXXX=", "PreSharedKey": "", "ManagementURL": { "Scheme": "https", "Opaque": "", "User": null, "Host": "****.com:33073", "Path": "", "RawPath": "", "OmitHost": false, "ForceQuery": false, "RawQuery": "", "Fragment": "", "RawFragment": "" }, "AdminURL": { "Scheme": "https", "Opaque": "", "User": null, "Host": "******.com:443", "Path": "", "RawPath": "", "OmitHost": false, "ForceQuery": false, "RawQuery": "", "Fragment": "", "RawFragment": "" }, "WgIface": "wt0", "WgPort": 51820, "IFaceBlackList": [ "wt0", "wt", "utun", "tun0", "zt", "ZeroTier", "wg", "ts", "Tailscale", "tailscale", "docker", "veth", "br-", "lo" ], "DisableIPv6Discovery": false, "RosenpassEnabled": false, "RosenpassPermissive": false, "ServerSSHAllowed": false, "SSHKey": "-----BEGIN PRIVATE KEY**********----END PRIVATE KEY-----\n", "NATExternalIPs": null, "CustomDNSAddress": "", "DisableAutoConnect": false } EOF ``` # Run a command as the logged-in user ``` sudo -u "$logged_in_user" open -g "/Applications/Netbird UI.app" ``` the config.json and opening the app works just fine. the only issue is the popup window
saavagebueno added the waiting-feedbackpackagingtriage-needed labels 2025-11-20 05:16:51 -05:00
Author
Owner

@nazarewk commented on GitHub (Apr 23, 2025):

@ez1976 is this still an issue for you in recent NetBird versions?

@nazarewk commented on GitHub (Apr 23, 2025): @ez1976 is this still an issue for you in recent NetBird versions?
Author
Owner

@ez1976 commented on GitHub (Apr 23, 2025):

Not sure.. let me test it from scratch

On Wed, Apr 23, 2025, 10:30 Krzysztof Nazarewski (kdn) <
@.***> wrote:

@ez1976 https://github.com/ez1976 is this still an issue for you in
recent NetBird versions?


Reply to this email directly, view it on GitHub
https://github.com/netbirdio/netbird/issues/1767#issuecomment-2823666420,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AANTDDZ3KALSCRVWP7D4YRT225MRLAVCNFSM6AAAAAB3V2K5P6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDQMRTGY3DMNBSGA
.
You are receiving this because you were mentioned.Message ID:
@.***>
nazarewk left a comment (netbirdio/netbird#1767)
https://github.com/netbirdio/netbird/issues/1767#issuecomment-2823666420

@ez1976 https://github.com/ez1976 is this still an issue for you in
recent NetBird versions?


Reply to this email directly, view it on GitHub
https://github.com/netbirdio/netbird/issues/1767#issuecomment-2823666420,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AANTDDZ3KALSCRVWP7D4YRT225MRLAVCNFSM6AAAAAB3V2K5P6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDQMRTGY3DMNBSGA
.
You are receiving this because you were mentioned.Message ID:
@.***>

@ez1976 commented on GitHub (Apr 23, 2025): Not sure.. let me test it from scratch On Wed, Apr 23, 2025, 10:30 Krzysztof Nazarewski (kdn) < ***@***.***> wrote: > @ez1976 <https://github.com/ez1976> is this still an issue for you in > recent NetBird versions? > > — > Reply to this email directly, view it on GitHub > <https://github.com/netbirdio/netbird/issues/1767#issuecomment-2823666420>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AANTDDZ3KALSCRVWP7D4YRT225MRLAVCNFSM6AAAAAB3V2K5P6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDQMRTGY3DMNBSGA> > . > You are receiving this because you were mentioned.Message ID: > ***@***.***> > *nazarewk* left a comment (netbirdio/netbird#1767) > <https://github.com/netbirdio/netbird/issues/1767#issuecomment-2823666420> > > @ez1976 <https://github.com/ez1976> is this still an issue for you in > recent NetBird versions? > > — > Reply to this email directly, view it on GitHub > <https://github.com/netbirdio/netbird/issues/1767#issuecomment-2823666420>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AANTDDZ3KALSCRVWP7D4YRT225MRLAVCNFSM6AAAAAB3V2K5P6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDQMRTGY3DMNBSGA> > . > You are receiving this because you were mentioned.Message ID: > ***@***.***> >
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/netbird#750