Skip to content

Commit 54b03bb

Browse files
committed
Add configurable legal pages (Impressum, Privacy, Terms) to template
Every page now shows Impressum, Privacy Policy and Terms of Use links in the sidebar footer, and the GDPR consent banner links to the privacy policy so consent and policy are tied together. Links default to the official OpenMS pages and are overridable via a new "legal_links" object in settings.json, so self-hosting forks can point them at their own legal pages (an Impressum must name the actual operator). - settings.json: add legal_links (impressum/privacy/terms) defaults - common.py: add get_legal_links() (settings overrides merged over the hardcoded OpenMS defaults, so older forks still inherit links) and render the three links in the sidebar on every page - captcha_.py: forward the privacy policy URL to the consent component - gdpr_consent: set Klaro privacyPolicyUrl so the banner shows a working privacy-policy link; rebuild dist/bundle.js - README: document the legal_links override - tests: cover get_legal_links default/override/fallback behavior https://claude.ai/code/session_01WCamMNCunp9T2aScEKKUvx
1 parent e9d162a commit 54b03bb

7 files changed

Lines changed: 223 additions & 5 deletions

File tree

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,27 @@ nginx config, PID files — to `/tmp/openms-runtime-$$`, which is always
164164
writable inside an apptainer container. The workspace cleanup cron job is
165165
skipped in this mode; rerun `clean-up-workspaces.py` manually if needed.
166166

167+
## ⚖️ Legal pages (Impressum, Privacy Policy, Terms of Use)
168+
169+
Every page shows **Impressum**, **Privacy Policy** and **Terms of Use** links at
170+
the bottom of the sidebar, and the GDPR consent banner links to the privacy
171+
policy. By default these point to the centrally maintained official OpenMS pages
172+
(`https://openms.de/impressum`, `/privacy`, `/terms`).
173+
174+
If you self-host a fork, override them in `settings.json` — an Impressum must
175+
name the **actual operator**, not OpenMS:
176+
177+
```json
178+
"legal_links": {
179+
"impressum": "https://your-domain.example/impressum",
180+
"privacy": "https://your-domain.example/privacy",
181+
"terms": "https://your-domain.example/terms"
182+
}
183+
```
184+
185+
Any link you omit falls back to its OpenMS default. The `privacy` URL is reused
186+
for the consent banner's privacy-policy link, so consent and policy stay in sync.
187+
167188
## Documentation
168189

169190
Documentation for **users** and **developers** is included as pages in [this template app](https://abi-services.cs.uni-tuebingen.de/streamlit-template/), indicated by the 📖 icon.

gdpr_consent/dist/bundle.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gdpr_consent/src/main.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ let klaroConfig: {
1414
mustConsent: boolean;
1515
acceptAll: boolean;
1616
services: Service[];
17+
translations?: Record<string, any>;
1718
} = {
1819
mustConsent: true,
1920
acceptAll: true,
@@ -125,6 +126,18 @@ function onRender(event: Event): void {
125126
)
126127
}
127128

129+
// Link the consent banner to the privacy policy. Setting privacyPolicyUrl
130+
// on the 'zz' fallback language makes Klaro render its default
131+
// "To learn more, please read our privacy policy." text with the URL,
132+
// regardless of the browser locale.
133+
if (data.args['privacy_policy']) {
134+
klaroConfig.translations = {
135+
zz: {
136+
privacyPolicyUrl: data.args['privacy_policy']
137+
}
138+
}
139+
}
140+
128141
// Create a new script element
129142
var script = document.createElement('script')
130143

settings.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
"github-user": "OpenMS",
44
"version": "1.1.1",
55
"repository-name": "streamlit-template",
6+
"legal_links": {
7+
"impressum": "https://openms.de/impressum",
8+
"privacy": "https://openms.de/privacy",
9+
"terms": "https://openms.de/terms"
10+
},
611
"analytics": {
712
"google-analytics": {
813
"enabled": false,

0 commit comments

Comments
 (0)