Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Goshimmer_without_tipselection
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
Container Registry
Model registry
Operate
Environments
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
COLLET Ismael
Goshimmer_without_tipselection
Commits
3f86f9a8
Unverified
Commit
3f86f9a8
authored
4 years ago
by
Jonas Theis
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Enable configuration via ENV variables (#481)
parent
53c315e5
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
plugins/config/plugin.go
+7
-0
7 additions, 0 deletions
plugins/config/plugin.go
with
7 additions
and
0 deletions
plugins/config/plugin.go
+
7
−
0
View file @
3f86f9a8
...
...
@@ -3,6 +3,7 @@ package config
import
(
"fmt"
"os"
"strings"
"github.com/iotaledger/hive.go/events"
"github.com/iotaledger/hive.go/node"
...
...
@@ -56,6 +57,12 @@ func init() {
// It automatically reads in a single config file starting with "config" (can be changed via the --config CLI flag)
// and ending with: .json, .toml, .yaml or .yml (in this sequence).
func
fetch
(
printConfig
bool
,
ignoreSettingsAtPrint
...
[]
string
)
error
{
// replace dots with underscores in env
dotReplacer
:=
strings
.
NewReplacer
(
"."
,
"_"
)
Node
.
SetEnvKeyReplacer
(
dotReplacer
)
// read in ENV variables
Node
.
AutomaticEnv
()
flag
.
Parse
()
err
:=
parameter
.
LoadConfigFile
(
Node
,
*
configDirPath
,
*
configName
,
true
,
*
skipConfigAvailable
)
if
err
!=
nil
{
...
...
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