Commit Graph

197 Commits

Author SHA1 Message Date
Benjamin
f65ebb0b07 feat: on-click deploy on elestio, render or digitalocean 2026-01-19 00:19:48 +01:00
Benjamin
de1d9cd5e5 doc: add missing env to .env.example 2026-01-19 00:10:12 +01:00
Benjamin
998d227898 refacto(backend): cleaning dead code 2026-01-17 01:49:41 +01:00
Benjamin
493d915fa7 refactor(server): encapsulate service initialization in ServerBuilder
Move all service creation (I18n, Email, MagicLink, Session, Config)
from main.go into ServerBuilder.Build(), making main.go minimal and
self-contained.

- ServerBuilder now only requires WithDB() and WithTenantProvider()
- AuthProvider and Authorizer have sensible CE defaults
- Rename DynamicAuthProvider → auth.Provider for simplicity
- Remove unused With* methods for internal services
2026-01-16 14:43:58 +01:00
Benjamin
b0ef28b0ae refactor(config): replace window variables with /api/v1/config endpoint
- Add new config handler to serve public app configuration
- Create Pinia config store to load and cache configuration
- Remove window variable injection from static.go and index.html
- Update all components to use config store instead of window vars
- Remove deprecated /api/v1/auth/config endpoint (merged into /config)
- Update Cypress tests with proper type annotations
2026-01-16 01:04:53 +01:00
Benjamin
421ffb3288 refacto: mv internal/domain/models/ → pkg/models/ 2026-01-15 16:16:56 +01:00
Benjamin
c4133c4017 test(cypress): update embed page tests for i18n changes
Update test assertions to match new terminology:
- "Sign this document" → "Confirm this document"
- "No signatures" → "No confirmations"
2026-01-15 15:45:37 +01:00
Benjamin
50fcd815ec feat(webapp): improve error handling with translated messages
- Add extractErrorDetails() to get both error code and message
- Use error codes to show appropriate translated messages in DocumentCreateForm
- Add translation keys for auth and permission errors
2026-01-15 15:45:31 +01:00
Benjamin
7689c26608 refactor(auth): load auth config from API instead of window variables
Replace static window variables (ACKIFY_OAUTH_ENABLED, ACKIFY_MAGICLINK_ENABLED)
with dynamic API call to /api/v1/auth/config. This allows auth methods to be
changed without rebuilding the frontend and supports dynamic tenant configuration.
2026-01-15 15:45:26 +01:00
Benjamin
ab3818146d feat(storage): auto-create S3 bucket if it doesn't exist
Instead of failing when bucket doesn't exist, attempt to create it.
This improves the initial setup experience with MinIO and other S3
compatible storage providers.
2026-01-15 15:45:21 +01:00
Benjamin
393fc1c984 refactor(db): remove unused admin_repository and fix signature test
- Remove admin_repository.go which was not RLS-compliant and unused
- Add missing UserEmail field in signature test fixtures
2026-01-15 15:45:15 +01:00
Benjamin
dbd667dea6 fix(db): use dbctx.GetQuerier in MagicLinkRepository for RLS support
MagicLinkRepository was bypassing RLS by using r.db directly instead of
dbctx.GetQuerier(ctx, r.db). This meant queries ran outside the
transaction with app.tenant_id set, causing RLS policies to not apply.

All methods now use dbctx.GetQuerier to properly participate in the
RLS transaction context.
2026-01-15 15:44:03 +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
fb33fd424d refactor: consolidate dependency injection and improve auth architecture
- Move service initialization (MagicLink, Email, i18n) to main.go
- Change signature lookup from user_sub to email for cross-auth consistency
- Remove OauthService wrapper, simplify auth layer
- Pass parent context to workers for graceful shutdown
- Fix IP extraction from RemoteAddr with port
- Add compact mode to SignatureList component
- Update Cypress tests with new data-testid attributes
2026-01-14 12:34:11 +01:00
Benjamin
2d78294f55 refactor(auth): unify AuthProvider interface with dynamic config support
- Create unified AuthProvider interface in pkg/providers/interfaces.go
  supporting OIDC, MagicLink, and session management
