Chatting server implemented by using Scala, Akka, Cats
Follow the link above and instructions to install CockroachDB
This is the process of running the CockroachDB and it includes configuration for authentication. Authentication is used for secure connection between CockroachDB and chat-server. The command cockroach cert create-client
must be run in both root and chatserver. We recommend you to set the dir for authentication to be ($HOME)/.cockroach-certs, otherwise you will have to set COCKROACH_CERTS_DIR before running chat-server.
Since Jdbc does not support pem authentication file, you have to use command below to convert the authentication file to pk8
ls $HOME/.cockroach-certs
openssl pkcs8 -topk8 -inform PEM -outform DER -in client.root.key -out client.root.pk8 -nocrypt
openssl pkcs8 -topk8 -inform PEM -outform DER -in client.chatserver.key -out client.chatserver.pk8 -nocrypt
cockroach start
to run a single node DB
cockroach sql
scripts/init.sql
to run sql.
While CockroachDB is running, run command below to start chat-server
// chat-server directory에서 실행
git submodule init
git submodule update
sbt
compile
run
Running chat-server provides gRPC API in chat-service
Change the following env. Variables to run server in TLS mode
an X.509 certificate chain file in PEM format: CHAT_TLS_CERT_CHAIN_FILE
a PKCS#8 private key file in PEM format: CHAT_TLS_KEY_FILE