Skip to content

Add AFFiNE — privacy-focused knowledge base (notes, docs, whiteboards)#3445

Open
EpicTGuy wants to merge 4 commits intoYunoHost:mainfrom
EpicTGuy:add-affine
Open

Add AFFiNE — privacy-focused knowledge base (notes, docs, whiteboards)#3445
EpicTGuy wants to merge 4 commits intoYunoHost:mainfrom
EpicTGuy:add-affine

Conversation

@EpicTGuy
Copy link
Copy Markdown

Description

AFFiNE is an open-source, local-first knowledge base combining notes,
rich-text documents and collaborative whiteboards in a single app.
It is a self-hostable alternative to Notion, Obsidian or Roam Research.

All 5 package_check tests pass (install, remove, backup/restore, upgrade, change_url).

Notable technical point

AFFiNE's server image is hosted exclusively on ghcr.io (not Docker Hub).
The package uses format = "docker" with a patched docker-image-extract
script that adds OCI multi-registry support (Bearer auth for non-Docker Hub
registries). The patched script is embedded in conf/ as a workaround until
the following PRs are merged:


Description

AFFiNE est une base de connaissances open source, local-first, combinant
notes, documents rich-text et tableaux blancs collaboratifs dans une seule
application. C'est une alternative auto-hébergeable à Notion, Obsidian ou
Roam Research.

Les 5 tests package_check passent (install, remove, backup/restore, upgrade, change_url).

Point technique notable

L'image serveur d'AFFiNE est hébergée exclusivement sur ghcr.io (pas Docker Hub).
Le package utilise format = "docker" avec un script docker-image-extract
patché qui ajoute le support des registries OCI non-Docker Hub (authentification
Bearer). Le script patché est embarqué dans conf/ en attendant le merge des
PR suivantes :

@ericgaspar
Copy link
Copy Markdown
Member

Thank you for the AFFIne package.
The package should follow the latest example_ynh template, using helpers v2.1.
I would also recommend removing all useless verbose files.

@otm33GH
Copy link
Copy Markdown
Contributor

otm33GH commented Apr 22, 2026

This is really a nice app ! ...but licensing is "hybrid". @EpicTGuy Did you package the community edition ?
See https://github.com/toeverything/AFFiNE/blob/canary/packages/backend/server/LICENSE

@oleole39
Copy link
Copy Markdown
Contributor

oleole39 commented Apr 22, 2026

but licensing is "hybrid"

Urggh.. Indeed, the Community Edition is licensed under MPL-2.0 , but the overall thing is even more complicated:

Portions of this software are licensed as follows:

- All content that resides under the "packages/backend" and "packages/common/native" directory of this repository, if that directory exists, is licensed under the license defined in "packages/backend/server/LICENSE".
- All third party components incorporated into the AFFiNE Software are licensed under the original license provided by the owner of the applicable component.
- Content outside of the above mentioned directories or restrictions above is available under the "MIT" license as defined in "LICENSE-MIT".

Source: https://github.com/toeverything/AFFiNE/blob/canary/LICENSE

Not sure how this is supposed to be added in manifest.toml? Only MPL-2.0?

@tituspijean
Copy link
Copy Markdown
Contributor

tituspijean commented Apr 23, 2026

Licensing

Every time I had a look to AFFiNE, I tuned down my enthusiasm due to the licensing matter.
The fact that their issue 14610 (a selfhoster wanting to stay compliant with their license, but confused as well) is not yet answered is annoying.

(Obligatory "I am not a lawyer".) According to https://affine.pro/pricing, self-hosters only get:

Unlimited local workspace
Unlimited use and Customization
Unlimited Doc and Edgeless editing

If they opt for the cloud hosting by Toeverything (the company behind AFFiNE), they additionally get:

(storage and support)
Real-time Syncing & Collaboration for more people

That last bit seems brought by the code covered in the EE-licensed area of the upstream repo. The EE license is not free and libre software.

My opinion: this code should not be included in the YunoHost package. The license in the manifest may then be MPL-2.0.

Use of generative AI

Since you have clearly used generative AI to help you package AFFiNE, though our policy is not yet written, I would like to reiterate eric's message. Our current opinion on the matter is: we tolerate it, as long as its well known verbosity does not hinder the comprehension of the architecture of the package and it uses all the latest packaging standards.

My opinion is that you (or heck, feed this list to your LLM) need to:

  1. remove all non-standard, self-describing files generated by the LLM.
  2. remove all unused files from the example app (the config panel file, for example)
  3. remove all custom tests, these are handled by the YunoHost CI
  4. check that all available and applicable helpers are used (e.g. there's been a simplification of the proxy_pass instructions for NGINX recently)

You may keep an original repository to keep these files, if these informational crutches are needed, but submit a repository that's cleaned up. :)

@EpicTGuy
Copy link
Copy Markdown
Author

Thank you all for the thorough review — very helpful feedback!

On licensing (@otm33GH @oleole39 @tituspijean):
You're right, the license declaration was incorrect. The AFFiNE backend server (packages/backend) is licensed under MPL-2.0 for the Community Edition. I've updated the manifest to license = "MPL-2.0". The EE-gated features (team sync, extra storage) require a paid subscription to Toeverything's cloud and are not activated in a self-hosted setup without an active EE subscription — so what actually runs on a self-hosted instance is the CE portion.

On generative AI / verbosity (@ericgaspar @tituspijean):
Point taken. I've made the following cleanups:

  1. Removed doc/ANALYSIS.md (LLM planning file, not a YunoHost standard)
  2. Removed all verbose French comments from conf files and scripts — only the non-obvious "why" comment remains (the workaround for fix: update vendored docker-image-extract to support OCI multi-registry (ghcr.io, quay.io, etc.) yunohost#2293)
  3. Replaced the manual proxy headers in nginx.conf with include proxy_params_no_auth; (covers WebSocket headers too)
  4. Added the missing README_fr.md

The package still relies on the patched docker-image-extract in conf/ as a workaround until YunoHost/yunohost#2293 is merged — this is unavoidable since AFFiNE's server image is only published on ghcr.io.


Merci pour la revue complète — des retours très utiles !

Sur la licence (@otm33GH @oleole39 @tituspijean) :
Vous avez raison, la déclaration de licence était incorrecte. Le serveur AFFiNE (packages/backend) est sous MPL-2.0 pour la partie Community Edition. J'ai mis à jour le manifest à license = "MPL-2.0". Les fonctionnalités EE (synchronisation équipe, stockage supplémentaire) nécessitent un abonnement payant au cloud Toeverything et ne sont pas activées dans une installation self-hosted sans abonnement EE actif — ce qui tourne effectivement sur une instance self-hosted est donc la portion CE.

Sur l'IA générative / verbosité (@ericgaspar @tituspijean) :
Message reçu. Voici les nettoyages effectués :

  1. Suppression de doc/ANALYSIS.md (fichier de planification LLM, non standard YunoHost)
  2. Suppression de tous les commentaires français verbeux dans les fichiers conf et scripts — seul le commentaire "pourquoi" non-évident reste (le workaround pour fix: update vendored docker-image-extract to support OCI multi-registry (ghcr.io, quay.io, etc.) yunohost#2293)
  3. Remplacement des headers proxy manuels dans nginx.conf par include proxy_params_no_auth; (inclut déjà le support WebSocket)
  4. Ajout du README_fr.md manquant

Le package utilise toujours le docker-image-extract patché dans conf/ en attendant le merge de YunoHost/yunohost#2293 — c'est incontournable car l'image serveur d'AFFiNE est uniquement publiée sur ghcr.io.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants