User Tools

Site Tools


procedures:new_be360_creation

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
procedures:new_be360_creation [2026/02/26 15:53] – created gemma.coppetaprocedures:new_be360_creation [2026/04/14 10:55] (current) mattia.stalio
Line 8: Line 8:
  
 ===== Copy an existing folder =====  ===== Copy an existing folder ===== 
-Copy an existing folder. \\+Copy an existing folder **AND REMEMEBR WHICH YOU USED, YOU WILL NEED THAT LATER**. \\
   * Customer with a domain: \\ <code bash> sudo cp -r be360cft/ be360customername/  </code>   * Customer with a domain: \\ <code bash> sudo cp -r be360cft/ be360customername/  </code>
   * Customer without domain: \\ <code bash> sudo cp -r be360farmacie/ be360customername/  </code>   * Customer without domain: \\ <code bash> sudo cp -r be360farmacie/ be360customername/  </code>
Line 16: Line 16:
 <code bash> cd be360customername/ </code> \\ <code bash> cd be360customername/ </code> \\
 With <code bash> ls -l </code> you can see the folder's content. With <code bash> ls -l </code> you can see the folder's content.
-To create a new  {{0:logobecloud.png?30}}tenant you can follow the [[new_tenant_creation]] guide.+You have to delete all the files **__except__**: 
 +  * app.js 
 +  * constants.json 
 +  * files/ (don't delete the folder, but **delete its content**) 
 +  * filesIn/ (don't delete the folder, but **delete its content**) 
 +  * main.js 
 +  * package-lock.json: contains the packages you install with npm install and their version 
 + 
 +<code bash>  
 +sudo rm wab.log 
 + 
 +sudo rm *.log.gz  
 + 
 +sudo rm -rf node_modules/ 
 + 
 +sudo rm package.json 
 + 
 +rm -f files/* 
 + 
 +rm -f filesIn/* </code> 
 + 
 +===== Install Json Packages ===== 
 +After deleting files you will have to install the packages in this directory. To do so run the following command: 
 +<code bash> 
 +npm i </code> 
 +To check if it worked you should see a new file named **package.json** 
 + 
 +===== Modify files =====  
 +In this part you will have to edit the content of the remaining files in the directory.\\ 
 +The first file we'll be edit is **constants.json** and it will be like that: 
 +<file> 
 +{ 
 +    "bpdomain":"*tenantname*.beincontact.becloudsolutions.com", 
 +    "bptenant":"*tenantname*.beincontact.becloudsolutions.com", 
 +    "bpappid":"see point 1", 
 +    "type":"WHATSAPP", 
 +    "from":"vedi punto 5", 
 +    "basicauth":"vedi punto 6", 
 +    "url":"https://*vedi punto 7*.api.infobip.com/whatsapp/1/message/text", 
 +    "localFilePath":"http://wab*nometenant*.ccaas.becloudsolutions.com/files/" 
 +}</file> 
 +  - bpappid 
 +    * Go on the [[https://beincontact.becloudsolutions.com/admin/|admin portal]] and instert in the URL the correct tenant at the start of the domain. 
 +    * On the menu on the left click on the **Scenarios** drop bar and then on the **Chat** option. 
 +    * Selevt the scenario name called **WhatsApp**. 
 +    * In the **Scenario Entries** part you will have to copy the value of the **unique identyfier**. 
 +    * Paste the value in the Json. 
 +  - from 
 +    * Login into [[https://portal.infobip.com/login?callback=https%3A%2F%2Fportal.infobip.com%2Fhomepage|Infobip]] with the credential of the tenant's account. 
 +    * On the menu on the left click on the **Channels and Numbers** voice and then on the **Numbers** options. 
 +    * There you will find a number. Copy it and pu it in the Json field. 
 +  - basichauth 
 +    * Search on the internet a Basic Authenticator Generator. 
 +    * Insert the username and password where the website tells you to and generate the "token"
 +    * Copy it and put it in the Json. 
 +  - url 
 +    * Login into [[https://portal.infobip.com/login?callback=https%3A%2F%2Fportal.infobip.com%2Fhomepage|Infobip]] with the credential of the tenant's account. 
 +    * On the menu on the left click on the **Developer Tools** voice and then on the **API Keys** options. 
 +    * In the section that you will have just opened, there will be a **Documentation** sectopn in the middle part of the screen. Click on it. 
 +    * Here you will find an URL. Copy only the value before the first dot. 
 +    * paste in in the Json. 
 +  - localFilePath 
 +    * Go on [[https://becloud-solutions.signin.aws.amazon.com/console|AWS Dashboard]] and log into it. 
 +    * Open **Amazon Route 53** and then on the **Hosted Zones**.and the **ccaas.becloudsolutions.com THE PUBLIC ONE**. 
 +    * You will now have to copy the IP address of the record name whose name corrispond to the initial direcotry from where you copied the files at the beginning. 
 +    * Click on **Create record** and in the **record name** field insert "wab+tenantname" and in the **Value** field paste the IP address or the domani you copied in the last point. 
 +    * Click on **Create record**.\\ 
 +The second file to edit will be the **app.js** file. 
 +  * Open it and go to the end of the file. There will be a string starting with **app.listening**. 
 +  * Cange the string with the correct name. 
 +  * For the port number you will have to exit the file editing and run this command: **netstat -tulpn** and use a port not displayed. 
 +  * After you choose wihich port to use just put it in the file and close it. 
 +  * To make sure everything is correct read the file and check if there are any other string/port/URLs to change.\\ 
 +The third file will be main.js. 
 +  * Open the file for example with an editor like **vim**. 
 +  * Search the subdomain of the copied tenant and, for vim, use the command **%s/oldtext/newtext/g** where old text is the old tenant subdomain and new is the new tenant subdomain. 
 +  * Repete the same command but instead put in the old field the old tenant name and in new the new tenant name. 
 +  * **CAREFULL** at line 126 you will need to add the username and password that you used to create the Basic Authenticator. 
 +  * To make sure everything is correct read the file and check if there are any other string/port/URLs to change.\\ 
 +The fourth file will be **server.config.js** 
 +  * To access this file go into the superior fodler and open the file. 
 +  * You will see a very clear scheme that you will have to edit juust by adding a new item coping on the existing and changing the fileds.
  
 ===== IT Billing =====  ===== IT Billing ===== 
procedures/new_be360_creation.1772121184.txt.gz · Last modified: by gemma.coppeta

Except where otherwise noted, content on this wiki is licensed under the following license: Public Domain
Public Domain Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki