You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is more of a stylistic preference I think, and just kind of a "maybe this is a good idea" thought I guess, feel free to reject or amend it. I was thinking it might be good to include some validations in the env.py file similar to the castings we're doing. This way the admin can see immediately if there are issues with the .env file settings.
Verify various configuration values in the .env file including:
Signal contacts/numbers
BOT_NUMBER - verify registration to allow sending
ADMIN_CONTACT - move heuristics from signal.py send_message() function to the env loading, verify existence and right to send
LISTEN_CONTACT - move heuristics from signal.py send_message() function to the env loading, verify existence and right to send
Add a ADMIN_CONTACT_TYPE and LISTEN_CONTACT_TYPE to support moving the heuristics out of signal and into the env file.
Various Twitter API access tokens - verify they work as expected
TWITTER_API_KEY
TWITTER_API_SECRET
TWITTER_ACCESS_TOKEN
TWITTER_TOKEN_SECRET
TRUSTED_TWEETERS - check for formatting ie. no @ at the beginning of the username, maybe just warn and strip instead of fail
Hashtag lists - check that hashtags start with #, maybe just warn and add the # if it doesn't exist
SEND_HASHTAGS
RECEIVE_HASHTAGS
AUTOSCAN_STATE_FILE_PATH:
check if the path is a relative path to the application directory
check if the path is within a mounted volume to ensure statefulness but probably only throw a warning if it isn't since it isn't really that big a deal
more things I'm sure
The text was updated successfully, but these errors were encountered:
I dig this!! I think it would be helpful to have it as a separate command, since some of these checks could be time consuming and we may not want it to run on every startup. But definitely a more thorough validation check could really help in getting an instance going.
Description
This is more of a stylistic preference I think, and just kind of a "maybe this is a good idea" thought I guess, feel free to reject or amend it. I was thinking it might be good to include some validations in the env.py file similar to the castings we're doing. This way the admin can see immediately if there are issues with the .env file settings.
Verify various configuration values in the .env file including:
send_message()
function to the env loading, verify existence and right to sendsend_message()
function to the env loading, verify existence and right to send@
at the beginning of the username, maybe just warn and strip instead of fail#
, maybe just warn and add the#
if it doesn't existThe text was updated successfully, but these errors were encountered: