gigafibre-fsm/scripts/migration
louispaulb 1b7bad1686 security: harden payments/hub auth + remove leaked ERPNext token from source
Auth hardening:
- payments: per-customer JWT authorization on dual-use /payments routes
  (balance/methods/invoice/checkout/setup/portal/toggle-ppa) via authorizeCustomer
  + PAYMENTS_AUTH=enforce; portal retains+sends magic-link JWT (sessionStorage)
- hub: fail-closed Stripe webhook, /accept/doc-pdf IDOR gate, telephony field-name
  guard (SQLi), modem-bridge private-IP guard (SSRF), ALWAYS_ENFORCE expansion

Leaked-credential cleanup (token already rotated in ERPNext):
- de-hardcode ERPNext API token -> env in bulk_submit.py, import_items.py,
  apps/client/deploy.sh; placeholder in apps/ops/infra/nginx.conf (nginx injects)
- ops prod build no longer bakes VITE_ERP_TOKEN (.env.production empty)
- de-hardcode legacy DB password -> env in import_items.py
- gitignore legacy migration PII exports (tsv/json)

Conversations/UI:
- floating (un-docked) conversation panel; full-width mailbox
- per-message real sender from email headers; unified scroll; header spacing
- campaign pre-send review (subject/from/channel), Gmail send channel, clone-as-draft

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-16 06:17:17 -04:00
..
genieacs-export feat: extract GenieACS WiFi/VoIP provisioning data from MariaDB 2026-04-03 08:49:26 -04:00
add_missing_custom_fields.py feat: ONT diagnostics — grouped mesh topology, signal RSSI, management link 2026-04-03 21:26:14 -04:00
add_office_extension.py refactor: reduce token count, DRY code, consolidate docs 2026-04-13 08:39:58 -04:00
add_performance_indexes.sql feat: telephony UI, performance indexes, Twilio softphone, lazy-load invoices 2026-04-02 13:59:59 -04:00
analyze_pricing_cleanup.py refactor: reduce token count, DRY code, consolidate docs 2026-04-13 08:39:58 -04:00
backfill_dispatch_address.sql feat(dispatch): pont d'écriture legacy + adresses/coords/carte/UX Planification 2026-06-07 22:32:00 -04:00
camping_dispatch_backfill.sql Pont : géoloc camping (fixe) sur les Dispatch Jobs — l'adresse de service ≠ résidence du client 2026-06-07 17:30:11 -04:00
camping_registry.sql Campings : registre + géoloc de remplacement FIXE sur tous les lots (1405 corrigés) 2026-06-07 17:04:03 -04:00
check_gl_dates.py refactor: reduce token count, DRY code, consolidate docs 2026-04-13 08:39:58 -04:00
check_items.py refactor: reduce token count, DRY code, consolidate docs 2026-04-13 08:39:58 -04:00
check_missing_cat26.py refactor: reduce token count, DRY code, consolidate docs 2026-04-13 08:39:58 -04:00
check_naming.py refactor: reduce token count, DRY code, consolidate docs 2026-04-13 08:39:58 -04:00
clean_reimport.py feat: flow editor, Gemini QR scanner with offline queue, dispatch planning v2 2026-04-22 10:44:17 -04:00
cleanup_customer_status.py feat: inline editing, search, notifications + full repo cleanup 2026-03-31 07:34:41 -04:00
create_custom_doctypes.py refactor: reduce token count, DRY code, consolidate docs 2026-04-13 08:39:58 -04:00
create_portal_users.py refactor: reduce token count, DRY code, consolidate docs 2026-04-13 08:39:58 -04:00
debug_idx.py refactor: reduce token count, DRY code, consolidate docs 2026-04-13 08:39:58 -04:00
debug_match.py refactor: reduce token count, DRY code, consolidate docs 2026-04-13 08:39:58 -04:00
debug_match2.py refactor: reduce token count, DRY code, consolidate docs 2026-04-13 08:39:58 -04:00
diag_dispatch_addr.sql feat(dispatch): pont d'écriture legacy + adresses/coords/carte/UX Planification 2026-06-07 22:32:00 -04:00
diag_dispatch_addr2.sql feat(dispatch): pont d'écriture legacy + adresses/coords/carte/UX Planification 2026-06-07 22:32:00 -04:00
explore_expro_payments.py refactor: reduce token count, DRY code, consolidate docs 2026-04-13 08:39:58 -04:00
explore_expro_services.py refactor: reduce token count, DRY code, consolidate docs 2026-04-13 08:39:58 -04:00
export_genieacs.sh feat: GenieACS config export + TR-069 to TR-369 migration plan 2026-04-02 21:03:41 -04:00
fix_and_invoices.py refactor: reduce token count, DRY code, consolidate docs 2026-04-13 08:39:58 -04:00
fix_annual_billing_dates.py refactor: reduce token count, DRY code, consolidate docs 2026-04-13 08:39:58 -04:00
fix_customer_links.py refactor: reduce token count, DRY code, consolidate docs 2026-04-13 08:39:58 -04:00
fix_dates.py refactor: reduce token count, DRY code, consolidate docs 2026-04-13 08:39:58 -04:00
fix_gl_entries.py refactor: reduce token count, DRY code, consolidate docs 2026-04-13 08:39:58 -04:00
fix_income_accounts.py refactor: reduce token count, DRY code, consolidate docs 2026-04-13 08:39:58 -04:00
fix_income_sql.py refactor: reduce token count, DRY code, consolidate docs 2026-04-13 08:39:58 -04:00
fix_invoice_customer_names.py refactor: reduce token count, DRY code, consolidate docs 2026-04-13 08:39:58 -04:00
fix_invoice_outstanding.py refactor: reduce token count, DRY code, consolidate docs 2026-04-13 08:39:58 -04:00
fix_issue_cust2.py refactor: reduce token count, DRY code, consolidate docs 2026-04-13 08:39:58 -04:00
fix_issue_owners.py refactor: reduce token count, DRY code, consolidate docs 2026-04-13 08:39:58 -04:00
fix_no_rebate_discounts.py refactor: reduce token count, DRY code, consolidate docs 2026-04-13 08:39:58 -04:00
fix_olt_port_ip.py refactor: major cleanup — remove dead dispatch app, commit all backend code, extract client composables 2026-04-08 17:38:38 -04:00
fix_reversals.py refactor: reduce token count, DRY code, consolidate docs 2026-04-13 08:39:58 -04:00
fix_reversement.py refactor: reduce token count, DRY code, consolidate docs 2026-04-13 08:39:58 -04:00
fix_sub_address.py refactor: reduce token count, DRY code, consolidate docs 2026-04-13 08:39:58 -04:00
fix_subscription_details.py refactor: reduce token count, DRY code, consolidate docs 2026-04-13 08:39:58 -04:00
geocode_locations.py feat: inline editing, search, notifications + full repo cleanup 2026-03-31 07:34:41 -04:00
import_customer_details.py refactor: reduce token count, DRY code, consolidate docs 2026-04-13 08:39:58 -04:00
import_devices_and_enrich.py refactor: reduce token count, DRY code, consolidate docs 2026-04-13 08:39:58 -04:00
import_employees.py refactor: reduce token count, DRY code, consolidate docs 2026-04-13 08:39:58 -04:00
import_expro_payments.py refactor: reduce token count, DRY code, consolidate docs 2026-04-13 08:39:58 -04:00
import_invoice_notes.py refactor: reduce token count, DRY code, consolidate docs 2026-04-13 08:39:58 -04:00
import_invoices.py feat: flow editor, Gemini QR scanner with offline queue, dispatch planning v2 2026-04-22 10:44:17 -04:00
import_items.py security: harden payments/hub auth + remove leaked ERPNext token from source 2026-06-16 06:17:17 -04:00
import_memos.py refactor: reduce token count, DRY code, consolidate docs 2026-04-13 08:39:58 -04:00
import_missing_services.py refactor: reduce token count, DRY code, consolidate docs 2026-04-13 08:39:58 -04:00
import_payment_arrangements.py refactor: reduce token count, DRY code, consolidate docs 2026-04-13 08:39:58 -04:00
import_payment_methods.py refactor: reduce token count, DRY code, consolidate docs 2026-04-13 08:39:58 -04:00
import_payments.py refactor: reduce token count, DRY code, consolidate docs 2026-04-13 08:39:58 -04:00
import_services_and_enrich_customers.py refactor: reduce token count, DRY code, consolidate docs 2026-04-13 08:39:58 -04:00
import_soumissions.py refactor: reduce token count, DRY code, consolidate docs 2026-04-13 08:39:58 -04:00
import_suspensions.py refactor: reduce token count, DRY code, consolidate docs 2026-04-13 08:39:58 -04:00
import_technicians.py feat: inline editing, search, notifications + full repo cleanup 2026-03-31 07:34:41 -04:00
import_terminated.py refactor: reduce token count, DRY code, consolidate docs 2026-04-13 08:39:58 -04:00
import_ticket_msgs.py refactor: reduce token count, DRY code, consolidate docs 2026-04-13 08:39:58 -04:00
import_voip_lines.py refactor: reduce token count, DRY code, consolidate docs 2026-04-13 08:39:58 -04:00
invoice_preview.jinja feat: flow editor, Gemini QR scanner with offline queue, dispatch planning v2 2026-04-22 10:44:17 -04:00
logo-targo-green.svg feat: flow editor, Gemini QR scanner with offline queue, dispatch planning v2 2026-04-22 10:44:17 -04:00
migrate_all.py refactor: reduce token count, DRY code, consolidate docs 2026-04-13 08:39:58 -04:00
migrate_direct.py refactor: reduce token count, DRY code, consolidate docs 2026-04-13 08:39:58 -04:00
migrate_locations.py fix(migration): clean address_line + postal_code + connection_type at import 2026-05-08 15:38:19 -04:00
migrate_missing_data.py refactor: reduce token count, DRY code, consolidate docs 2026-04-13 08:39:58 -04:00
migrate_phase3.py refactor: reduce token count, DRY code, consolidate docs 2026-04-13 08:39:58 -04:00
migrate_phase5.py refactor: reduce token count, DRY code, consolidate docs 2026-04-13 08:39:58 -04:00
migrate_provisioning_data.py refactor: reduce token count, DRY code, consolidate docs 2026-04-13 08:39:58 -04:00
migrate_tickets.py refactor: reduce token count, DRY code, consolidate docs 2026-04-13 08:39:58 -04:00
migrate_users.py refactor: reduce token count, DRY code, consolidate docs 2026-04-13 08:39:58 -04:00
MIGRATION_MAP.md refactor: reduce token count, DRY code, consolidate docs 2026-04-13 08:39:58 -04:00
normalize_service_locations_pass2.sql SL normalisation passe 2 : récupération GPS par numéro+ville (sans contrainte postale) 2026-06-06 16:19:37 -04:00
normalize_service_locations.sql Normalisation AQ des 17k Service Locations (lien RQA + statut, adresse originale préservée) 2026-06-06 15:59:21 -04:00
nuke_data.py feat: inline editing, search, notifications + full repo cleanup 2026-03-31 07:34:41 -04:00
reconcile_subscriptions.py feat: subscription reimport, customer/doctype ID rename, zero-padded format 2026-04-01 17:17:23 -04:00
reimport_payments.py refactor: reduce token count, DRY code, consolidate docs 2026-04-13 08:39:58 -04:00
reimport_subscriptions.py feat: telephony UI, performance indexes, Twilio softphone, lazy-load invoices 2026-04-02 13:59:59 -04:00
rename_all_doctypes.py feat: subscription reimport, customer/doctype ID rename, zero-padded format 2026-04-01 17:17:23 -04:00
rename_customers_c_prefix.py feat: telephony UI, performance indexes, Twilio softphone, lazy-load invoices 2026-04-02 13:59:59 -04:00
rename_customers.py feat: subscription reimport, customer/doctype ID rename, zero-padded format 2026-04-01 17:17:23 -04:00
rename_to_readable_ids.py feat: inline editing, search, notifications + full repo cleanup 2026-03-31 07:34:41 -04:00
setup_invoice_print_format.py feat: flow editor, Gemini QR scanner with offline queue, dispatch planning v2 2026-04-22 10:44:17 -04:00
setup_portal_auth_bridge.py feat: inline editing, search, notifications + full repo cleanup 2026-03-31 07:34:41 -04:00
setup_quote_print_format.py feat: flow editor, Gemini QR scanner with offline queue, dispatch planning v2 2026-04-22 10:44:17 -04:00
setup_scheduler_toggle.py feat: inline editing, search, notifications + full repo cleanup 2026-03-31 07:34:41 -04:00
setup_subscription_api.py feat: inline editing, search, notifications + full repo cleanup 2026-03-31 07:34:41 -04:00
setup_user_roles.py refactor: reduce token count, DRY code, consolidate docs 2026-04-13 08:39:58 -04:00
simulate_payment_import.py refactor: reduce token count, DRY code, consolidate docs 2026-04-13 08:39:58 -04:00
sync_invoices_incremental.py feat(fsm): platform build — comms UI, F→ERPNext sync/billing, roster, campaigns, network, reports 2026-06-15 06:12:12 -04:00
sync_services_incremental.py feat(fsm): platform build — comms UI, F→ERPNext sync/billing, roster, campaigns, network, reports 2026-06-15 06:12:12 -04:00
test_jinja_render.py feat: flow editor, Gemini QR scanner with offline queue, dispatch planning v2 2026-04-22 10:44:17 -04:00
update_assigned_staff.py refactor: reduce token count, DRY code, consolidate docs 2026-04-13 08:39:58 -04:00
update_item_descriptions.py refactor: reduce token count, DRY code, consolidate docs 2026-04-13 08:39:58 -04:00
update_opened_by_staff.py refactor: reduce token count, DRY code, consolidate docs 2026-04-13 08:39:58 -04:00