Back

A question about function domain certificates

  • 0
  • Self Hosted
  • Functions
Ernest
22 Dec, 2023, 18:13

Are certificates generated for the autogenerated domains for functions? In the appwrite console, the cert status is generated. However, monitoring the appwrite-worker-certificates there were no logs of the certs being generated. The Functions docs about certificates were also largely refering to the main domain. My setup: I have a wildcard DNS record on cloudflare for functions (without certs 2nd level subdomain) which is not proxied through cloudflare because of SSL mismatch. I thought since SSL certs are generated by appwrite for the functions it would be 'okay' to access them directly for but the generated function domains are not.

TL;DR
User is asking for help with function domain certificates in the context of Traefik and Appwrite. They mention trying to get it to work and considering moving away from Traefik. They have tried using Nginx proxy manager (NPM) and mention the possibility of using NPM or Traefik for generating Let's Encrypt certificates. They express concerns about modifying the existing compose file and ask for alternatives using a separate docker-compose.yml file. They share their confusion about the setup and the SSL certificates on Cloudflare. They mention that Appwrite does not generate certificates for auto-generated function domains and explain their setup with a wildcard DNS record
Drake
22 Dec, 2023, 18:44

No Appwrite doesn't actually generate the auto function domain. Cloudflare should be able to handle it all. You may need to enable flexible SSL certificates or something like that in cloudflare

Ernest
22 Dec, 2023, 18:54

With flexible SSL certs the console fails to load because of 'too many redirects' which seems to be as a result of appwrite's autogenerated cert for _APP_DOMAIN.

Drake
22 Dec, 2023, 18:55

NVM it should be full, but not strict

Ernest
22 Dec, 2023, 18:56

That's what it is currently

Drake
22 Dec, 2023, 18:57

Wait I'm confused about your setup...do you have certs on cloudflare?

Ernest
22 Dec, 2023, 19:08

Cloudflare's free tier provides free SSL certs for the root domain and any first level subdomains. That is; mydomain.com ----> OK appwrite.mydomain.com ------> OK sample.appwrite.mydomain.com -----> N/A on free tier

and my functions DNS entry is *.appwrite.mydomain.com which makes all generated function domains e.g. func1.appwrite.mydomain.com not available for SSL certs when proxied through cloudflare and also results in ERR_SSL_VERSION_OR_CIPHER_MISMATCH error when accessing functions via the url. So my thinking was if appwrite's traefik service generates SSL certs for the functions then it'll still be 'secure' even when it's not proxied through cloudflare but the function domains are not "secured".

Ernest
22 Dec, 2023, 19:19

The reason I thought it'd work is because the SSL generated by appwrite's traefik service still works for the _APP_DOMAIN i.e. appwrite.mydomain.com even when the DNS record is not proxied through cloudflare. I thought it'd be the same for functions

Drake
22 Dec, 2023, 19:29

I see so you're not using cloudflare's certificate

Drake
22 Dec, 2023, 19:29

Appwrite doesn't generate certificates for auto generated function domains

Drake
22 Dec, 2023, 19:30

You can either manually generate it or configure traefik to generate the certificate.

Drake
22 Dec, 2023, 19:31
Ernest
22 Dec, 2023, 19:40

I had hoped that wasn't the case I really don't want to modify the default compose file.

Ernest
22 Dec, 2023, 19:41

I had already planned to have another separate Traefik service proxying to appwrite and my other services maybe it's time to revisit it

Ernest
22 Dec, 2023, 19:44

Thanks Steve

Drake
22 Dec, 2023, 20:53

I don't suggest modifying the existing compose file. Instead, extend services using a docker-compose.yml file

Drake
22 Dec, 2023, 20:54

I've used nginx proxy manager (NPM) in front of Appwrite and NPM can be configured to generate those let's encrypt certificates

Ernest
22 Dec, 2023, 21:03

I actually initially tried nginx (not NPM) but switched to traefik because it seemed easier and also to learn more about it since that's what appwrite uses in case I need to heavily customize it. Thus, I haven't really given NPM much thought even though I now realize it's also easy (maybe more so than traefik)

Ernest
22 Dec, 2023, 21:04

Thanks, I'll try that. If there's no success I go with NPM

Ernest
23 Dec, 2023, 22:52

[SOLVED] A question about function domain certificates

ideclon
23 Dec, 2023, 22:56

This is what I do now, but I’m thinking about moving away from Traefik

Ernest
23 Dec, 2023, 23:35

I'm still trying to get it to work. Do you mind sharing how you got it to work?

Ernest
23 Dec, 2023, 23:35

A question about function domain certificates

ideclon
24 Dec, 2023, 02:02

Will do if I remember next time I’m at the computer. Will probably be tomorrow sometime

Ernest
24 Dec, 2023, 16:22

All right, 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