#development

1 messages · Page 245 of 1

frosty gale
#

even C has automatic and transparent buffer flushing

#

writes get stored in a buffer and get flushed if enough data gets written or if the handle closes

#

or you decide to read/write in a different location

#

sounds like youre using a self signed certificate

sharp geyser
#

nope

#

cloudflare origin ca certs

frosty gale
#

check what the certificates are showing up as

sharp geyser
#

Shows up correctly

quartz kindle
# sharp geyser

are you trying to access your thing directly without going through cloudflare?

#

like via ip instead of domain?

#

or did you turn off cloudflare proxy thing ?

sharp geyser
#

fixed it somehow

#

the thing is

#

if I proxy it through cloudflare

#

thunderbird and such can't send emails

#

it refuses to

#

idk why

#

It's like it can't connect to the SMTP

sharp geyser
#

SMTP and such wont pass through cloudflare's proxy

quartz kindle
#

yeah well you cant use CF origin cert for that then

#

CF origin cert only works for the CF proxy

sharp geyser
#

well rip

sharp geyser
#

oh you mean the enterpirse plan price

spark flint
#

Yes

#

I have an ent account :^)

#

but idk the price I just break stuff

sharp geyser
#

bros paying for an ent account

spark flint
frosty gale
#

unless youre using some dedicated cloudflare smtp thing it wont work

#

well it might it just wont work very well

#

if you want to hide your SMTP servers real IP you should use something like mailgun to receive the mail which forwards it to your servers SMTP server

sharp geyser
#

the issue is

#

mail.vidcord.xyz has basically everything running through it

#

the ui, SMTP, IMAP/POP3, etc etc

#

If I don't proxy mail.vidcord.xyz then the ui will lose https because I use cloudflare origin ca certs

#

Im also too lazy to separate out the SMTP to its own subdomain so I can avoid proxying it through cloudflare and only do the ui

winged linden
#

Anyone worked with telegram auth before?

#

Their login with telegram auth widget is ass and not customizable at all, trying to see if i can have my own button

frosty gale
#

but since youre using cloudflare you probably dont want your servers ip exposed

#

what are you using smtp for?

#

sending, receiving or both?

sharp geyser
#

both

#

mailcow can receive and send

frosty gale
#

all your mail will immediately go to spam lol

#

you have to have a static ip for your smtp server

sharp geyser
#

I do

frosty gale
#

with a reverse dns record

#

so your domain maps back to your servers ip

sharp geyser
#

I do have a static ip

frosty gale
#

but you said youre passing the smtp server through cloudflare

sharp geyser
#

not anymore

#

because it causes problems

#

it wont send or recieve mail when proxied through cloudflare

frosty gale
#

but then whats the point of using cloudflare if your ip is exposed through smtp anyways

sharp geyser
#

because I am not a network guy

#

I set this up poorly

sharp geyser
#

until then im fucked cuz I suck at networking

pearl trail
#

lmao

#

networking sucks

frosty gale
sharp geyser
#

I'd rather set it up properly

frosty gale
#

but for your use case you need to either use cloudflares dedicated smtp thing or something like mailgun

sharp geyser
#

if Im supposed to be hiding my ip then I shall

frosty gale
#

i believe mailgun has a free tier

#

you set your dns records to point to mailguns stuff

sharp geyser
#

100 emails a day

#

I don't expect that much

frosty gale
#

unless youre a mad man you probably wont need more

sharp geyser
#

but I also dont know

#

as I will be having support emails run through my mailcow server

frosty gale
#

similar with sending, you send the emails to the mailgun smtp proxy and it will forward your mail on behalf of it

sharp geyser
#

Are these my only options

#

Because while mailgun will help, I plan on having support emails run through my mailserver

#

and I don't want to cap it at 100 a day

#

💀

frosty gale
#

youre quite limited when it comes to not paying anything

#

i just wouldnt worry about exposing my servers ip honestly

sharp geyser
#

Well, you made it sound like I should...

frosty gale
#

as long as your firewalls are setup correctly you should be fine

#

dos attacks are quite rare unless you piss someone off

#

even then host providers let you pay a tiny bit extra for dos protection

sharp geyser
#

well

#

How can I proxy my ui through cloudflare but not my smtp part

#

Idk if that will be mailcow specific or not

frosty gale
#

are you using a reverse proxy?

#

if so then its simple

sharp geyser
#

I am using nginx

frosty gale
#

what port is your mailcow webui listening on

sharp geyser
#

8080

#
server {
        listen 443 ssl http2;
        listen [::]:443 ssl http2;

        server_name mail.vidcord.xyz autoconfig.* autodiscover.*;

        ssl_certificate /etc/ssl/certs/vidcord.xyz.pem;
        ssl_certificate_key /etc/ssl/certs/vidcord.xyz.key;
        ssl_client_certificate /etc/ssl/certs/cloudflare.crt;
        ssl_verify_client on;
        ssl_session_timeout 1d;
        ssl_session_cache shared:SSL:50m;
        ssl_session_tickets off;

        ssl_protocols TLSv1.2;
        ssl_ciphers HIGH:!aNULL:!MD5:!SHA1:!kRSA;
        ssl_prefer_server_ciphers off;

        location /Microsoft-Server-ActiveSync {
                proxy_pass http://127.0.0.1:8080/Microsoft-Server-ActiveSync;
                proxy_set_header Host $http_host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto $scheme;
                proxy_connect_timeout 75;
                proxy_send_timeout 3650;
                proxy_read_timeout 3650;
                proxy_buffers 64 512k; # Needed since the 2022-04 Update for SOGo
                client_body_buffer_size 512k;
                client_max_body_size 0;
        }

        location / {
                proxy_pass http://127.0.0.1:8080/;
                proxy_set_header Host $http_host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto $scheme;
                client_max_body_size 0;
                proxy_buffer_size 128k;
                proxy_buffers 64 512k;
                proxy_busy_buffers_size 512k;
        }
}
frosty gale
#

you can just do it directly through cloudflare

#

mail.vidcord.xyz cname

sharp geyser
#

I mean

frosty gale
#

then setup another subdomain specifically for your smtp server

#

and make it point to your real servers ip

#

not proxied

sharp geyser
#

would I have to modify anything in nginx?

#

I guess I would have to have a 443 server block for smtp and route smtp.vidcord.xyz with location / proxy_pass to 127.0.0.1:465 (SMTPS port)

#

I suck with nginx tho so idk if I will need any proxy_set_header usage

quartz kindle
#

isnt the point of email precisely not hiding your ip so you can be trusted?

sharp geyser
#

ig

#

Ima try and do the nginx proxy pass thing

#

I will let you guys know if it works

#

wait, I can't use my cloudflare certs for smtp

pearl trail
#

so uh, what is this virt thingy

quartz kindle
#

virtual memory, nothing real

#

VIRT stands for the virtual size of a process, which is the sum of memory it is actually using, memory it has mapped into itself (for instance the video card’s RAM for the X server), files on disk that have been mapped into it (most notably shared libraries), and memory shared with other processes. VIRT represents how much memory the program is able to access at the present moment.

frosty gale
sharp geyser
#

idk how

frosty gale
#

its a bit annoying ngl

#

actually no not with nginx

#

do a standalone one

#

actually wont work either since youre using nginx

sharp geyser
#

yea

#

this is why I use cloudflare

#

I looked at letsencrypt

#

andi t was too annoying

frosty gale
#

do it through dns

sharp geyser
#

ty

#

I will try that here in a bit Thumbs_Up_Medium_AE

frosty gale
#

then your certificate should be somewhere in /var/letsencrypt/live/ and you can use that in your smtp thing

sharp geyser
#

love having to generate an ssl cert JUST for my smtp server

frosty gale
#

the cloudflare one you have is one that's self signed by cloudflare anyways

#

so its not a proper one

pearl trail
quartz kindle
pearl trail
#

ooooo

quartz kindle
#

actual memory usage is RES

#

residential set

frosty gale
#

virt is irrelevant for basically any use case

#

fake ram

pearl trail
#

alright so another question, there are tons of sidekiq thingy with 10.5% mem, does it mean 10.5% each or the sum?

quartz kindle
#

10.5% is all threads combined

#

since they are all 1 process

pearl trail
#

oooo i see

#

thanks!!

quartz kindle
#

press F5

#

tree view is nicer

pearl trail
#

o

#

damn yeah it looks much nicer

frosty gale
#

jeez top is confusing

#

at least I think that's top

quartz kindle
#

its htop

#

a better top

frosty gale
#

still confusing

#

Windows task manager >

quartz kindle
#

lmao

frosty gale
#

I don't need to know how much memory my program has mapped in the virtual address space

#

just give me physical memory usage, maybe swap, and cpu percentage

#

everyone's happy

pearl trail
quartz kindle
pearl trail
#

pink accent color supremacy sunglas

quartz kindle
#

automatic accent xD

frosty gale
#

Brazil national color

sharp geyser
#

@frosty gale btw when setting up the dns record for the acme challenge do I proxy it or no?

quartz kindle
#

acme challenge should be reachable on port 80

sharp geyser
#
server { 
        listen 443 ssl http2;
        listen [::]:443 ssl http2;

        server_name smtp.vidcord.xyz;

        ssl_certificate /etc/letsencrypt/vidcord.xyz/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/vidcord.xyz/privkey.pem;

        location / { 
                proxy_pass http://127.0.0.1:465;
        }
}
#

does this look correct?

#

Im not sure if I need to set any proxy_set_header stuff

radiant kraken
pearl trail
radiant kraken
#

ew pink

pearl trail
#

i dont use pink

#

i use plum light

radiant kraken
#

still pinkish

pearl trail
#

it aint pink

radiant kraken
#

still ew

pearl trail
soft laurel
#

How do you determine if an Entitlement is active? I've cancelled a test one and it looks like nothing has changed on the Entitlement object in the provided interaction.

frosty gale
frosty gale
#

certbot is very annoying so I prefer doing it with dns

#

it modifies your nginx/apache2 configs for auto renewal

#

and you can't do web server verification if you have anything else on port 80

sharp geyser
#

it asked me to set a CNAME

#

not a txt

frosty gale
#

what is a cname gonna do

#

what did it say

sharp geyser
#

I forgot

#

all I know is it worked

#

and generated a ssl cert

#

and now my smtp works

frosty gale
#

magnificent

soft laurel
proud plover
#

Hey, I just wanted to ask how does the bot listing work? Like to be no.1 on the search results do votes matter or not? Because my bot has 36 votes and when I search “study” on top.gg, random bots come on top that have like 7-15votes.

deft wolf
#

The website simply needs a few days for everything to settle down

pearl trail
#

@sharp geyser you use postfix for mailing server?

proud plover
frosty gale
#

does appear to use postfix under the hood

#

as do most of them

#

i made my own smtp server and mail client just so i didnt have to deal with postfix

#

but using an all in one mail tool is probably better

#

not even joking that making your own smtp server is easier than configuring postfix properly from scratch

pearl trail
#

alright thank you very much for the suggestion

pearl trail
#

wtf someone is trying to break into my git ssh 💀

#

as expected, they're from china. idk the service said "vpn server"

real rose
#

standard for every machine getting brute force attempts

pearl trail
radiant kraken
pearl trail
#

idk

#

probably no you cant

radiant kraken
#

is it like a AllowedUsers = ['myip'] thing

pearl trail
#

that too

#

i disallow root login

radiant kraken
#

root login?

pearl trail
#

root@ip

radiant kraken
#

login that gives root access?

pearl trail
#

and i disabled password login so unless they have my key, no one can login to my server

pearl trail
#

basically user@ip

radiant kraken
#

hm

pearl trail
radiant kraken
#

gpg key?

pearl trail
#

ssh key

radiant kraken
#

hm

pearl trail
#

i dont think gpg is used on ssh

small tangle
#

passwordless auth NoddersHYPER

radiant kraken
#

they're probably from the people that hacked your github acc

small tangle
#

i did that with my pi and its cool. together with the ssh config i can simply write ssh pi and im connecting to it

pearl trail
#

ikr, it's cool KEK and safe

radiant kraken
#

ooo

small tangle
#

that too yea dogkek

radiant kraken
#

then yea i can see that

small tangle
#

okay at least in my case, i dont need to fear attacks since its not exposed to the internet derpcat

pearl trail
#

yeah

pearl trail
small tangle
#

but is it really making things more secure pikathink

#

cant you just scan which ports are opened and test them?

pearl trail
#

well yeah

