You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support for password: syntax for the gitRepoURL parameter when using http/https
296
+
297
+
Bugfix for proxy code to work with git & HTTP proxies
298
+
292
299
### 1.2.2
293
300
This version includes a few changes, these include two new parameters on the version control backup:
294
301
`run_ko_query` - if enabled this runs a Splunk savedsearch and adds the additional information of tag=`git_tag_name` into the output of the modular input which is then indexed
Copy file name to clipboardExpand all lines: README/inputs.conf.spec
+7-2Lines changed: 7 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ srcPassword = <value>
8
8
gitTempDir =<value>
9
9
* location where to store the output of the script on the filesystem (note this directory will be deleted/re-created but the parent dir must exist)
10
10
gitRepoURL =<value>
11
-
* git repository URL to store the objects
11
+
* git repository URL to store the objects. password:passwordinpasswordsconf can be used for token/password substitution if required for http/https URL's
12
12
sslVerify =<boolean>
13
13
* Set to 'true' or 'false' to enable/disable SSL verification for REST requests to `srcUrl`. Set to a path to specify a file with valid CA. (https://2.python-requests.org/en/master/user/advanced/#ssl-cert-verification)
14
14
noPrivate =<boolean>
@@ -51,6 +51,8 @@ run_ko_query = <boolean>
51
51
* Do you want to run a Splunk query to determine which knowledge objects changed? macro 'splunk_vc_ko_query' (defaults to false)
52
52
run_ko_diff =<boolean>
53
53
* Should output of the modular input include diff information (requires run_ko_query to be true, defaults to false)
54
+
disable_git_ssl_verify =<boolean>
55
+
* Use GIT_SSL_NO_VERIFY=true on all git commands
54
56
55
57
[splunkversioncontrol_restore://<name>]
56
58
destURL =<value>
@@ -62,7 +64,7 @@ destPassword = <value>
62
64
gitTempDir =<value>
63
65
* location where to store the output of the script on the filesystem (note this directory will be deleted/re-created but the parent dir must exist)
64
66
gitRepoURL =<value>
65
-
* git repository URL to restore the objects from
67
+
* git repository URL to restore the objects from. password:passwordinpasswordsconf can be used for token/password substitution if required for http/https URL's
66
68
sslVerify =<boolean>
67
69
* Set to 'true' or 'false' to enable/disable SSL verification for REST requests to `srcUrl`. Set to a path to specify a file with valid CA. (https://2.python-requests.org/en/master/user/advanced/#ssl-cert-verification)
68
70
auditLogsLookupBackTime =<value>
@@ -87,3 +89,6 @@ git_proxy = <value>
87
89
* If supplied provides a proxy setting to use to access the git repository (https proxy). Use https://user:password:[email protected]:3128 and the application will obtain the password for the entry 'passwordinpasswordsconf'. If password: is not used the password is used as per a normal proxy setting, for example https://user:[email protected]:3128</description>
88
90
file_per_ko =<boolean>
89
91
* Do you want one file per knowledge object? Or a combined file? Defaults to false (i.e. 1 large file for global dashboards in an app). Note that if you change this you will need to re-create or wipe the repository as the files are stored differently...Note this setting should match in both backup and restore modular inputs for a particular repo
Copy file name to clipboardExpand all lines: bin/splunkversioncontrol_backup.py
+25-2Lines changed: 25 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -46,7 +46,7 @@
46
46
</arg>
47
47
<arg name="gitRepoURL">
48
48
<title>gitRepoURL</title>
49
-
<description>git repository URL to store the objects</description>
49
+
<description>git repository URL to store the objects. password:passwordinpasswordsconf can be used for token/password substitution if required for http/https URL's</description>
50
50
</arg>
51
51
<arg name="sslVerify">
52
52
<title>sslVerify</title>
@@ -167,6 +167,13 @@
167
167
<data_type>boolean</data_type>
168
168
<validation>is_bool('run_ko_diff')</validation>
169
169
</arg>
170
+
<arg name="disable_git_ssl_verify">
171
+
<title>disable_git_ssl_verify</title>
172
+
<description>Use GIT_SSL_NO_VERIFY=true on all git commands</description>
logger.debug('disable_git_ssl_verify set to boolean False from: '+val_data['disable_git_ssl_verify'])
274
+
else:
275
+
logger.warn('disable_git_ssl_verify not set to a valid value, ignoring the setting, please update the setting from: '+val_data['disable_git_ssl_verify'])
logger.debug('disable_git_ssl_verify set to boolean False from: '+config['disable_git_ssl_verify'])
1356
+
else:
1357
+
logger.warn('disable_git_ssl_verify not set to a valid value, ignoring the setting, please update the setting from: '+config['disable_git_ssl_verify'])
logger.fatal("i=\"%s\" git clone failed for some reason...on url %s stdout of '%s' with stderrout of '%s'"% (self.stanzaName, self.gitRepoURL, output, stderrout))
1484
+
logger.fatal("i=\"%s\" git clone failed for some reason...on url %s stdout of '%s' with stderrout of '%s'"% (self.stanzaName, self.gitRepoURL_logsafe, output, stderrout))
1465
1485
sys.exit(1)
1466
1486
else:
1467
-
logger.info("i=\"%s\" Successfully cloned the git URL from %s into directory %s"% (self.stanzaName, self.gitRepoURL, self.gitTempDir))
1487
+
logger.info("i=\"%s\" Successfully cloned the git URL from %s into directory %s"% (self.stanzaName, self.gitRepoURL_logsafe, self.gitTempDir))
logger.fatal("i=\"%s\" git clone failed for some reason...on url %s stdout of '%s' with stderrout of '%s'"% (self.stanzaName, self.gitRepoURL, output, stderrout))
1565
+
logger.fatal("i=\"%s\" git clone failed for some reason...on url %s stdout of '%s' with stderrout of '%s'"% (self.stanzaName, self.gitRepoURL_logsafe, output, stderrout))
1546
1566
sys.exit(1)
1547
1567
else:
1548
-
logger.info("i=\"%s\" Successfully cloned the git URL from %s into directory %s"% (self.stanzaName, self.gitRepoURL, self.gitTempDir))
1568
+
logger.info("i=\"%s\" Successfully cloned the git URL from %s into directory %s"% (self.stanzaName, self.gitRepoURL_logsafe, self.gitTempDir))
logger.fatal("i=\"%s\" git clone failed for some reason...on url %s stdout of '%s' with stderrout of '%s'"% (self.stanzaName, self.gitRepoURL, output, stderrout))
1704
+
logger.fatal("i=\"%s\" git clone failed for some reason...on url %s stdout of '%s' with stderrout of '%s'"% (self.stanzaName, self.gitRepoURL_logsafe, output, stderrout))
1685
1705
sys.exit(1)
1686
1706
else:
1687
-
logger.info("i=\"%s\" Successfully cloned the git URL from %s into directory %s"% (self.stanzaName, self.gitRepoURL, self.gitTempDir))
1707
+
logger.info("i=\"%s\" Successfully cloned the git URL from %s into directory %s"% (self.stanzaName, self.gitRepoURL_logsafe, self.gitTempDir))
Copy file name to clipboardExpand all lines: bin/splunkversioncontrol_restore.py
+25-1Lines changed: 25 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -48,7 +48,7 @@
48
48
</arg>
49
49
<arg name="gitRepoURL">
50
50
<title>gitRepoURL</title>
51
-
<description>git repository URL to store the objects</description>
51
+
<description>git repository URL to store the objects. password:passwordinpasswordsconf can be used for token/password substitution if required for http/https URL's</description>
52
52
</arg>
53
53
<arg name="sslVerify">
54
54
<title>sslVerify</title>
@@ -118,6 +118,13 @@
118
118
<data_type>boolean</data_type>
119
119
<validation>is_bool('file_per_ko')</validation>
120
120
</arg>
121
+
<arg name="disable_git_ssl_verify">
122
+
<title>disable_git_ssl_verify</title>
123
+
<description>Use GIT_SSL_NO_VERIFY=true on all git commands</description>
logger.debug('disable_git_ssl_verify set to boolean False from: '+val_data['disable_git_ssl_verify'])
280
+
else:
281
+
logger.warn('disable_git_ssl_verify not set to a valid value, ignoring the setting, please update the setting from: '+val_data['disable_git_ssl_verify'])
282
+
265
283
git_proxies= {}
266
284
if'git_proxy'inval_data:
267
285
git_proxies["https"] =val_data['git_proxy']
@@ -274,6 +292,12 @@ def validate_arguments():
274
292
275
293
ifgitRepoURL.find("http") ==0:
276
294
gitRepoHTTP=True
295
+
ifgitRepoURL.find("password:") !=-1:
296
+
start=gitRepoURL.find("password:") +9
297
+
end=gitRepoURL.find("@")
298
+
logger.debug("Attempting to replace gitRepoURL=%s by subsituting=%s with a password"% (gitRepoURL, gitRepoURL[start:end]))
0 commit comments