-
Notifications
You must be signed in to change notification settings - Fork 39
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
Simplify the environment variables #46
Simplify the environment variables #46
Conversation
There is even more too 👅 For the consumer, after i converted to modules, I moved them all here as modules are instantiated once For the producer, anything in the json files in the Configuration folders can be an env var. For jackettio, they are here: https://github.com/Gabisonfire/torrentio-scraper-sh/blob/master/src/node/addon-jackett/src/lib/settings.js Selfhostio doesn't have them like this yet - trival to produce though |
@iPromKnight yeah, I am not well versed in JS so it’s a nightmare. I’m almost learning as I’m going lol. Feel free to pull the branch from my fork and push some changes and PR it 😂 I’m done for today. It’s sit on the sofa and watch crappy TV time |
Can one of you offer me the way to change:
so it will use the
variables instead. Ideally I want to strip out all double coded values. I can see in this file: and then your comment @iPromKnight: |
I'm going to add comments into the code, if we can make a habit of this going forward I'd be a lot happier. I can see a few undocumented environment variables, like:
I'm curious what the consequences would be if we disabled the cache, is this a functionality we wish to keep or am I safe in assuming this could be removed. Can I confirm @iPromKnight that you have no plans to drop a 32k commit completely rewriting the addon or consumer 😂😂😂😂😂😂 If you do please let me know 😋 |
I'm currently changing this to be 1:1 functionality with the old, just a simple rewrite.
becomes:
I want to remove the defaults, and set a few variables as necessary. Some others can remain optional, and they all need documenting. Error handling needs adding. |
Pausing for a few hours. Haven't tested the latest push yet. It should work. |
Morning Emily Yeah I will sort that out we'd have to introduce new properties for them in the Models/ScraperConfig file and turn the connection string into a computed property. I'll do later 😃 |
Haha no nothing like that. I'm going to try to see how they run under bun as opposed to nodejs when I get home as it's really gaining traction now |
Me neither really. Not used it in years but it's all been coming back this week lol. I much prefer strongly typed typescript. I've been a .net dev for 23 years though lol |
Great! You think it’s worth doing the same with RabbitMQ as well? The service you proposed in #45 will need access to Rabbit as well right? Tidy the Rabbit vars up so it’s easier to switch to an unattached service if the user already has one. I think Mongo and Postgres are done. Just needs testing to make sure nothing is broken. I am trying to back edit some of the changes you made into the consumer into the add on. How much of the code from addon/consumer is reused? Could these two be merged into one folder with a different entrypoint.sh/command. From my quick perusal a lot of the code is duplicated anyway so all we are doing is doubling the maintenance cost. |
I’ll nod along and trust your judgement. The only bun I’m thinking of is 🧁 |
Is this a bug? Addon cache is hard coded as: selfhostio_addon_collection Consumer cache is using cacheConfig.COLLECTION_NAME which is Should these be the same value? |
Haha 👅 Unfortunately Bun is a no go..
No no - the consumer one is just for imdbIds - once its found one for a series etc, it keeps it cached for 7 days so that if it finds another episode or another file in the torrent it needs to look up, it can get the id without having to go off and use name-to-imdb, which is rate limited, or the fall-back google search Should probably be an env var on the addon though - and not hard coded 😄 I think for lib - it kinda makes sense to create a shared project, and bring it into both the consumer and addon, get rid of all this duplication. |
Agree with the shared library idea. |
addon and consumer. Todo: producer Change DATABASE_URI to be generic POSTGRES variables DOES NOT WORK - First pass at upgrading environment variables PostgreSQL environment variables have been split for addon and consumer. ENABLE_SYNC hard coded as `true` MongoDB variables update. Make the addon code more similar to the consumer code Get some parity between addon and consumer
Just the producer left to tidy up @iPromKnight to get everything on the same level. The library idea can be done in another request. Can merge this as is and create a new pr for producer parity, or do it in this PR |
I'll pull down in a few and sort it out cheers Emily |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Theres still a lot of duplicated variables, these need merging and clarifying.