[stork-users] What does stork-install-agent.sh do?

DDFR | Ronald Blaas ronald.blaas at ddfr.nl
Thu Sep 14 18:49:39 UTC 2023


I might be trying something which is not possible.

I want the agent to be authorized automatically
That is why I entered the host key in the env file. But the agent is not authorized. It will come as unauthorized and I have to manually authorize it.

As the client did not auto authorized I was using the register command trying to use my env file because it has all the settings 🙂

Am i doing this the wrong way ?

Regards


________________________________
Van: Slawek Figiel <slawek at isc.org>
Verzonden: donderdag 14 september 2023 17:10
Aan: DDFR | Ronald Blaas <ronald.blaas at ddfr.nl>; stork-users at lists.isc.org <stork-users at lists.isc.org>
Onderwerp: Re: [stork-users] What does stork-install-agent.sh do?

Hello,

The "register" command is incompatible with your environment file. The
CLI framework expects the file to contain only command-specific
arguments. But you use the environment file configured to run the agent
without any command (standard run). The "commandless" handler and the
"register" command handler support different parameters so your
environment file

I think this situation should be handled in a more user-friendly way.
I've opened https://gitlab.isc.org/isc-projects/stork/-/issues/1160 to
address this issue.

Regards
Slawek

On 14/09/2023 15:49, DDFR | Ronald Blaas wrote:
> So I am trying to make the client authorized automatically but have no luck
>
> When I run the command I get this error:
> stork-agent --use-env-file register
> FATA[2023-09-14 15:44:08]             main.go:402   the
> '/etc/stork/agent.env' environment file is invalid: cannot set
> 'STORK_AGENT_HOST=xxx.xxx.xxx' environment variable: no such flag
> -STORK_AGENT_HOST
>
> But the env file should be correct.
> When I just restart the service the client will be listed as
> unauthorized (and I can authorized the client manually)
>
> Here is the contents of the agent.env
>
> cat /etc/stork/agent.env
> ### the IP or hostname to listen on for incoming Stork server connections
> STORK_AGENT_HOST=xxx.xxx.xxx
>
> ### the TCP port to listen on for incoming Stork server connections
> STORK_AGENT_PORT=8090
>
> ### listen for commands from the Stork server only, but not for
> Prometheus requests
> STORK_AGENT_LISTEN_STORK_ONLY=true
>
> ### Stork Server URL used by the agent to send REST commands to the
> server during agent registration
> STORK_AGENT_SERVER_URL=https://yyy.yyy.yyy:8080/
> STORK_AGENT_SERVER_TOKEN=qwertyuiop123456
>
> ### skip TLS certificate verification when the Stork Agent connects
> ### to Kea over TLS and Kea uses self-signed certificates
> STORK_AGENT_SKIP_TLS_CERT_VERIFICATION=true
>
>
> ### Logging parameters
>
> ### Set logging level. Supported values are: DEBUG, INFO, WARN, ERROR
> STORK_LOG_LEVEL=INFO
>
> ### disable output colorization
> # CLICOLOR=false
>
> ### path to the hook directory
> # STORK_AGENT_HOOK_DIRECTORY=
>
>
>
> So am I missing something or doing it wrong?
>
> Any help is apreciated
>
> Regards,
>
>
>
>
> ------------------------------------------------------------------------
> *Van:* Slawek Figiel <slawek at isc.org>
> *Verzonden:* maandag 11 september 2023 16:04
> *Aan:* DDFR | Ronald Blaas <ronald.blaas at ddfr.nl>;
> stork-users at lists.isc.org <stork-users at lists.isc.org>
> *Onderwerp:* Re: [stork-users] What does stork-install-agent.sh do?
> Sure. Please check these references:
>
> -
> https://stork.readthedocs.io/en/latest/install.html#installation-from-cloudsmith-and-registration-with-a-server-token <https://stork.readthedocs.io/en/latest/install.html#installation-from-cloudsmith-and-registration-with-a-server-token>
> - https://stork.readthedocs.io/en/latest/man/stork-agent.8.html
> <https://stork.readthedocs.io/en/latest/man/stork-agent.8.html>
> - stork-agent register --help
>
> In short:
>
> 1. Running the register command without argument will prompt
> interactively for server token
>
> stork-agent register --server-url=...
>
> 2. Running the register command with server token argument will
> authorize agent on server right away:
>
> stork-agent register --server-url=... --server-token=...
>
> 3. The server token may also be provided in the STORK_AGENT_SERVER_TOKEN
> environment variable. In this case, the server token will be used during
> the register command call or the initial run if the registration has not
> been performed yet.
>
> On 11/09/2023 15:47, DDFR | Ronald Blaas wrote:
>> is there a syntax available ?
>>
>> Would love to see that 🙂
>>
>>
>>
>> ------------------------------------------------------------------------
>> *Van:* Slawek Figiel <slawek at isc.org>
>> *Verzonden:* maandag 11 september 2023 15:35
>> *Aan:* DDFR | Ronald Blaas <ronald.blaas at ddfr.nl>
>> *Onderwerp:* Re: [stork-users] What does stork-install-agent.sh do?
>> If you want to register an agent without manually authorizing it, you
>> can pass the server token to the register command. The agent will be
>> authorized on the server right away.
>>
>> Regards,
>> Slawek
>>
>> On 11/09/2023 15:28, DDFR | Ronald Blaas wrote:
>>> a yes, i see.
>>>
>>> So the script will not authorized the agent in the server.
>>> This is still a manual task i guess.
>>>
>>> We install the agent via the repository so no need for a script in that
>>> part.
>>> Config can be handy 🙂
>>>
>>> Regards,
>>>
>>> *Van:* Stork-users <stork-users-bounces at lists.isc.org> namens Slawek
>>> Figiel <slawek at isc.org>
>>> *Verzonden:* maandag 11 september 2023 15:22
>>> *Aan:* stork-users at lists.isc.org <stork-users at lists.isc.org>
>>> *Onderwerp:* Re: [stork-users] What does stork-install-agent.sh do?
>>> Hello Ronald!
>>>
>>> The script is available if you provide the Stork agent binary packages
>>> in the /assets/pkgs directory in your WWW root (by default:
>>> /usr/share/stork/www , so the full path is:
>>> /usr/share/stork/www/assets/pkgs).
>>>
>>> The script should be executed on the machine where you want to install
>>> the Stork agent.
>>>
>>> It downloads and installs the binary package appropriate for a given
>>> operating system. Next, it uses systemctl to set up Stork agent as a
>>> daemon. After that, it registers a new Stork agent in the Stork server.
>>>
>>> The script is generated from the template available in the
>>> backend/server/restservice/middleware.go:151 file:
>>> https://gitlab.isc.org/isc-projects/stork/-/blob/master/backend/server/restservice/middleware.go#L151 <https://gitlab.isc.org/isc-projects/stork/-/blob/master/backend/server/restservice/middleware.go#L151> <https://gitlab.isc.org/isc-projects/stork/-/blob/master/backend/server/restservice/middleware.go#L151 <https://gitlab.isc.org/isc-projects/stork/-/blob/master/backend/server/restservice/middleware.go#L151>> <https://gitlab.isc.org/isc-projects/stork/-/blob/master/backend/server/restservice/middleware.go#L151 <https://gitlab.isc.org/isc-projects/stork/-/blob/master/backend/server/restservice/middleware.go#L151 <https://gitlab.isc.org/isc-projects/stork/-/blob/master/backend/server/restservice/middleware.go#L151>>>
>>>
>>> Best regards
>>> Slawek
>>>
>>>
>>> On 11/09/2023 15:07, DDFR | Ronald Blaas wrote:
>>>> So I know there is an issue/bug with this script not being available but
>>>> what does this script do?
>>>>
>>>> I wonder if I can use this script to auto add an agent to stork.
>>>>
>>>> Would anyone care to share the contents of the script ?
>>>>
>>>> Regards,
>>>>
>>>> Ronald
>>>>
>>> --
>>> Stork-users mailing list
>>> Stork-users at lists.isc.org
>>> https://lists.isc.org/mailman/listinfo/stork-users
> <https://lists.isc.org/mailman/listinfo/stork-users>
>> <https://lists.isc.org/mailman/listinfo/stork-users
> <https://lists.isc.org/mailman/listinfo/stork-users>>
>>> <https://lists.isc.org/mailman/listinfo/stork-users
>> <https://lists.isc.org/mailman/listinfo/stork-users
> <https://lists.isc.org/mailman/listinfo/stork-users>>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/stork-users/attachments/20230914/f644fecf/attachment-0001.htm>


More information about the Stork-users mailing list