eternal osprey
#

    cron.schedule(
      "0 12 * * *",
      async () => {
    // some code here
      },
      {
        scheduled: true,
        timezone: "America/New_York",
      }
    );```
i am using node-cron, why is this not executing at 12 in the morning in est time
#

it just not executes at all

frosty gale
# radiant kraken how do u mitigate this

disallow root login, only enable the accounts you need, disable password logins and only use certificates, thats basically all you can do and its usually enough

#

its part of normal internet noise

#

these scanners only look for low hanging fruit like pre-set passwords to known user accounts or stupidly weak passwords

pearl trail
#

oooo

frosty gale
#

or timezone

quartz kindle
quartz kindle
#

but if you want top tier security, use ssh tunnels instead

small tangle
frosty gale
#

im developing my own high tech solution for this

quartz kindle
frosty gale
#

make ssh only listen locally and the only way to connect is to connect to a tunnel which is protected by my own oauth2 login gateway

quartz kindle
#

im a simple man tho, i use root login with ssh keys

#

:^)

frosty gale
#

all behind a passwordless windows laptop somewhere in brazil

quartz kindle
#

yup

#

well the ssh key itself is password protected

#

it asks for password every time i connect

lament rock
#

Got a pin on my pc and ssh keys for my servers on non root users

#

No pw based login on a different sshd port

pearl trail
frosty gale
#

you can do that but theres no point

pearl trail
#

yeah true

#

otherwise the ws security is compromised mmLul

#

basically the same, or maybe worse

solemn latch
austere portal
#

@earnest phoenix turkish?

past field
#

need some advice 👀

#

so i have my click war bot

#

and right now i have 3 versions of the game

#

and i want 1 of them to be a premium feature game

#

what would be the best way to go about that?

quartz kindle
#

look into discord's premium systems i guess

past field
#

👀

#

would i need a website for that?

earnest phoenix
#

no

past field
earnest phoenix
past field
earnest phoenix
austere portal
surreal sage
#

nothing better than some testing in production Blushy_hearts

ionic schooner
#

thats the only way god intended

#

like is it really "testing" if its not in production

surreal sage
#

am i wrong

#

for not writing

#

declared callback functions

#

and anonymous functions

#

as callbacks

#

for react component events

#
<button onClick((event) => doStuff()) />```
#

instead of const onClickHandler = (event) => doStuff()

neon leaf
#

its fine

sharp geyser
#
  let account_details = query!(
    r#"
  SELECT a.*, l.license_id, s.* FROM accounts a
  LEFT JOIN licenses l
    ON a.account_id = l.account_id
  LEFT JOIN seats s
    ON l.license_id = s.license_id
  WHERE a.account_id = $1
  "#,
    &session.get::<i64>("id").await.unwrap().unwrap(),
  )
  .fetch_one(&state.db)
  .await?;

I have this sql query that won't work, mainly because of the duplicate values being returned. As both licenses & accounts will return an account_id and both licenses & seats will return an license_id

#

Is there anyway to do this without specifying each and every field I want back

#

or am I fucked

pearl trail
#

what does LEFT JOIN do? neko_think

sharp geyser
#

Good question

#

I barely know

#

I just know it works

#

I just realized, I don't even want to do it this way val_WaaGone

turbid pier
#

mui

lyric mountain
#

As in, get LEFT side, RIGHT is optional

eternal osprey
#

in puppeteer how can i emulate that my browser is in est timezone?

await page.emulateTimezone("America/New_York");```
tried doing this but shit aint working
pine willow
#

Wtf is this

bitter granite
pine willow
#

Goofy ass shit

pearl trail
#

omw implementing that

frosty gale
#

bro thinks discord will give him a cut 😭

pine willow
#

Fr

knotty quartz
#

Is it normal that when emphermal is true that it doesn't work

deft wolf
#

Isn't it ephemeral?

knotty quartz
#
        return interaction.editReply({ embeds: [isBlacklistedEmbed], ephemeral: true  });
#

So this would be correct?

#

Oh wait

#

For it to work I would need to make the defer

#

Ephemeral

deft wolf
#

I think so

knotty quartz
#

Sorry for wasting your time 😭

pearl trail
#

ephemeral works on both method

pearl trail
#

:>

small tangle
lyric mountain
#

discord has a new message type?

sharp geyser
#

Maybe

pearl trail
#

PURCHASE_NOTIFICATION ? idk that looks new to me

#

well i havent touched discord message api in a while so dont blame me if it's wrong

neon leaf
lyric mountain
#

ah wait, it's poll

lament rock
#

Poll message type has existed for a while

#

like over a month roughly

green kestrel
green kestrel
# neon leaf

its good if you want to buy a chip fab real cheap kekeke

craggy pine
#
if(checkBoostLog) {

    const wasBoosting = !!oldMember.premiumSince;
    const isBoosting = !!newMember.premiumSince;
    const channel = await newMember.guild.channels.cache.get(checkBoostLog[0].boost_channel_id)

    if (!wasBoosting && isBoosting) {

      if(newMember.guild.premiumSubscriptionCount <= 14) {
        const embed = client.quickEmbed(`${newMember.nickname ?? newMember.user.username} has boosted the server!`, `Thanks to ${newMember} We're now at **${newMember.guild.premiumSubscriptionCount} / 14 boosts!**`)
        embed.setThumbnail(newMember.displayAvatarURL({dynamic: true}))
        channel.send({embeds: [embed]})
      } else if(newMember.guild.premiumSubscriptionCount > 14) {
        const embed = client.quickEmbed(`${newMember.nickname ?? newMember.user.username} has boosted the server!`, `Thanks to ${newMember} We're now at **${newMember.guild.premiumSubscriptionCount} boosts!**`)
        embed.setThumbnail(newMember.displayAvatarURL({dynamic: true}))
        channel.send({embeds: [embed]})
      }
    } else if (wasBoosting && !isBoosting) {
      const embed = client.quickEmbed(`${newMember.nickname ?? newMember.user.username} boost has expired!`, `We're now at **${newMember.guild.premiumSubscriptionCount} boosts!**`)
      embed.setThumbnail(newMember.displayAvatarURL({dynamic: true}))
      channel.send({embeds: [embed]})
    }
  }

Anyone notice any flaws or things I could do a bit differently with my boost log code? Sometimes my counts are a little inaccurate or they arn't logged at all. I don't get many boosts as it is so testing can be difficult sometimes. https://scs.twilightgamez.net/72IsC.png

mild hill
#

has someone a simple code to post shard and guild stats in d.py?

lyric mountain
#

check topgg api documentation

crystal wigeon
#

hey anyone know how i can load default emojis like 🏐 on node canvas

#

?

#

the icon is not appearing at all

#

or it shows some weird unicode

#

i tried Noto Color Emoji font but it isnt working

craggy pine
#

Doing a quick google search seems like emojis have been an issue in the past, not sure if preseant. But I noticed some npm canvas emoji extensions? That could work like canvas-emoji

sharp geyser
crystal wigeon
#

sad unmaintained

#

sad

sharp geyser
#

wtf is that name

bitter granite
crystal wigeon
crystal wigeon
#

im just surprised nobody has tried to load emojis on node canvas

#

i dont have a choice but to manually parse the string and load the detected twemojis

#

not worth the effort tbh

crystal wigeon
bitter granite
crystal wigeon
#

aaa

bitter granite
#

Oh left

crystal wigeon
#

@flapze

#

sad

