Shows user-specific "news items" after SAML2 login. News items are loaded from CSV files on disk and matched against a SAML2 user attribute.
| Your news | Admin interface |
|---|---|
![]() |
![]() |
| Dark mode | Mobile |
|---|---|
![]() |
![]() |
The demo/ folder contains a ready-to-run setup including a test SAML IdP.
cd demo
docker compose up- Open http://localhost:8080
- Log in with
user1/user1pass(admin, see/admin) oruser2/user2pass(regular user)
The demo mounts demo/news writable so the admin interface can change it. On Linux hosts, make it writable for the container user first (see Writable storage): sudo chown -R 999 demo/news.
Configuration is done via application.yml.
Spring Boot also reads external config from ./application.yml and ./config/application.yml relative to the working directory. In the Docker demo, the config is mounted to /usr/src/newslist/config/application.yml.
news.csv-path: Directory that contains the.csvfiles (the directory is scanned recursively).news.csv-format: Apache Commons CSV predefined format name (seeCSVFormat.Predefined), e.g.Default.news.saml2-key: The SAML2 attribute name whose value is used as the lookup key (demo:uid).
- Put one or more
.csvfiles into the directory configured vianews.csv-path. - All
.csvfiles found under that path are loaded at startup and after each change through the admin interface (sorted by file path/name).
The filename (without .csv) becomes the title of the news item. Underscores are removed.
Example filenames:
News Item 1.csv→ title:News Item 1Security_Notice.csv→ title:SecurityNotice
Each CSV record must have exactly two columns:
- Key: must match the logged-in user’s SAML2 attribute value (as configured by
news.saml2-key). - Content: the text to display for that news item.
Records with anything other than exactly two columns are skipped.
Examples (using news.csv-format: Default):
user1,Welcome to NewsList!
user2,"This message contains a comma, so it is quoted."Changes made through the admin interface (see below) apply immediately. If you edit the files on disk by other means, use "Reload from disk" in the admin interface, or restart the application (e.g., docker compose restart newslist).
Admins can upload and delete the news CSV files at /admin.
news.admin.ids: List of user IDs allowed to use the admin interface. Each value is compared against the SAML2 attribute configured vianews.saml2-key(demo:uid, souser1withuid1is admin). An empty list (the default) disables the admin interface. Everybody else gets HTTP 403.- Uploads must be
.csvfiles that parse with the configurednews.csv-format; they are stored in the root ofnews.csv-pathand replace a file with the same name. Rows without exactly two columns are skipped with a warning. news.admin.max-upload-size: Maximum size of an uploaded CSV (default5MB). It must stay belowspring.servlet.multipart.max-file-size/max-request-size(default config:8MB), which act as a hard cap answered with a bare HTTP 413.news.csv-pathmust be writable by the application, see Writable storage.
The only location NewsList writes to is the news.csv-path directory:
- Uploads are written there (via a temporary
.upload-*.tmpfile in the same directory that is then moved into place), and deletes remove files from it. - If the directory does not exist, it is created on the first upload, so its parent must be writable in that case.
- Everything else, in particular
application.yml, can stay read-only.
If the directory is not writable, NewsList still serves news, but uploads and deletes fail with an error message in the admin interface.
The image runs as UID 999. A host directory mounted as news.csv-path must therefore be writable by that UID, and must not be mounted with :ro:
mkdir -p news
sudo chown -R 999 news # or: sudo chmod -R a+rwX newsWith Docker Desktop (macOS/Windows), bind mounts are usually writable without changing ownership.
Mount the config read-only and the news directory writable as separate volumes (don't mount the news directory inside a read-only mount):
volumes:
- ./config/application.yml:/usr/src/newslist/config/application.yml:ro
- ./news/:/usr/src/newslist/news/and set news.csv-path: /usr/src/newslist/news in application.yml.
The project is built with a local Gradle installation (no Gradle wrapper) and JDK 25:
gradle bootJar # builds build/libs/NewsList-<version>.jar
gradle test # runs the tests; the integration tests need a running Docker daemon (Testcontainers)services:
newslist:
image: ghcr.io/kit-sdq/newslist:latest
container_name: "newslist"
restart: unless-stopped
volumes:
- ./config/application.yml:/usr/src/newslist/config/application.yml:ro
- ./news/:/usr/src/newslist/news/ # writable by UID 999, see "Writable storage"with news.csv-path: /usr/src/newslist/news in config/application.yml.
docker build -t newslist:local .NewsList runs from /usr/src/newslist/news.jar and will pick up external config from /usr/src/newslist/config/application.yml. The news directory must be writable by UID 999 (see Writable storage).
docker run -p 8080:8080 \
-v $(pwd)/demo/application.yml:/usr/src/newslist/config/application.yml:ro \
-v $(pwd)/demo/news:/usr/src/newslist/config/news \
newslist:localThis repository publishes images to GitHub Container Registry (GHCR):
ghcr.io/kit-sdq/newslist:latestis built from themainbranch.- Git tags like
v1.2.3are published asghcr.io/kit-sdq/newslist:1.2.3.



