58 Commits

Author SHA1 Message Date
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
v1.1.2
2025-10-03 15:47:19 +02:00
Benjamin
2583482198 fix: isolate blockchain chains per document
Each document now maintains its own independent blockchain chain
with its own genesis signature. GetLastSignature now filters by
doc_id to prevent cross-document chain corruption.

Changes:
- Add docID parameter to GetLastSignature interface and implementation
- Update SQL query to filter by document ID
- Add comprehensive test for multi-document blockchain isolation
- Update all test mocks and integration tests
2025-10-03 15:47:09 +02:00
Benjamin
0ce076bd3a refactor: separate template variables from locale strings
Move all template variables out of locale JSON files into separate keys.
Update templates to concatenate locale strings with dynamic values.
Replace inline conditionals with proper locale key lookups for pluralization.
v1.1.1
2025-10-02 22:34:36 +02:00
Benjamin
06e4b33167 fix: properly handle NULL UserName in database operations
Add scanSignature helper to convert sql.NullString to string type.
Update Create method to insert NULL for empty UserName values.
Fix integration tests to work with string type instead of pointer.
2025-10-02 21:03:00 +02:00
Benjamin
d6dd3625a9 fix: ensure blockchain hash determinism by refactoring UserName to string
Changed UserName field from *string to string to fix blockchain integrity
validation issues. The pointer was causing non-deterministic hash computation
due to memory address comparison instead of value comparison.

This change:
- Fixes blockchain validation for signatures with UserName
- Simplifies code by removing pointer dereferencing logic
- Maintains backward compatibility (NULL DB values map to empty string)
- Updates i18n templates to display values directly
2025-10-02 18:22:40 +02:00
Benjamin
6a292f7617 docs: use correct syntax to generate private key ED25519 2025-10-01 18:19:27 +02:00
Benjamin
378afc43a2 docs: update docker-compose.yml example file to reflect needed custom oidc provider configuration 2025-10-01 14:05:08 +02:00
Benjamin
48a06f8aa2 fix: download tailwind cli corresponding to arch v1.1.0 2025-10-01 00:58:11 +02:00
Benjamin
00250e5f0b fix: format lang.go 2025-10-01 00:38:18 +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
dbe43a4ff8 doc: update readme 2025-09-28 21:47:27 +02:00
Benjamin
1ae8287ca5 fix: memory leak or deferrer errors on tests files 2025-09-28 21:12:09 +02:00
Benjamin
273c8adb7c doc: add ackify.eu website links 2025-09-27 23:07:56 +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
4b11f5f638 tests: add Docker smoke test script for local e2e validation 2025-09-27 17:37:56 +02:00
Benjamin
06fb2d5b89 docs: standardize health endpoint; document admin ACL and routes; add staticcheck guidance and target 2025-09-26 23:32:20 +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
cf2a943ea6 feat: oauth persist and verify state token via session to prevent CSRF 2025-09-26 23:32:20 +02:00
Benjamin
da64683431 feat: validation enforce strict patterns for doc and user query parameters 2025-09-26 23:32:20 +02:00
Benjamin
ff657e6d0d ci: fix docker-test service; skip outdated generate-mocks target 2025-09-26 23:32:20 +02:00
Benjamin
8bda0ae1b9 ci: use -tags=integration to match build tags 2025-09-26 23:32:20 +02:00
Benjamin
8d6f71d69d fix: chain update prev_hash via UPDATE during chain rebuild (no INSERT) 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
76c2e8de4e feat: enhance admin dashboard with chain integrity verification
- Add chain integrity verification system for document signatures
- Implement VerifyDocumentChainIntegrity method in AdminRepository
- Add ChainIntegrityResult struct to track validation status
- Display chain integrity status in admin document details page
- Add API endpoint for programmatic chain integrity checks
- Add admin access link in main interface for authorized users
- Update templates to show integrity verification results
- Add admin configuration to docker-compose environment
2025-09-26 21:27:17 +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
dd9834792f build: clean docker file 2025-09-23 22:46:21 +02:00
Benjamin
38e98a2e90 doc: add video as mp4 format 2025-09-20 12:27:20 +02:00
Benjamin
be7b3404a8 doc: improve gifs size v1.0.0 2025-09-19 23:46:25 +02:00
Benjamin
cd20de6624 doc: add videos screen captures 2025-09-19 23:41:34 +02:00
Benjamin
c3269936cc feat: update docker-compose db_dsn 2025-09-19 23:24:57 +02:00
Benjamin
16e7b60e69 ci: align IMAGE_TAG across build and security jobs 2025-09-19 23:03:12 +02:00
Benjamin
c5264b8cfe refactor: improve code formatting in config test file
Align environment variable assignments in test setup for better readability and consistency across all test functions.
2025-09-16 00:35:23 +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
ee64839bc8 fix: correct Docker migration service configuration
- Fix ackify-migrate service to run migrate binary instead of main server
- Add entrypoint override to bypass default ENTRYPOINT in Docker image
- Copy migrations directory to Docker image for migrate binary access
- Update migrate binary with better error handling and code quality
2025-09-15 16:53:15 +02:00
Benjamin
54aa967e79 feat: update Docker configuration for unified binary structure
- Rename binary from ackify-ce to ackify for consistency
- Add migrate binary build and deployment
- Add migration service to docker-compose with proper dependency chain
- Ensure migrations run before main service startup
- Update dependencies from migration system integration
2025-09-14 23:53:42 +02:00
Benjamin
78da25559a fix: prevent invalid Docker tags on release builds 2025-09-14 23:11:52 +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
bde1049343 feat: implement standalone SQL migration system
- Add golang-migrate based migration CLI in cmd/migrate/
- Extract hardcoded SQL migrations from connection.go to proper migration files
- Create 0001_init migration with complete signatures table schema
- Remove embedded migrations from Go code for cleaner separation
- Support up/down/version/drop migration operations
- Migration files follow semantic versioning starting at 0001
2025-09-14 17:59:33 +02:00
Benjamin
18c8d61d75 feat: migrate to chi router for ee integration 2025-09-14 15:54:51 +02:00
Benjamin
dbe27434e4 fix: gofmt 2025-09-13 22:36:55 +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
887d36c333 doc: make english readme as default 2025-09-11 18:05:11 +02:00
Benjamin
829db768e0 doc: make english readme as default 2025-09-11 17:51:45 +02:00