bitter granite
#

Thats why i cant tag

crystal wigeon
#

@flaze

#

or he renamed?

bitter granite
#

Left

#

Checked the mutual

crystal wigeon
#

sad

#

i was gonna ask the dude to maintain it kekcry

#

it works but the url is broken since it was left unmaintained for 3 years

#

he needs to update with the new twemoji url

bitter granite
#

Welp still in friendlist thoy

crystal wigeon
#

tbh im thinking of take his code and making changes

#

and pushing it in my repo

#

is that bad

bitter granite
#

Maybe forking from the thing?

crystal wigeon
#

yeah but like i dont think he active

bitter granite
#

Rip almost accdently call flaze

crystal wigeon
#

i just need to change the url to make it work idk tbh havent tried yet

#

lmaooo

#

anyway i started learning rust

#

gonna start

mild hill
solemn latch
sharp geyser
#

@lyric mountain can you help me with an sql query?

#

I am trying to get data on 3 tables, but when I am joining I am getting duplicates, and quite honestly I want to basically make a map of data where its like

{
  "account": {AcountData},
  "licenses": {LicenseData},
  "seats": {SeatsData} 
}
#

I almost had it last night, but I forgot what I did

#

Account < - Licenses <- Seats

Licneses has a fk to Account, Seats has an Fk to Licenses

lyric mountain
#

what are the relationships?

lyric mountain
#

an account can have many licenses, and a license can have many seats?

sharp geyser
#

An account can have 1 license, and a license can have many seats

lyric mountain
#

when I mean relationship I mean X-to-Y

#

like, X can have N Y

sharp geyser
#
create table accounts (
    account_id            int8            not null primary key unique,
    email                varchar(65358)    not null unique,
    password            varchar(255)    not null
);

create table licenses (
    license_id             int8             not null primary key unique,
    account_id            int8            not null unique,
    license_key         varchar(255)     not null unique,
    expiratation        int8            not null,
    paid                boolean            not null default false,
    seats                int                not null default 0,
    constraint fk_account foreign key (account_id) references accounts(account_id)
);

create table seats (
    seat_id                int8            not null primary key unique,
    license_id            int8            not null,
    invitee_license        varchar(255)    not null,
    invitee_account_id    int8            not null,
    constraint fk_seat_license foreign key (license_id) references licenses(license_id)
);
#

if you are curious these are the tables

lyric mountain
#

ok, so it is account --1-> license --N-> seats?

sharp geyser
#

Yea, I got it backwards

#

sorry

lyric mountain
#

hm?

#

how many licenses can an account have?

sharp geyser
#

Your account can have 1 license, BUT you should also be able to be invited as a "seat" for another license

lyric mountain
#

by --X-> I mean "can have X"

#

hard to draw an uml with text so I resort to it

#

ok, so an account can have many licenses, and a license can have many seats

#

doesn't matter if the account is the owner or not, if it can be invited then it can have

sharp geyser
#

yea

lyric mountain
#

this is a case where you can technically do in a single select, but it's better not to

sharp geyser
#

The way it works is, an account can register for a license, and that license can have sub-licenses (seats) that other accounts can use

lyric mountain
#

because it will have duplicates no matter what you do, account will repeat for every license it's part of

sharp geyser
#

Though im thinking of just removing the whole sub-licneses and just using an invite system

#

that way seats are only tracking account_id & license_id skuLul

lyric mountain
#

well, if you're using postgres you can use a jsonb field for seat occupants

#

instead of a 2-column table

sharp geyser
#

it'd have to be an array right?

lyric mountain
#

jsonb covers both object and array

sharp geyser
#

like a jsob[] or whatever the table is

#

oh cool

lyric mountain
#

jsonb is {} and []

#

do note this is only on postgres

sharp geyser
#

so i can do

  {
    "account_id": 1234,
    "license_id": 12345    
  }, 
  {
    "account_id": 12345,
    "license_id: 12345
  }
]```?
lyric mountain
sharp geyser
#

Oh wait right

lyric mountain
#

it'll already be a column of license, u dont need the id

sharp geyser
#

its on the license

#

no need to do the id

#

I see

#

So what would the sql query look like for this

#

because I am making an @me endpoint that will return all their information

lyric mountain
#

SELECT * FROM licenses WHERE seats ? :account_id

sharp geyser
#

Account, Licenses and Seats if they are part of any

lyric mountain
#

? is "has" operator for jsonb

sharp geyser
#

gotcha

lyric mountain
#

there are a handful of operators you'll eventually use, json is well integrated into postgres

sharp geyser
#

So I can do 1 select for the account and 1 for the licenses & seats

#

Ty 2prayge

lyric mountain
#

you can get all licenses too, just dont create a new account entry for every repetition

#

but separate selects is probably the best option, this way you avoid loading all licenses everytime u get an account

#

make a lazy acessor that loads the data only if used

sharp geyser
#

well sqlx has a fetch_optional

#

so if it finds nothing in the sqlx query

lyric mountain
#
public List<Licenses> getLicenses() {
  if (licenses == null) {
    licenses = SQL.get("...");
  }

  return licenses;
}
``` or smth
sharp geyser
#

it returns None or (similarly) null in other languages

#

so I dont have to worry bout that :p

#

Also

#

will that licenses select query return only if they exist in the seat jsonb

#

or if they also have a license?

#

cause they can own a license too

lyric mountain
#

only if they're in a seat

#

just add and OR clause for license ownership

sharp geyser
#

honestly might do 1 more select

lyric mountain
#

SELECT * FROM licenses WHERE account_id = :account OR seats ? :account

sharp geyser
#

and just return an extra field

#

Because i'd rather be able to more easily tell if they own it or if they are a part of it

lyric mountain
#

aight

sharp geyser
#

I think 3 queries is still reasonable

#

It shouldn't be too bad on performance

lyric mountain
#

3 queries but not always

#

since it's only if it's accessed

#

and u can cache the result

sharp geyser
#

yuh fair

#

I should 100% cache it if sqlx doesn't do it for me

#

Since I already use redis I will just cache it here

#

:p

#

Thanks a lot haku!

lyric mountain
#

yw

sharp geyser
#

I will have to find a way to write helper methods now :p

sharp geyser
#

How the fuck do people implement openid 2.0 when majority of the libs out there no longer support it

#

Like, rust has 0 libs that support openid 2.0 let alone any other libs in another language

#

but steam uses openid 2.0 for some god damn reason

#

I have to be a partner to use oauth2 val_WaaGone

#

I guess I will have to do it myself

frosty gale
#

who is openid 2.0

quartz kindle
#

closedid 2.0 when

solemn latch
sharp geyser
#

Right so rust is officially fucking gay

