#development

1 messages Β· Page 271 of 1

prime cliff
#

Got pretty much most of the docker stuff aside from a few stack/container things

#

Need to do a bit of testing with how stacks will work and also do permission controls too

#

I also made a nice task list for long running operations πŸ™‚

pearl trail
#

just curious, is there anything in your project that portainer doesn’t have

prime cliff
#

Yea it's gonna have a bunch of developer tools and services integrated into it like project/website management, short links with customization, pastebin/privatebin, game console access for minecraft/battleye, server tools, image gen, API access (which portainer does not have)

pearl trail
#

i see, interesting

prime cliff
#

Minecraft and Dayz/Battleye games rcon

pearl trail
winter pasture
earnest phoenix
#
  • exposing it to the frontend so that there's no backend needed for fetching data, client-side ftw mmLol /s
winter pasture
#

nod
Thats why its called Serverless, right?

earnest phoenix
#

hellyeah

pearl trail
#

heck yeah πŸ”₯

winter pasture
#

Just ship it all to client!

earnest phoenix
#

we just need to make sure we sometimes send the local sqlite db so that they can update the served db

#

just to be sure things are up to date for everyone else as well

pale iron
elfin helm
#

are we meant to mind read the issue

earnest phoenix
#

aren't you a seer? unfortunate

pale iron
quartz kindle
neon leaf
#

happy bday tim

deft wolf
#

Happy birthday

quartz kindle
#

tenk yu!!

neon leaf
quartz kindle
#

<3

lament rock
#

How many segfaults will there be today

crystal wigeon
quartz kindle
#

@lament rock@crystal wigeon tenk yo tenk yo

short pilot
#

how do discord activities work visive top.gg?

#

can you post them just like a bot and people invite them

#

im just starting to learn about activities after making a couple bots a long time ago

#

also im researching how i would get into making an activity using unreal and c++ (and i assume some js is required as well)

#

so any info/links on that would be amazing

lyric mountain
#

for the same reason they dont accept interaction-only bots

#

as for your other question, you dont need js, you'll make a game as you would normally, then export for web

#

be aware that the game will be running in a browser, so dont go too fancy

short pilot
#

used to using unreal and have been spending a lot of time learning c++ lately, looks like the better option for this is to use godot and learn gdscript though

lyric mountain
#

godot works well, albeit unable to use c# for web on latest version (and I refuse to use a python-like lang to code a big project)

#

I have yet to try unity as they seem to have good support for web apps

short pilot
#

this is a remake of a pixel art bot game i made where i would draw pngs and send them, i figure if i can make it this way it can exist out of discord and actually be animated and a proper game

lyric mountain
#

do you even need an engine in that case?

#

that should be simple enough to make using raw html + js (+ jquery)

short pilot
#

i don't know javascript though

#

i did start remaking the entire thing as a bot using c++ only and started getting fancy with performance maxxing then i realized this was an option πŸ™ƒ

wheat mesa
#

create your own engine

#

you'd be surprised how powerful a simple ECS and renderer can be

lyric mountain
#

the hardest part is just finding out a way to export to web

slender wagon
#

Hi guys, i currently use postgres for most of my db tasks in my bot.
But there is a new feature im introducing where i have to store all the messages of each person in a certain channel, and then after a x amount of time i extract them out and clean it from the db.
For now i have used a statemanager with just array's but i don't feel thats right.
What do you guys suggest i use, so something quick and not heavy

lyric mountain
#

so basically it's a ticket transcription feature

#

idk what a statemanager is, but could instead of saving to the db, fetch the last N messages in that channel

#

you can only fetch 100 at a time, but you can do it in chunks till u reach the start

slender wagon
#

it is a transcription but not for tickets, and these channels are debate channels. (up to 5 hours)

#

i would not trust discord with that

lyric mountain
#

fetching will be the best way if you dont want to store thousands of messages

slender wagon
#

considering the messages will be deleted after 2 - 5 hours

#

most of them after 2 hours

lyric mountain
#

yes, but still

slender wagon
#

like from the db

#

and i only plan on leaving it in like 10 server max

lyric mountain
#

on a hot topic it'll be several messages per minute

slender wagon
#

but huge ones

lyric mountain
#

by fetching you can take your time processing them all without bloating your bot's memory

slender wagon
#

yeah but i was thinking of using a db instead of an array

lyric mountain
#

it'll waste a lot of I/O unless you use a separate DB specifically for that

slender wagon
#

r u sure i wont get rate limited by discord

lyric mountain
#

there's a bulk message fetch endpoint, just give it some time between chunks and you're good

slender wagon
#

okay thank you!

lyric mountain
#

you can also transcript as you go

#

like, if it's a file output you can use the logging technique

#

basically make a queue to store the messages, then every X seconds you flush to the file

#

this would be the most straightforward option with zero fetching required

slender wagon
#

whats the difference between that and just using the db?

lyric mountain
#

no entries deleted, no post-processing, no second queries

#

and the only memory spent would be the one you reserved for the buffer

#

this is a very common technique for loggers when you have many threads and a lot of writes at once

#

because from the file's POV, it's only being written once every few seconds

slender wagon
#

oh gotcha, that makes sense

#

i will probably go with that. However i do need to store each user id for each message and the channel id they came from

#

would that be possible with a file

lyric mountain
#

you can format the file contents however you want

slender wagon
#

would json be ok

lyric mountain
#

what were u planning to do with the messages afterwards?

slender wagon
#

or csv

#

they will go through a AI query

#

and be summarised

#

then i don't need em anymore

lyric mountain
#

well, it doesnt have to be any format in specific, just something the ai can understand

slender wagon
#

well the ai does need to know the users

#

or the usernames at least

#

and then i need to know which channel it was taken from

#

@lyric mountain can u go dms real quick

lyric mountain
#

aight

slender wagon
lyric mountain
#

yep

prime cliff
#

Much better over portainers πŸ™‚

delicate zephyr
prime cliff
#

You could try test out the docker features if you like at the end of the week when i release this build πŸ™‚

pearl trail
#

wao, didnt know portainer got that

prime cliff
#

You mean the process list?

#

You basically click the stats of a container

#

And it will show the process and graphs

#

Gonna replicate this and improve it in my project

#

I could probably even implement like alerts if a certain container cpu usage is being maxed out > 70% total

pearl trail
#

πŸ’€πŸ’€i know the graph is there but didn’t realize there is processes ;D thanks for letting me know

deep cedar
#

Can someone say me how to make an discord dashboard on Discord.py? Also I am on phone ☠️

lyric mountain
#

you cant make one with d.py

#

