34 Commits

Author SHA1 Message Date
Benjamin
6ce67b02d4 fix: add SHM directory to store identity file (must be persisted on host) 2026-01-20 22:42:40 +01:00
Benjamin
82b695baeb Merge branch 'feat/reader'
# Conflicts:
#	install/compose.yml
#	webapp/cypress/e2e/01-signature-workflow.cy.ts
#	webapp/cypress/e2e/02-signature-uniqueness.cy.ts
#	webapp/cypress/e2e/03-admin-signers-management.cy.ts
#	webapp/cypress/e2e/04-admin-email-reminders.cy.ts
#	webapp/cypress/e2e/06-my-signatures-page.cy.ts
#	webapp/cypress/e2e/07-admin-document-deletion.cy.ts
#	webapp/cypress/e2e/08-admin-route-protection.cy.ts
#	webapp/cypress/e2e/09-complete-workflow.cy.ts
#	webapp/cypress/e2e/10-unexpected-signatures.cy.ts
#	webapp/cypress/e2e/13-embed-page.cy.ts
#	webapp/cypress/e2e/14-csv-preview.cy.ts
#	webapp/src/components/DocumentForm.vue
#	webapp/src/components/layout/AppHeader.vue
#	webapp/src/locales/de.json
#	webapp/src/locales/es.json
#	webapp/src/locales/it.json
#	webapp/src/pages/EmbedPage.vue
#	webapp/src/pages/HomePage.vue
#	webapp/src/pages/admin/AdminDashboard.vue
#	webapp/src/pages/admin/AdminDocumentDetail.vue
#	webapp/tests/components/SignButton.test.ts
2026-01-14 22:25:27 +01:00
Benjamin
a272cc7de9 feat(storage): improve MIME type detection and add ODF format support
- Add extension-based MIME type refinement for text formats (.md, .docx, .xlsx, .odt, .ods)
- Add charset=utf-8 for text-based MIME types in Content-Type header
- Support ODF formats (OpenDocument Text/Spreadsheet)
- Unify compose templates into single compose.yml.template with region markers
- Add update mode to install script to preserve existing configuration
- Extend file upload accept list in DocumentCreateForm
- Remove binary file from repository
2026-01-08 23:16:54 +01:00
Benjamin
fb9dab2f0f feat: add document storage and integrated PDF viewer
Storage:
- Add S3 and local storage providers for document uploads
- Support file upload with checksum calculation
- Fix S3 upload for non-TLS connections (MinIO)

Document viewer:
- Add PDF.js-based viewer with scroll tracking
- Implement checksum verification on document load
- Add reader options (read mode, download, require full read)
- Auto-detect read completion for signed documents

