Introduction
This article describe Proxy activation so SYSTRAN can pull TR from the Translation Resource Store. This works if Proxy allows tunneling connection.
Procedure
1) Update TRSL services with proxy:
Service file to update are:
/usr/lib/systemd/system/systran-trs-console.service
/usr/lib/systemd/system/systran-trs-poller.service
For each file add the following information in the [Service] section
Environment=HTTPS_PROXY=https://Proxy:Proxy_port
Config file should look like:
[Unit]
Description=Systran Translation Resource Store is node js server web
After=network.target
[Service]
Type=simple
User=systran
WorkingDirectory=/opt/systran/apps-node/translation-resource-store
ExecStart=/usr/bin/node trs-console.js
LimitNOFILE=16384
Environment=HTTPS_PROXY=https://proxy:8080
Restart=on-failure
RestartSec=1s
SyslogIdentifier=systran-trs-console
StandardOutput=journal
StandardError=journal
[Install]
WantedBy=multi-user.target
RequiredBy=systran-translation-resource-store.target
2) Restart TRS services
First relaod deamon files:
systemctl daemon-reload
Then restart services:
systemctl restart systran-trs-console
systemctl restart systran-trs-poller
3) Monitor log files
journalctl -f -u systran-trs\*
4) Certificates using company CA
nodeJS embed public common CA. To add your company CA, follow the steps below. If your CA is not properly configured, the following error will be displayed:
Nov 29 10:46:23 systran systran-trs-console[8879]: [Master - 8879] 2022-11-29T09:46:23.447Z - error: downloadLocal
Nov 29 10:46:23 systran systran-trs-console[8879]: { message: 'unable to get local issuer certificate',
Nov 29 10:46:23 systran systran-trs-console[8879]: stack:
Nov 29 10:46:23 systran systran-trs-console[8879]: 'Error: unable to get local issuer certificate\n at TLSSocket.onConnectSecure (_tls_wrap.js:1058:34)\n at TLSSocket.emit (events.js:198:13)\n at TLSSocket.EventEmitter.emit (domain.js:448:20)\n at TLSSocket._finishInit (_tls_wrap.js:636:8)',
Nov 29 10:46:23 systran systran-trs-console[8879]: code: 'UNABLE_TO_GET_ISSUER_CERT_LOCALLY' }
Nov 29 10:46:23 systran systran-trs-console[8879]: ::ffff:127.0.0.1 - - [29/Nov/2022:09:46:23 +0000] "GET /api/translationResource/download/851b1e2e-fac2-490a-ba3d-5cc3195b1360 HTTP/1.1" 500 50 "-" "python-requests/2.6.0 CPython/2.7.5 Linux/3.10.0-1160.el7.x86_64"
Nov 29 10:46:24 systran systran-trs-console[8879]: [Master - 8879] 2022-11-29T09:46:24.257Z - error: Downloading from TRS Cloud to backendStorage 448436f5-195b-4ef9-80c7-9cd1fd11c5d6
To configure your CA, please add in the 2 files from paragraph 1) above, in the "[Service]" part :
[Service]
...
Environment="NODE_EXTRA_CA_CERTS=/opt/systran/certs/customCA.pem"
...
Restart the 2 services and retest :
systemctl daemon-reload
systemctl restart systran-trs-console
systemctl restart systran-trs-poller