Issue: Avatar URLs are using server IP address instead of configured domain Environment:
Appwrite Version: 1.8.0 Setup: Self-hosted on Google Compute Engine with Cloudflare Tunnel Domain: <your-domain> Frontend: Firebase Hosting at <your-frontend-domain>
Problem: The avatars.getInitials() endpoint is generating URLs with the server's IP address instead of the configured domain:
Current (wrong): http://<public-ip>/v1/avatars/initials?name=User&project=<project-id> Expected: https://<your-domain>/v1/avatars/initials?name=User&project=<project-id>
This causes:
ERR_CERT_AUTHORITY_INVALID errors (IP has no SSL cert) Mixed content warnings (HTTP images on HTTPS page) Blocked image requests
Configuration: All environment variables are correctly set in both .env and docker-compose.yml: bash_APP_DOMAIN=<your-domain> _APP_DOMAIN_TARGET=<your-domain> _APP_DOMAIN_FUNCTIONS=<your-domain> _APP_ENDPOINT=https://<your-domain>/v1 Verified: bashdocker exec -it appwrite printenv | grep APP_DOMAIN
Shows all domain variables are correct
Steps Taken:
Restarted Appwrite multiple times Cleared browser cache Added platform for frontend domain in Appwrite console Verified Cloudflare Tunnel is working correctly (other API endpoints work fine)
Question: Why is the avatar service still generating URLs with the IP address? Is there a cached value in the database or a specific configuration for the avatar service we're missing?
I been in the issue from yesterday
My appwrite is self hsoted in gcp and I have used cloudfalre tunnel for it.Console is opening from my subdomain adn data are allso being fetch from db.But avatar are not showing
You're passing an IP address into client.setEndpoint()
Get initials doesn't make any api call. It just builds the url and returns it. See https://github.com/appwrite/sdk-for-web/blob/de72141ece55b1eb4e8d14b8bf429c3b8bf690ce/src/services/avatars.ts#L461
No,I am not passing .I am passing subdomain url.import { Client, Account, Databases, Storage, Avatars } from 'appwrite'
export const appwriteConfig = { projectId: import.meta.env.VITE_APPWRITE_PROJECT_ID, url: import.meta.env.VITE_APPWRITE_URL, databaseId: import.meta.env.VITE_APPWRITE_DATABASE_ID, storageId: import.meta.env.VITE_APPWRITE_STORAGE_ID, userCollectionId: import.meta.env.VITE_APPWRITE_USERS_COLLECTION_ID, postCollectionId: import.meta.env.VITE_APPWRITE_POSTS_COLLECTION_ID, savesCollectionId: import.meta.env.VITE_APPWRITE_SAVES_COLLECTION_ID, commentsCollectionId: import.meta.env.VITE_APPWRITE_COMMENTS_COLLECTION_ID, followCollectionId: import.meta.env.VITE_APPWRITE_FOLLOW_COLLECTION_ID }
export const client = new Client(); client.setProject(appwriteConfig.projectId) client.setEndpoint(appwriteConfig.url)
export const account = new Account(client); export const databases = new Databases(client); export const storage = new Storage(client); export const avatars = new Avatars(client);
environment variable is set and I have rebuild and deplyed too by clearing cache.Everyone is requesting in subdomainurl but while fetching avatar url,it using http:<my public ip>
Before you call avatars.getInitials() can you log avatars.client.config?
And can you confirm which Appwrite SDK you're using and what version?
I need some time
Recommended threads
- Can Sites deployments be limited to the ...
Hey all! I’m using Appwrite Cloud Sites with GitHub connected. Right now, Appwrite seems to build for every push and PR, not just for my production branch (main...
- [Sites] pnpm Turborepo monorepo — stuck ...
deployment seems to never finish. Testing Appwrite Sites with a standard pnpm Turborepo monorepo (npx create-turbo@latest). Repo: https://github.com/saitrogen/...
- flutter realtime not working since versi...
I have the problem, that in flutter the realtime does not work anymore when I upgrade the sdk to verison 21.0.0+ (works with 20.3.3) I think the queries are not...