Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Truststore
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mirrored_repos
smallstep
Truststore
Commits
ad5f4a56
Commit
ad5f4a56
authored
6 years ago
by
Mariano Cano
Browse files
Options
Downloads
Patches
Plain Diff
Add flags for java and firefox.
parent
527d1a35
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cmd/truststore/main.go
+27
-3
27 additions, 3 deletions
cmd/truststore/main.go
with
27 additions
and
3 deletions
cmd/truststore/main.go
+
27
−
3
View file @
ad5f4a56
...
...
@@ -16,9 +16,15 @@ func usage() {
}
func
main
()
{
var
uninstall
,
help
bool
var
uninstall
,
help
,
verbose
bool
var
java
,
firefox
,
noSystem
,
all
bool
flag
.
Usage
=
usage
flag
.
BoolVar
(
&
uninstall
,
"uninstall"
,
false
,
"uninstall the given certificate"
)
flag
.
BoolVar
(
&
java
,
"java"
,
false
,
"install or uninstall on the Java truststore"
)
flag
.
BoolVar
(
&
firefox
,
"firefox"
,
false
,
"install or uninstall on the Firefox truststore"
)
flag
.
BoolVar
(
&
noSystem
,
"no-system"
,
false
,
"disables the install or uninstall on the system truststore"
)
flag
.
BoolVar
(
&
all
,
"all"
,
false
,
"install or uninstall on the system, Firefox and Java truststores"
)
flag
.
BoolVar
(
&
verbose
,
"v"
,
false
,
"be verbose"
)
flag
.
BoolVar
(
&
help
,
"help"
,
false
,
"show help"
)
flag
.
Parse
()
...
...
@@ -32,13 +38,31 @@ func main() {
os
.
Exit
(
1
)
}
var
opts
[]
truststore
.
Option
if
all
{
opts
=
append
(
opts
,
truststore
.
WithJava
(),
truststore
.
WithFirefox
())
}
else
{
if
java
{
opts
=
append
(
opts
,
truststore
.
WithJava
())
}
if
firefox
{
opts
=
append
(
opts
,
truststore
.
WithFirefox
())
}
}
if
noSystem
{
opts
=
append
(
opts
,
truststore
.
WithNoSystem
())
}
if
verbose
{
opts
=
append
(
opts
,
truststore
.
WithDebug
())
}
if
uninstall
{
if
err
:=
truststore
.
Uninstall
Certificat
e
(
flag
.
Arg
(
0
));
err
!=
nil
{
if
err
:=
truststore
.
Uninstall
Fil
e
(
flag
.
Arg
(
0
)
,
opts
...
);
err
!=
nil
{
fmt
.
Fprintln
(
os
.
Stderr
,
err
)
os
.
Exit
(
2
)
}
}
else
{
if
err
:=
truststore
.
Install
Certificat
e
(
flag
.
Arg
(
0
));
err
!=
nil
{
if
err
:=
truststore
.
Install
Fil
e
(
flag
.
Arg
(
0
)
,
opts
...
);
err
!=
nil
{
fmt
.
Fprintln
(
os
.
Stderr
,
err
)
os
.
Exit
(
2
)
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment