[GH-ISSUE #79] Recommend adding clarity to envars #15
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
TheLovinator/discord-twitter-webhooks#15
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @dziban303 on GitHub (Mar 28, 2023).
Original GitHub issue: https://github.com/TheLovinator1/discord-twitter-webhooks/issues/79
Many of the variables in the .env file are ambiguous because of several layers of negation in the verbiage, which leads to confusion and frustration about what the settings will accomplish.
Setting to true could mean disabling the conversion of special characters. Or, it could mean the opposite. The juxtaposition of affirmational and negational words makes it unclear. Something clearer would be:
Finally, the variable itself is changed to remove the
DISABLE_, and other negational words or prefixes ('UN'), even if that requires reversing the effect, because it's another unnecessary and ambiguous layer of negation. Rather than unescape, it should just be escape.Another example,
REPLACE_SUBREDDIT=makes more sense thanDISABLE_REPLACE_SUBREDDIT=, especially because setting this particular feature toDISABLE_REPLACE_SUBREDDIT=Trueseems to actually enable the replacement of/r/whateverwith a clickable link. That's the opposite of what the variable name itself suggests! Really the variable should be something likeCREATE_SUBREDDIT_LINK, where setting to true leaves no doubt about what will happen: a subreddit link will be created.@TheLovinator1 commented on GitHub (Mar 28, 2023):
Yeah, the config file just got worse and worse, lol. When people contacted me on Discord for features it was easiest to add the feature and then 10 minutes later responding with "You can do that by adding APPEND_USERNAME=True"
I am planning to rewrite/reword all the variables and add images, so it should hopefully get better.
I am also planning to add so you can format the message yourself instead of having 10 environment variables that change one thing.
@TheLovinator1 commented on GitHub (Mar 31, 2023):
I updated the .env.example, what environment variables should be renamed? What comments should be improved? I will add images showing what each variable does someday.
@dziban303 commented on GitHub (Mar 31, 2023):
Hey, just looked over the new format. This is great, a huge improvement. Though when I tried to run it with just the defaults of the new .env (excepting my token and a webhook/rule) it threw an error:
So perhaps the logic that stuffs a default value if no discrete value (or an invalid value?) is supplied in .env should be looked at. Setting
LOG_LEVELto one of the acceptable values resolves the issue.Thank you again for making this change, I realize it was probably enough work to be annoying. Really appreciate it 💗
@TheLovinator1 commented on GitHub (Mar 31, 2023):
It should be fixed now, I forgot to set the default value when LOG_LEVEL is equal to nothing.
The only thing that would happen if the issue/feature is too annoying is that I will be too lazy to fix/add it :p
@dziban303 commented on GitHub (Apr 1, 2023):
Closed as completed