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

added setting stat ip in env and fixed changin stat port #69

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,13 @@ DEFAULT_ARGS="--http-port 8081 --dir=${TELEGRAM_WORK_DIR} --temp-dir=${TELEGRAM_
CUSTOM_ARGS=""

if [ -n "$TELEGRAM_STAT" ]; then
CUSTOM_ARGS="${CUSTOM_ARGS} --http-stat-port=8082"
CUSTOM_ARGS="${CUSTOM_ARGS} --http-stat-port=$TELEGRAM_STAT"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Avoid changing the port inside the container, with docker you can change the exposed port, the internal port shall always be 8082 for the http-stat-port (eg docker run -p 8082:8888 will bind the stat port to 8888 from the external environment)

Copy link
Collaborator

Choose a reason for hiding this comment

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

But most people probably wanna use a reverse proxy to add auth anyway, so it wouldn't matter as long as they use the same at both places.

I'd say

TELEGRAM_STAT=${TELEGRAM_STAT:-8082}

at the beginning of the script would solve that, setting a sane default but still allowing to change it.

@giuseppeM99 Why would you need it to be never changed by anyone in their own deployment?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Is not that i need it to never be changed
I just don't want it changed inside the docker container, instead i want docker to manage the port forwarding

fi

if [ -n "$TELEGRAM_STAT_HOST" ]; then
CUSTOM_ARGS="${CUSTOM_ARGS} --http-stat-ip-address=$TELEGRAM_STAT_HOST"
fi

if [ -n "$TELEGRAM_STAT_HIDE_SENSIBLE_DATA" ]; then
CUSTOM_ARGS="${CUSTOM_ARGS} --stats-hide-sensible-data"
fi
Expand Down