Back

Locale in function, cannot get result

  • 0
  • Self Hosted
  • Functions
  • Locale
polbuhanky
2 Nov, 2023, 19:00

selfhosting

TL;DR
User is having trouble with a function that is giving unexpected results when trying to fetch the locale. They are concerned about unauthorized users abusing the function and want to restrict its execution. Another user suggests setting execute permissions on the function to limit access. A question is asked about installing Appwrite using the docker install command, but it is not clear if the user had done so. The user clarifies that they did not use a VPN and are accessing Appwrite through a physical device and VPS server. They confirm that Appwrite is not installed locally where the emulator is running and do not have a reverse proxy in front of Appwrite. No
Drake
2 Nov, 2023, 19:49

and do you have something in front of Appwrite like a reverse proxy?

D5
2 Nov, 2023, 20:50

The user said that no

Drake
2 Nov, 2023, 21:02

Is Appwrite installed locally where the emulator is running?

polbuhanky
2 Nov, 2023, 21:03

Yes, appwrite is deployed on a vps server

Drake
2 Nov, 2023, 21:04

And the Android emulator is on that vps server?

polbuhanky
2 Nov, 2023, 21:05

No, it's physical device

polbuhanky
2 Nov, 2023, 21:05

Just my phone

Drake
2 Nov, 2023, 21:14

Are you connecting to Appwrite through a VPN?

I'm curious what the 172.18 network is...

Did you install Appwrite using the docker install command?

polbuhanky
2 Nov, 2023, 21:19

No, i didn't use vpn

polbuhanky
2 Nov, 2023, 21:19

"Did you install Appwrite using the docker install command?" yes

Drake
2 Nov, 2023, 21:22

Oooh wait this is in a function!

polbuhanky
2 Nov, 2023, 21:23

yep)

Drake
2 Nov, 2023, 21:23

locale.get() fetches the current clients locale so this result is expected

Drake
2 Nov, 2023, 21:23

The current client is the function

polbuhanky
2 Nov, 2023, 21:32

I see, thanks

polbuhanky
2 Nov, 2023, 21:34

Is there a way to restrict the executes of a specific function? The function calls sms and it will be bad if someone abuses it

Drake
2 Nov, 2023, 21:49

Set execute permissions on the function

polbuhanky
2 Nov, 2023, 21:49

I mean to reduce count of execution per minute

Drake
2 Nov, 2023, 21:50

Keep track of the count and then don't call the API got the sms

polbuhanky
2 Nov, 2023, 21:51

But if they spam for different phone numbers?

Drake
2 Nov, 2023, 21:54

And?

polbuhanky
2 Nov, 2023, 21:56

The fact is that this function is available to unauthorized users. I can only limit it to guests only (anonymous sessions). Therefore, I cannot save the id of the user who called the function

Drake
2 Nov, 2023, 21:57

sorry, can't help you there

polbuhanky
2 Nov, 2023, 21:57

okay, thanks

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more