v1.2.0 - Container Security and Enhanced Logging
Overview
Version 1.2.0 focuses on hardening the application's security and improving the robustness of the logging system. This release introduces a more secure Docker container environment by implementing a multi-stage build, a non-root user, and a minimal scratch base image. The logging module has also been significantly enhanced to support multiple log levels and provide more structured output. Additionally, the build pipeline has been simplified for better maintainability.
What's New
- Container Security Hardening
- Implemented a multi-stage Docker build process to reduce the final image size and attack surface.
- The application now runs as a non-root user (applicationuser) to mitigate potential security risks.
- The final image is now based on a minimal scratch image, and Nginx has been replaced with busybox httpd.
- Enhanced Logging
- The logging module has been refactored to support multiple log levels: error, warn, info, log, debug, and trace.
- Log messages are now consistently formatted with a timestamp and log level for easier debugging.
- A bug in the logging logic that prevented DEBUG mode from working correctly has been fixed.
- Simplified Build Pipeline
- The GitHub Actions workflow has been simplified by removing the DockerSlim optimization step, which reduces build complexity and reliance on external tools
Upgrade Guide
Docker Users
To upgrade, pull the latest image from Docker Hub:
docker pull amnoorbrar/digital-clock:latest
docker run --rm -p 8080:80 amnoorbrar/digital-clock:latestBuilding from Source
To build this version from source:
git clone https://github.com/Amnoor/Digital-Clock-Program.git
cd Digital-Clock-Program
git checkout v1.2.0
docker build -t digital-clock .
docker run --rm -p 8080:80 digital-clockCompatibility
This release is fully backward compatible with previous versions. No breaking changes have been introduced.
Files Modified
- .github (Folder, Modified):
- workflows (Folder, Modified):
- docker-push.yml (File, Modified)
- workflows (Folder, Modified):
- assets (Folder, Unchanged):
- background.jpg (File, Unchanged)
- clock-icon.svg (File, Unchanged)
- modules (Folder, Modified):
- logs (Folder, Modified):
- index.js (File, Modified)
- logs (Folder, Modified):
- style (Folder, Unchanged):
- style.css (File, Unchanged)
- .dockerignore (File, Modified)
- Dockerfile (File, Modified)
- index.html (File, Unchanged)
- index.js (File, Modified)
- LICENSE (File, Unchanged)
- README.md (File, Unchanged)
Verification
This release has been tested for:
- ✅ Successful multi-stage Docker image builds.
- ✅ Correct application behavior when running as a non-root user.
- ✅ Correct functionality of the enhanced logging system and DEBUG flag.
- ✅ Simplified and successful execution of the GitHub Actions build pipeline.
- ✅ Continued core clock functionality without regressions.
Links
- Repository: Digital Clock Program v1.2.0 (https://github.com/Amnoor/Digital-Clock-Program/tree/v1.2.0)
- Docker Hub: amnoorbrar/digital-clock (https://hub.docker.com/r/amnoorbrar/digital-clock)
- Changelog:
- Compare v1.1.0...v1.2.0 (v1.1.0...v1.2.0)
- Compare v1.0.2...v1.2.0 (v1.0.2...v1.2.0)
- Compare v1.0.1...v1.2.0 (v1.0.1...v1.2.0)
- Compare v1.0.0...v1.2.0 (v1.0.0...v1.2.0)
- Changelog:
Contributors
- Amnoor Brar (https://github.com/Amnoor) - Project Owner & Lead Developer
Full Changelog: