Hi. I'm trying to implement password recovery in my app, but I have met issue with locating web page on my server. I created simple html file which will confirm password recovery called recovery.html. Also I have my own domain - https://chowapp.site, which opens appwrite console. I want to open c password recovery confirm page by such link https://chowapp.site/recovery.html. Where should I locate file to achieve that?
#[SOLVED] Where to locate web page to confirm password recovery
46 messages · Page 1 of 1 (latest)
Are you using a VPS to host your appwrite instance?
Considering that you've self-hosted, you should have access to some sort of a terminal, which you must have used to install and setup appwrite.
You can use this terminal to point chowapp.site/recovery.html to the html file you created.
That's a very high-level explanation, so here's what I did.
I use nginx as my webserver.
my domain is example.com.
in my nginx config, all requests to example.com/ go to the appwrite console.
a request to example.com/fail will take the user to a locally-hosted html file.
and so on
you can do this with any webserver
Thanks for answer! I will work on this direction.
If you face any issues or need any help, feel free to tag me in this thread!
[SOLVED] Where to locate web page to confirm password recovery
Hello again. I'm sorry to bother you. I probably almost did it, but I got stuck in one place. I decided to use Nginx Proxy Manager like here: https://medium.com/@stnguyen90/how-to-run-appwrite-behind-nginx-19348ed34243. Next, I created a docker container with an html file that I need. Via IP:Port I get access to file without any problems, as well as through the main domain using NPM, but I want my file to be located in this way example.com/recovery and when using the custom-domains tab with such parameters, I get a 404 error.
.
Next, I created a docker container with an html file that I need.
How does that work exactly?
Appwrite let you to set the url to redirect when a user asks for a password recovery:
Check:
https://appwrite.io/docs/client/account?sdk=web-default#accountCreateRecovery
Firstly I created image by this Dockerfile:
COPY . /usr/local/apache2/htdocs/
COPY cert1.pem /usr/local/apache2/conf/server.crt
COPY privkey1.pem /usr/local/apache2/conf/server.key
RUN sed -i \
-e 's/^#\(Include .*httpd-ssl.conf\)/\1/' \
-e 's/^#\(LoadModule .*mod_ssl.so\)/\1/' \
-e 's/^#\(LoadModule .*mod_socache_shmcb.so\)/\1/' \
conf/httpd.conf
And then run container with following command: docker run -dit --name recovery -p 2024:80 -p 2025:443 recovery
Interesting...so you can browser to port http://<ip>:2024/recovery and it works?
Yes
so chowapp.site is already for appwrite...you want to use a different domain for this recovery page?
I want to use chowapp.site/recovery for recovery page.
i think forward hostname and port are incorrect. that should be how you access the page
You mean error somewhere here? I've tried launch this container on chowapp.site instead of appwrite-traefik and it was working fine.
yes, there.
I've tried launch this container on chowapp.site
I don't know what you mean.
How are you testing the page when it works? what are you browsing to?
I mean, if I use docker container (in my case recovery) in Details tab, everything works. When you enter chowapp.site, it throws you to the password recovery page. But if I specify this on the custom locations tab, then when I enter show chowapp/recovery, I have a 404 error. Maybe I'm moving in the wrong direction at all, because this is my first big project.
if I use docker container (in my case recovery) in Details tab, everything works
What do you mean?
you said you got this running. how did you verify it's running? What did you browse to in your browser?
I mean recovery from npm_gateway, where I added docker container which contains html file earlier.
"Name": "npm_gateway",
"Id": "08281cac18ef52c3e017952eda1567c50a09c6d2ed2694b3b7a3dc948fc92682",
"Created": "2023-05-11T14:35:48.217696676+03:00",
"Scope": "local",
"Driver": "bridge",
"EnableIPv6": false,
///
"Containers": "217b1763e5f2717d6c42bde61d71fbadae330e45a5b347943e35068efd82e066": {
"Name": "recovery",
"EndpointID": "35d81b3ef7aec828acadb090ca4a1c84fbe355ec52fe940ccf56553c123a0954",
"MacAddress": "02:42:ac:15:00:02",
"IPv4Address": "172.21.0.2/16",
"IPv6Address": ""
},
"32ccc54dd367f7d479181cf278b4dd7a351f36304a11412e871b1fd30edd0bf6": {
"Name": "npm-app-1",
"EndpointID": "42a6efa66fbb9ce7daa30eba67cca6302ec37d700141f0f68f5f6d5a31f9f1d1",
"MacAddress": "02:42:ac:15:00:03",
"IPv4Address": "172.21.0.3/16",
"IPv6Address": ""
},
"efad25ce4ae75f56ad7cbb1099ab9ce7c55e85491160e410e69c379cf113a60b": {
"Name": "appwrite-traefik",
"EndpointID": "9f306ada0577d375443d23ed6b2fbd12b1c7f4d027889b1baba76db23c6ee0e8",
"MacAddress": "02:42:ac:15:00:04",
"IPv4Address": "172.21.0.4/16",
"IPv6Address": ""
}
},
"Options": {},
"Labels": {
"com.docker.compose.network": "gateway",
"com.docker.compose.project": "npm",
"com.docker.compose.version": "2.15.1"
}
}
you said you browsed to it and it worked...what did you browse to?
Just browsing https://chowapp.site and I got to the needed page
Do you see the recovery page when you browse to this?
How do you see the recovery page?
I just temporarily replaced it to check if recovery works as hostname. Now I have returned everything and the appwrite console returns on request. Previously, it opened as needed.
What exactly did you put in the url without NPM?
How about you try putting recovery/recovery for the hostname?
I can't understand you. Checked through https://chowapp.site/. As forward hostname used recovery with the same protocol and port.
I didn't help.
would you please share a screenshot of your npm config?
Where I can find that?
these
I haven't changed them, they are the same so far.
i asked you to change hte hostname from recovery to recovery/recovery
would you please share the output of docker inspect recovery?
is your recovery page blank?
btw, your recovery page doesn't need to be on the same domain as your appwrite instance
It contained a simple form for entering a password and confirmation, but I only noticed that it is empty and the Index OF was written when accessing by IP. Before that, I was restarting the server, perhaps because of this. Anyway thanks for taking the time. It seems to me that I need to completely go through all the stages of creation, because I have recreated and changed a lot of things, and because of this something is probably going wrong.