diff --git a/cmd/server.go b/cmd/server.go index f2174c9..5ac4b62 100644 --- a/cmd/server.go +++ b/cmd/server.go @@ -79,6 +79,21 @@ var serverCmd = &cobra.Command{ if err != nil { log.Fatalf("error writing hosts file: %v", err) } + + rootCert, err := ioutil.ReadFile(serverCert) + if err != nil { + log.Fatalf("error reading %s file: %v", serverCert, err) + } + err = ioutil.WriteFile(path.Join(configDir, "root-certificate.pem"), rootCert, 0644) + if err != nil { + log.Fatalf("error writing root-certificate.pem file: %v", err) + } + + // FIXME: this is going away as part of fixing https://github.com/lf-edge/adam/issues/16 + err = ioutil.WriteFile(path.Join(configDir, "Force-API-V1"), []byte{}, 0644) + if err != nil { + log.Fatalf("error writing Force-API-V1 file: %v", err) + } log.Printf("EVE-compatible configuration directory output to %s", configDir) s := &server.Server{ diff --git a/scripts/eve-embedded.sh b/scripts/eve-embedded.sh index f463347..b2accf2 100755 --- a/scripts/eve-embedded.sh +++ b/scripts/eve-embedded.sh @@ -41,10 +41,8 @@ bootstrap() { # if this is the first run on this /persist -- generate everything if [ ! -d $DB ]; then - adam generate --db-url $DB --server --hosts 127.0.0.1,localhost --cn localhost.localdomain - cp $DB/server.pem /config/root-certificate.pem - echo $SERVER > /config/server + adam generate --db-url $DB --server --hosts 127.0.0.1,localhost --cn localhost bootstrap & fi -adam server --port $PORT --db-url $DB --conf-dir $DB/eve-conf --server-cert $DB/server.pem --server-key $DB/server-key.pem +adam server --port $PORT --db-url $DB --conf-dir /config --server-cert $DB/server.pem --server-key $DB/server-key.pem