Krzaku

Notifications from inside of Docker container

5 posts in this topic

In my Docker container I would like to send notifications using built-in webGui notification system. To do this I'm making a POST request to "http://tower/webGui/include/Notify.php", but the problem is I need to include the "csrf_token" variable with every request. Is there a way to retrieve that variable from inside of the container so it doesn't need to be manually entered using env variables?

0

Share this post


Link to post
Share on other sites
1 hour ago, Krzaku said:

In my Docker container I would like to send notifications using built-in webGui notification system. To do this I'm making a POST request to "http://tower/webGui/include/Notify.php", but the problem is I need to include the "csrf_token" variable with every request. Is there a way to retrieve that variable from inside of the container so it doesn't need to be manually entered using env variables?

You're going to be better off mapping the folder /usr/local/emhttp/plugins/dynamix/scripts inside the container, and then calling the notify script manually

 

Your container won't be able to determine the csrf_token, and the value changes with every reboot, so an environment variable won't work either.

0

Share this post


Link to post
Share on other sites

Mapping this single folder would not work, would it? It requires some other scripts and configs, and also requires a php interpreter to be installed in the container.

0

Share this post


Link to post
Share on other sites

You can get the csrf from the var.ini file on tapatalk at the moment so can't give you the exact folder though

Sent from my SM-T560NU using Tapatalk

0

Share this post


Link to post
Share on other sites

Posted (edited)

I decided to not include notifications in my script as I don't think it's a good idea to pass the root password to Docker containers via env variables. Thanks for your help anyway.

Edited by Krzaku
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

Copyright © 2005-2017 Lime Technology, Inc. unRAID® is a registered trademark of Lime Technology, Inc.