 cd /var/www/vigilanza-turni
git pull origin main
npm run build
remote: Enumerating objects: 12, done.
remote: Counting objects: 100% (12/12), done.
remote: Compressing objects: 100% (7/7), done.
remote: Total 7 (delta 5), reused 0 (delta 0), pack-reused 0 (from 0)
Unpacking objects: 100% (7/7), 4.43 KiB | 756.00 KiB/s, done.
From https://git.alfacom.it/marco/VigilanzaTurni
 * branch            main       -> FETCH_HEAD
   51a2eec..b5008a9  main       -> origin/main
Updating 51a2eec..b5008a9
Fast-forward
 .replit                                                                    |   4 -
 ...done-remote-Counting-objects-100-19-19--1760633252233_1760633252233.txt | 140 ++++++++++++++++++++++++++++++++++
 server/localAuth.ts                                                        |  28 +++++--
 3 files changed, 163 insertions(+), 9 deletions(-)
 create mode 100644 attached_assets/Pasted-git-pull-origin-main-remote-Enumerating-objects-19-done-remote-Counting-objects-100-19-19--1760633252233_1760633252233.txt

> rest-express@1.0.0 build
> vite build && esbuild server/index.ts --platform=node --packages=external --bundle --format=esm --outdir=dist

vite v5.4.20 building for production...
transforming (3) src/main.tsxBrowserslist: browsers data (caniuse-lite) is 12 months old. Please run:
  npx update-browserslist-db@latest
  Why you should do it regularly: https://github.com/browserslist/update-db#readme
transforming (4) src/App.tsx
A PostCSS plugin did not pass the `from` option to `postcss.parse`. This may cause imported assets to be incorrectly
transformed. If you've recently added a PostCSS plugin that raised this warning, please contact the package author to fix the issue.
✓ 2673 modules transformed.
../dist/public/index.html                   1.49 kB │ gzip:   0.63 kB
../dist/public/assets/index-DdJrKUWT.css   75.43 kB │ gzip:  12.17 kB
../dist/public/assets/index-C9iY8fDP.js   590.69 kB │ gzip: 173.23 kB

(!) Some chunks are larger than 500 kB after minification. Consider:
- Using dynamic import() to code-split the application
- Use build.rollupOptions.output.manualChunks to improve chunking: https://rollupjs.org/configuration-options/#output-manualchunks
- Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.
✓ built in 9.07s

  dist/index.js  62.0kb

⚡ Done in 15ms
[root@localhost vigilanza-turni]# pm2 restart vigilanza-turni
Use --update-env to update environment variables
[PM2] Applying action restartProcessId on app [vigilanza-turni](ids: [ 0 ])
[PM2] [vigilanza-turni](0) ✓
┌────┬────────────────────┬──────────┬──────┬───────────┬──────────┬──────────┐
│ id │ name               │ mode     │ ↺    │ status    │ cpu      │ memory   │
├────┼────────────────────┼──────────┼──────┼───────────┼──────────┼──────────┤
│ 0  │ vigilanza-turni    │ fork     │ 4    │ online    │ 0%       │ 12.6mb   │
└────┴────────────────────┴──────────┴──────┴───────────┴──────────┴──────────┘
[root@localhost vigilanza-turni]# pm2 logs vigilanza-turni --lines 50 --nostream
[TAILING] Tailing last 50 lines for [vigilanza-turni] process (change the value with --lines option)
/root/.pm2/logs/vigilanza-turni-error.log last 50 lines:
0|vigilanz |     _errorEmitted: true,
0|vigilanz |     _extensions: {},
0|vigilanz |     _paused: false,
0|vigilanz |     _protocol: '',
0|vigilanz |     _readyState: 3,
0|vigilanz |     _receiver: null,
0|vigilanz |     _sender: null,
0|vigilanz |     _socket: null,
0|vigilanz |     _bufferedAmount: 0,
0|vigilanz |     _isServer: false,
0|vigilanz |     _redirects: 0,
0|vigilanz |     _autoPong: true,
0|vigilanz |     _url: 'wss://localhost/v2',
0|vigilanz |     _req: null,
0|vigilanz |     [Symbol(shapeMode)]: false,
0|vigilanz |     [Symbol(kCapture)]: false
0|vigilanz |   },
0|vigilanz |   [Symbol(kType)]: 'error',
0|vigilanz |   [Symbol(kError)]: Error [ERR_TLS_CERT_ALTNAME_INVALID]: Hostname/IP does not match certificate's altnames: Host: localhost. is not in the cert's altnames: DNS:vt.alfacom.it
0|vigilanz |       at Object.checkServerIdentity (node:tls:316:12)
0|vigilanz |       at TLSSocket.onConnectSecure (node:_tls_wrap:1687:27)
0|vigilanz |       at TLSSocket.emit (node:events:524:28)
0|vigilanz |       at TLSSocket._finishInit (node:_tls_wrap:1076:8)
0|vigilanz |       at ssl.onhandshakedone (node:_tls_wrap:862:12) {
0|vigilanz |     code: 'ERR_TLS_CERT_ALTNAME_INVALID',
0|vigilanz |     reason: "Host: localhost. is not in the cert's altnames: DNS:vt.alfacom.it",
0|vigilanz |     host: 'localhost',
0|vigilanz |     cert: {
0|vigilanz |       subject: [Object: null prototype],
0|vigilanz |       issuer: [Object: null prototype],
0|vigilanz |       subjectaltname: 'DNS:vt.alfacom.it',
0|vigilanz |       infoAccess: [Object: null prototype],
0|vigilanz |       ca: false,
0|vigilanz |       bits: 256,
0|vigilanz |       pubkey: <Buffer 04 1f 47 37 77 2f 24 97 69 bf 9b 69 2c 6f f1 94 ea 66 2a 19 e8 89 2c 5b 59 ca 44 8f 3f 04 9f c9 ff f3 47 fa 2b 72 43 d9 66 11 90 31 04 31 fb 82 22 4c ... 15 more bytes>,
0|vigilanz |       asn1Curve: 'prime256v1',
0|vigilanz |       nistCurve: 'P-256',
0|vigilanz |       valid_from: 'Oct 16 07:57:48 2025 GMT',
0|vigilanz |       valid_to: 'Jan 14 07:57:47 2026 GMT',
0|vigilanz |       fingerprint: 'D0:77:49:94:D8:06:A7:C5:EC:21:74:C6:B3:F5:42:48:96:77:46:28',
0|vigilanz |       fingerprint256: '8B:D9:F6:31:F4:0A:65:53:B7:69:ED:4C:8C:B9:D5:92:91:81:56:B2:33:B5:0E:F1:8A:E3:FC:BA:EB:12:87:D0',
0|vigilanz |       fingerprint512: '9A:1A:04:0D:E2:CE:78:E3:52:9F:6E:1C:25:95:95:FF:C9:7C:62:C6:D6:98:CA:E8:59:5C:01:0A:5F:A5:C2:43:50:77:10:2E:07:CB:7B:F3:C9:DE:39:37:A5:54:86:FD:C7:0F:02:DF:F6:E7:C8:BB:BA:BE:FB:79:AE:77:76:59',
0|vigilanz |       ext_key_usage: [Array],
0|vigilanz |       serialNumber: '068FB11FEDA957005036401D5EBC8CB8BD43',
0|vigilanz |       raw: <Buffer 30 82 03 87 30 82 03 0c a0 03 02 01 02 02 12 06 8f b1 1f ed a9 57 00 50 36 40 1d 5e bc 8c b8 bd 43 30 0a 06 08 2a 86 48 ce 3d 04 03 03 30 32 31 0b 30 ... 857 more bytes>,
0|vigilanz |       issuerCertificate: [Object]
0|vigilanz |     }
0|vigilanz |   },
0|vigilanz |   [Symbol(kMessage)]: "Hostname/IP does not match certificate's altnames: Host: localhost. is not in the cert's altnames: DNS:vt.alfacom.it"
0|vigilanz | }

/root/.pm2/logs/vigilanza-turni-out.log last 50 lines:
0|vigilanz | > rest-express@1.0.0 start
0|vigilanz | > NODE_ENV=production node dist/index.js
0|vigilanz |
0|vigilanz | 12:26:08 PM [express] serving on port 5000
0|vigilanz |
0|vigilanz | > rest-express@1.0.0 start
0|vigilanz | > NODE_ENV=production node dist/index.js
0|vigilanz |
0|vigilanz | 12:31:17 PM [express] serving on port 5000
0|vigilanz |
0|vigilanz | > rest-express@1.0.0 start
0|vigilanz | > NODE_ENV=production node dist/index.js
0|vigilanz |
0|vigilanz | 12:35:39 PM [express] serving on port 5000
0|vigilanz |
0|vigilanz | > rest-express@1.0.0 start
0|vigilanz | > NODE_ENV=production node dist/index.js
0|vigilanz |
0|vigilanz | 12:37:02 PM [express] serving on port 5000
0|vigilanz | 12:37:32 PM [express] GET /api/auth/user 401 in 7ms :: {"message":"Unauthorized"}
0|vigilanz | 12:37:33 PM [express] GET /api/login 302 in 59ms
0|vigilanz | 12:37:38 PM [express] GET /api/login 302 in 11ms
0|vigilanz | 12:37:43 PM [express] GET /api/auth/user 401 in 7ms :: {"message":"Unauthorized"}
0|vigilanz | 12:37:45 PM [express] GET /api/login 302 in 9ms
0|vigilanz | 12:38:13 PM [express] GET /api/login 302 in 35ms
0|vigilanz | 12:38:48 PM [express] GET /api/login 302 in 31ms
0|vigilanz |
0|vigilanz | > rest-express@1.0.0 start
0|vigilanz | > NODE_ENV=production node dist/index.js
0|vigilanz |
0|vigilanz |  Usando Local Auth (vt.alfacom.it)
0|vigilanz | ✅ [LocalAuth] Sistema autenticazione locale attivato
0|vigilanz |  Email admin: admin@vt.alfacom.it
0|vigilanz |  Password admin: admin123
0|vigilanz |  Auto-login: GET /api/auto-login-admin
0|vigilanz | 12:46:18 PM [express] serving on port 5000
0|vigilanz | 12:46:42 PM [express] GET /api/auth/user 401 in 12ms :: {"message":"Unauthorized"}
0|vigilanz | 12:46:43 PM [express] GET /api/login 200 in 9ms
0|vigilanz | 12:46:43 PM [express] GET /api/auth/user 401 in 8ms :: {"message":"Unauthorized"}
0|vigilanz | 12:46:58 PM [express] GET /api/auto-login-admin 500 in 48ms :: {"error":"Errore server"}
0|vigilanz |
0|vigilanz | > rest-express@1.0.0 start
0|vigilanz | > NODE_ENV=production node dist/index.js
0|vigilanz |
0|vigilanz |  Usando Local Auth (vt.alfacom.it)
0|vigilanz | ✅ [LocalAuth] Sistema autenticazione locale attivato
0|vigilanz |  Email admin: admin@vt.alfacom.it
0|vigilanz |  Password admin: admin123
0|vigilanz |  Auto-login: GET /api/auto-login-admin
0|vigilanz | 12:52:28 PM [express] serving on port 5000

[root@localhost vigilanza-turni]#                    