API:
- Add document upload endpoint with storage integration
- Add proxy endpoint for stored documents
- Extend document metadata with storage and reader fields
2026-01-08 20:39:34 +01:00
Benjamin
a025a102d0 fix: install db config 2025-12-29 22:35:21 +01:00
Benjamin
70eb52735b fix: install db config 2025-12-29 22:28:59 +01:00
Benjamin
c374021675 Merge branch 'feat/telemetry' 2025-12-22 22:17:03 +01:00
Benjamin
3f745405c7 feat(install): add telemetry option to installation script
- Add interactive telemetry prompt with GDPR compliance explanation
- Document collected metrics (documents, signatures, webhooks, reminders)
- Add ACKIFY_TELEMETRY to .env.example, compose.yml and compose-traefik.yml
- Update README.md with telemetry documentation
- Default to disabled but encourage users to opt-in
2025-12-22 20:37:45 +01:00
Benjamin
eb320cb239 fix: install script env var 2025-12-19 23:02:43 +01:00
Benjamin Touchard
7218cbfd0f fix: install script app password for db 2025-12-19 15:19:21 +01:00
Benjamin
bd46d6b706 fix(install): add missing env var on downloadable compose 2025-11-28 21:50:02 +01:00
ArnaudFra
ec947afc24 feat(mail): add ACKIFY_MAIL_INSECURE_SKIP_VERIFY option (#6)
* feat(mail): add option to skip TLS certificate verification

Add ACKIFY_MAIL_INSECURE_SKIP_VERIFY environment variable to allow
bypassing TLS certificate verification for self-signed certificates.

This is useful for development/testing environments with self-signed
SMTP certificates while maintaining secure defaults (false by default).

* docs: add ACKIFY_MAIL_INSECURE_SKIP_VERIFY documentation
2025-11-22 22:20:34 +01:00
Benjamin
aa5fee90f6 feat(admin): add option to restrict document creation to admins only
Add new configuration option ACKIFY_ONLY_ADMIN_CAN_CREATE (default: false) to control who can create documents.

Backend changes:
- Add OnlyAdminCanCreate config field to AppConfig
- Implement authorization checks in document handlers
- Protect POST /documents and GET /documents/find-or-create endpoints
- Add unit tests for admin-only document creation (4 tests)

Frontend changes:
- Inject ACKIFY_ONLY_ADMIN_CAN_CREATE to window object
- Hide DocumentForm component for non-admin users when enabled
- Add i18n translations (en, fr, es, de, it)
- Display warning message for non-admin users

Documentation:
- Update .env.example files with new variable
- Update configuration docs (en/fr)
- Update install script to prompt for restriction option
- Update install/README.md

When enabled, only users listed in ACKIFY_ADMIN_EMAILS can create new documents. Both direct creation and find-or-create endpoints are protected.
2025-11-06 16:08:03 +01:00
Benjamin
2dd7d8686c fix(email): correct SMTP TLS/STARTTLS configuration for Gmail
Backend changes:
- Use 'else if' to prevent activating both TLS and STARTTLS simultaneously
- Add StartTLSPolicy = MandatoryStartTLS for proper STARTTLS enforcement
- Add comments explaining TLS modes (implicit SSL vs explicit STARTTLS)

Install script changes:
- Auto-detect TLS configuration based on port number
- Port 465 → TLS=true, STARTTLS=false (implicit SSL)
- Port 587 → TLS=false, STARTTLS=true (explicit TLS/STARTTLS)
- Non-standard ports → manual configuration with clear prompts

This fixes timeout errors when sending emails via Gmail SMTP (port 587)
which requires STARTTLS, not direct TLS connection.
2025-11-06 00:05:16 +01:00
Benjamin
d3f7aa4853 fix(install): always write auth method enabled flags to .env
- Add ACKIFY_AUTH_OAUTH_ENABLED=true when OAuth is configured
- Add ACKIFY_AUTH_OAUTH_ENABLED=false when OAuth is not configured
- Write ACKIFY_AUTH_MAGICLINK_ENABLED with true/false value explicitly
- Provides clear visibility of enabled authentication methods in .env

These variables are already passed to containers via compose files.
2025-11-05 23:48:12 +01:00
Benjamin
e71528a76b fix(install): correct mail template directory path
Change ACKIFY_MAIL_TEMPLATE_DIR from 'templates/emails' to 'templates'
to match actual directory structure where templates are in /app/templates.
2025-11-05 23:44:42 +01:00
Benjamin
4269b66c18 fix: add ACKIFY_ prefix to all variables in .env.example files
Update both .env.example files to use correct variable names:

Root .env.example:
- Remove obsolete APP_NAME and APP_DNS variables
- Add ACKIFY_DB_DSN example
- Add ACKIFY_ADMIN_EMAILS section
- Remove deprecated ACKIFY_TEMPLATES_DIR

install/.env.example:
- Fix all variable names to use ACKIFY_ prefix
- Update OAuth variables (PROVIDER, CLIENT_ID, etc.)
- Update Mail/SMTP variables (HOST, PORT, USERNAME, etc.)
- Update Auth variables (AUTH_OAUTH_ENABLED, AUTH_MAGICLINK_ENABLED)
- Update Admin variables (ADMIN_EMAILS)
- Update all references in comments and instructions
2025-11-05 23:41:00 +01:00
Benjamin
c13ce508c7 fix(install): add all missing env variables to compose files
Complete both compose.yml and compose-traefik.yml with missing environment
variables:

OAuth variables:
- OAUTH_SCOPES, OAUTH_GITLAB_URL, OAUTH_AUTO_LOGIN
- AUTH_OAUTH_ENABLED, AUTH_MAGICLINK_ENABLED
- Add fallback defaults (:-) for all OAuth variables

Mail/SMTP variables:
- MAIL_USERNAME, MAIL_PASSWORD, MAIL_TIMEOUT
- MAIL_SUBJECT_PREFIX, MAIL_TEMPLATE_DIR, MAIL_DEFAULT_LOCALE
- Fix MAIL_TLS and MAIL_STARTTLS to use env variables instead of hardcoded false

This ensures MagicLink authentication works properly when SMTP is configured.
2025-11-05 23:38:20 +01:00
Benjamin
4386a02a8c fix(install): generate hex password to avoid URL encoding issues
Use openssl rand -hex instead of -base64 for database password to prevent
special characters (/, +, =) from breaking the DSN URL parsing
2025-11-05 22:35:28 +01:00
Benjamin
12ef046bea fix(install): add missing env variables and fix key name
- Add ACKIFY_LOG_LEVEL=info to prevent Docker Compose warning
- Fix ACKIFY_ED25519_PRIVATE_KEY_B64 -> ACKIFY_ED25519_PRIVATE_KEY
  to match expected variable name in backend code
2025-11-05 22:25:43 +01:00
Benjamin
6efb1b6aba fix(install): improve domain extraction and password input
- Use cut with dot counting for more robust subdomain removal
  (sign.kolapsis.com -> kolapsis.com)
- Redirect password prompt newline to stderr to avoid polluting
  captured variable value
2025-11-05 22:24:39 +01:00
Benjamin
10d3406a80 fix(install): use domain instead of DNS for email addresses
Extract APP_DOMAIN from APP_DNS (removing subdomain and port) and use it
for default email addresses (noreply@domain.com, admin@domain.com) instead
of using the full DNS (noreply@subdomain.domain.com).
2025-11-05 22:16:42 +01:00
Benjamin
fa85dba6e2 fix(install): add ACKIFY_ prefix to all environment variables
Corrects all environment variable names in the installation script to match
the expected configuration format. Adds missing ACKIFY_DB_DSN variable.
2025-11-05 22:11:21 +01:00
Benjamin
b867acb61d feat: improve install script + installation readme 2025-11-05 17:17:55 +01:00
Benjamin
68426bc882 feat: add PKCE support to OAuth2 flow for enhanced security
- Implement PKCE (Proof Key for Code Exchange) with S256 method
- Add crypto/pkce module with code verifier and challenge generation
- Modify OAuth flow to include code_challenge in authorization requests
- Update HandleCallback to validate code_verifier during token exchange
- Extend session lifetime from 7 to 30 days
- Add comprehensive unit tests for PKCE functions
- Maintain backward compatibility with fallback for non-PKCE sessions
- Add detailed logging for OAuth flow with PKCE tracking

PKCE enhances security by preventing authorization code interception
attacks, as recommended by OAuth 2.1 and OIDC standards.

feat: add encrypted refresh token storage with automatic cleanup

- Add oauth_sessions table for storing encrypted refresh tokens
- Implement AES-256-GCM encryption for refresh tokens using cookie secret
- Create OAuth session repository with full CRUD operations
- Add SessionWorker for automatic cleanup of expired sessions
- Configure cleanup to run every 24h for sessions older than 37 days
- Modify OAuth flow to store refresh tokens after successful authentication
- Track client IP and user agent for session security validation
- Link OAuth sessions to user sessions via session ID
- Add comprehensive encryption tests with security validations
- Integrate SessionWorker into server lifecycle with graceful shutdown

This enables persistent OAuth sessions with secure token storage,
reducing the need for frequent re-authentication from 7 to 30 days.
2025-10-26 02:32:10 +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
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
06fb2d5b89 docs: standardize health endpoint; document admin ACL and routes; add staticcheck guidance and target 2025-09-26 23:32:20 +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
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
632ed6f1c2 fix: ED25519 format from install script 2025-09-10 21:13:51 +02:00
Benjamin
6e828a98ba fix: bad delimiter for sed on install script 2025-09-10 20:11:33 +02:00
Benjamin
6608bd7dc2 feat: add install script 2025-09-10 20:03:24 +02:00