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

Support reading config from environment variables #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

berberman
Copy link

从环境变量传入的配置可覆盖配置文件中的对应项,这将有助于模块化配置。设置以下环境变量可达到与配置文件示例的相同效果:

TELEGRAM_API_ID="10000" \
TELEGRAM_API_HASH="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
TELEGRAM_ACCOUNT="+1234567890" \
TELEGRAM_SESSION_DB="mybot" \
TELEGRAM_PROXY="127.0.0.1,1080" \
TELEGRAM_INDEX_GROUPS="1000000000, 1000000001" \
DATABASE_URL="postgresql:///luoxu" \
WEB_LISTEN_HOST="localhost" \
WEB_LISTEN_PORT=9008 \
WEB_PREFIX="/luoxu" \
WEB_CACHE_DIR="cache" \
WEB_DEFAULT_AVATAR="nobody.jpg" \
WEB_GHOST_AVATAR="ghost.jpg" \
WEB_ORIGINS="http://localhost"

@lilydjwg
Copy link
Owner

lilydjwg commented Aug 3, 2023

No. These values will be passed into every child processes. Also it takes space.

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