tawny lava
#

bro rust's been gay hello

proven lantern
sharp geyser
#

?

#

OIDC is the newer protocol

#

openid 2.0 is a legacy protocol that hardly anyone uses anymore

#

except steam is one of those that do

proven lantern
#

sad times

frosty gale
#

nodejs is unsafe??

#

not even node is safe

#

rust forever beloved

warm surge
#

?

pearl trail
frosty gale
# warm surge ?

fs promise api in nodejs is not thread safe so if you modify the same file in 2 different places for example the behaviour is not defined and may corrupt your file by writing at the same time which is undefined behaviour categorically

#

Rust™️ on the other hand would've detected this via the borrow checker and forced you to use a mutex

#

i think this is why json databases tend to corrupt

#

but if you implement it properly your json database will never corrupt

#

you just need to ensure theres only one write at a time

earnest phoenix
frosty gale
#

why not

#

for simple projects its a great way to store data

#

low traffic ones as well

pearl trail
#

the corrupt only happen if something other than the node process itself write into the file right?

frosty gale
#

that can be one way it happens but no, it can happen if you do it in the same process multiple times using async fs, i dont think the OS would even let multiple processes have write access to the same file unless you explicitly allow it

#

if you do it with the normal blocking fs it wont happen since it blocks the event loop so its guaranteed to only write to it one at a time

frosty gale
#

anyways this is getting deeply into the nodejs and asynchronous programming internals but in basic sense fs.writeFile can happen at the same time in the same program which can lead to corruption

pearl trail
#

o damn

#

thanks for the explanation

lyric mountain
frosty gale
#

you wouldnt use this for performance reasons to begin with

lyric mountain
#

you can bet some people would

#

that's why it's a general rule against json dbs, people like it and try to use everywhere

quartz kindle
#

create file with random name, write to it, rename it overwriting the original file

#

there's your atomically safe write, and thats how you do "safe json"

#

but you'd still need some sort of versioning system or in-memory copy, otherwise one write may accidentally delete/rollback another write

radiant kraken
#

tried rewriting my C++ app in Rust and decided to re-rewrite it back to C++

radiant kraken
#

i gotta be possesssed by brain

frosty gale
#

might as well use that database that stores data using networks relying on the fact that nodes bounce messages between each other

mild hill
#
import topgg

class Owner(Cog):
    def __init__(self, bot: Evelina):
        self.bot = bot
        self.cash = "💵"
        topgg_token = 'key'
        self.dbl_client = topgg.DBLClient(bot, topgg_token, autopost=True)

    @command()
    @is_owner()
    async def post_guild_count(self, ctx: EvelinaContext):
        try:
            await self.dbl_client.post_guild_count()
            await ctx.send("Successfully posted guild count to Top.gg")
        except Exception as e:
            await ctx.send(f"Failed to post guild count: {e}")

async def setup(bot: Evelina) -> None:
    await bot.add_cog(Owner(bot))

Can some help me why its not working? It says successfuly posted but on top.gg there are no server stats

lyric mountain
#

to clear cache

#

otherwise try an anonymous tab

surreal sage
#

are posts within this ⬇️ type of channel called threads?

deft wolf
#

I guess so

surreal sage
#

i need to know whenever one is created with discord.js

deft wolf
#

Also it's called forum channel iirc

surreal sage
#

i suppose so

lyric mountain
#

you can notice by how the "channels" are shown in the client

eternal osprey
#

Hey, when i use nodemailer to connect to my hotmail and send enails to customers i sometimes get ratelimited for suspicious activities..

#

Any way to get that fixed? Any different library? Any certbot certifcates to setup and fix this issue?

lyric mountain
#

if you send too fast for too many people you'll be flagged

#

especially if the target is gmail

#

automatic emails is complicated

#

you only solution would be to have your targets add you as a contact

frosty gale
#

yeah these apis that hotmail and gmail allow arent really meant to be used for anything other than personal use like extensions or custom email clients

#

if you start sending lots of emails to different addresses with them it wont like it

#

youd need to get an enterprise account or make your own mail server

#

or use some email platform that gives you an email under their domain and lets you send whatever you need with it

frosty gale
#

you likely have free tiers too

surreal sage
#

hiya

#

question for mongoosers

#

when should I use index in a schema?

#

I'm working on statistics for a game where we have 2 branches, dev/staging and production

And the statistics in question is vehicle kill/death ratio

#

placeId is basically the branch name

#

name is the vehicle name

#

version is basically git HEAD

#

just not sure if this is proper

surreal sage
# surreal sage

Going with this for now unless someone has suggestions ❤️

frosty gale
# surreal sage I'm working on statistics for a game where we have 2 branches, dev/staging and p...

as a general rule of thumb you should only index fields that:

  • you are going to be using that field to look up specific documents in your collection in your program
  • the collection it is in has many documents, otherwise indexing will likely have adverse returns
  • the field will be one of the main deciders on filtering your documents when querying (e.g. if im looking for exact matches for placeId and i know i wont get more than a handful of documents after that filter is applied, theres no point for me indexing other fields as the database can comfortably sort through the remaining documents anyways)

if you dont really understand those requirements, you should just stick to only indexing ID fields or fields that often appear in your find queries
if you dont know what indexing is, indexing a field lets the database find documents based on conditions relating to that field in an o(log n) fashion instead of scanning the entire collection for the documents

#

indexing is quite an expensive process so you should only index the fields you need to

surreal sage
#

yeah okay, there wont be thousands of documents

#

will make more documents every new version

#

so i'll just remove the index on name

frosty gale
#

yeah i really wouldnt bother indexing anything in that collection in that case

surreal sage
#

because there wont be more than 100 documents per version

#

and should I index placeId if it's only 2?

#

there are other schemas where a new document gets created like 6x every hour

#

so not sure

frosty gale
surreal sage
#

basically undisclosed enum of 2 distinct values

frosty gale
#

if you use it frequently to look up documents and theres a lot of documents in that collection or expected to have a lot, then yes

#

unless that field is always the same value you should index it

lyric mountain
#

you want to index thing you'll frequently be using to retrieve values basically

#

this is the same for all dbs

frosty gale
#

i think in mongodb your threshold for "lots of documents" should be lower as well since the schema is dynamic so the database cant perform certain assumptions a relational database can

surreal sage
#

this hurts to look at

deft wolf
#

I thought you meant sky-high pricing KEKW

surreal sage
#

ehhhhhhhhhh meow_stare

#

not bad

austere portal
#

hello i will authenticate for my discord bot but i don't know the requirements example how old do i have to be

lyric mountain
#

18

mild hill
lyric mountain
#

it stores a "snapshot" called cache

#

so you wont see new changes unless you force it to do a clean load

mild hill
#

Ah, now I understand what you mean. I had already tried it but after a few hours it is now displayed.

eternal osprey
sharp geyser
#

I have ran into a critical error in testing my backend api

#
  1. I am required to login via steam oidc
  2. To generate a license I need to be logged in, creating a license is done via a post request (tho ig I can do a get request as I am not sending any data over, mearly "requesting" a license to be generated)

I can't login via postman, which means I also can't generate a license val_WaaGone

#

Should I just make generating a license a get request?

full moth
#

does anyone use google cloud to host a bot?

sharp geyser
#

What is your question

#

Its better to ask your question then to ask if anyone has used x

spiral obsidian
sharp geyser
#

Yea no

lyric mountain
#

So u can set the redirect url to localhost and have Postman receive the response

sharp geyser
#

Im not using webhooks

full moth
# sharp geyser What is your question

I suppose thats true. The issue ive ran into is that when i run my bot from my pc it works fine, but when trying to upload it to the VM i get a timeout issue when its trying to connect to mongo (or from what i can tell), so was more wondering if anyone was aware of some setting that needs to be adjusted or any other suggestions for this to be solved. Just to reiterate it runs perfectly from my pc which makes me believe its an issue with the google cloud stuff

rose warren
#

Make sure the port mongo uses is open on the VPS? Your timeout error message should explain more?

full moth
#

Ill take a look and check it

civic scroll
pearl trail
civic scroll
#

it's your web api after all

crystal wigeon
#

can someone help

#

how do i load gif on node-canvas?

#

idk why its doing this

#
const { createCanvas, ImageData } = require('canvas');
const GIFEncoder = require('gif-encoder-2');
const GIFDecoder = require('gifuct-js');
const fetch = require('node-fetch');

async function loadGif(filePath) {
  const resp = await fetch("https://i.ibb.co/NjFLXG3/test.gif")
  const buff = await resp.buffer();
  const gif = GIFDecoder.parseGIF(buff);
  return GIFDecoder.decompressFrames(gif, true);
}

async function createAnimatedGif(gifPath, outputFilePath) {
  const frames = await loadGif(gifPath);
  const w = 688, h = 196;
  const canvas = createCanvas(w, h);
  const ctx = canvas.getContext('2d');

  const gifEncoder = new GIFEncoder(w, h, 'neuquant', true);
//   gifEncoder.setQuality(50); // 1 - 30
//   gifEncoder.setDelay(50); // You can adjust the delay
  gifEncoder.setRepeat(0); // 0 for repeat, -1 for no-repeat
  gifEncoder.start();

  // Draw each frame of the GIF
  for (let i = 0; i < frames.length; i++) {
    ctx.clearRect(0, 0, w, h);

    const frame = frames[i];
    const frameData = frame.patch;
    const imgData = new ImageData(
      new Uint8ClampedArray(frameData),
      frame.dims.width,
      frame.dims.height
    );
    ctx.putImageData(imgData, frame.dims.left, frame.dims.top);

    // Add additional drawings if necessary
    // e.g., draw some text or other images on top of each frame

    gifEncoder.addFrame(ctx);
  }

  // Continue with the rest of the drawings if any
  // For example, you can draw some static content on the last frame or any additional graphics
  ctx.fillStyle = "white"
  ctx.fillText("Some Text", 10, 10); // Example: adding text

  gifEncoder.finish();

  // Write the GIF to a file
  const buffer = gifEncoder.out.getData();
  await fs.promises.writeFile(outputFilePath, buffer);
  console.log(`GIF created at ${outputFilePath}`);
}

// Usage
const gifPath = './profile.gif'; // Path to the input GIF
const outputFilePath = './profile.gif'; // Path to the output GIF
createAnimatedGif(gifPath, outputFilePath);
#

Ive followed the base boilerplate

earnest phoenix
#

that is cursed

crystal wigeon
#

fr

#

there's more cursed

#

idk what is doing that fr kekcry im literally just using the methods shown on the packages

#

this is shit

#

can make a meme outa this kekcry with Tyler 1 screaming "help"

pearl trail
pearl trail
lyric mountain
crystal wigeon
#

but now im stuck in the delimma to understand how the save and resotre works. and see if its relevant for me.

#
const { createCanvas } = require('canvas')
const { writeFile } = require('fs')
const path = require('path')

const size = 200
const half = size / 2

const canvas = createCanvas(size, size)
const ctx = canvas.getContext('2d')
const drawBackground = () => {
    ctx.clearRect(0, 0, canvas.width, canvas.height)
    ctx.fillStyle = "white"
    ctx.fillText("Some Text", 10, 10); // Example: adding text
    ctx.globalCompositeOperation = "destination-over";
    ctx.fillStyle = "pink";
    ctx.fillRect(0, 0, canvas.width, canvas.height);
    ctx.globalCompositeOperation = "source-over"
  }

drawBackground()
ctx.save();
const encoder = new GIFEncoder(size, size)
encoder.setDelay(500)
encoder.start()


ctx.fillStyle = '#ff0000'
ctx.fillRect(0, 0, half, half)
encoder.addFrame(ctx)

ctx.restore()

ctx.fillStyle = '#00ff00'
ctx.fillRect(half, 0, half, half)
encoder.addFrame(ctx)

ctx.restore()

// drawBackground()
// ctx.fillStyle = '#0000ff'
// ctx.fillRect(half, half, half, half)
// encoder.addFrame(ctx)

// drawBackground()
// ctx.fillStyle = '#ffff00'
// ctx.fillRect(0, half, half, half)
// encoder.addFrame(ctx)

encoder.finish()

const buffer = encoder.out.getData()