you have to use some web framework (like flask in python's case) or straight up html

#

then you make an api to supply info to the site

#

the api can use d.py to retrieve data tho

deep cedar
#

Alr so I can't do with discord.py only with flask right?

#

That's what u saying?

lyric mountain
#

d.py can only make bots, for a dashboard you need a site + api

#

so yeah, you'll need to learn separate stuff

#

tho being on a phone will make it much harder for u

deep cedar
#

Yeah I got it

#

I'm gonna see what can I do

pearl trail
#

if (rawCtx is not SocketUserMessage { Channel: SocketTextChannel channel } reactedCtx) this is cool SkadiDaijoubu

sharp geyser
#

Yuppppp

#

It’ll be null if it’s false

#

I think right?

rose relic
#

I mean - if you set up such condition you should already handle that rawCtx is failing it

#

or I'm understaing it wrong

pearl trail
sharp geyser
#

Ah right

rose relic
#

I have big codebase in plain react, but I'm struggling with SEO (google does it better when we're doing the SSR thing). Anyone have any ideas, how can I smoothly move my codebase to Next.JS so SEO will be more... working? πŸ˜„

sharp geyser
#

In retrospect there isnt much difference between react & nextjs since all nextjs is just a framework that has built in routing and other features

#

All you gotta do is learn how its routing works and thats pretty much it

small tangle
#

graph theory my behated owoPain

proven lantern
#

what's the best and cheapest way to keep a large(10,000) rank order list?

#

like a leaderboard with 10,000 players and they check their rank 500 times a days. and ranks are changing all the time

delicate zephyr
#

wdym

proven lantern
#

like a 10,000 person chess tournament

delicate zephyr
#

Ah okay

#

so for example, with topstats

we store the rank and the vote_count in the same table

#

we calculate the rank every hour after the votes update

proven lantern
#

is that a mysql table?

delicate zephyr
#

mhm

#

Postgres

#

but same difference

proven lantern
#

and then a query like this?
"SELECT COUNT(*) FROM player WHERE mmr >= %s ORDER BY mmr DESC;"

delicate zephyr
#

and thats 45k+ bots

proven lantern
#

do you think postgres or any sql database will be cheaper than DynamoDB for this use case?

#

i think it would be around $15 a month to handle those queries via DynamoDB

#

i'm not sure though

delicate zephyr
#

I mean, idk

#

Ive never used dynamoDB

proven lantern
#

the pricing is confusing

#

actually i think my math was way off.
10,000 * 500 = 5 million read request units
5 * $0.125 = $0.625

#

what kind of instance/machine is the sql db running on?

proven lantern
delicate zephyr
proven lantern
#

16gb+ ram?

#

i'm guessing a free tier EC2 instance wont have enough ram or cpu power to handle that

proven lantern
#

i think running redis on an EC2 and using ZREVRANK might be the best way. it'll only use around 10MB of memory for a list of 10,000 numbers
https://redis.io/docs/latest/commands/zrevrank/

delicate zephyr
#

timescale only takes like 12GB

#

and postgres uses less for me

#

hold on lemme check

#

cause rn topstats has zero caching so it's worst case scenario for you ig

delicate zephyr
sharp geyser
#

Yea pg is rather cheap

proven lantern
#

nice, so that's an option too. it's going to be annoying to make sure the data is synced between dynamodb and sql or redis

delicate zephyr
#

could just move to postgres and use prisma

proven lantern
#

i'll check that out. i was looking at upstash.com for redis hosting

#

this is what AI is saying

radiant kraken
pearl trail
#

it still compiles to js right?

earnest phoenix
#

tsgo πŸ—Ώ

elfin helm
#

least obvious scam

#

"kindly" and "indian", we not even trying anymore

covert gale
elfin helm
covert gale
#

i'm not looking for a job, however that doesn't change that your basing something off a stereotype that anything regarding "tech" and "india/indian" is a scam

spark flint
#

its a recruitment scam, they join dev servers trying to recruit for jobs that dont exist

covert gale
#

yes i get that, but i'm talking about the fact that they are basing part of that from the fact that it mentions india

spark flint
#

its the same as crypto people trying to hire

earnest phoenix
#

4 yeras

deft wolf
#

Every other person doesn't care

radiant kraken
charred thistle
#

Uhm hello

elfin helm
#

And the use of "kindly" as well, typical scammer jargon

lyric mountain
#

@dense flame

pearl trail
sharp geyser
#

Gawt damn

#

there was 3 of the mfs at once

surreal sage
#

I'm trying to do borderRadius on a next/image with objectFit contain

#

bounding box won't match image content

lyric mountain
#

are u setting height somewhere?

quartz kindle
#

which element are you setting the border-radius on?

frosty gale
#

late response but true

#

why is everything a factory in java

#

what even is a factory

lyric mountain
#

fun fact, it isn't

#

that's just corporate bullshit conventions that people think is java

lyric mountain
#

for example a database pooler is a connection factory

#

it exists everywhere, people just dont notice cuz it's not explicitly named factory

earnest phoenix
#

java be like: no need of comments when the function name is the comment already

surreal sage
#

i love using a server cpu with single thread rating comparable to that of a pi 5

#

(3 and a half minutes to build a simple nextjs project)

slender wagon
#

so i woke up this one day and i can't fetch/pull/push from github

#

it times out

pearl trail
#

that's weird, i guess you use ssh?

slender wagon
#

yes

pearl trail
#

oh, you have multiple github user

slender wagon
#

yes

#

but it always worked okay

pearl trail
#

what does ssh -T git@MyUsername.github.com says

#

is there any error or what

slender wagon
#

times out

pearl trail
slender wagon
#

let me try again and give u the exact message, but it will take a few minutes

slender wagon
#

im not ratelimited

pearl trail
#

hmm that's weird

#

check if you can access the port 22, nc -zv github.com 22

slender wagon
#

so my friend had a similar issue a day ago

#

we use the same isp

pearl trail
#

your isp might block port 22 i guess?

small tangle
#

you can look at the debug logs with -v. What does ssh -vT git@MyUsername.github.com give you?

solemn latch
#

theres no way right? πŸ‘€

pearl trail
#

but there's still a way pepe_glass_c

solemn latch
#

fair

#

I just cant imagine an ISP blocking 22

slender wagon
#

ssh -vT git@MyUsername.github.com
OpenSSH_8.9p1 Ubuntu-3ubuntu0.11, OpenSSL 3.0.2 15 Mar 2022
debug1: Reading configuration data /home/grainger/.ssh/config
debug1: /home/grainger/.ssh/config line 13: Applying options for MyUsername.github.com
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug1: Connecting to github.com [140.82.121.4] port 22.

#

this will 100% time out

pearl trail
slender wagon
#

i can imagine the isp having technical issue

slender wagon
pearl trail
#

damn

slender wagon
#

pretty sure time out

pearl trail
#

you can try port 443

slender wagon
#

that one works

#

but i can't use it for ssh

slender wagon
pearl trail
#

that's definitely weird yeah

slender wagon
#

after updating the config file to use 443 do i have to restart anything

#

or should it pull automatically

earnest phoenix
#

we gaming

slender wagon
#

ima try to ssh on my vps see if same thing happens

pearl trail
#

hope it works

slender wagon
#

oh no

#

it aint working

solemn latch
#

πŸ‘€ no way

slender wagon
#

is it time to call my isp?

#

wait let me check firewall

#

but it shouldn't be firewall since i haven't touched any config files on this system

pearl trail
#

πŸ’€ πŸ™

slender wagon
#

okay yeah this sealed things up

#

i switched system

#

from ubuntu to windows

#

same thing

#

i'll sue my isp

pearl trail
#

haha, good luck!

solemn latch
#

back to testing CCX13 πŸ˜„

solemn latch
#

Yeah CCX actually just sucks

#

I guess I'm using CPX

neon leaf
solemn latch
#

Its more the memory side, more memory for the cost.

neon leaf
#

ah

solemn latch
#

But I do want something that makes sense πŸ˜„

small tangle
#

Actually its a port not a rewrite Kappa

pearl trail
#

rust developers when they see a project not using rust

solemn latch
#

I think they should have used scratch

#

but thats just me

sharp geyser
#

I think they should of used pearl

#

but thats just me

neon leaf
#

nah squeeze it through jsfuck

pearl trail
solemn latch
#

did this change already happen? πŸ‘€

neon leaf
#

ye

#

they plan to release by ts 7.0

sharp geyser
#

Isnt it only 5.8.2 rn

earnest phoenix
#

which is like in 2026 if not later

solemn latch
#

ah, so it hasnt happened yet

#

Fun stuff

earnest phoenix
#

they plan for some changes etc for 6.0 and then tsgo the next one

sharp geyser
#

Fairs

#

I wonder if they will release a preview before official release

neon leaf
#

they always do

sharp geyser
#

true

solemn latch
neon leaf
#

well

#

on the shared one you cant use 100% cpu for prolonged periods

solemn latch
#

Their limits are really really high from what I've heard

#

Even if I used 40%(of the three cores) I still get more cpu power

neon leaf
#

yeah

slender wagon
solemn latch
#

ay

neon leaf
#

1 of 4 servers replaced with arm πŸ™

real rose
sharp geyser
#

HAHA

#

Maverick made funny

thin flint
#

Is there an absence bot for players so that they can do an absence??

real rose
gilded plankBOT
#

topgg To find a bot that you need, please try searching for it on our website.

You may need to refine your search term, but with just a little effort you can find the bot that you need. Read our Quick Start Guide to Top.gg support article for more information on how to best use our search.

If you still haven't found a bot that suits your needs, then try searching on Google for it.

neon leaf
#

@harsh nova did you do CX22 vs CPX11?

#

nvm it was @solemn latch

real rose
#

wrong wallet

neon leaf
solemn latch
#

Cpx, ccx just makes no sense

frosty gale
#

compiling my rust project to arm64 failed, c++ project definitely wont compile because some of the libraries dont have arm64 code and use x86 instruction sets for acceleration

neon leaf
#

Yeah, my main issue was a rust app but GitHub added native arm runners a month ago so that wasn't too hard

prime cliff
#

Pog Got docker logs working with a nice auto scroll toggle and up/down

delicate zephyr
#

I love you unironically, I want it

prime cliff
#

Docker also has a way to track file system changes might be useful to track down extra log files πŸ˜„

acoustic bough
#

balling

sharp geyser
acoustic bough
sharp geyser
#

but the likes were already 2

#

prior to the 2nd reaction

acoustic bough
#

that's a screenshot

sharp geyser
#

Oh wait

acoustic bough
#

you have to look further down

sharp geyser
#

πŸ’€

acoustic bough
#

lmao

sharp geyser
#

I see that now

#

The video player bar was covering it

acoustic bough
#

ass example

#

ah lol

#

it's so cool

sharp geyser
#

That's pretty sick

#

Do you use a bot?

#

I assume right

#

Honestly no idea what is possible on discord anymore

#

πŸ’€

acoustic bough
#

yes it's a bot

#

my initial idea was just adding buttons on bluesky notifications but I thought 'why not let users react to any message containing a bluesky post'

sharp geyser
#

How do you post the like to that post though?

#

Is that even allowed via their api?

#

or is it only posts that you make

acoustic bough
#

I use bluesky oauth2

#

and yes it's allowed

sharp geyser
#

I was under the assumption you were somehow doing it ot other people's posts

acoustic bough
#

bluesky has a shit ton of alternative frontends through which you can like posts - so why shouldn't you be able to from discord

sharp geyser
#

That's fair

#

I have no idea what bluesky is tbh

sharp geyser
#

I know its a twitter alternative

acoustic bough
#

it's technically impossible for them to close their api

sharp geyser
#

interesting

acoustic bough
#

bluesky is just an app view for the atprotocol

lyric mountain
#

chrome is just digging its own grave with those recent updates

#

esp now that there are other chromium alternatives

solemn latch
#

Whoops πŸ‘€

#

idk what I did to make that happen

real rose
#

fishing bot

neon leaf
#

changed all servers outside eu to 2gb now

#

sad that theres no arm in usa

solemn latch
#

seriously

#

it would be so nice

neon leaf
#

yea

#

their arm cpus are so much faster than the shared amd

solemn latch
#

Pretty much everything I want to do works on arm now

lament rock
#

Time to switch I guess

uncut briar
#

suppose so. manifest v3 is more restrictive if i recall, so ublock origin was forcefully disabled for that reason by chrome.

lament rock
#

Yup. Funnily enough, you can just go back into the ext page and re-enable it and it still works

#

so mv2 is still in the code?

uncut briar
#

i guess? i mean i havent used chrome in years but using same extension on firefox.

lament rock
#

I only deal with chrome for work because our POS system is intended for use in Chromium browsers and FireFox sometimes works and sometimes doesnt

uncut briar
#

makes sense

lament rock
#

Personally not really trusting FireFox anymore because of some recent controversy, but I'd been using Arc for a minute anyways

uncut briar
#

didnt read much on that but didnt bother me anyway

lament rock
#

I mean, basically FireFox going back on its promises of never selling your data and being privacy centric

uncut briar
#

ah

vivid fulcrum
#

best of both worlds

real rose
#

@harsh nova @solemn latch aPES2_Cheer

lament rock
#

Someone just mentioned this browser the other day

harsh nova
#

ZEN MENTION

lament rock
#

I guess I shall

harsh nova
#

hello, best browser

real rose
#

we have been looking at Zen the last couples days 😭

#

mention in the wild is crazy

solemn latch
#

I'm trying so hard to use it

harsh nova
#

its comfy

solemn latch
#

Its just so different

#

And I'm finding bugs

real rose
#

i havent fully swapped either, ive just been using it for a lil search here and ther

solemn latch
#

Yeah

quartz kindle
lament rock
#

never had an issue with ublock tbh

quartz kindle
acoustic bough
minor epoch
lament rock
#

I even use some dynamic ad blockers that dont rely on hosts files and they didnt pick it up

quartz kindle
pearl trail
#

lmao youtube once lags my laptop like a lot that i can barely do navigation in youtube when im using adblocker that blocks their ads

prime cliff
#

My laptop gpu has a really weird issue with Discords tenor gif popup if you try to scroll or load a few gifs it just blanks out the entire Discord app with the theme color or maybe some obscure electron issue

pearl trail
#

android?

lament rock
#

iOS

pearl trail
#

weird, i never encountered that issue

delicate zephyr
#

thats sick dude

real rose
#

has fire ptero addons too πŸ”₯

frosty gale
#

