5.24.7 • Published 1 year ago

@webframework/scripts v5.24.7

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

CLI tool for basic utilities of Webframework Applications

Install

#  Install tool for use in application
npm install @webframework/scripts --save

Configure

  1. Create a file called .wfrc in the root of cloned directory.Note that it only has an extension and no name.This should be a valid JSON content.Refer below sample.

    {
        "dsisConfigUrl":"<hostname>:<port>/dsis-config/api/v1/applications",
        "keycloakConfig":{
            "<Content_of_Keycloak.json>"
        },
        "serviceRegistryConfigs": [
            {
                "ServiceName": "<service_name>",
                "ConnectionURL": "<url>",
                "Username": "<user>",
                "AuthenticationType": "<authentication_type>",
                "ServiceType": "",
                "QueryOptions": "",
                "Status": "Active",
                "Credentials": "<encrypted_pwd>"
            }
        ],
        "platformServersConfigs": [
            {
                "server": "<server_display_name",
                "url": "<url>",
                "icon": "<icon>"
            }
        ],
        "nodeLogStashConfig": {
            "node_logstash_output_folder": "<output_folder_path>",
            "input_logs_file": "<input_log_file_path>"
        },
        "launchTechnologyConfigs": {
            "horizonViewConfig": {
                "horizonclientID": "<horizon_client_id>",
                "discoveryUserName": "<discovery_user_name>",
                "horizonClientSecret": "<horizon_vidm_client_secret>",
                "horizonLaunchClient": "desktop",
                "customLoggerEnabled": true,
                "exceptionLoggerEnabled": true
            },
            "hprgsConfig": {
                "customLoggerEnabled": false,
                "exceptionLoggerEnabled": true,
                "VMLockingTimeInMinutes": 10,
                "jobTimeInMinutes": 1
            }
        },
        "rssFeedSources" :[{
    
            "id":"ienergynews",
            "rssFeedTitle": "",
            "refreshInterval": 60,
            "rssFeedUrls": [
                {
                    "url": "http://www.ienergy.community/NewsHandler.aspx",
                    "title": "IEnergy News"
                }
            ]
    
        }],
        "emailServiceConfig": {
            "host": "whsmtp.corp.halliburton.com",
            "port": "25",
            "isProtected": false,
            "userName": "AKIAJZVSBK3UCWQZVNHQ",
            "password": "Ag2YgykzL42jKHy1WimBUoemYdbs2VcxLPCw0/2VD3SA",
            "customLoggerEnabled": false,
            "exceptionLoggerEnabled": true,
            "landmarkssservice": "/lea/landmarkssservice"
        },
        "appStoreBPMConfig": {
            "bpmWorkflowDeploymentId":"WF:RequestApprovals:1.0",
            "bpmWorkflowDefinitionId":"WF.NewProductAccessRequest",
            "serviceUrl":"<wf-services-host>:<port>",
            "fromEmailAddress":"webframework@halliburton.com",
            "approversEmailAddresses":"approver1@halliburton.com;approver2@halliburton.com"
        },
        "supportAssistantConfig": {
            "supportassistantserviceUrl": "/supportassistantservice/",
            "emailServiceURL": "/emailservice/",
            "defaultToEmailAddress": "supportassistant@halliburton.com",
            "defaultFromEmailAddress": "supportassistant@halliburton.com",
            "customLoggerEnabled": false,
            "customerSupportLiveChatURL":"https://www.ienergy.community/Chat",
            "customerSupportPortalURL"  :"https://www.ienergy.community/Support",
            "createCaseURL": "http://css.lgc.com/psp/crmp/CUSTOMER/CRM/c/RC_SELF_SERVICE.RC_CASE_SW_SS_RPT.GBL?PAGE=RC_CASE_SW_SS_RPT&BUSINESS_UNIT=LGC01&DISP_TMPL_ID=RC_SUPPORT"
        },
        "deleteApplication":true,
        "importPath":"<path_to_configurations_to_be_imported>",
        "exportPath":"<path_to_directory_where_configurations_to_be_exported>"
    }

Add Environment Variables

Create two environment variables named as KEYCLOAK_USER and KEYCLOAK_PASSWORD. KEYCLOAK_USER should be a keycloak admin user and KEYCLOAK_PASSWORD should be encrypted password for the user specified in KEYCLOAK_USER.

Required Attributes

  • dsisConfigUrl: This will be url to your dsis config service in the format http://dsis-1804031445.ad.openearth.community:8080/dsis-config/api/v1/applications
  • keycloakConfig: Content of the keycloak.json file. Refer here for steps to get keycloak.json.
  • serviceRegistryConfigs : Contains a list of external services that your application wants to consume. Each service should have parameters like 1) ServiceName by which service will be identified, 2) ConnectionURL on which this service is accessible over web, 3) Username to be used to access the service, 4) Encrypted password of the user specifed in UserName should be present in Credentials parameter and 5) AuthenticationType by which it is identified whether this service requires credentials or not.

