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

Fix token auth and hardcode org=influxdata request parameter #60

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

waeltken
Copy link

@waeltken waeltken commented Sep 1, 2023

I've encountered two issues when running the script form the dev branch.

  1. Influxdb now requires the org name to part of the HTTP GET parameters. Could this be added as an additional field to the UI?
  2. The Conf_FromSettings function seems to strip off equal signs from the strings passed as values. Breaking my Auth Token that end with a double equal sign. https://github.com/jackyaz/connmon/blob/7c7e37d8b32b71d0d0af715d6aeb6343f5efece7/connmon.sh#L333C13-L333C13

@waeltken waeltken marked this pull request as draft September 1, 2023 07:43
@waeltken waeltken mentioned this pull request Sep 1, 2023
@jackyaz
Copy link
Owner

jackyaz commented Sep 1, 2023

I was just logging in to suggest fixing the cut command instead of hardcoding == to the token and you got there first!

@jackyaz
Copy link
Owner

jackyaz commented Sep 1, 2023

How does influx v1 handle thr additional url parameter?

@waeltken
Copy link
Author

waeltken commented Sep 1, 2023

How does influx v1 handle thr additional url parameter?

I'm not sure about that, but I think they should be ignored.

@waeltken
Copy link
Author

waeltken commented Sep 1, 2023

I was just logging in to suggest fixing the cut command instead of hardcoding == to the token and you got there first!

I've tried this... But it did not work. The config file uses a space in between key and value so that does not seem to be the issue.

@waeltken
Copy link
Author

waeltken commented Sep 1, 2023

If the settings would not strip "=" signs something like this could also work:

image

@waeltken waeltken force-pushed the develop branch 2 times, most recently from 66ac5c7 to b4c7f7e Compare September 13, 2023 08:39
@waeltken waeltken changed the title Brute force fixing the curl request Fix token auth and hardcode org=influxdata request parameter Sep 13, 2023
@waeltken waeltken marked this pull request as ready for review September 13, 2023 08:44
@@ -2018,7 +2018,7 @@ SendToInfluxDB(){
INFLUX_AUTHHEADER="$(Conf_Parameters check NOTIFICATIONS_INFLUXDB_APITOKEN)"
fi

/usr/sbin/curl -fsL --retry 3 --connect-timeout 15 --output /dev/null -XPOST "$NOTIFICATIONS_INFLUXDB_PROTO://$NOTIFICATIONS_INFLUXDB_HOST:$NOTIFICATIONS_INFLUXDB_PORT/api/v2/write?bucket=$NOTIFICATIONS_INFLUXDB_DB&precision=s" \
/usr/sbin/curl -fsL --retry 3 --connect-timeout 15 --output /dev/null -XPOST "$NOTIFICATIONS_INFLUXDB_PROTO://$NOTIFICATIONS_INFLUXDB_HOST:$NOTIFICATIONS_INFLUXDB_PORT/api/v2/write?bucket=$NOTIFICATIONS_INFLUXDB_DB&org=influxdata&precision=s" \
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be great to add this as an additional UI option for configuration.

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

Successfully merging this pull request may close these issues.

2 participants