Shows user-specific "news items" after SAML2 login. News items are loaded from CSV files on disk and matched against a SAML2 user attribute.
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
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 (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."CSV files are parsed once on application startup. If you add/edit/remove CSV files, you must restart the application for changes to take effect.
Examples:
- Docker Compose:
docker compose restart newslist - Plain Docker run: stop the container and start it again
./gradlew bootJarservices:
newslist:
image: ghcr.io/kit-sdq/newslist:latest
container_name: "newslist"
restart: unless-stopped
volumes:
- ./config/:/usr/src/newslist/config/:rodocker 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.
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:ro \
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.