
Okay there is the thing. Im using Supabase as main backend, but self host Supabase is a hell and edge functions are just bad. So I wanna use Appwrite functions instead. How can I trigger Appwrite from HTTP Request ? Im using self hosted appwrite and the domain of my appwrite function is quick weird :
http://e9e9e9e9e9e9e99e.https//appwrite.mydomain.com
Where e9e9e9e9e9e9e99e
is the id and https//appwrite.mydomain.com
my appwrite domain

What if triggering it with rest instead of API?

Ive try :
curl -X POST https://appwrite.mydomain.app/v1/functions/e9e9e9e9e9e9e99e/executions \
-H "Content-Type: application/json" \
-H "X-Appwrite-Project: o3o3o3o3o3oo3o3"
But fonction failed with this :
An internal curl error has occurred within the executor! Error Number: 6. Error Msg: Could not resolve host: 672f985795d76\nError Code: 500

Does the same happen when you trigger it through the console?


Interesting. What's the function code?

Ive take the template starter :
import { Client } from 'node-appwrite';
// This is your Appwrite function
// It's executed each time we get a request
export default async ({ req, res, log, error }) => {
// Why not try the Appwrite SDK?
//
// const client = new Client()
// .setEndpoint('https://cloud.appwrite.io/v1')
// .setProject(process.env.APPWRITE_FUNCTION_PROJECT_ID)
// .setKey(process.env.APPWRITE_API_KEY);
log('req', req);
log('res', res);
// You can log messages to the console
log('Hello, Logs!');
// If something goes wrong, log an error
error('Hello, Errors!');
// The `req` object contains the request data
if (req.method === 'GET') {
// Send a response with the res object helpers
// `res.send()` dispatches a string back to the client
return res.send('Hello, World!');
}
// `res.json()` is a handy helper for sending JSON
return res.json({
motto: 'Build like a team of hundreds_',
learn: 'https://appwrite.io/docs',
connect: 'https://appwrite.io/discord',
getInspired: 'https://builtwith.appwrite.io',
});
};

So the hello world one basically 😅

How do you have installed appwrite 👀

Also, what are the docker logs for the appwrite and openruntimes-executor container?

You can get them with docker compose logs appwrite
and
docker compose logs openruntimes-executor

I'm not sure about that. You can try to use the same subdomain, but if it doesn't work, create a separated subdomain and that should solve the conflict.

Hmmm why?

From what I understand Coolify acts as a reverse proxy? 🤔

Yes (from what I understand too ahah)

With traefik

If you add it in the env variable, Appwrite's traefik should generate the certificate automatically, but since Coolify could be using it's own traefik, then maybe it's different 👀

Wait maybe I have to leave coolify for Appwrite because there is to many conflict rn

Well Im gonna start using docker compose

Appwrite is supposed to generate the ssl ? Using docker compose my domain appwrite.mydomain.com
dont have ssl certificate

Yes, appwrite should generate automatically the SSL certificates

in env we have to set the https
prefix ?
//env
_APP_ENV=production
_APP_LOCALE=en
_APP_OPTIONS_ABUSE=enabled
_APP_OPTIONS_FORCE_HTTPS=disabled
_APP_OPTIONS_FUNCTIONS_FORCE_HTTPS=disabled
_APP_OPTIONS_ROUTER_PROTECTION=disabled
_APP_OPENSSL_KEY_V1=iz5AxCPfwGRAbJyb6BNHG9+HolanAb8GdiXCkmueKv0=
_APP_DOMAIN=appwrite.mydomain.com
_APP_DOMAIN_FUNCTIONS=appwrite.mydomain.com
_APP_DOMAIN_TARGET=appwrite.mydomain.com
_APP_CONSOLE_WHITELIST_ROOT=enabled
....

Nope

The doc say :
You need to ensure you have a valid email address set on _APP_SYSTEM_SECURITY_EMAIL_ADDRESS. The default setup comes with certs@appwrite.io as the default value. While this address will work, it's recommended to change it to your own email.
from https://appwrite.io/docs/advanced/self-hosting/tls-certificates
But the doc dont say we need _APP_EMAIL_CERTIFICATES
to generate certificates

Okay so now Ive set the domain function appwrite-functions.domain.com
but how generate ssl for functions ?
Recommended threads
- deno 2 Cloud random errors
we have big problems with the functions. although we do not change anything in the function, we have the following random behaviour: - no scope permissions erro...
- Functions not work on Server only Localh...
Hi, I successfully upgraded from 1.4 to 1.7, but I'm having a problem. The functions no longer work with the settings I had. I assume some changes were made. It...
- Console Login after upgrade
Hi, running a small instance self hosted, upgraded from 1.6.0 to 1.74 this morning before spotting the migration guide... When trying to login to the console n...
