Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Acme Downloader
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Geant DevOps
Acme Downloader
Commits
deb6969f
Unverified
Commit
deb6969f
authored
3 years ago
by
Massimiliano Adamo
Browse files
Options
Downloads
Patches
Plain Diff
fix comments
parent
d8d4d28a
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Pipeline
#29737
passed
3 years ago
Stage: sonarqube
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
main.go
+6
-6
6 additions, 6 deletions
main.go
with
6 additions
and
6 deletions
main.go
+
6
−
6
View file @
deb6969f
...
...
@@ -63,7 +63,7 @@ var (
httpClient
=
&
http
.
Client
{
Timeout
:
10
*
time
.
Second
}
)
//
app
clean and exit
// clean
-up
and exit
func
appExit
(
status
int
)
{
if
runtime
.
GOOS
==
"windows"
{
certTmpDir
=
"C:
\\
tmp
\\
acme-downloader
\\
"
...
...
@@ -223,7 +223,7 @@ func checkPrivkey(privkey string, pubkey string, fail bool) bool {
return
true
}
// get
r
edis key
// get
R
edis key
func
GetRedisKey
(
redisurl
string
,
redistoken
string
)
string
{
client
:=
&
http
.
Client
{}
req
,
err
:=
http
.
NewRequest
(
"GET"
,
redisurl
,
nil
)
...
...
@@ -307,7 +307,7 @@ func moveFile(source string, destination string, groupid int, filemode os.FileMo
fmt
.
Printf
(
"%v installed: %v
\n
"
,
infoMsg
,
destination
)
}
// ReadOS
R
elease from /etc/os-release
// Read
OS
r
elease from /etc/os-release
func
ReadOSRelease
(
configfile
string
)
map
[
string
]
string
{
ConfigParams
:=
make
(
map
[
string
]
string
)
cfg
,
err
:=
ini
.
Load
(
configfile
)
...
...
@@ -423,7 +423,7 @@ Options:
appExit
(
0
)
}
// che
k
c upstream version
// chec
k
upstream version
metadataBase
:=
"https://artifactory.software.geant.org/artifactory/api/storage/acme-downloader/acme-downloader"
metadataURL
:=
fmt
.
Sprintf
(
"%v_%v_%v?properties=version"
,
metadataBase
,
runtime
.
GOOS
,
runtime
.
GOARCH
)
if
runtime
.
GOOS
==
"windows"
{
...
...
@@ -563,8 +563,8 @@ Options:
moveFile
(
tmpCaDestination
,
caDestination
,
GroupID
,
0644
,
0755
)
moveFile
(
tmpKeyDestination
,
keyDestination
,
GroupID
,
0640
,
0750
)
// Exit 64: it means that the certificate was replaced
and the
// application can be reloaded to make use of the new certificate
// Exit 64:
if we are here
it means that the certificate was replaced
//
and the
application can be reloaded to make use of the new certificate
appExit
(
64
)
}
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