[relay] Attribution: GET /about serves the CPAL credit and the source URL (Ludus G9.130)

This commit is contained in:
Marek Novák
2026-11-24 07:37:11 +01:00
parent 6190a564c7
commit 3256adece3
7 changed files with 109 additions and 7 deletions
+26 -1
View File
@@ -58,6 +58,17 @@ export interface RelayConfig {
* not silently truncated at a number they never chose.
*/
readonly boardMaxRows: number;
/**
* Where the source of THIS running relay can be read, served by `GET /about`.
*
* The relay is published under CPAL-1.0 as LudusPublic, and CPAL §15 counts running it for other people as
* distributing it: whoever runs it must make its source available to the people who use it. A relay is an
* API with no screen, so the place its users can find that source is a response. The default is LudusPublic
* itself; a self-hoster running a MODIFIED relay must point this at their own copy, because the obligation is
* to publish the code that runs, not the code it was forked from.
*/
readonly sourceUrl: string;
}
export const DEFAULT_RELAY_CONFIG: RelayConfig = {
@@ -65,9 +76,23 @@ export const DEFAULT_RELAY_CONFIG: RelayConfig = {
displayNameMaxChars: 32,
leagueIdMaxChars: 64,
maxBodyBytes: 8 * 1024,
boardMaxRows: 200
boardMaxRows: 200,
sourceUrl: 'https://gitea.marek-novak.cz/mnovak/LudusPublic'
};
/**
* The CPAL-1.0 Exhibit B credit, exactly as LudusPublic's LICENSE states it.
*
* Not configurable: the attribution belongs to the Original Developer and a relay may not drop it (CPAL §14).
* Copied from the licence rather than paraphrased; `server.test.ts` checks the words.
*/
export const ATTRIBUTION = {
phrase: 'Built on Domi',
url: 'https://aula.marek-novak.cz',
copyright: 'Copyright (c) 2026 Marek Novák',
licence: 'CPAL-1.0'
} as const;
export function relayConfig(overrides: Partial<RelayConfig> = {}): RelayConfig {
return { ...DEFAULT_RELAY_CONFIG, ...overrides };
}