be360:ocme:frontend

This is an old revision of the document!


Operation

Server

Dedicated: WhatsappTemplates (ID: i-072df39da22f6bd3d)
Directories: /var/www/ocme
OS: *TO DO*
SSH login: admin@52.28.158.203
Hours of operation: 24/7


├── dist
├── node_modules
├── public
├── src
│   ├── assets
│   |   ├── aus.png
│   |   ├── bg.jpg
│   |   ├── bg.png
│   |   ├── bra.png
│   |   ├── eng.png
│   |   ├── fra.png
│   |   ├── ita.png
│   |   ├── mex.png
│   |   ├── sou.png
│   |   ├── spa.png
│   |   ├── tha.png
│   |   └── usa.png
│   ├── components
│   |   ├── InputPhone.jsx
│   |   ├── Message.jsx
│   |   ├── style.css
│   |   ├── Template.jsx
│   |   └── Title.jsx
|   ├── pages
│   |   ├── Aus.jsx
│   |   ├── Bra.jsx
│   |   ├── Debug.jsx
│   |   ├── Eng.jsx
│   |   ├── Fra.jsx
│   |   ├── Ita.jsx
│   |   ├── Mex.jsx
│   |   ├── Sou.jsx
│   |   ├── Spa.jsx
│   |   ├── Tha.jsx
│   |   └── Usa.jsx
|   ├── App.css
|   ├── App.jsx
|   ├── index.css
|   ├── lang.json
│   └── main.jsx
├── index.html
├── package.json
└── README.md
└── vite.config.js
└── yarn.lock

dist

Folder that contains the build of the project To run the build enter '/var/www/ocme and run the command yarn build Application code. It create the endpoint “/webhook/image”.
Sample request: <code> POST https://wabfimmdemo.ccaas.becloudsolutions.com/webhook/image { “phone”:“3519970274”, “URL”:“https://i.4cdn.org/g/1594686838367.png” } </code> On request, it add “00” in front of the phonenumber, it create a WriteSteam in the
/Storage folder with name pattern phone + “_” + timestamp + “.jpg” and then download the image from the link in the stream.
=== Storage === Contains images that are gonna to be sent in the FTP connection.
=== uploadFtp.sh === Bash script that upload to Fimm's FTP all images sent in the lat 60 minutes using ncftp.
It runs with a cronjob every second minute of each hours, in order to discriminate if it needs to upload the images in the
$yesterdayDate folder or in the $todayDate folder.
It also handle logs creation and clear
wab.log.
=== Certs === Contains certificates to enable https endpoint in
app.js.
To create: <code> openssl req -nodes -new -x509 -keyout server.key -out server.cert </code>
=== wab.log === Pm2 log file. Every hour is cleaned by
uploadFtp.sh and saved in the /Logs/Webhook folder.
=== Logs === Contains hourly logs for both FTP and webhooks interactions.
=== node_modules, package.json, package-lock.json === Standard NodeJS stuff.

=== Nginx config === Located at
/etc/nginx/sites-available/node.conf, all endpoints are served in HTTPS.
* Port 5000: AQP * Port 5001: ComoAcque * Port 5002: 2iReteGas_Lotto_5 * Port 5003: 2iReteGas_Lotto_6
=== Active cronjobs === * Automated SSL certs renewal:
0 0 25 */2 * sudo certbot –nginx renew –all –force-renewal * Automated updatedb command: */30 * * * * /usr/bin/updatedb * For each Fimm's customer there is a separated cronjob 2 * * * * /home/admin/be360fimm-*/uploadFtp.sh''


Lorenzo Cesana 2024/03/26 09:25

  • be360/ocme/frontend.1785406865.txt.gz
  • Last modified: 2026/07/30 10:21
  • by luca.bottoli