Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements to simplify dev experience with go backend #2861

Merged
merged 16 commits into from
Aug 28, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix ups
  • Loading branch information
nwmac committed Aug 20, 2018
commit 2db338a6e7af124a6c22012776ad6b6cde453ccf
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ CONSOLE_ADMIN_SCOPE=stratos.admin
CF_ADMIN_ROLE=cloud_controller.admin
ALLOWED_ORIGINS=http://nginx
SESSION_STORE_SECRET=wheeee!
#CONSOLE_PROXY_CERT_KEY=use local dev-cert/pproxy.key in portal-proxy repo
#CONSOLE_PROXY_CERT=use local dev-cert/pproxy.crt in portal-proxy repo
CONSOLE_PROXY_CERT_PATH=../../dev-ssl/server.crt
CONSOLE_PROXY_CERT_KEY_PATH=../../dev-ssl/server.key
ENCRYPTION_KEY=B374A26A71490437AA024E4FADD5B497FDFF1A8EA6FF12F6FB65AF2720B59CCF
#VCAP_APPLICATION={"cf_api": "https://api.10.4.21.240.nip.io:8443"}
# Kepe the sql lite database file
SQLITE_KEEP_DB=true
SQLITE_KEEP_DB=true
11 changes: 10 additions & 1 deletion src/jetstream/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,11 @@ func getEncryptionKey(pc interfaces.PortalConfig) ([]byte, error) {
return key32bytes, nil
}

// Check we have volume and filename
if len(pc.EncryptionKeyVolume) == 0 && len(pc.EncryptionKeyFilename) == 0 {
return nil, errors.New("You must configure either an Encryption key or the Encryption key filename")
}

// Read the key from the shared volume
key, err := crypto.ReadEncryptionKey(pc.EncryptionKeyVolume, pc.EncryptionKeyFilename)
if err != nil {
Expand Down Expand Up @@ -370,7 +375,11 @@ func initSessionStore(db *sql.DB, databaseProvider string, pc interfaces.PortalC
func loadPortalConfig(pc interfaces.PortalConfig) (interfaces.PortalConfig, error) {
log.Debug("loadPortalConfig")

config.LoadConfigFile("./config.properties")
// Load config.properties if it exists, otherwise look for default.config.properties
err := config.LoadConfigFile("./config.properties")
if os.IsNotExist(err) {
config.LoadConfigFile("./default.config.properties")
}

if err := config.Load(&pc); err != nil {
return pc, fmt.Errorf("Unable to load configuration. %v", err)
Expand Down