Linus Gasser 3c87e66e48 Adapt recipe to Docs v6 (yhub collaboration server)
- the new yhub service needs new initialisation and RSA keys
- SOFT_MIGRATION on by default, add migrate_documents command
- back up the yhub database too
- document the v5 -> v6 upgrade in README and release/next

Following the [C4DT AI Policy](https://git.coopcloud.tech/c4dt/ai-policy/src/branch/main/AI-POLICY.md):

 #LLM_vibe
 #LLM_model Claude Opus 5.5

- [x] I take full responsibility for this code
- [x] I understand every line of this code
- [x] I tested this code thoroughly on my own computer / servers
- [x] None of the commit messages were created using LLMs
- [x] I will participate in any discussion on my own and will not use an LLM for the discussion
2026-10-20 21:31:51 +02:00
2025-06-05 16:12:51 +01:00
2025-06-05 16:12:51 +01:00
2026-03-10 17:50:52 +00:00

lasuite-docs

Docs (part of La Suite Numerique) for Co-op Cloud

Quick start

  • abra app new lasuite-docs --secrets
  • Insert the two RSA keys, which abra cannot generate (see below)
  • abra app config <app-name>
  • abra app deploy <app-name>

You should then be able to visit the landing page of your app, but not yet to login. To login, you need to deploy and integrate single sign on (described below in the "Configure Authentication" section).

  • Migrations run automatically on backend startup. To trigger manually: abra app cmd <app-name> backend migrate
  • Minio buckets are created automatically on first deploy. To manually trigger: abra app cmd <app-name> minio minio_initialize

RSA keys

Since v6, the backend and the collaboration server (yhub) authenticate each other with signed tokens. Each needs its own RSA private key, never the same one:

openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:2048 -out jwt.pem
openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:2048 -out yhub-jwt.pem
abra app secret insert <app-name> jwt_pk v1 jwt.pem -f
abra app secret insert <app-name> yhub_jwt_pk v1 yhub-jwt.pem -f
rm jwt.pem yhub-jwt.pem

Upgrading from v5 to v6

v6 replaces the collaboration server. Document content moves from the minio bucket to the new yhub service, which stores it in its own yhub database. If you skip the migration, every existing document opens empty. See UPGRADE.md upstream for details.

  1. Insert the two RSA keys (see "RSA keys" above). The collab_ss secret is no longer used.
  2. Leave SOFT_MIGRATION at its default (true) and deploy. The yhub schema is created on startup. A document is copied to yhub the first time someone opens it.
  3. Copy all remaining documents: abra app cmd <app-name> backend migrate_documents. You can pass arguments, e.g. abra app cmd <app-name> backend migrate_documents -- --dry-run. Re-run it with --retry-failed if some documents failed.
  4. Only after that, you may set SOFT_MIGRATION=false. Keep the minio bucket and its object versions: they hold the document history from before v6.

Configure Authentication

lasuite-docs requires an OpenID Connect (OIDC) single sign-on provider; deployment has been tested with Keycloak, which we recommend, or you could also try Authentik, both of which are installable using Co-op Cloud.

Instructions for integrating keycloak with docs after deploying it, are below.

  • In keycloak, create a realm (save the name of this realm, you will need it later)

  • Within that realm, create a client

    • during client creation, ensure:
      • Standard flow: True
      • Direct access grants: True
      • Authorization: True
      • Client authentication: True
      • PKCE method: none
  • Within the client tab, for your client, click on "Credentials". Click on the the copy button to copy "Client Secret" so you can insert this into your coop cloud deployment in the next step.

  • abra app secret insert <app-name> oidc_rpcs v2 <yoursecret>

  • abra app config <app-name> # set SECRET_OIDC_RPCS_VERSION=v2

  • Now create a user for this client within keycloak. Within the Users tab, click "Add User". Any username and password works. Save this info.

You then additionally need to modify the config of docs to point to your keycloak deployment.

  • abra app config <app-name>
OIDC_REALM=<the realm you configured in keycloak>
AUTH_DOMAIN=<the domain of your keycloak instance>
OIDC_RP_CLIENT_ID=<yourkeycloakclientid>

then redeploy docs: abra app deploy <app-name> --force

at this point, when you go to your docs url, you shoud then be able to click "login" and login with the username and password for the user you created in keycloak.

you can make additional users in keycloak for this "client" and they will all be able to login to docs and collaborate.

Configure E-Mail

Using abra app config <app-name> you need to set the following for your smtp server:

DJANGO_EMAIL_HOST="yourmailserver.com"
DJANGO_EMAIL_PORT=1025
DJANGO_EMAIL_FROM=noreply@example.com

You then need to insert the password for your smtp server as a secret:

  • abra app secret insert <app-name> email_pass v2 <youremailpass>
  • abra app config <app-name> # set SECRET_EMAIL_PASS_VERSION=v2

Then redeploy the app, and automated e-mail sending should work:

abra app deploy <app-name> --force

S
Description
A collaborative note taking, wiki and documentation platform that scales.
https://github.com/suitenumerique/docs/
Readme
356 KiB
Languages
Shell 55.3%
Go Template 44.7%