Files
autocrm/.env.example
T
Vasyka c413004930 Stage 15 — PWA complete: install prompt + Web Push notifications
Dependency:
- minishlink/web-push v10 (VAPID JWT + aes128gcm payload encryption)
- Dockerfile: add curl, mbstring, gmp extensions (web-push needs ext-curl)

VAPID:
- config/webpush.php from env; `php artisan push:vapid` generates keypair
- Shared platform keypair; .env.example has empty placeholders

Schema:
- push_subscriptions (user/company, endpoint unique, p256dh, auth, encoding)

WebPushService:
- send / sendToUser / dispatch via WebPush::flush
- Auto-prunes subscriptions reported expired (404/410)

Subscribe flow:
- POST /push/subscribe + /push/unsubscribe (auth, tenant)
- Tenant panel JS subscribes after SW registration with VAPID public key

Service worker (/sw.js):
- Cache v2, push listener → showNotification, notificationclick → focus/open

Install prompt:
- Floating "Instalează aplicația" button wired to beforeinstallprompt

Staff push:
- WorkOrder master_id change → push to assigned mechanic
- Settings "Test notificare push" action

Tests (6 new):
- subscribe stores + upserts; requires auth (401); validation (422);
  service configured; sendToUser with no subs returns zero

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-28 05:11:18 +00:00

78 lines
1.4 KiB
Bash

APP_NAME=AutoCRM
APP_ENV=production
APP_KEY=
APP_DEBUG=false
APP_TIMEZONE=Europe/Chisinau
APP_URL=https://service.mir.md
# Multi-tenant
CENTRAL_DOMAIN=service.mir.md
APP_LOCALE=ro
APP_FALLBACK_LOCALE=en
APP_FAKER_LOCALE=ro_RO
APP_MAINTENANCE_DRIVER=file
LOG_CHANNEL=stack
LOG_STACK=daily
LOG_LEVEL=info
LOG_DEPRECATIONS_CHANNEL=null
# DB — completate la deploy din Coolify
DB_CONNECTION=mariadb
DB_HOST=g5au90p05p2grua61up8cz8v
DB_PORT=3306
DB_DATABASE=default
DB_USERNAME=mariadb
DB_PASSWORD=
# Sesiuni / Cache / Queue → Redis
SESSION_DRIVER=redis
SESSION_LIFETIME=120
SESSION_DOMAIN=null
SESSION_SECURE_COOKIE=true
SESSION_SAME_SITE=lax
CACHE_STORE=redis
CACHE_PREFIX=autocrm
QUEUE_CONNECTION=redis
REDIS_CLIENT=phpredis
REDIS_HOST=z3jdc302kml28j8gjgq8sb74
REDIS_PORT=6379
REDIS_PASSWORD=
REDIS_DB=0
# Broadcasting (Reverb — adăugăm la nevoie)
BROADCAST_CONNECTION=log
# Mail — Mailpit intern
MAIL_MAILER=smtp
MAIL_HOST=autocrm-mailpit
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS="noreply@service.mir.md"
MAIL_FROM_NAME="${APP_NAME}"
# Web Push (VAPID) — generate with: php artisan push:vapid
VAPID_SUBJECT=mailto:admin@service.mir.md
VAPID_PUBLIC_KEY=
VAPID_PRIVATE_KEY=
# Storage — local pentru MVP, S3-compatible mai târziu
FILESYSTEM_DISK=local
# Octane
OCTANE_SERVER=frankenphp
# Misc
BCRYPT_ROUNDS=12
VITE_APP_NAME="${APP_NAME}"
# Boot
RUN_MIGRATIONS=true