writeFile('profile.gif', buffer, error => {
  // gif drawn or error
  console.log(error)
})```
lyric mountain
#

save and restore?

crystal wigeon
#

so like here

#

i want to see the bg

#

but i dont want to keep redrawing it. i want the red rect to dipp

lyric mountain
#

is the red square in the first frame?

crystal wigeon
#

yeah

lyric mountain
#

that's your issue

crystal wigeon
#

rn there only 2 frames which is why you see the green disappearing.

#

hmm

lyric mountain
#

first frame in gif is called "background" frame

crystal wigeon
#

no

lyric mountain
#

it'll be constant in every frame

crystal wigeon
#

ahhhh

#

so i need to add bg as the first frame?

lyric mountain
#

yes, then additional frames will either add to it or replace

crystal wigeon
lyric mountain
#

the encoder will likely use add, cuz it's better size-wise

crystal wigeon
#

that doesnt solve the problem

#

you see how red isnt disappearing?

#

in frame 2?

lyric mountain
#

see what I said about add and replace

crystal wigeon
#

im adding new frames

lyric mountain
#

if you want to hide the square after, you need to have the green square frame have a pink bg

#

not transparent

crystal wigeon
#

but can i not remove it entirely?

lyric mountain
#

you cant "remove" anything from canvas

#

you just draw over it

crystal wigeon
#

clearRect

lyric mountain
#

that wont remove

#

it'll draw over

crystal wigeon
#

i mean clearRect to clear that position

lyric mountain
#

it'll draw a black square with CLEAR blend mode

#

which technically erases, but it's not actually erasing, just drawing over

crystal wigeon
#

yeah and then i need to refill this black square

#

hmm

#

mmm

lyric mountain
#

it should be this

#

however, you're supposed to use replace disposition there if every frame is supposed to be only bg + frame

crystal wigeon
#

so every time i add a new frame i need to redraw the previous state

#

which is why i thought i could like use "save" to save the current state then restore

#

to redraw it?

lyric mountain
#

idk what the restore function does, but gifs arent that intuitive

#

these are the 2 available disposition modes

#

you currently have combine disposition

crystal wigeon
#

hmm

lyric mountain
#

replace will "restore" to the background layer before adding the next

#

so it'll do what u want

crystal wigeon
#

logicaly i was thinking more like use ctx.save() when you first draw the bg add to frame then after you draw frame 1 which is the red square you restore it to the bg state, and so on

crystal wigeon
#

wait

lyric mountain
#

I dont see you setting the disposition mode anywhere in that code

crystal wigeon
#

idc about disposition

#

like

#

what i mean is

#

a state where there are no squares

#

frame1

#

i use ctx.save to save a state where no squares exist

#

fram2 i draw 1 square, and go back to state where there are no squares

#

makes sense?

#

hmmm

lyric mountain
#

thing is, you're not using vanilla canvas, I'm unsure if it'll even work with gifencoder

#

cuz gifs work differently

crystal wigeon
#

right

#

i supposed i can save the prev state as an image and load it on each frame

#

which is basically drawing it gain

rustic nova
crystal wigeon
#

like in this example

#

he keeps calling "drawbackground" on each frame

#

i wanted to avoid that but ig you cant

lyric mountain
#

I mean, in either case you'd be redrawing again

crystal wigeon
#

didnt understand a thing here kekcry

#

yeah

#

ig

lyric mountain
#

save probably saves a snapshot of the canvas, then restore redraws it over everything

#

cuz image operations are atomic, no layerrs or whatsoever, once drawn, it's drawn

crystal wigeon
#

but it didnt do that

#

i was expecting the green rect to disappear since save was called before it

#

but all it did was reset the fillStyle to black

#

from green

lyric mountain
#

oh wait, then that would make sense

crystal wigeon
#

how

lyric mountain
#

restore doesnt restore the image then

#

it restores the state

crystal wigeon
#

isnt a drawn rect a state too?

lyric mountain
#

not really

#

for example, lets say you fiddled with metrics and changed rotation of the canvas

crystal wigeon
#

so it only restores states like globalAlpha, composite and fillstate

#

ig

#

right

lyric mountain
#

restore would reset the coordinates to the last save

crystal wigeon
#

the description isnt clearn, it needs to be better

#

yeah

#

that makes more sense

lyric mountain
#

cant you draw a canvas on a canvas?

crystal wigeon
#

but ye its misleading i thought it would save the whole canvas

lyric mountain
#

if so u can just clone the instance

crystal wigeon
#

thats the same as toDataUrl and then loading it again

#

but ig thats all you can do

lyric mountain
#

btw set this to true

crystal wigeon
#

yeah it is true

lyric mountain
#

idk why they made it false by default

crystal wigeon
#

ikr

#

anyway i have this idea "twitter for devs" with collaborative capabilities. what do you think? today, if someone needs help with code, you are having to keep sending jsfiddle links or jsbin linnks where you make changes

#

what if there's a space where you can click collaborate and edit the code on the same platform

#

solves the problem faster

#

and avoids people having to go back and forth

lyric mountain
#

isn't that github?

crystal wigeon
#

nah its diff

#

for example in our case just now

#

i shared some code here

#

you had to copy paste it somewhere etc to try it for me

#

what if we could just turn on collaborative mode

#

and you give your insights on what i need to fix and we see the changes

#

live

#

without leavingf the platform

#

i feel like it would be nice to have

lyric mountain
#

no, like, I meant github already has a "social media" mode

plain bough
#

lol

feral aspen
#

Just to make sure, if you're country isn't in the eligible country list, then you're not forced to switch your subscription to Discord, right?

deft wolf
#

Until they add this country

#

The same applies to annual subscriptions. For now, Discord doesn't have them, but they will probably add them in the future

#

So you probably won't escape it

feral aspen
surreal sage
#

my fucking face when vsc doesnt record me deleting a folder and not being unable to undo it

lament rock
#

Check the recycling bin

#

Made a bot that breaks down crash logs for mc

#

Stuff like mod list or mod loader detection is iffy, but is for the most part accurate

vivid fulcrum
neon leaf
quartz kindle
#

is it like a custom furnace or something?

neon leaf
#

It's a computer running lua

quartz kindle
#

oh lmao

#

but its working like an item "upgrader"?

#

or is it like a command block that you can customize

neon leaf
neon leaf
quartz kindle
neon leaf
#

It runs inside the game

quartz kindle
#

using ingame physics

neon leaf
#

Yesnt

quartz kindle
#

show the cpu

neon leaf
#

Well the only block in this case is that computer

#

It can just fully interact with the world

quartz kindle
#

so its not one of these

neon leaf
#

No, it's a mod

quartz kindle
#

lame

#

lmao jk

quartz kindle
neon leaf
quartz kindle
#

xD

pearl trail
#

"minecraft is a kid game" NERD

sharp geyser
#

Did you see the guy that made a machine learning model in minecraft?

pearl trail
#

💀 💀 💀

crystal wigeon
#

@lyric mountain you around? I got some weird glitch. ok so when draw shapes on gif with soem opacity, its glitching for some reason

#

the rect i drew has a globalAlpha .7 and then after drawing the rect i reset it to 1

#
const { createCanvas, ImageData, loadImage, Image } = require('canvas');
const GIFEncoder = require('gif-encoder-2');
const GIFDecoder = require('gifuct-js');
const fetch = require('node-fetch');

async function loadGif(filePath) {
  const resp = await fetch("https://i.ibb.co/NjFLXG3/test.gif")
  const buff = await resp.buffer();
  const gif = GIFDecoder.parseGIF(buff);
  return GIFDecoder.decompressFrames(gif, true);
}

async function createAnimatedGif(gifPath, outputFilePath) {
  const frames = await loadGif(gifPath);
//   const w = 688, h = 196;
const w = 708, h = 550;
  const canvas = createCanvas(w, h);
  const ctx = canvas.getContext('2d');

  const gifEncoder = new GIFEncoder(w, h, 'neuquant', true);
//   gifEncoder.setQuality(50); // 1 - 30
//   gifEncoder.setDelay(50); // You can adjust the delay
  gifEncoder.setRepeat(0); // 0 for repeat, -1 for no-repeat
  gifEncoder.start();

  gifEncoder.setDelay(frames[0].delay)
  // Draw each frame of the GIF

  // Continue with the rest of the drawings if any
  // For example, you can draw some static content on the last frame or any additional graphics
  
  for (let i = 0; i < frames.length; i++) {
    const frame = frames[i];
    const imgData = new ImageData(
      frame.patch,
      frame.dims.width,
      frame.dims.height
    );
    const temp = createCanvas(frame.dims.width, frame.dims.height)
    const tempCtx = temp.getContext("2d")
    tempCtx.putImageData(imgData, 0, 0)
    const img = new Image()
    img.src = temp.toDataURL()

    ctx.drawImage(img, 0, 0);

    ctx.fillStyle = "black"
    ctx.globalAlpha = .7
    ctx.rect(10, 10, 100, 200)
    ctx.fill();
    ctx.globalAlpha = 1;
    // Add additional drawings if necessary
    // e.g., draw some text or other images on top of each frame

    gifEncoder.addFrame(ctx);
  }

  gifEncoder.finish();

  // Write the GIF to a file
  const buffer = gifEncoder.out.getData();
  await fs.promises.writeFile(outputFilePath, buffer);
  console.log(`GIF created at ${outputFilePath}`);
}

// Usage
const gifPath = './test.gif'; // Path to the input GIF
const outputFilePath = './profile.gif'; // Path to the output GIF
createAnimatedGif(gifPath, outputFilePath);
#

im not understanding something here

crystal wigeon
#

there we go

#

Guys i found a bug on discord

#

Where do I get hired

#

I just downloaded this gif on google, but when i send it on discord it glitches

quartz kindle
#

lmao

quartz kindle
lyric mountain
#

that's normal

#

you REALLY dont want to work with opacity on gifs

lyric mountain
pearl trail
crystal wigeon
pearl trail
#

maybe try apng

crystal wigeon
lyric mountain
#

sadly apng doesnt work on discord

crystal wigeon
#

anyway now for some reason next build isnt working

#

like it just stops after it runs eslint

#

with no errors

lyric mountain
#

thing is, you're limited to 254 + 1 colors if using transparency

#

or 255 without transp

#

semitransparent overlays will effectively cut your allowed color count by half

crystal wigeon
#

ye

#

anyway do you know how to fix this weird next build issue ;-;

#

its so stupid

#

its working on my local machine

#

but on ubuntu next build simply stops

lyric mountain
#

u sure there are no errors?

crystal wigeon
#

yeah lemme send ss

#

it just randomly stopped

#

usually it shows the bundle size

#

if it successfully built

lyric mountain
#

u should really not ignore those warnings

crystal wigeon
#

but it works on local machine, it builds properly

lyric mountain
#

well, try building in another log level

#

like debug or trace

crystal wigeon
#

how

#

DEBUG=* next build?

lyric mountain
crystal wigeon
#

it just says failed to compile

crystal wigeon
lyric mountain
#

hm, you'll need tim then

crystal wigeon
lyric mountain
#

?

#

it compiled successfully?

crystal wigeon
#

no

#

like it showed some debug logs

#

and it says compile error like wtf

#

thats it

lyric mountain
#

do you have any muted exception?

#
try {

} catch (e) {
  // forgot to log here
}
``` like this
#

