!NhAsaYbbgmzHtXTPQJ:funklause.de

Nix NodeJS

210 Members
61 Servers

Load older messages


SenderMessageTime
10 Sep 2023
@lily:lily.flowersLily FosterAnd then you're passing in the file there20:09:19
@lily:lily.flowersLily Foster(Side note but programs args are visible by anyone on a linux system and are discouraged for secrets, but for single-user systems I suppose the threat is not great)20:10:08
@shaniag:matrix.orgshaniagokay, I will modify my code so it can take a path20:10:50
@lily:lily.flowersLily FosterOkay, sounds good!20:11:43
@lily:lily.flowersLily Foster
In reply to @shaniag:matrix.org
Nope, it only works with the token in plain text (node index.js --token=23948u2cxjMMwkejrjdslsf), I thought that systemd stuff pastes the files contents there
(Also that's not your actual token, right? I forget the format discord app tokens are in)
20:12:12
@shaniag:matrix.orgshaniag
In reply to @lily:lily.flowers
(Also that's not your actual token, right? I forget the format discord app tokens are in)
no, it is not lol
20:12:27
@lily:lily.flowersLily FosterOkay, good, just making sure because you never know 😅20:15:11
@lily:lily.flowersLily FosterAlso these channel logs are publicly available20:15:26
@lily:lily.flowersLily FosterAnd we've, uh, had at least one accidental token leak already in this room20:15:42
@shaniag:matrix.orgshaniag
In reply to @lily:lily.flowers
Okay, good, just making sure because you never know 😅
hmm, Error: ENOENT: no such file or directory, open '$CREDENTIALS_DIRECTORY/bot.token
20:18:21
@shaniag:matrix.orgshaniagbut it works locally20:18:25
@shaniag:matrix.orgshaniagwith a path20:18:29
@lily:lily.flowersLily FosterOof that means it did not do the environment variable interpolation20:20:42
@lily:lily.flowersLily FosterI thought ExecStart did but maybe it doesn't do that var20:20:58
@shaniag:matrix.orgshaniagok, should i put that stuff in script?20:21:12
@lily:lily.flowersLily Foster You could. Try just using %d in place of $CREDENTIALS_DIRECTORY real quick though and see if that works 20:22:52
@lily:lily.flowersLily Foster(Still with ExecStart to test)20:23:01
@shaniag:matrix.orgshaniag
In reply to @lily:lily.flowers
You could. Try just using %d in place of $CREDENTIALS_DIRECTORY real quick though and see if that works
okayy, so this works for some reason
20:26:14
@lily:lily.flowersLily Foster Neat apparently ExecStart does substitute env vars but it does so earlier than that var exists. But they provide %d for use in certain unit options and I guess you have to use that when it's for creds and in the execstart line 20:27:28
@lily:lily.flowersLily FosterIt's probably due to Arcane Nonsense™️ so it might be best to just accept that that's the case and use it 😅20:28:28
@shaniag:matrix.orgshaniag
In reply to @lily:lily.flowers
It's probably due to Arcane Nonsense™️ so it might be best to just accept that that's the case and use it 😅
hmm, okay :)
20:28:46
@shaniag:matrix.orgshaniag

Can I somehow shorten this?

${pkgs.nodejs_20}/bin/node dbInit.js && ${pkgs.nodejs_20}/bin/node index.js --token=%d/bot.token
20:28:54
@lily:lily.flowersLily FosterYou could make dbInit a ExecStartPre option20:31:36
@lily:lily.flowersLily Foster If you did use npm-installed bins too then you wouldn't need the ${pkgs.nodejs_20}/bin/node part either :) 20:32:45
@shaniag:matrix.orgshaniag
In reply to @lily:lily.flowers
If you did use npm-installed bins too then you wouldn't need the ${pkgs.nodejs_20}/bin/node part either :)
i am tooooo lazy now it works and I never want to change it again hahaha
20:33:11
@lily:lily.flowersLily FosterYeah I definitely get it, I'm happy to help with whatever works for you20:33:41
@shaniag:matrix.orgshaniagThe problem is now my nextcloud broke lmao20:33:48
@shaniag:matrix.orgshaniagafter it worked for multiple years20:33:58
@lily:lily.flowersLily Fosterrip20:34:17
@shaniag:matrix.orgshaniagprobably has something to do with the postgres stuff i added20:34:28

Show newer messages


Back to Room ListRoom Version: 6