Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add beszel-agent startup arguments #581

Merged
merged 1 commit into from
Feb 19, 2025
Merged

Conversation

a-mnich
Copy link
Contributor

@a-mnich a-mnich commented Feb 15, 2025

I'm running the beszel-agent on Windows as a permanently running scheduled task in system context to avoid needing alternative programs like NSSM for running it in the background. As the Windows task scheduler provides support for supplying startup arguments I prefer to directly supply key and port via the commandline to be able to manage everything at one place.

Changes:

  • Added support for -key and -port flags to allow users to specify the public key and port number directly from the command line.
  • Updated the usage information to provide a clear guide on available options and subcommands.
  • Modified the logic to prioritize the -key flag over the KEY environment variable and the -port flag over the PORT environment variable.
  • Enhanced error messaging to include instructions for using the help subcommand when the key is not provided.
  • changed the version command to version instead of -v to allign with the other command like help and update

@henrygd
Copy link
Owner

henrygd commented Feb 17, 2025

Thanks!

I need to refactor this section anyway as we're deprecating PORT in favor of ADDR. I'll merge this before I do that, probably tomorrow.

We'll likely go with -addr instead of -port, but no further changes are necessary to the PR 👍

@gedw99
Copy link

gedw99 commented Feb 18, 2025

great I need this too for agent.

@gedw99
Copy link

gedw99 commented Feb 18, 2025

Would be nice if the ENV's are prefixed with BESZEL_, so that we do not pollute Env namespace with other things running.

The flags dont need this, just the ENV names.

@henrygd
Copy link
Owner

henrygd commented Feb 18, 2025

@gedw99 This has been added. In the next release you can optionally prefix all env vars with BESZEL_HUB_ or BESZEL_AGENT_.

@gedw99
Copy link

gedw99 commented Feb 18, 2025

@gedw99 This has been added. In the next release you can optionally prefix all env vars with BESZEL_HUB_ or BESZEL_AGENT_.

Sweet :) thanks @henrygd

@henrygd henrygd merged commit 1a6a2a6 into henrygd:main Feb 19, 2025
@henrygd
Copy link
Owner

henrygd commented Feb 19, 2025

Merged, thanks 👍

@kenrmayfield
Copy link

@a-mnich

Can you provide the Steps for Settting Up the Beszel Agent in the Windows Task Scheduler?

@a-mnich
Copy link
Contributor Author

a-mnich commented Feb 28, 2025

@a-mnich

Can you provide the Steps for Settting Up the Beszel Agent in the Windows Task Scheduler?

See #570

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants