23 Commits

Author SHA1 Message Date
Benjamin
6e12fb69ed feat: add email reminder system for pending signers
Enable admins to send reminder emails to expected signers who haven't signed yet.
This addresses the need to follow up with pending signers without manual tracking.

- Add reminder_logs table to track all email sends (success and failures)
- Implement ReminderService with SMTP integration
- Extend admin dashboard with reminder stats and send interface
- Support bulk send (all pending) or selective send (manual selection)
- Track reminder count and last sent date per signer
- Change terminology from "signature" to "lecture/confirmation de lecture" across all templates and emails
2025-10-08 00:57:04 +02:00
Benjamin
5e74921ee7 feat: admin dashboard document request signatures
- New, clearer dashboard showing the status of each document
- The administrator can create a list of expected signatures for a given document.
- The administrator can manage the list of users who must confirm that they have read the document
2025-10-06 23:34:01 +02:00
Benjamin
0015af12e1 feat: add silent OAuth login with auto-authentication
- Add ACKIFY_OAUTH_AUTO_LOGIN config flag (default: false)
- Implement /api/auth/check endpoint for session validation
- Add silent login flow with prompt=none OAuth parameter
- Implement localStorage-based retry prevention (5min cooldown)
- Add comprehensive OAuth flow debugging logs
- Handle OAuth errors gracefully (login_required, interaction_required)
- Update templates with silent login JavaScript
- Add login button in header when not authenticated
- Fix /health endpoint documentation (remove /healthz alias)
- Extend tests to include autoLogin parameter
2025-10-06 13:13:17 +02:00
Benjamin
296010c0aa feat: add SSO provider logout support
When users click logout, they are now redirected to the SSO provider's
logout endpoint to ensure complete session termination. This prevents
users from remaining logged in at the provider level after logging out
of the application.

Changes:
- Add LogoutURL configuration for OAuth providers (Google, GitHub, GitLab)
- Implement GetLogoutURL method with post-logout redirect parameter
- Update HandleLogout to redirect to SSO logout when configured
- Add ACKIFY_OAUTH_LOGOUT_URL environment variable for custom providers
- Add tests for both local and SSO logout scenarios
2025-10-03 15:47:19 +02:00
Benjamin
9c53a8bf2b feat: implement complete i18n support with French and English
Add comprehensive internationalization support:
- Browser language detection via Accept-Language header
- Cookie-based language preference persistence (1 year)
- Language switcher with flag emojis (🇫🇷 🇬🇧)
- 71 translation keys covering all UI elements
- Context-based translation injection via middleware

Replace Tailwind CDN with production build:
- Tailwind CLI v3.4.16 for CSS compilation
- Minified CSS output (5.9KB from several MB)
- Docker build integration
- Custom color palette configuration

Update all templates with i18n support:
- Main pages: home, sign, signatures, error
- Admin dashboard and document details
- Embed iframe widget (English only for international use)
- Language switcher preserves current page URL

Technical implementation:
- golang.org/x/text for language matching
- Middleware pattern for consistent i18n injection
- Fallback chain: Cookie → Accept-Language → English
- Separate translation files (locales/fr.json, locales/en.json)
2025-10-01 00:13:40 +02:00
Benjamin
6ff6966193 refactor: implement config injection pattern and enhance admin access control
- Load configuration once in main.go and inject through dependencies
- Remove duplicate config.Load() calls in admin routes and server init
- Add AdminEmails field to AppConfig with lowercase normalization
- Implement HTML error pages for 403 Forbidden responses
- Add comprehensive debug logging for admin access verification
- Improve template conditional formatting for readability
- Add test coverage for admin email parsing (6 test cases)
2025-09-30 22:37:51 +02:00
Benjamin
8d3b7ba927 feat: improved the logging system to enable troubleshooting of OAuth2 errors:
- Added structured logs in HandleError() for each error type in middleware
 - Explicit log of the OAuth callback error before handling

feat: add configurable log level via ACKIFY_LOG_LEVEL
 - Add ParseLevel function to logger package
 - Extend config structure with LoggerConfig
 - Apply log level during server initialization
 - Update documentation and .env.example
2025-09-30 15:38:07 +02:00
Benjamin
1ae8287ca5 fix: memory leak or deferrer errors on tests files 2025-09-28 21:12:09 +02:00
Benjamin
3aaf1b25f8 docs: migrate to AGPL-3.0-or-later and add COPYRIGHT
- Replace SSPL with GNU AGPLv3 (LICENSE)
- Add COPYRIGHT with attribution
- Update Dockerfile label, README(s), BUILD.md
- Add SPDX headers across repo

refacto: remove redundant descriptive comments; keep only meaningful rationales
- Convert doc-comments to GoDoc style without colons
- Keep only security/algorithm rationales (CSRF state, CSP, chain hash, Bresenham)

tests: harden OAuth handlers tests (state missing/invalid) and fix fakes
- Add VerifyState token checks; ensure CreateAuthURL used
- Clean noisy comments in tests

docs: align docker-compose and scripts headers
2025-09-27 17:39:17 +02:00
Benjamin
5e41f14f94 refactor: reuse server DB; add request logging; tighten CSP with frame-ancestors and embed override 2025-09-26 23:32:20 +02:00
Benjamin
84bce9af0b logging: remove private key print; downgrade OAuth PII logs to debug 2025-09-26 23:32:20 +02:00
Benjamin
ef49dca8cd feat: http add /healthz alias; ignore local .gocache 2025-09-26 23:32:19 +02:00
Benjamin
53aa233f66 feat: add admin dashboard with document and signature management
- Admin middleware with ACKIFY_ADMIN_EMAILS environment variable authentication
- Dashboard view listing all documents with signature counts (/admin)
- Document details view showing signataires and metadata (/admin/docs/{docID})
- Read-only admin repository with dedicated database connection
- Responsive UI templates consistent with existing design
- Secure route protection and proper error handling

Configuration: Set ACKIFY_ADMIN_EMAILS="email1@domain.com,email2@domain.com"
2025-09-23 23:03:08 +02:00
Benjamin
297ada2c78 feat: complete migration to ACKIFY_ prefixed environment variables
Update all documentation, tests, and configuration files to use consistent
ACKIFY_ prefixed environment variable names. This ensures proper namespacing
and avoids conflicts with system environment variables.

- Update test files with new variable names
- Standardize documentation examples in README files
- Fix Docker compose configurations and install scripts
- Update error messages and warnings to use new variable names
2025-09-16 00:31:53 +02:00
Benjamin
014078303d feat: add organisation support to templates and improve Docker configuration
- Add organisation field to signature handlers and page data
- Update Docker compose to use ACKIFY_DB_DSN environment variable
- Remove redundant blank line in router setup
2025-09-15 23:58:10 +02:00
Benjamin
1a41d15df9 refactor: remove redundant comments and improve code readability
Remove trivial comments that duplicate what the code already expresses clearly.
Keep only essential documentation for public exports as per Go conventions.
This improves code maintainability and follows the principle that code should
be self-documenting.
2025-09-15 22:59:50 +02:00
Benjamin
aebef77434 feat: standardize environment variable names with ACKIFY_ prefix
- Renamed all environment variables to use consistent ACKIFY_ prefix
- Updated configuration files, Docker compose, and build documentation
- Modified database connection variables and OAuth configuration
- Updated crypto key environment variable reference
- Ensured consistency across all configuration files
2025-09-15 21:45:11 +02:00
Benjamin
609cdfce4d feat: migrate templates from embedded filesystem to file-based system
- Move templates from webtemplates/templates/ to templates/
- Replace embedded filesystem with filesystem-based template loading
- Add ACKIFY_TEMPLATES_DIR environment variable for custom template paths
- Update Dockerfile to copy templates and set default template directory
- Improve template resolution with fallback paths for development
- Remove webtemplates package and embedded filesystem dependencies
- Update BUILD.md documentation for template configuration
2025-09-15 20:56:28 +02:00
Benjamin
c1595ffe3e feat: migrate templates to embedded filesystem
- Move templates from web/templates/ to webtemplates/templates/
- Replace file-based template loading with Go embed
- Remove external template directory dependency from Dockerfile
- Add webtemplates package with embedded template functionality
- Include comprehensive tests for embedded templates
- Update server initialization to use new embedded template system

This change makes the application self-contained by embedding templates
directly in the binary, eliminating the need for external template files
at runtime.
2025-09-14 21:37:13 +02:00
Benjamin
18c8d61d75 feat: migrate to chi router for ee integration 2025-09-14 15:54:51 +02:00
Benjamin
c38558fea6 feat: refactor Ackify to support CE/EE separation
- Move web server logic to pkg/web package for external imports
- Rename cmd/ackify to cmd/community for clarity
- Create NewServer(multitenant bool) function for EE integration
- Add basic unit tests for Community Edition
- Update Dockerfile to build from cmd/community
- Add comprehensive build and deployment documentation

This change enables the Enterprise Edition to import and extend
the Community Edition while maintaining clean separation.
2025-09-13 22:28:27 +02:00
Benjamin
faefc9061d fix: suffix _utc & _b64 on sql fields and struct name 2025-09-10 21:28:48 +02:00
Benjamin
62f8a56c7a feat: initial project setup
Add complete Go application for cryptographic document signature validation with OAuth2 authentication, Ed25519 signatures, and PostgreSQL storage following clean architecture principles.
2025-09-10 17:10:22 +02:00