Push keys and db config to server package.

This commit is contained in:
Mariano Uvalle 2023-11-12 07:40:09 +00:00
parent 33fdec9f28
commit ae49f30c96
3 changed files with 51 additions and 24 deletions

View file

@ -4,24 +4,12 @@ import (
"log"
"os"
"github.com/AYM1607/ccclip/internal/config"
"github.com/AYM1607/ccclip/internal/server"
)
func main() {
privateKeyPath := os.Getenv("CCCLIP_PRIVATE_KEY")
publicKeyPath := os.Getenv("CCCLIP_PUBLIC_KEY")
databaseLocation := os.Getenv("CCCLIP_DATABASE_LOCATION")
port := os.Getenv("CCCLIP_PORT")
if publicKeyPath == "" || privateKeyPath == "" {
log.Fatalf("database location and public and privae keys must be provided")
}
config.Default.PrivateKeyPath = privateKeyPath
config.Default.PublicKeyPath = publicKeyPath
config.Default.DatabaseLocation = databaseLocation
if port == "" {
port = "8080"
}