Configure using a script

Note

You must be a root user to configure Helix Search.

This section details how to configure Helix Search using a script. You can run the etc/configure.sh script file located in the installation directory to configure Helix Search.

The configure.sh script file updates the following configuration options:

com.perforce.p4search.core.service.p4user

com.perforce.p4search.core.index.p4user

com.perforce.p4search.core.anonymous.p4user

com.perforce.p4search.core.service.p4ticket

com.perforce.p4search.core.index.p4ticket

com.perforce.p4search.core.anonymous.p4ticket

com.perforce.p4search.core.p4port

com.perforce.p4search.core.p4trust

com.perforce.p4search.service.external-url

com.perforce.p4search.elastic.hosts

com.perforce.p4search.elastic.user

com.perforce.p4search.elastic.pass

Depending on your choices, the configuration script creates users, groups, and the required permissions in Helix Core Server.

The default configuration creates the following:

  • Users:

    p4search (admin permission, standard user or a service user at security level 5 or above)
    p4index (super permission, standard user)
    anonymous (read permission, standard user)
  • Users are added to the group:

    unlimited (with unlimited ticket 'Timeout')
  • Server specification is created for security level 5 or above:

    p4search (configuring the User, AllowedAddresses and Address fields)

Sample output

The following is a sample output for when you run the configure.sh script:

Note
  • To accept the default values within [default], press the Enter key.

  • The [Y/n] option in the configure.sh script file defaults to yes. You can press the Enter key to move on to the next configuration item.

$ ./configure.sh
Connecting to your Perforce Server... 
 Perforce Server [localhost:4000]: 
 Superuser account name [super]:
 Enter Password: ********
 OK

Configure the external URL for P4Search (used by the Perforce Server)...
 External URL [http://localhost:1601]: 
 OK

Security level: 2

Configuring HelixCore index user account...
 Username [p4index]:
 Enter password for index: ********

User 'p4index' does not exist!
 Create user? [Y/n]: Y

Creating 'p4index' user account...
 OK

Setting 'p4index' password...
 OK

Configuring unlimited ticket group...
 Group name [unlimited]:

User p4index is not a member of unlimited!
 Add user to group? [Y/n]: Y

Adding p4index to group...
 OK

Generating 'p4index' ticket...
Access for user 'p4index' has not been enabled by 'p4 protect'.
Access for user 'p4index' has not been enabled by 'p4 protect'.

Checking 'p4index' permissions...

User p4index does not have 'super' access!
 Append 'super user p4index * //...' permission to protects? [Y/n]: Y

Adding permission...
 OK

Configuring HelixCore anonymous user account...
 Username [anonymous]:
 Enter password for anonymous: ********

User 'anonymous' does not exist!
 Create user? [Y/n]: Y

Creating 'anonymous' user account...
 OK

Setting 'anonymous' password...
 OK

Configuring unlimited ticket group...
 Group name [unlimited]:

User anonymous is not a member of unlimited!
 Add user to group? [Y/n]: Y

Adding anonymous to group...
OK

Generating 'anonymous' ticket...
Access for user 'anonymous' has not been enabled by 'p4 protect'.
Access for user 'anonymous' has not been enabled by 'p4 protect'.

Checking 'anonymous' permissions...

User anonymous does not have 'read' access!
 Append 'read user anonymous * //...' permission to protects? [Y/n]: Y

Adding permission...
 OK
NOTE: in low security mode you can use the same Perforce user for both 'service' and 'index' users.

Configuring HelixCore service user account...
 Username [p4search]:
 Enter password for service: ********

User 'p4search' does not exist!
 Create user? [Y/n]: Y

Creating 'p4search' user account... 
 OK

Setting 'p4search' password...
 OK

Configuring unlimited ticket group...
 Group name [unlimited]:

User p4search is not a member of unlimited!
 Add user to group? [Y/n]: Y

Adding p4search to group...
 OK

Generating 'p4search' ticket...
Access for user 'p4search' has not been enabled by 'p4 protect'.
Access for user 'p4search' has not been enabled by 'p4 protect'.

Checking 'p4search' permissions...

User p4search does not have 'admin' access!
 Append 'admin user p4search * //...' permission to protects? [Y/n]: Y

Adding permission...
 OK

Extensions depot does not exist!
  Create extension depot .p4extensions:

Creating extensions depot...
  OK


Connecting to your Elastic Server(s)...
 ElasticSearch host(s) (comma seperated) [http://localhost:9200]:
 Elastic username [elastic]:
 Elastic password: ********
 Connection OK

--------------------------------------------------------------------------------
Configuration finished.

After making configuration changes, you must restart the service:
  sudo systemctl restart p4search.service
--------------------------------------------------------------------------------