Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
IRMA
Github mirrors
irmago
Commits
f7aba437
Commit
f7aba437
authored
May 18, 2021
by
Sietse Ringers
Browse files
fix: suppress warning that local IP could not be determined when local IP is not used
parent
4f091dfa
Changes
2
Hide whitespace changes
Inline
Side-by-side
irma/cmd/server.go
View file @
f7aba437
...
...
@@ -13,6 +13,10 @@ import (
"github.com/sietseringers/viper"
)
var
(
localIP
,
localIPErr
=
server
.
LocalIP
()
)
var
serverCmd
=
&
cobra
.
Command
{
Use
:
"server"
,
Short
:
"IRMA server for verifying and issuing attributes"
,
...
...
@@ -67,13 +71,9 @@ func setFlags(cmd *cobra.Command, production bool) error {
flags
.
SortFlags
=
false
var
defaulturl
string
var
err
error
if
!
production
{
defaulturl
,
err
=
server
.
LocalIP
()
if
err
!=
nil
{
logger
.
Warn
(
"Could not determine local IP address: "
,
err
.
Error
())
}
else
{
defaulturl
=
"http://"
+
defaulturl
+
":port"
if
localIP
!=
""
{
defaulturl
=
"http://"
+
localIP
+
":port"
}
}
...
...
@@ -146,6 +146,10 @@ func setFlags(cmd *cobra.Command, production bool) error {
}
func
configureServer
(
cmd
*
cobra
.
Command
)
(
*
requestorserver
.
Configuration
,
error
)
{
if
localIPErr
!=
nil
{
logger
.
Warn
(
"Could not determine local IP address: "
,
localIPErr
.
Error
())
}
readConfig
(
cmd
,
"irmaserver"
,
"irma server"
,
[]
string
{
"."
,
"/etc/irmaserver/"
,
"$HOME/.irmaserver"
},
map
[
string
]
interface
{}{
"no-auth"
:
false
,
...
...
irma/cmd/session.go
View file @
f7aba437
...
...
@@ -238,6 +238,10 @@ func configureSession(cmd *cobra.Command) (irma.RequestorRequest, *irma.Configur
logger
.
Level
=
server
.
Verbosity
(
verbosity
)
irma
.
SetLogger
(
logger
)
if
localIPErr
!=
nil
{
logger
.
Warn
(
"Could not determine local IP address: "
,
localIPErr
.
Error
())
}
return
configureRequest
(
cmd
)
}
...
...
@@ -246,12 +250,8 @@ func init() {
logger
.
Formatter
=
&
prefixed
.
TextFormatter
{
FullTimestamp
:
true
}
var
err
error
defaulturl
,
err
=
server
.
LocalIP
()
if
err
!=
nil
{
logger
.
Warn
(
"Could not determine local IP address: "
,
err
.
Error
())
}
else
{
defaulturl
=
"http://"
+
defaulturl
+
":port"
if
localIP
!=
""
{
defaulturl
=
"http://"
+
localIP
+
":port"
}
flags
:=
sessionCmd
.
Flags
()
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment