-
Notifications
You must be signed in to change notification settings - Fork 29
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
Can we specify a key via an environment variable or via the config file #24
Comments
Hi ZEVENET root saves its API Key in /usr/local/zevenet/config/global.conf
check the variable $zapikey.
I hope it helps you.
Regards!
El mar, 30 ago 2022 a las 19:59, drgr33n-vw ***@***.***>)
escribió:
… Hi,
I'm not sure if this is possible but can I specify an API key within a
config file? If not, would it be possible to add the functionality? If not
from a config file, maybe read from an environment variable?
—
Reply to this email directly, view it on GitHub
<#24>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFBQEPDTH7HAGR6ARZ34B2LV3ZDXZANCNFSM6AAAAAAQAUOIQE>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
--
Emilio CamposZEVENET Teamwww.zevenet.com
Review ZEVENET Product at Gartner Insights <https://gtnr.io/LfXtqnsSr>
<https://www.linkedin.com/company/zevenet> <https://twitter.com/zevenet>
<https://www.facebook.com/zevenet> <https://github.com/zevenet>
[image: ZEVENET] <https://www.zevenet.com/signature/>
DISCLAIMER: This message contains confidential information and is intended
only for the individual named. If you
are not the named addressee please notify the sender immediately by email
if you have received it by mistake and
delete it from your system, you should not disseminate, distribute or copy
this email in whole or in part.
|
No, it is not supported. The key currently is only via command line but it's hidden. |
Sorry but I don't understand the use case, can you share with us an example?
Thanks!
El mié, 31 ago 2022 a las 9:43, Laura Garcia ***@***.***>)
escribió:
… I'm not sure if this is possible but can I specify an API key within a
config file? If not, would it be possible to add the functionality? If not
from a config file, maybe read from an environment variable?
No, it is not supported. The key currently is only via command line but
it's hidden.
—
Reply to this email directly, view it on GitHub
<#24 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFBQEPBSDCDRIHLTYXBSGVDV34EKJANCNFSM6AAAAAAQAUOIQE>
.
You are receiving this because you commented.Message ID:
***@***.***>
--
Emilio CamposZEVENET Teamwww.zevenet.com
Review ZEVENET Product at Gartner Insights <https://gtnr.io/LfXtqnsSr>
<https://www.linkedin.com/company/zevenet> <https://twitter.com/zevenet>
<https://www.facebook.com/zevenet> <https://github.com/zevenet>
[image: ZEVENET] <https://www.zevenet.com/signature/>
DISCLAIMER: This message contains confidential information and is intended
only for the individual named. If you
are not the named addressee please notify the sender immediately by email
if you have received it by mistake and
delete it from your system, you should not disseminate, distribute or copy
this email in whole or in part.
|
Understood, sorry discard my latest comment
El mié, 31 ago 2022 a las 10:16, Emilio Campos Martín (<
***@***.***>) escribió:
… Sorry but I don't understand the use case, can you share with us an
example?
Thanks!
El mié, 31 ago 2022 a las 9:43, Laura Garcia ***@***.***>)
escribió:
> I'm not sure if this is possible but can I specify an API key within a
> config file? If not, would it be possible to add the functionality? If not
> from a config file, maybe read from an environment variable?
>
> No, it is not supported. The key currently is only via command line but
> it's hidden.
>
> —
> Reply to this email directly, view it on GitHub
> <#24 (comment)>, or
> unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AFBQEPBSDCDRIHLTYXBSGVDV34EKJANCNFSM6AAAAAAQAUOIQE>
> .
> You are receiving this because you commented.Message ID:
> ***@***.***>
>
--
Emilio CamposZEVENET Teamwww.zevenet.com
Review ZEVENET Product at Gartner Insights <https://gtnr.io/LfXtqnsSr>
<https://www.linkedin.com/company/zevenet> <https://twitter.com/zevenet>
<https://www.facebook.com/zevenet> <https://github.com/zevenet>
[image: ZEVENET] <https://www.zevenet.com/signature/>
DISCLAIMER: This message contains confidential information and is intended
only for the individual named. If you
are not the named addressee please notify the sender immediately by email
if you have received it by mistake and
delete it from your system, you should not disseminate, distribute or copy
this email in whole or in part.
--
Emilio CamposZEVENET Teamwww.zevenet.com
Review ZEVENET Product at Gartner Insights <https://gtnr.io/LfXtqnsSr>
<https://www.linkedin.com/company/zevenet> <https://twitter.com/zevenet>
<https://www.facebook.com/zevenet> <https://github.com/zevenet>
[image: ZEVENET] <https://www.zevenet.com/signature/>
DISCLAIMER: This message contains confidential information and is intended
only for the individual named. If you
are not the named addressee please notify the sender immediately by email
if you have received it by mistake and
delete it from your system, you should not disseminate, distribute or copy
this email in whole or in part.
|
OK, thanks for your replies. My use case is I've rolled this into a small Arch package and I would like to have a configuration file that I can use to control configuration variables when starting. Currently, I have it setup so SystemD reads an environment file and just adds those the the startup command but that's not ideal. I'd like to be able to specify variables like host, port and key from either a configuration file or environment variables. This would make it much easier to run as a SystemD service. I initially thought you could add the key into a file and have the application collect this by specifying a config file but skimming through the code, it looks like this is for bootstrapping rules and not configuring the behavior of the daemon. I've not programmed in C for many years but I could look at adding this functionality myself. If you feel like it would be a useful feature to have, I could submit a PR if you like. That's if I can manage to actually add that functionality. |
Sure! It should be very easy. Getting the key from the environment: Getting the key from a file: Regards. |
Awesome, I've forked the repo and I've added the env var functionality. Seems to be working as expected. The configuration file part looks a little more difficult as I would have to write a parser to collect variables. I could use a third-party library and maybe use INI format but that's adding too much complexity for such a small change. I'll take a look later in the week |
I've also added this project to the Arch AUR. Not sure if I can put URLs here but I'll try :) |
Sure. thank you for the upload in archlinux. I revisit your patch and it seems that your editor changed the indentation. I'll made some changes to your patch and apply in the devel branch if this is ok for you. |
No Problem. Yes, I used CLion and it always does that :) I'm not a very good programmer either so you might want to change how I've implemented that small change. I know you have to be careful with C when adding these types of user input so not to introduce vulnerabilities. I'll leave this ticket open for the time being as I'll probably add the file configuration option later this week. |
Hi,
I'm not sure if this is possible but can I specify an API key within a config file? If not, would it be possible to add the functionality? If not from a config file, maybe read from an environment variable?
The text was updated successfully, but these errors were encountered: