Skip to content

tabital0/go-clearkey-server

 
 

Repository files navigation

DRM ClearKey Server

Go

The idea behind this little project is to have a working ClearKey server for test purposes. This was the idea behind the real first version, but I ended up with a new version of this project written with hexagonal architecture in mind. If you don't know what ClearKey systems are, I let you check what is a DRM first, then look for this kind of system. Of course, this server is completely compliant with W3C specification.

As this is my first application in Go & with this kind of architecture, it is obvious that it is not production ready.

Usage

go run .

If you are willing to use PostgreSQL as repository, you have a docker-compose.yml file available which have credentials that are the same as environment variable's default.

Environment variables

Variable name Viper KeyID Default Description
ENV EnvType development Either development or production, if development the logs are sugared, else it is JSON
PORT Port 8080 Listening port of the application
IP Ip 0.0.0.0 Listening IP address of the application
ALLOWED_DOMAINS Domains []string{"http://localhost:*", "http://127.0.0.1:*"} CORS allowed domains
REPOSITORY_TYPE Repository RAM Define the type of repository used, choose between RAM and PSQL
PSQL_PASSWORD Psql_pass PostgreSQL password
PSQL_USER Psql_user PostgreSQL username
PSQL_ADDR Psql_addr 127.0.0.0:5433 PostgreSQL address (default is docker-compose.yml port)
PSQL_DB Psql_db postgres PostgreSQL database
PSQL_INSECURE Psql_insecure true Define whether postgres tries to connect using TLS handshake

Routes

Method Route Description
POST /license Request a license value following W3C specs
POST /license/register Request to register a new license, no body expected, but it will generate a key that will be returned as license format

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 94.0%
  • HTML 5.2%
  • Dockerfile 0.8%