Secure DB proxy?

well, db doesn’t persist, so its kinda useless now that I think

1 Like

@python660 what do you mean?

canned reply I made a while ago

So basically, when you run a (non-website) Repl you don’t own from the cover page, Replit will automatically fork the Repl (this is known as a ghost fork).

And when a Repl is forked by a user who doesn’t have edit permissions, all Secrets’ values are lost and the Replit DB doesn’t save to the original Repl’s DB. The only way you can have the Database save among all users is by setting the DB’s URL which can be very insecure and can allow users to delete your entire DB, edit the DB’s keys, or even add their own keys. There isn’t anything that can be done about this other than to just change your Repl into a website.

4 Likes

@QwertyQwerty88 is that why I can only see leaderboard users from my device (such as Owner SalladShooter and Beta Tester SalladShooter)? If so is there anyway to fix it?

2 Likes

From your account actually.

3 Likes

Probably. I’d recommend not using ReplDB (Highly recommend, it uses a lot of egress), but whether you do or not, you’ll need to use an external Repl or service for your DB.

1 Like

You could use a ReplDB proxy, but that uses a lot of egress, and it should have security measures to make sure others can’t edit your DB.

1 Like

that’s what I meant by this

BTW how are you supposed to do it securely?

2 Likes

If you used a DB Proxy, you could (somehow) have your game include a key in it’s DB requests, and have the proxy only accept requests with the key to access the DB. How to do that, I’m not sure, but it’s an idea.

2 Likes

@Firepup650 If you some how figure it out, it would probably be easier to invite you to my Repl.

2 Likes

Imma try make that, could be cool.

2 Likes

Proxy itself isn’t hard, a minute or two at most. It’s the security that I don’t know how to do.

1 Like

@Firepup650 well I don’t know how to do a proxy either :person_shrugging:.

2 Likes

Only reason I do is because of this nice Repl: https://replit.com/@util/Replit-Database-proxy#main.py
Fork, change URL in your project (db.db_url="URL"), make sure the DB doesn’t sleep, and you’re good!

1 Like

@Firepup650 wdym change url, change it to my game url? How do I make the db not sleep (I can’t do always on or deployments since I don’t have cycles)?

No, in the game change it to the DB’s URL (it hosts a webserver).

Pingers are always an option for something like this ¯⁠\⁠_⁠(⁠ツ⁠)⁠_⁠/⁠¯

@Firepup650 I don’t know pingers either :laughing:.

wait how could you do that securely???

1 Like

That’s where I hit a wall in my thought process. I’ll put more thoughts into it and see what I can come up with.

@Firepup650 ok thanks!

1 Like