also, what font are u using on that profile card?

crystal wigeon
#

this isnt related to the profile card

#

this is a next web server

#

website

lyric mountain
#

ah ok

crystal wigeon
#

nvm it built

#

welp moving on to next issue now

#

fkin rat issues

lyric mountain
#

what did u change?

crystal wigeon
#

there was a random console.log without semicolon lol

#

but now back to original issue. for some fkin reason its not logging in but everything else works

#

like wtf man

#

it says 502

#

but when i go check the service it is running correctly

lyric mountain
crystal wigeon
#

like wtf i never faced this issue before at all

lyric mountain
#

webserver issue

crystal wigeon
#

it just randomly popper up

#

but the gateway is fkin workin

#

like wtf

#

wait wtf

#

typo

#

like

#

nothing makes sense

lyric mountain
#

I suppose ur using nginx

crystal wigeon
#

yeah

#

everything is loading for fk sake

#

but when you click login

#

it fails

#

for no reason at all and then says its 502

#

but i can see the logs on my backend

#

i see no errors

#

it says success

#

like wtf

lyric mountain
#

did you declare the endpoint as login/ instead of login?

#

also login works for me

crystal wigeon
#

no like actually login

#

follow through

#

itll take you back to website

#

and then fail

crystal wigeon
#

my end points are all correct

#

i see the request in my backend and i also see the success on set session

lyric mountain
#

check your /auth endpoint

#

oh wait

crystal wigeon
#

yeah the backend gets a success

#

like wtf

lyric mountain
#

isn't it supposed to be api.?

crystal wigeon
#

ye my web app makes that call

#

it was working

lyric mountain
#

https%253A%252F%252Fizzi-xenex.xyz%252Fauth

crystal wigeon
#

fine

lyric mountain
#

this is the redirect url

crystal wigeon
#

yeah ik

lyric mountain
#

it's sending to base url

crystal wigeon
#

i set it that way

#

i set it up that way

#

i handle the inc request

#

it was working fine

#

all these days

#

for years

#

liek wtf happened now

#

why am i getting a 502

lyric mountain
#

are u using nginx?

crystal wigeon
#

what fkin non sense is this

lyric mountain
#

open /var/log/nginx/access

#

go to the bottom and look for any 502

#

it'll tell you the issue there

#

might want to use an editor without auto-refresh btw

crystal wigeon
#

i just see this

#

thats my route

#

i dont see any error

#

but i do see 502 on that route

#

[08/Aug/2024:07:22:49 -0500] "GET /api/v1/ums/auth/discord?code=4hM3Zt9iJcYAS9r8TZ6e9PxOE1rMUO HTTP/1.1" 502 166 "-" "axios/0.27.2"

lyric mountain
#

ugh, axios

#

well, then it isn't an issue up to nginx, it's something in the code indeed

crystal wigeon
#

but hpw is it working locally

#

and i made no changes

#

to login

#

i even see the backend setting the cookie

#

fkin

#

wtf

#

wtf man

#

AAa