it is almost impossible to have a graphics glitch free experience using anything electron/chromium with hardware acceleration on

#

i think its partly due to graphics drivers and gpu companies making changes faster than the chromium team can keep up

acoustic bough
#

and then randomly it's on my GPU again

earnest phoenix
#

guys is it good practice to if bot gets removed from a server delete the server data?
Or do i keep it for future incase they add it back

acoustic bough
earnest phoenix
#

bruh my worst enemy is await

acoustic bough
frosty gale
#

you should be able to just have a column which tracks when an entry was added then have a loop which does a query that deletes all records older than x

earnest phoenix
#

if i need to use async function it doesnt even error it just sets the variable to a promise

acoustic bough
#

idk what you mean

frosty gale
earnest phoenix
#

i ran var dd = loadData(); which loads data from json but it didnt even add guild data to data.json cause it would try to run saveData(<promise>) instead which didnt save stuff so i was wondering why didnt it save data

acoustic bough
#
async function do() {
  const data = await load();

  data.lol = true;

  void save(data);
}
earnest phoenix
# acoustic bough ```ts async function do() { const data = await load(); data.lol = true; ...

i did

bot.on("guildCreate", async (guild) => {
  var dd = loadData();
  dd[guild.id]=dd[guild.id]==null?{}:dd[guild.id]
  dd[guild.id]["prefix"]=dd[guild.id]["prefix"]==null?defaultPrefix:dd[guild.id]["prefix"]
  dd[guild.id]["roleData"]=dd[guild.id]["roleData"]==null?[]:dd[guild.id]["roleData"]
  dd[guild.id]["userData"]=dd[guild.id]["userData"]==null?[]:dd[guild.id]["userData"]
  dd[guild.id]["commandData"]=dd[guild.id]["commandData"]==null?[]:dd[guild.id]["commandData"]
  dd[guild.id]["levelData"]=dd[guild.id]["levelData"]==null?[]:dd[guild.id]["levelData"]
  for (var i in dd[guild.id]["userData"]) {
    if (dd[guild.id]["userData"][i]["permissionLevel"] == 6) {
      dd[guild.id]["userData"][i]["permissionLevel"] = 0
    }
  }
  dd[guild.id]["userData"].push({
    "userId": guild.ownerId,
    "permissionLevel": 6
  })
  saveData(dd);
})
acoustic bough
#

what the fuck

neon leaf
#

.........

acoustic bough
#

do you just have a huge json file for like all servers?

acoustic bough
#

this is a programming war crime

earnest phoenix
#

i never understood sql

#

or how to set up an database

#

json is my favourite database for now

lyric mountain
#

it's also the least reliable one

deft wolf
#

And worst at the same time

neon leaf
#

no setup required

earnest phoenix
neon leaf
#

time to learn

acoustic bough
#

learn it

#

programming is constant learning

earnest phoenix
#

i am still gonna use json cause its dynamic

acoustic bough
#

when I started with wamellow I didn't know shit about it either

lyric mountain
acoustic bough
neon leaf
#

no sql needed

minor epoch
#

Mongodb is also very slow

#

Unless you pay for it

neon leaf
#

well faster then json

acoustic bough
#

