Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Acme Web
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 Web
Commits
5b6512d3
Unverified
Commit
5b6512d3
authored
3 years ago
by
Max Adamo
Browse files
Options
Downloads
Patches
Plain Diff
allow custom script
parent
0470db1e
Branches
Branches containing commit
Tags
v0.5.2
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
main.go
+5
-2
5 additions, 2 deletions
main.go
with
5 additions
and
2 deletions
main.go
+
5
−
2
View file @
5b6512d3
...
...
@@ -16,6 +16,7 @@ var (
appVersion
string
buildTime
string
webDir
string
jsonConverter
string
WarningLogger
*
log
.
Logger
InfoLogger
*
log
.
Logger
ErrorLogger
*
log
.
Logger
...
...
@@ -32,7 +33,7 @@ func init() {
func
renderPage
(
w
http
.
ResponseWriter
,
req
*
http
.
Request
)
{
provider
:=
strings
.
Split
(
req
.
URL
.
Path
,
"/"
)
serveFile
:=
filepath
.
Join
(
webDir
,
req
.
URL
.
Path
)
cmd
:=
exec
.
Command
(
"/root/bin/cert2json.py"
,
"-p"
,
provider
[
1
])
cmd
:=
exec
.
Command
(
jsonConverter
,
"-p"
,
provider
[
1
])
err
:=
cmd
.
Run
()
if
err
!=
nil
{
WarningLogger
.
Println
(
err
)
...
...
@@ -60,7 +61,7 @@ func main() {
- serve ACME HTML pages
Usage:
%v [--listen-address=LISTENADDRESS] [--listen-port=LISTENPORT] [--verbose]
%v
[--json-converter=JSONCONVERTER]
[--listen-address=LISTENADDRESS] [--listen-port=LISTENPORT] [--verbose]
%v -h | --help
%v -b | --build
%v -v | --version
...
...
@@ -69,6 +70,7 @@ Options:
-h --help Show this screen
-b --build Print version and build information and exit
-v --version Print version information and exit
--json-converter=JSONCONVERTER Path to json converter script [default: /usr/bin/cert2json.py]
--listen-address=LISTENADDRESS Web server address. Check Go net/http documentation [default: any]
--listen-port=LISTENPORT Web server port [default: 8000]
--verbose Log also successful connections
...
...
@@ -82,6 +84,7 @@ Options:
}
webDir
=
"/var/www/acme_web"
jsonConverter
=
arguments
[
"--json-converter"
]
.
(
string
)
verboseBool
=
arguments
[
"--verbose"
]
.
(
bool
)
listenAddress
:=
arguments
[
"--listen-address"
]
.
(
string
)
listenPort
:=
arguments
[
"--listen-port"
]
.
(
string
)
...
...
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