T04.f: backend Festipod ActivityPods + dockerisation
- Ajoute la configuration et les services backend (app, actors, registration, attendees, contacts, catalog, core auth/nodeinfo/proxy/notification). - Corrige le démarrage : désactive resourcesWithContainerPath pour éviter le conflit entre l'URI de l'acteur applicatif (/as/actor/app) et la route /app. - Corrige l'URL du dépôt de shapes : https://shapes.activitypods.org/. - Ajoute backend/Dockerfile et docker-compose.yml racine (frontend + backend). - Met à jour .env.example racine avec les variables SEMAPPS_* et VITE_BACKEND_*. - Gates verts : bunx tsc --noEmit (0 erreur) et bun test (50 pass).
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
const { CacherMiddleware } = require('@semapps/webacl');
|
||||
const CONFIG = require('./config/config');
|
||||
|
||||
Error.stackTraceLimit = Infinity;
|
||||
|
||||
const cacherConfig = CONFIG.REDIS_CACHE_URL
|
||||
? {
|
||||
type: 'Redis',
|
||||
options: {
|
||||
prefix: 'action',
|
||||
ttl: 2592000,
|
||||
redis: CONFIG.REDIS_CACHE_URL
|
||||
}
|
||||
}
|
||||
: undefined;
|
||||
|
||||
const SkipOrphanBlankNodesCleanupMiddleware = () => ({
|
||||
name: 'SkipOrphanBlankNodesCleanupMiddleware',
|
||||
localAction: (next, action) => {
|
||||
if (action.name === 'triplestore.deleteOrphanBlankNodes') {
|
||||
return async () => {};
|
||||
}
|
||||
return next;
|
||||
}
|
||||
});
|
||||
|
||||
// ActivityPods app services mark internal calls with isSystemCall, but the SDK
|
||||
// triplestore layer needs an explicit webId='system' to bypass pod-side WAC.
|
||||
const SystemCallWebIdMiddleware = () => ({
|
||||
name: 'SystemCallWebIdMiddleware',
|
||||
localAction: (next, action) => {
|
||||
return async ctx => {
|
||||
if (ctx.meta?.isSystemCall && !ctx.params?.webId) {
|
||||
ctx.params.webId = 'system';
|
||||
}
|
||||
return next(ctx);
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = {
|
||||
middlewares: [
|
||||
SkipOrphanBlankNodesCleanupMiddleware(),
|
||||
SystemCallWebIdMiddleware(),
|
||||
CacherMiddleware(cacherConfig)
|
||||
],
|
||||
logger: {
|
||||
type: 'Console',
|
||||
options: {
|
||||
formatter: 'short',
|
||||
level: 'info'
|
||||
}
|
||||
},
|
||||
retryPolicy: {
|
||||
enabled: true,
|
||||
retries: 0,
|
||||
delay: 100,
|
||||
maxDelay: 30000,
|
||||
factor: 2,
|
||||
check: err => err && !!err.retryable
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user