-
Notifications
You must be signed in to change notification settings - Fork 343
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fix windows installer service and missing flags
Signed-off-by: Michele Meloni <cleaversdev@gmail.com>
- Loading branch information
Showing
6 changed files
with
97 additions
and
216 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
/* | ||
Copyright 2021 CodeNotary, Inc. All rights reserved. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package immudb | ||
|
||
import ( | ||
"github.com/codenotary/immudb/pkg/server" | ||
"github.com/spf13/viper" | ||
) | ||
|
||
func parseOptions() (options *server.Options, err error) { | ||
dir := viper.GetString("dir") | ||
port := viper.GetInt("port") | ||
address := viper.GetString("address") | ||
|
||
pidfile := viper.GetString("pidfile") | ||
logfile := viper.GetString("logfile") | ||
|
||
mtls := viper.GetBool("mtls") | ||
auth := viper.GetBool("auth") | ||
maxRecvMsgSize := viper.GetInt("max-recv-msg-size") | ||
noHistograms := viper.GetBool("no-histograms") | ||
detached := viper.GetBool("detached") | ||
certificate := viper.GetString("certificate") | ||
pkey := viper.GetString("pkey") | ||
clientcas := viper.GetString("clientcas") | ||
|
||
devMode := viper.GetBool("devmode") | ||
adminPassword := viper.GetString("admin-password") | ||
maintenance := viper.GetBool("maintenance") | ||
signingKey := viper.GetString("signingKey") | ||
synced := viper.GetBool("synced") | ||
tokenExpTime := viper.GetInt("token-expiry-time") | ||
|
||
webServer := viper.GetBool("web-server") | ||
webServerPort := viper.GetInt("web-server-port") | ||
|
||
storeOpts := server.DefaultStoreOptions().WithSynced(synced) | ||
|
||
tlsConfig, err := setUpTLS(pkey, certificate, clientcas, mtls) | ||
if err != nil { | ||
return options, err | ||
} | ||
|
||
options = server. | ||
DefaultOptions(). | ||
WithDir(dir). | ||
WithPort(port). | ||
WithAddress(address). | ||
WithPidfile(pidfile). | ||
WithLogfile(logfile). | ||
WithTLS(tlsConfig). | ||
WithAuth(auth). | ||
WithMaxRecvMsgSize(maxRecvMsgSize). | ||
WithNoHistograms(noHistograms). | ||
WithDetached(detached). | ||
WithDevMode(devMode). | ||
WithAdminPassword(adminPassword). | ||
WithMaintenance(maintenance). | ||
WithSigningKey(signingKey). | ||
WithStoreOptions(storeOpts). | ||
WithTokenExpiryTime(tokenExpTime). | ||
WithWebServer(webServer). | ||
WithWebServerPort(webServerPort) | ||
|
||
return options, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters