Xitmer Documentation

Note: This documentation is of the latest version of the Xitmer client software. If you find any information in this documentation to be not working, then please ensure you have the latest version of the software (v0.5.2) installed on your system.

Keystore

During development you may need to store application secrets like DB password, DB usernames, etc. Also, you may need to store the .env files of your application and that too securely. The Keystore feature provides a convinient way to simplyfy this.

Storing values in the Keystore

The keystore can store key and their values. To do so, you can use a command in the following pattern:

xit ks put key_name -v "value"

It can also store the contents of a file (like .env file) as the value of a key. To do so you need to issue the -f flag followed by the absolute path to the file.

xit ks put key_name -f "D:\Creds\prod_server\id_rsa"

It is essential that you store all sensitive and secret information encrypted. So when you put any value to the keystore it is stored encrypted by deafult. If however you have to store any value without encryption you can issue the -ne flag at the end as shown below to specify that no encrytion to be done on the value being stored:

xit ks put key_name -v "some value" -ne
xit ks put key_name -f "D:\Text\download_instructions.txt" -ne

Getting values fromt the Keystore

To get the value of a key stored in the keystore and display it in the terminal a command in the following pattern can be used:

xit ks get key_name -i

You can also save the value to a file instead of displaying it in the terminal. To do so, you need to issue the -f flag instead of the -i flag:

xit ks get key_name -f

The above command will get the value from the keystore and save the value in a file named same as the key name in the keystore folder of the Xitmer data directory. The value of the key is automatically decrypted when you get it from the keystore.

If you wish to save the key value to a file with a different name or in a different location, then you can specify the file path after the -f flag as shown below:

xit ks get key_name -f "D:\Creds\prod_server\id_rsa"

There are few convinience shortcut notations available which can be used for specifying the path while getting the value from the keystore. For example, if you wish to store the above fetched id_rsa value in the user's .ssh directory instead, then you can use the >sshd notation as shown below:

xit ks get key_name -f ">sshd\id_rsa"

Deleting stored values in the system

So you may want to delete the keyvalue files once you have done your work. To do so, you can issue a command like below:

xit ks del key_name

If you wish to delete all the stored keys in the host system you can use the --all flag instead of the key name as shown below:

xit ks del --all