Optional Attributes

  • deleteApplication: Boolean Set it to true of you want to delete existing application with same name. Default : false

  • importPath: Local Path from where the configurations would be imported to Dsis config service. By Default it will try to find inside Default : ./data

  • exportPath: Local path where the configurations from Dsis config service would be exported to. Default : ./
  • node_logstash_output_folder: Server path where node logstash will create output file by using user id as name. This file will contain user specific activities details
  • input_logs_file: Server path to log file which contains the user specific activity logs written by the applicaiton which node logstash can read and create output files
  • horizonclientID: A client is required to be created on horizon VIDM in order to use its admin API to discover products. PLease follow horizon setup guide for more details
  • discoveryUserName: This is the user name too which products are assign on horizon VIDM. When admin API call is made this user name is passed as parameter. only those products will be returned which are assigned to this user.
  • horizonClientSecret: This is the client secret for the client given in horizonclientID. PLease follow horizon setup guide for more details
  • horizonLaunchClient: Horizon supports both broser launch as well as thick client launch. If horizonLaunchClient value is browser then horizon applications will be launch in broser. If horizonLaunchClient value is desktop then Horizon thick client will be launch that will open the horizon application.
  • platformServersConfigs: Contains a list of servers that admin want to monitor in admin dashboard. Each server should have three parameters defined, server which contains the display name of the server, url which contains the URL to monitor and icon which contains the icon to be shown on admin dashboard.

The Tool Provides the below mentioned CLI commands

Import Configurations

Run the below mentioned command for importing configurations to DSIS Config Service.

wf import-config

Export Configurations

Run the below mentioned command for exporting configurations from DSIS Config Service.

wf export-config

Encrypt Credentials

wf encrypt

This will prompt for Plain Text.Enter Text you wish to encrypt and hit enter.You will get the value of encrypted Text.

Decrypt Credentials

wf decrypt

This will prompt for Encrypted Text Text.Enter Text you wish to decrypt and hit enter.You will get the value of plain Text.

Copy Additional Commands

wf copy-commands @path@

This command will copy the application specific commands from the given path to the framework commands folder. By using this feature as an application developer someone can add and execute additional commands in order to perform application specific actions

Add First User

wf add-first-user

This command will add a default user in security server. This default user has fwuser as id and is an super user. It is intended only for first time use and expected to be deleted as soon as another admin user is added by admin

Add Horizon Configurations

wf add-horizon-view-configs

This command will add horizon view technology specific configurations like discovery user name, VIDM client name, its secret and launch client which can be either browser or desktop. Follow horizon setup guide to know more details on these parameters. Please populate the launchTechnologyConfigs -> horizonViewConfig section of .wfrc before runing this script.

Add Platform Server Configurations

wf add-platform-servers

This command will add platform servers list which admin wants to monitor on admin dashboard. Please populate the platformServersConfigs section of .wfrc before runing this script. Please note, this script will overwrite existing configurations and if you want preserve/update any existing entries then add those again to .wfrc file.

Add HP-RGS Configurations

wf add-hprgs-configs

This command will add hprgs technology specific configurations like VMLockingTimeInMinutes and jobTimeInMinutes. Please populate the launchTechnologyConfigs -> hprgsConfig section of .wfrc before runing this script.

Add Node logstash Configurations

wf setup-node-logstash

This command will add node logstash server specific configurations like what is the path to input log file to read from and what is the output folder to write user specific logs.

Add Service Registry Configurations

wf add-service-registry-entry

This command will add list of external service that your application needs. Please populate the serviceRegistryConfigs section of .wfrc before runing this script. Please note, this script will overwrite existing configurations and if you want preserve/update any existing entries then add those again to .wfrc file.

Add RSS Feed Sources Configurations

wf  add-rss-feed-sources

This command will add new or update existing RSS feed source configurations. Please populate the rssFeedSources section of .wfrc before runing this script.

Add Email Service Configurations

wf  add-email-configs

This command will add email service specific configurations like SMTP server host, SMTP server port, if it is protected then username and password. Please populate the emailServiceConfig section of .wfrc before runing this script.

Add AppStore BPM Configurations

wf  add-appstore-bpm-configs

This command will add BPM server configurations required specifically for AppStore component in order to perform access request submission and approval workflows. Please populate the appStoreBPMConfig section of .wfrc before runing this script.

Add Support Assitant Configurations

wf add-support-assistant-configs

This command will add support assistant UI component as well as backend nodejs configurations required specifically for submitting support ticket. Please populate the supportAssistantConfig section of .wfrc before runing this script.

5.24.7

1 year ago