- Implement DynamicAuthProvider that reads config from ConfigService
  on each request, enabling hot-reload of auth settings
- Simplify ServerBuilder by removing separate oauthProvider and flags
- Consolidate auth handlers into single handler.go using unified interface
- Remove obsolete providers (oauth_provider.go, magiclink_provider.go)
- Remove separate magic_link_handler.go and reminder_auth_handler.go
- Update tests with new mockAuthProvider implementing full interface
- Fix config_service_test.go SMTP validation (requires Host + From)
2026-01-13 08:59:20 +01:00
Benjamin
9b28f78ce9 feat(admin): add tenant configuration UI with hot-reload support
Add admin settings page allowing runtime configuration of:
- SMTP settings with connection testing
- OIDC/OAuth2 authentication with validation
- S3 storage configuration with connectivity check

Backend includes config service with atomic hot-reload,
encrypted secrets storage, and environment seeding on startup.
2026-01-12 22:46:04 +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
c887305b7a feat: improve e2e with data-testid for futur ui evolution 2025-12-29 21:52:13 +01:00
Benjamin
29d8012c22 feat: improvement of user name display 2025-12-29 16:00:25 +01:00
Benjamin
c2c096dd3c wip 2025-12-27 22:16:54 +01:00
Benjamin
e4521d87c7 feat(webapp): UI redesign with Technical Trust design system
- New design system (IBM Plex fonts, slate palette, dark mode)
- Complete refactor of components and pages
- Add favicon, PWA icons and new logo
- Minor fixes (null handling, translations, navigation)
2025-12-23 11:31:16 +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
bc53b3ece9 feat: add anonymous telemetry for usage metrics
- Integrate SHM SDK (v1.2.0) to collect anonymous usage statistics
- Track documents, confirmations, webhooks and reminders count
- Add ACKIFY_TELEMETRY env var (disabled by default, opt-in)
2025-12-22 19:04:32 +01:00
Benjamin
296c06f374 docs: update examples 2025-12-20 10:11:54 +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
32c5fef0a5 Merge branch 'main' into feat/telemetry 2025-12-18 18:02:01 +01:00
Benjamin
cd0b751966 fix: ensures the SessionService is created whenever ANY authentication method is enabled. v1.2.8 2025-12-18 11:44:10 +01:00
Benjamin
41881c02b5 wip 2025-12-18 11:43:05 +01:00
Benjamin
600d709834 fix: missing ci ackify_app role creation 2025-12-16 00:43:52 +01:00
Benjamin
19cda55de9 fix: missing ci ackify_app role creation 2025-12-16 00:25:20 +01:00
Benjamin
44431dabf4 feat(rls): move ackify_app role creation from init script to migrate tool
BREAKING CHANGE: ACKIFY_APP_PASSWORD environment variable is now required for RLS support. The migrate tool creates the ackify_app role before running migrations, ensuring compatibility with existing deployments.

Changes:
- Add ensureAppRole() in cmd/migrate to create/update ackify_app role
- Remove docker/init-scripts/01-create-app-user.sh (no longer needed)
- Update compose.yml: add ACKIFY_APP_PASSWORD, backend connects as ackify_app
- Update migration 0016: remove conditional role creation
- Add RLS documentation (docs/en/configuration/rls.md, docs/fr/configuration/rls.md)
- Update configuration docs with RLS section and security checklist

Migration path for existing deployments:
1. Set ACKIFY_APP_PASSWORD in .env
2. Run docker compose up (migrate will create the role automatically)
2025-12-15 23:59:06 +01:00
Benjamin
eca55c6bcb refactor(go): restore go.mod (and sum) on project root
and restore missing cypress tests
v1.2.6 v1.2.7
2025-12-10 16:29:00 +01:00
Benjamin
5f05ef2b7e refactor(go): rename module to github.com/btouchard/ackify-ce/backend
Enable importing backend packages in other project by aligning module path with its location in the repository.
2025-12-08 19:02:39 +01:00
Benjamin
ab6cdbb383 refactor(go): rename module to github.com/btouchard/ackify-ce/backend
Enable importing backend packages in SaaS project by aligning module
path with its location in the repository.
2025-12-08 19:01:28 +01:00
Benjamin
956192b946 fix(ci): build multi-plateforme linux/amd64,linux/arm64 QEMU 2025-12-08 16:58:29 +01:00
Benjamin
d2a4651ec7 fix(ci): go.mod moved to backend, so build is inside backend folder, not at root 2025-12-08 16:42:42 +01:00
Benjamin
9b7a289a2e fix: remove invalid coreapp from merge 2025-12-08 16:31:37 +01:00
Benjamin
02b2ed0bb5 fix(merge): resolve conflits 2025-12-08 16:13:10 +01:00
Benjamin
24e2de2922 refactor(arch): enforce strict layered architecture with private interfaces
Apply Clean Architecture principles throughout the codebase to eliminate tight coupling between layers. Handlers now depend exclusively on services through private interfaces, never directly on repositories.
Introduce a ServerBuilder pattern with pluggable capability providers.

refactor(auth): introduce injectable AuthorizerService

Replace hardcoded AdminEmails and OnlyAdminCanCreate config fields
with an injectable AuthorizerService. This improves testability and
follows the dependency injection pattern used elsewhere in the codebase.

- Create AuthorizerService in application/services/
- Define minimal Authorizer interfaces in consuming packages
- Update middleware, handlers, and router to use injected authorizer
- Update all affected tests with mock implementations

refactor(build): move go.mod to backend directory
Move Go module files from project root to backend/ directory while keeping the module name as github.com/btouchard/ackify-ce.
This improves project structure by keeping Go-specific files within the Go codebase directory.

# Conflicts:
#	backend/internal/application/services/checksum_service_test.go
#	backend/internal/application/services/document_service.go
#	backend/internal/application/services/document_service_duplicate_test.go
#	backend/internal/application/services/document_service_test.go
#	backend/internal/presentation/api/documents/handler.go
#	backend/internal/presentation/api/documents/handler_test.go
#	backend/internal/presentation/api/router.go
#	backend/pkg/web/server.go
2025-12-08 16:07:03 +01:00
Benjamin
1b108ed874 refacto(backend): extract coreapp packages for DI and authorization
- Add pkg/coreapp/ with service interfaces and dependency injection
- Add DocumentAuthorizer for document access control
- Add ExpectedSignerService for expected signers management
- Simplify router and handlers by using coreapp dependencies
2025-12-04 15:19:01 +01:00
Benjamin
796d327442 feat(tenant): add tenant support
- Add instance_metadata table with unique UUID per instance
- Add tenant_id column to all business tables (documents, signatures, expected_signers, webhooks, reminder_logs, email_queue, checksum_verifications, webhook_deliveries)
- Backfill existing data with instance tenant UUID
- Create TenantProvider interface and SingleTenantProvider implementation
- Update all repositories to filter by tenant_id
- Add immutability triggers to prevent tenant_id modification after creation

Migration 0015 includes:
- Schema changes with indexes for tenant_id columns
- SQL backfill for existing data
- Trigger functions for data integrity
2025-12-03 23:46:09 +01:00
Benjamin
249849b3ed feat(tenant): add tenant support
- Add instance_metadata table with unique UUID per instance
- Add tenant_id column to all business tables (documents, signatures, expected_signers, webhooks, reminder_logs, email_queue, checksum_verifications, webhook_deliveries)
- Backfill existing data with instance tenant UUID
- Create TenantProvider interface and SingleTenantProvider implementation
- Update all repositories to filter by tenant_id
- Add immutability triggers to prevent tenant_id modification after creation

Migration 0015 includes:
- Schema changes with indexes for tenant_id columns
- SQL backfill for existing data
- Trigger functions for data integrity
2025-12-03 22:24:12 +01:00
Benjamin
6d2dd8b000 feat(e2e): fix 05-document-creation-by-url 2025-12-03 13:54:22 +01:00
Benjamin
686edc6123 feat(mail): fix mail suject alway in english, now is based on i18n 2025-12-03 12:21:44 +01:00
Benjamin
aa002f824c feat(db): improve db migrations system with force & goto command (for existing db without migration schema) 2025-12-03 11:01:23 +01:00