(I'm not a fan of mongo due to performance issues and constant crashes)

earnest phoenix
#

i think it is

earnest phoenix
#

bson = json but binary

neon leaf
minor epoch
neon leaf
#

you can use the client with normal json

neon leaf
acoustic bough
#

in the way you interface with it is just json

neat mulch
#

helllo

#

Do you think that I could clone whole disk/part using clonezilla in order to move from higher vps plan to lower one on contabo?
Could that work when I buy new vps with lower plan, resize disk partition (because lower plan has less storage) and then boot into rescue mode with clonezilla option

minor epoch
#

Hardly noticeable

earnest phoenix
#

anyways i dont think im gonna rewrite the entire code for the bot to use mongodb

neon leaf
earnest phoenix
#

cause it has like 20 js files that use the same json file

minor epoch
minor epoch
earnest phoenix
#

none

minor epoch
#

You'll be fine for now, but consider learning how web db's work

earnest phoenix
#

i kinda wana switch to a db cause

#

it takes 10 seconds to run the leaderboard command

#

there are only 12 people on it

acoustic bough
#

dbs are just way easier to interface than with... what ever you made

earnest phoenix
#

My sd card is probably dying rn

minor epoch
#

Then do it locally

earnest phoenix
#

ok imma fix the og code then do local stuff

#

😭

minor epoch
#

Shut up

earnest phoenix
#

πŸ€‘ free money

earnest phoenix
#
bot.on("guildCreate", async (guild) => {
    console.log("New guild");
    var dd = await loadData() || {}; // set new guild data
    dd[guild.id]=dd[guild.id]==null?{}:dd[guild.id]
    dd[guild.id]["prefix"]=dd[guild.id]["prefix"]==null?defaultPrefix:dd[guild.id]["prefix"]
    dd[guild.id]["roleData"]=dd[guild.id]["roleData"]==null?[]:dd[guild.id]["roleData"]
    dd[guild.id]["userData"]=dd[guild.id]["userData"]==null?[]:dd[guild.id]["userData"]
    dd[guild.id]["commandData"]=dd[guild.id]["commandData"]==null?[]:dd[guild.id]["commandData"]
    dd[guild.id]["levelData"]=dd[guild.id]["levelData"]==null?[]:dd[guild.id]["levelData"]
    // remove anyone who had owner previously
    for (var i in dd[guild.id]["userData"]) {
        if (dd[guild.id]["userData"][i]["permissionLevel"] == 6) {
            dd[guild.id]["userData"][i] // delete it
        }
    }
    // owner = level 6 permission
    dd[guild.id]["userData"].push({
        "userId": guild.ownerId,
        "permissionLevel": 6
    })
    saveData(dd);
});
``` help
#

how do i delete the user data for owner

#

lemme ask the local ai

#

btw how do i edit messages more?

#

cause it gets rate limited fast

acoustic bough
#

what do you mean

#

if you hit a rate limit, you must slow down

earnest phoenix
#

for my ai commands it has live message thing

#

it edits at every 30 token for now

#

but i want it less

acoustic bough
#

chunk it to only update once per second at max

earnest phoenix
#

dang bruh the ai yapped so much it crashed my bot 😭

acoustic bough
earnest phoenix
#

idk how to do that

acoustic bough
#

thats a slash command

#

wdym

earnest phoenix
#

yea

#

ok but

#

how do you send more messages at once

minor epoch
#

You need to create a slash command loader

acoustic bough
#

follow ups

earnest phoenix
#

oh i forgot that exists

minor epoch
acoustic bough
earnest phoenix
#

my ai command looks like garbage

#
action_slash: async function(interaction, client, permissionLevel) {
        const prompt = interaction.options.getString("prompt");
        if (!prompt) {
            return interaction.reply("You need to provide a prompt!");
        }
        const model = "gemma2:2b";
        const system = "Be friendly";
        await interaction.deferReply();
        try {
            const response = await axios.post(
                ip + "/generate",
                {
                    stream: true,
                    prompt: prompt,
                    model: model,
                    context: context,
                    system: system
                },
                {
                    responseType: 'stream'
                }
            );

            let buffer = ""; // Buffer to accumulate the response
            let userResponse = "";
            let nextTime = 0;

            for await (const chunk of response.data) {
                // Accumulate the chunk data
                buffer += chunk.toString();
                
                // Split the buffer by newlines to handle separate JSON objects
                let lines = buffer.split('\n');
                
                // Reset the buffer to the last incomplete line
                buffer = lines.pop(); // The last part may not be complete
                
                // Process each line
                for (let line of lines) {
                    try {
                        let restext = JSON.parse(line);
                        console.log(restext.response);
                        userResponse += restext.response;
                        
                        if (nextTime == 30) {
                            nextTime = 0;
                            await interaction.editReply("Generating...\n" + userResponse + "\n-# Generated with " + model);
                        }

                        if (restext.done) {
                            console.log("Done!");
                            userResponse = userResponse.trimEnd();
                            await interaction.editReply(userResponse + "\n-# Generated with " + model);
                            context = restext.context;
                            console.log(userResponse);
                            break;
                        }
                    } catch (err) {
                        console.error('Error parsing JSON:', err);
                    }
                }
            }
        } catch (error) {
            await interaction.editReply({
                embeds: [
                    new EmbedBuilder()
                        .setColor(colors.deny)
                        .setTitle("Failed!")
                        .setDescription("Failed to generate a response!")
                        .setFooter({text:error})
                ]
            });
        }
    }
minor epoch
#

Why so many comments?

earnest phoenix
#

i used a bit of chatgpt

#

i never used chunks

minor epoch
#

...

acoustic bough
#

dont use ai to code if you want to learn

earnest phoenix
#

nah but fr every code snippet i made in C# i used ai

#

now i know C# so well

acoustic bough
neon leaf
#

my ai code is ~3000 lines

earnest phoenix
#

it takes like 10 minutes to switch to another model

#

completely slows down the queue

steel scaffold
lyric mountain
steel scaffold
#

I also recommend not relying entirely on AI, sometimes AI may struggle with handling complex code

earnest phoenix
#

wtf is going on with the ips

#

it keeps changing from 192.168.1.13 to 192.168.1.132

#

and vice versa

solemn latch
#

Local ips change

#

you have to make it static

earnest phoenix
#

It just keeps setting the ip to one that already exists

#

Even tho i set the one that exists to use another one

solemn latch
#

πŸ‘€ you did this in your router settings right?

earnest phoenix
#

yea

#

now it bound correctly

#

idk why but it connects with both wifi and lan instead of just lan

#

so i have to separate the ips

acoustic bough
#

my ips havent changed in years

#

though I mostly just use the ips from my vpn

#

100.65.0.1/24

minor epoch
#

Mines been the same for around 4 years lmfao

acoustic bough
minor epoch
#

WinSCP nb_cat_heart_A

acoustic bough
#

wait lmaoi

#

forgot

acoustic bough
minor epoch
acoustic bough
#

I just mount as a drive

minor epoch
#

Yeah I wondered actually

#

I was going to ask

earnest phoenix
#

Why do low param models like to yap a lot

acoustic bough
#

they copy humans

#

stupid people talk a lot of shit

earnest phoenix
#

I sent a message 2 mins ago

acoustic bough
#

lol

earnest phoenix
#

Its still thinking

acoustic bough
#

i have like thousand tokens per second

#

depending on the model

earnest phoenix
acoustic bough
#

that bot name is very silly to remember

earnest phoenix
#

its what tells an multi boot boot manager that the os is multi boot

acoustic bough
#

and if you want to actually grow the bot that name kinda sucks seo wise

earnest phoenix
#

uhh this can break the entire bot

#

why is there null

#

ok ya it broke

minor epoch
#

Well, there's no data set to the variables....

prime cliff
#

sets null as key
Whoops it broke

acoustic bough
#

lmao

minor epoch
earnest phoenix
#

i think its cause i deleted a item while iterating

acoustic bough
#

a .filter(Boolean) would safe that

earnest phoenix
#

thats how i fixed it

#

btw my bot is heavily reliant on the administrator permission and it would crash without it

#

will it affect the review thing

deft wolf
#

Yes

earnest phoenix
#

uhh

#

someone added it to a server

#

@limpid crescent

#

nvm

acoustic bough
#

NONE

earnest phoenix
minor epoch
#

Literally none lol

earnest phoenix
#

lemme change the link for the bot invite in top.gg

minor epoch
#

Just set it to the normal oath

#

discord already handles the permissions anyways

#

Just set the correct ones in discord

earnest phoenix
minor epoch
#

No need to add the scopes in the slug

earnest phoenix
#

And how do i set scopes then

minor epoch
earnest phoenix
#

Oh

minor epoch
earnest phoenix
#

I already set one

acoustic bough
#

discord should disallow that permission for bots

earnest phoenix
#

Ok but what if i set all permissions except admin

minor epoch
minor epoch
#

I doubt you do

earnest phoenix
minor epoch
#

Make sure

earnest phoenix
#

doesnt mee6 use administrator

#

it does

minor epoch
#

Well MEE6 is awful

earnest phoenix
#

ok what about this

earnest phoenix
earnest phoenix
earnest phoenix
#

im adding moderation and stuff

#

then add the permissions when you add a feature that effectively needs the permission

#

when i invite a bot and see all those permissions it asks for, i just invite another bot

earnest phoenix
#

no, which is why you should do some brainstorming about what you plan on adding

#

if one day later your bot needs another permission, you can put that in your support server announcement & website

earnest phoenix
#

cause i dont have a website or will i plan on maintaining an support server

#

unless i make it anarchy

neon leaf
#

tbf its not as needed anymore as in the past

#

with cf d1 this made the api call be 200ms instead of 800ms

acoustic bough
#

wtf is that nested tenary

neon leaf
#

✨ magic

sharp geyser
acoustic bough
#

horrible

minor epoch
limpid onyx
#

ternary should be rather simple, if it looks like this, it shouldn't be a ternary

earnest phoenix
#

i added !call and !hangup to my bot

#

it was easy

acoustic bough
quartz kindle
neon leaf
#

yea

#

I cant dare to touch it

acoustic bough
#

idk didnt bother reading it

quartz kindle
#

if only js had php8's pattern matching expression

#

there is a stage 1 proposal for that, but atm its ugly af

neon leaf
#

pg probably has a way to just pass in json and compare with that

minor epoch
#

Code use to be allot uglier back in the days lol

prime cliff
#

Almost done vibecat alternative to Portainer

short pilot
#

got everything set up to develop games with godot and make them work on discord activities

#

someone tested it on ipad and got "this activity is not currently available on this os" and i have no idea if it's discord not handling ipads well or something i've done weirdsip

uncut briar
#

your activity has a settings page in devportal i think, for choosing which platform the activity is best for.

prime cliff
#

You actually got godot working with Discord activities nice

lyric mountain
#

it works nicely

#

sadly no c# on latest version

proven lantern
#

i wonder why Microsoft didn't choose C# for their TypeScript rewrite

uncut briar
#

its a port, not rewrite though.

quaint fern
small tangle
#

although thats more of "why go and not why not c#"

prime cliff
neon leaf
#

v1 lookup translated devious ```rs
pub async fn by_v1_identifier(
database: &crate::database::Database,
identifier: &str,
) -> Option<(Self, Self, Version)> {
let hash: Option<&str> = match identifier.len() {
32 => Some("md5"),
40 => Some("sha1"),
56 => Some("sha224"),
64 => Some("sha256"),
96 => Some("sha384"),
128 => Some("sha512"),
_ => {
if identifier.parse::<i32>().is_ok() {
None
} else {
return None;
}
}
};

    let query = sqlx::query(&format!(
        r#"
        WITH spec_build AS (
            SELECT {}
            FROM {}
            LIMIT 1
        )

        , filtered_builds AS (
            SELECT {}
            FROM builds b
            INNER JOIN spec_build sb
                ON sb.id = b.id 
                OR (COALESCE(sb.version_id, sb.project_version_id) = COALESCE(b.version_id, b.project_version_id) AND sb.type = b.type::text)
            WHERE b.type != 'ARCLIGHT' OR (
                (sb.project_version_id LIKE '%-fabric' AND b.project_version_id LIKE '%-fabric')
                OR (sb.project_version_id LIKE '%-forge' AND b.project_version_id LIKE '%-forge')
                OR (sb.project_version_id LIKE '%-neoforge' AND b.project_version_id LIKE '%-neoforge')
                OR (sb.project_version_id NOT LIKE '%-fabric' AND sb.project_version_id NOT LIKE '%-forge' AND sb.project_version_id NOT LIKE '%-neoforge')
            )
        )

        SELECT *, 0 AS build_count, now()::timestamp as version2_created, '' AS _version_id, 'RELEASE' AS version_type, false AS version_supported, 0 AS version_java, now() AS version_created
        FROM spec_build

        UNION ALL

        SELECT x.*, mv.*
        FROM (
            SELECT *
            FROM (
                SELECT {}, count(1) OVER () AS build_count, min(b.created) OVER () AS version2_created
                FROM filtered_builds b
                ORDER BY b.id DESC
            ) LIMIT 1
        ) x
        LEFT JOIN minecraft_versions mv ON mv.id = x.version_id;
        "#,
        Self::columns_sql(None, None),
        if let Some(hash) = hash {
            format!("build_hashes INNER JOIN builds ON builds.id = build_hashes.build_id WHERE {} = $1", hash)
        } else {
            "builds WHERE builds.id = $1::int".to_string()
        },
        Self::columns_sql(None, Some("b")),
        Self::columns_sql(None, Some("b"))
    ))
    .bind(identifier)
    .fetch_all(database.read())
    .await
    .unwrap();

    if query.is_empty() {
        return None;
    }

    return Some((
        Self::map(None, &query[0]),
        Self::map(None, &query[1]),
        Version {
            id: query[1]
                .try_get("version_id")
                .unwrap_or(query[1].try_get("project_version_id").unwrap_or_default()),
            r#type: query[1]
                .try_get("version_type")
                .unwrap_or("RELEASE".to_string()),
            supported: query[1].try_get("version_supported").unwrap_or(true),
            java: query[1].try_get("version_java").unwrap_or(21),
            builds: query[1].try_get("build_count").unwrap_or(0),
            created: query[1]
                .try_get("version_created")
                .unwrap_or(query[1].get("version2_created")),
        },
    ));
}```
pearl trail
#

damn, never seen SELECT {}

quartz kindle
#

its probably a placeholder for format!()

neon leaf
#

ye

frosty gale
#

huh?

docker build --tag filestash
failed to fetch metadata: fork/exec /usr/local/lib/docker/cli-plugins/docker-buildx: input/output error

DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
            Install the buildx component to build images with BuildKit:
            https://docs.docker.com/go/buildx/

docker: 'docker build' requires 1 argument

Usage:  docker build [OPTIONS] PATH | URL | -

Run 'docker build --help' for more information

why is it complaining about a deprecated builder when i installed the latest docker

frosty gale
#

i would just make a view so i dont have to look at that in my code

uncut briar
pearl trail
#

@modern sable beep boop

#

oof didnt see there is moddum online

modern sable
#

ty

quaint fern
prime cliff
#

I mean you can't really expect me to make something that amazing by myself xD

lament rock
#

idk man. You're pretty cracked at code

neon leaf
#

I probably could but honestly idk if it'll make it any better

earnest phoenix
solemn latch
earnest phoenix
neon leaf
#

eepy ```js
function format(data) {
const customFloatType = new yaml.Type('tag:yaml.org,2002:float', {
kind: 'scalar',
resolve: function(data) {
return /^[-+]?[0-9].[0-9]+$/.test(data);
},
construct: function(data) {
return data;
},
predicate: function(object) {
return typeof object === 'string' && /^[-+]?[0-9]
.[0-9]+$/.test(object);
},
represent: function(object) {
return object;
}
});

const preserveDecimalsSchema = yaml.DEFAULT_SCHEMA.extend({
    implicit: [customFloatType]
});

const loadedData = yaml.load(data, { schema: preserveDecimalsSchema });

return yaml.dump(loadedData, { 
    schema: preserveDecimalsSchema, 
    sortKeys: true, 
    lineWidth: Infinity,
});

}

lyric mountain
#

unless that isnt js

earnest phoenix
#

it is

lyric mountain
#

then dont, use let instead

#

var has scope issues you'll eventually run into

#

it exists solely because legacy web

earnest phoenix
lyric mountain
#

I think so, just beware excess

#

tho I'd make a separate function personally

#

inlined functions will get ugly if you format the code, and can get very unreadable

earnest phoenix
#

anyways how to try to convert this to sql

lyric mountain
#

well, do you know how sql works?

earnest phoenix
#

all i know is create table and select

lyric mountain
#

ok, which database are u going to use?

earnest phoenix
#

sqlite

lyric mountain
#

you basically just declare your classes as tables then, sqlite only has a single datatype for each type

earnest phoenix
#

ok so how do i make types in sql

lyric mountain
#

like, to use your first class, it'd become

#
CREATE TABLE economy_data AS (
  user_id        INT PRIMARY KEY,
  cash           INT NOT NULL DEFAULT 0,
  bank           INT NOT NULL DEFAULT 0,
  daily_claimed  TIMESTAMP,
  weekly_claimed TIMESTAMP
)
#

if it's a number without decimal it's INT, if it's a string it's TEXT, if it's a decimal it's FLOAT

#

and so on

#

in other databases you'd have different types depending on context, but sqlite is straightforward

earnest phoenix
#

i know types but the thing is

#

how do i make a table into a type

lyric mountain
#

as in, select into a js class?

earnest phoenix
#

no like

#

in c# would be

public class uhhtest {
  uhhtest(bool aaa) {
    this.aaa = aaa
  }
}
public class testtwo {
  testtwo(uhhtest bbb) {
    this.bbb = bbb
  }
}
#

i havent use c# in a while so sorry if wrong

vivid fulcrum
lyric mountain
#

not that cry lul

lyric mountain
#

and the rows would be equivalent to instances

earnest phoenix
#

ok so if i make a table i can just use it as a type?

lyric mountain
#

well, no, you link to it through a foreign key

#

for example, in the ddl I sent earlier there's user_id

#

you'd use that value to find a specific row in that table

vivid fulcrum
earnest phoenix
#

ok i dont understand at all so imma just ask chatgpt to tell me how do i create a table with types as other tables

lyric mountain
#

if there were other tables that'd need to refer to that table, then you just save the same value in it

#

consider this:

earnest phoenix
#

or are there any other sql providers that have custom types

lyric mountain
#

wait

earnest phoenix
#

ohhh

#

i see

#
FOREIGN KEY (itemId) REFERENCES InventoryItems(id),
#

this is an example it gave me

lyric mountain
#
CREATE TABLE owner AS (name TEXT, birth DATE);

CREATE TABLE car AS (id INT, owner_id INT, color INT, model TEXT);

CREATE TABLE wheel AS (id INT, car_id INT, wear FLOAT);
earnest phoenix
#

i understand now

#

thanks tho

lyric mountain
#

sql doesn't use types in the same way programming languages do

lyric mountain
#

so u cant insert a row with an itemId that doesn't exist in InventoryItems

earnest phoenix
#

sql is too confusing

lyric mountain
#

it's just different, you'll get the hang of it with usage

#

you dont insert objects inside objects, you just put them in their own tables and link them together through an identifier

earnest phoenix
#

is postgres good?

#

i found a guide

lyric mountain
#

sigh, look, postgres can have custom types, but that's not how sql works

#

you'll ve trying to fit the circle in a square hole

earnest phoenix
#

all i want is a db that i can use like json

neon leaf
earnest phoenix
#

the thing is i want something dynamic

#

so if i wanna add a feature to my bot

#

i can add another item to the data

lyric mountain
#

you can do that with any db

#

every database has their pros and cons, dont just choose based on what is easier

#

if u want something close to json then there's redis, albeit not made to be used like that

#

do note that it's hell to have it work in windows

earnest phoenix
lyric mountain
#

it's only windows the issue

earnest phoenix
lyric mountain
#

ignore the cloud part, just install locally

earnest phoenix
#

oh you need brew

#

i dont have brew cause 12.7.6

#

imma use the linux version on my server

lyric mountain
#

isn't brew the core feature of macos?

earnest phoenix
#

its a community made tool

lyric mountain
#

ah

#

what is the apt equivalent then?

earnest phoenix
#

none

lyric mountain
#

hm, I thought being based on bsd it'd have some package manager built in

earnest phoenix
#

its not bsd based i think

#

it uses darwin

#

which is their own unix clone

lyric mountain
#

anyway, I'd seriously recommend eventually learning how to work with sql, most tech jobs you'd find out there will have some form of interaction with it

earnest phoenix
#

great

#

redis is not on arm i guess

#

also just broke apt

lyric mountain
#

?

earnest phoenix
#

wont let me install anything now

lyric mountain
#

what did u do?

earnest phoenix
#

i did the commands on the docs

#

for linux

#

oh it fixed

#

i did apt remove redis-server

solemn latch
#

πŸ‘€ I wonder what doesnt run on arm right now

earnest phoenix
#

and fortnite

#

-# but that is coming soon already

solemn latch
#

I mean server side

#

rust had some issues a few years ago iirc, I wonder if thats still an issue

#

rust is fine

#

hmm

earnest phoenix
#

imma just use mongodb

#

There is no arm64 debian can i just use ubuntu

#

They both use .deb

#

How do i log into mongo bruh

prime cliff
earnest phoenix
#

imma use postgres

#

cause it works on arm

prime cliff
#

Isnt arm64 just x64 though

#

And no x64 is normally refered to as amd64

earnest phoenix
#

arm64 is a more efficient cpu architecture used by phones and single board computers

#

i use raspberry pi

#

which is arm64

#

x64 however is the bulky cpus

#

Intel is x64 based

#

Low power cpus use arm64

#

You can get 3ghz out of arm64 at 25 watts now

uncut briar
earnest phoenix
#

im watching a sql tutorial

lyric mountain
#

imagine you have 2 documents, they're related but from different contexts so you must store them in separate drawers

#

how do you link them? with a label/identifier

#

that's how you do in sql too

neon leaf
#

x86_64 is 64bit x86

scenic kelp
#

(which is named after the 8086 chip)

slender wagon
#

quick question, i am setting up my bot with docker the bot uses postgres as a db. Should i setup the db as well with docker or should i do it separately

acoustic bough
#

even though I added 0.0.0.0/0 to the hba conf and as listening to all (*) network interfaces

#

I am probably just stupid but still

wheat mesa
#

Docker is a fantastic option for deployment. Especially with Postgres

uncut briar
#

i had no issues with Docker networking between the two for mine.

slender wagon
#

when i setup a new vps its really a pain in the ass to download docker and everything

#

i was just wondering what u guys do

acoustic bough
#

I setup my pg instance before I used docker

#

so pg isnt in a container

slender wagon
#

yeah that's what i have done until now

uncut briar
#

installing Docker engine on fresh VPS/VM seemed painless for me, i guess its different for each distros.

as for networking, i currently have postgres and bot containers in same compose file and use the postgres container's hostname for connection string

prime cliff
wheat mesa
#

Docker is very easy to setup

acoustic bough
uncut briar
#

Docker by default bypasses the firewall so its accessible to the internet unless you alter the iptables.

acoustic bough
#

I host at home anyway behind a nat

#

so idc

uncut briar
#

thats normal, no altering needed then

wheat mesa
neon leaf
earnest phoenix
#

serde_yaml πŸ—Ώ

neon leaf
earnest phoenix
#

isn't it deprecated

neon leaf
#

is it

earnest phoenix
#

at least not using serde_yml

#

so all good

neon leaf
#

i mean

#

I highly doubt any exploit can exist in this for rce or whatever

#

if just parsing is outdated its fine

earnest phoenix
#

shrug

neon leaf
#

dont want to bother making the js implementation have 1:1 parity again

pale iron
#

this is the error displayed in the dev tools

#

@radiant kraken

spark flint
#

yeah null why are you blocking requests

quartz kindle
#

also, you need to add type="module" to your app.js <script>

pale iron
#

Kk thanks

neon leaf
#

nodejs api

#

rust api

#

πŸ”₯

bitter granite
earnest phoenix
#

not fast, blazingly fast πŸ”₯πŸ”₯ πŸš€πŸš€ πŸ”₯

neon leaf
#

blazingly fast, the endpoint requires quite a lot of server side processing

#

(also I changed the implementation from O(n*d*n) to O(n*2) but shh)

vivid lake
#

Hi guys, I want my uses to vote my bot to let them use it, could you help me to do that? My bot language is python

shadow dirge
#

ee

crystal wigeon
#

has anyone used wireguard

#

also like does anyone know how i can open a port?? i used iptables to allow connections on the port. but when i run curl command it says connection refused

pearl trail
#

i tried doing ddd in golang, and it's hell KEK got 4 same package name. it's time to refactor
edit: oh right, i can edit package name. i thought it's not recommended but seems like it's fine

prime cliff
crystal wigeon
#

Tryna get the client to connect to server. Idk if I’m doing the configuration wron

wheat mesa
#

Tried to use wireguard, it sucked. Swapped to OpenVPN, my life was infinitely easier

crystal wigeon
#

when you add peers what do I add in allowed IPs? The client wg0 ip? Or eth0 ip

crystal wigeon
#

So learning a bit

pearl trail
#

waffle told me ddd few days ago in general, so i'm interested and seems like it looks professional

sharp geyser
#

Looks neat

#

I will take a gander

wheat mesa
#

For the server peers

crystal wigeon
#

yeah i've set them up correctly but for some reason it still isnt pinging

wheat mesa
#

Show your client and server config (keys omitted ofc)

crystal wigeon
#

Client ```[Interface]
PrivateKey =
Address = 10.0.0.1/24
ListenPort = 51820
MTU = 1800

[Peer]
PublicKey =
AllowedIPs = 192.168.0.1/32
endpoint = 172.19.46.130:51820```

Server

[Interface]
Address = 192.168.0.1/24
MTU = 1280
SaveConfig = true
PostUp = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE;
PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE;
ListenPort = 51820
PrivateKey = 

[Peer]
PublicKey = 
AllowedIPs = 10.0.0.1/32
Endpoint = 172.19.6.218:51820```

I did ip link up and everything.
#

its added to ip addr also

wheat mesa
#

Get rid of that SaveConfig = true lime

crystal wigeon
#

client

#

server

wheat mesa
#

I had issues where it was fucking with iptables rules with that on

crystal wigeon
#

lemme try

shadow dirge
#

.documentation

crystal wigeon
#

is everything else correct tho?

wheat mesa
#

Restart the entire service and make sure your server config file is correct after deleting that line

#

SaveConfig messes with the file itself is what I found, sometimes it would delete stuff from my config after I had already saved it

crystal wigeon
#

i delete the entire server and rebuilt again and added all the config.

#

i only added saveConfig now

#

to see if that worked

#

but i didnt have it before

#

for the same config

wheat mesa
#

Mmmm

#

Does it work locally?

#

Are you testing on the same network

crystal wigeon
#

yea same network. nop not locally

wheat mesa
#

Not sure what that is

#

Is the server on the same network as the client right now?

crystal wigeon
#

Also i see this in ip table, maybe something wrong here?

#

yea

wheat mesa
#

If you try to connect via public IP to your server when you’re on the same network at your client, it won’t always work

shadow dirge
#

Your using diffrent MTU could that issue?

crystal wigeon
wheat mesa
#

Some routers do not support that feature

crystal wigeon
wheat mesa
#

It’s called NAT Loopback and if this is a self hosted server on your home internet, your consumer grade router probably doesn’t support it

#

Try changing your client config to use your server’s local IP instead of the public IP of your network

#

See if that works

crystal wigeon
#

no no thats what im doing. im doing all this on 2 vms

#

1 client vm and 1 server vm

#

in the docs it says i gotta use the eth0 ip in allowed ips

#

the 192.168.0.1 is random. it can be anything. or so i read

wheat mesa
#

Never worked with VMs in this scenario before, I just know that if you have the client and server on the same network, most routers will not support connecting via public IP between one another

#

When they’re on the same network you must use your local IP

shadow dirge
#

Curl wont work im pretty sure curl uses TCP but wiregaurd uses UDP

crystal wigeon
#

is there a way?

wheat mesa
#

I’m assuming 172.xx is your public IP

crystal wigeon
#

on the machines

#

my machine details

#

no public ip

wheat mesa
#

I had something like this for when I used wireguard

#

Here is my server side config

[Interface]
Address = 10.0.0.1/24
PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -A FORWARD -o %i -j ACCEPT; iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -D FORWARD -o %i -j ACCEPT; iptables -t nat -D POSTROUTING -o wlan0 -j MASQUERADE
ListenPort = 51820
PrivateKey = <Server Privkey>

[Peer]
PublicKey = <Client Pubkey>
AllowedIPs = 10.0.0.2/24
``` and my client side

[Interface]
PrivateKey = <Client Privkey>
Address = 10.0.0.2/24

[Peer]
PublicKey = <Server Pubkey>
AllowedIPs = 10.0.0.0/24
Endpoint = <My Local Network IP>:51820
PersistentKeepalive = 25

#

I did find that installing docker after installing wireguard fucked with my IPTABLES rules and broke it, beware

#

I had to reinstall wireguard for some reason

#

And this was the headache that caused me to just switch to OpenVPN instead

crystal wigeon
#

wait your instance says 10.0.0.1/24 but in your client you are using 10.0.0.0/24?

#

shouldnt it be the server address?

wheat mesa
#

10.0.0.0 is the tunnel itself. 10.0.0.1 is my server’s IP within the tunnel subnet, and 10.0.0.2 was my client’s IP within the tunnel subnet

crystal wigeon
#

hmm, so i put my server's interface ip in allowed ip

#

maybe i gotta set it to 192.168.0.0/24 to be able to ping 192.168.0.1?

#

also i see you using /24 but i have /32 does it matter?

#

cause while adding the ip initially with wg add i used /24

#

but in config i set /32

wheat mesa
crystal wigeon
#

hmm

#

so there nothing wrong with my config

#

i dont see any errors also

#

do i need to open some port maybe?

wheat mesa
#

Make sure UFW also allows UDP traffic through 51820

#

Assuming you have UFW installed

crystal wigeon
#

im using iptables so didnt use uwf. but i havent opened 51820 port

#

imma try

#

actually i tried installing ufw but it said there some conflict with ip6table

#

so had to get rid of it

#

ok but like all im trying to do is ping 192.168.0.1

wheat mesa
#

Not sure. Honestly this might be one of the few situations where AI might be able to help

crystal wigeon
#

ye i tried gpt, the free version sucks with random hallucinations

#

shit makes no sense

#

can i address be the same or should they be same?

#

the 10.0.0.1 on client and 10.0.0.2 on server

#

hmm, it says it can be problem since they not same subnet

rare peak
#

Hello, I made a bot and shared it on top.gg but it didn't appear on the list. There is a warning that it is in the approval process. Does anyone know how long this process takes?

deft wolf
#

Few days

#

If reviewers have more free time, it is faster, if less, it is slower

slender wagon
#
FROM node:21

WORKDIR /app

COPY package*.json ./

RUN npm install

RUN npm install prisma --save-dev

COPY prisma ./prisma/
COPY src ./src/
COPY tsconfig.json ./

COPY wait-for-db.sh ./

RUN npx prisma generate

RUN npm run build  

RUN chmod +x wait-for-db.sh

CMD ["sh", "-c", "./wait-for-db.sh && npx prisma migrate deploy && npm start"]

i have added the prisma migrations in the dockerfile, would this be risky or is it ok to use like that?

neon leaf
#

why node 21

slender wagon
#

good question, what should i go with