How to make GitHub credentials persistent

When configuring Glamorous Toolkit with an SSH key or an access token for GitHub, they are only set for that installation. If you download a new release the configuration should be done again.

These credentials are stored by default next to the Glamorous Toolkit image in the folder iceberg\credentials.fuel . The snippet below inspects the current store for credentials:

IceCredentialStore storeFile
  

NB: In case you are using an access token or a passphrase, note that they will be store in plain text.

A solution to persist credentials accross releases is using global settings. For this we change the credentials store setting to a user-specific path and make sure the credentials are stored there. The next time an image is started, it will pick up the credentials path from the global settings.

The following snippet changes the default credential store to the 'credentials.fuel' file in the home directory.

settings := SettingTree acceptableKeywords:SettingBrowser settingsKeywords.
(settings deeplyDetect: [ :e | 
	 e settingNodeIdentifier = '#icebergCredentials#storeFile' ]) 
	realValue: FileLocator home / 'credentials.fuel'.
settings storeSettingNodes.

IceCredentialStore current
	storeFile: FileLocator home / 'credentials.fuel';
	saveIntoStore
  

In case you are using an SSH key also run the following snippet to configure that:

settings := SettingTree acceptableKeywords:SettingBrowser settingsKeywords.
(settings deeplyDetect: [ :e | 
	e settingNodeIdentifier = '#icebergCredentials#useCustomSsh' ]) 
		realValue: true.
settings storeSettingNodes.
  

Now you should have a user-specific credentials file

FileLocator home / 'credentials.fuel'
  

And your global settings should be updated accordingly

SystemSettingsPersistence defaultPreferenceFileReference
  

You can inspect the credential store to see what it contains.

IceCredentialStore current
  

Reseting the persistency of credentials

If you no longer want to have a persisted credentials there are two options:

1. Deleting the global preferences file.

If you do not have other preferences appart from credentials, you can delete the global preferences file:

SystemSettingsPersistence defaultPreferenceFileReference
  

2. Configure the global preferences file with the default option

settings := SettingTree acceptableKeywords:SettingBrowser settingsKeywords.
(settings deeplyDetect: [ :e | 
	 e settingNodeIdentifier = '#icebergCredentials#storeFile' ]) 
	realValue: IceCredentialStore defaultCredentialsStoreFile.
(settings deeplyDetect: [ :e | 
	e settingNodeIdentifier = '#icebergCredentials#useCustomSsh' ]) 
		realValue: false.
settings storeSettingNodes.

IceCredentialStore current
	storeFile: IceCredentialStore defaultCredentialsStoreFile;
	saveIntoStore