GithubHelp home page GithubHelp logo

sewiti / licensing-system Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 2.0 1.67 MB

Open source licensing system to make digital rights management secure. Bachelor's degree project.

Go 98.75% Shell 0.13% CSS 0.03% HTML 0.43% Makefile 0.66%
bsc-project go

licensing-system's Introduction

Online Software Licensing System

Test

Install

Requires system with systemd and Go (at least 1.18).

sudo make install

make install builds, and sets up /opt/licensing-server directory, where the built binary will be copied to. Also generates keys file and sets up LICENSING_SERVER_KEY variable in .env. keys file includes licensing server's public and private keys, used by licensing protocol to function.
Client's software should have public part (aka id) hard-coded into the binary.

For system to work, couple environment config variables are required, this includes:

  • DB_DSN (See PostgreSQL)
  • LICENSING_SERVER_KEY (Autogenerated by make install)

PostgreSQL

PostgreSQL is required for system to function. Database credentials should be entered in /opt/licensing-server/.env in the following format:

DB_DSN=postgres://licensingUname:securePasswd@localhost:5432/licensingDB?sslmode=disable

Starting

Using systemd service:

sudo systemctl enable --now licensing.server.service

Env config

System has a lot of options to configure to fit your needs. Default location of the config is located in /opt/licensing-server/.env.

Supported environment config variables include:

Variable Meaning
DB_DSN Used for connecting to a database (should start with postgres://).
DISABLE_GUI Disables integrated webpage (default: false).
HTTP_LISTEN Specifies TCP address for server to listen on (default: :http/:https depending on TLS).
HTTP_READ_TIMEOUT Maximum duration for reading entire request (default: 30s).
HTTP_WRITE_TIMEOUT Maximum duration before timing out writes of the response (default: 30s).
HTTP_SHUTDOWN_TIMEOUT Maximum duration before server shutdown is forced (default `30s).
HTTP_GZIP Use gzip compression for requests (default false).
HTTP_CORS_RESOURCE_API_ENABLED Use CORS for resource API (issuers, products, licenses) (default: false).
HTTP_CORS_LICENSING_API_ENABLED Use CORS for licensing API (creating, refreshing license sessions) (default: false).
HTTP_CORS_ALLOWED_ORIGINS Allowed origins for CORS.
HTTP_TLS_CERT_FILE TLS certificate file.
HTTP_TLS_KEY_FILE TLS private key file.
INTERNAL_SOCKET Socket path for internal CLI (default: /run/licensing-server.sock).
LICENSING_SERVER_KEY Licensing server's private key, base64 encoded.
LICENSING_MAX_TIME_DRIFT Max allowed time drift between server and client (default: 6h).
LICENSING_CLEANUP_INTERVAL Inactive/expired/overused license sessions cleanup interval (default: 20m).
LICENSING_REFRESH_MIN License session minimum refresh duration (default: 5m).
LICENSING_REFRESH_MAX License session maximum refresh duration (default: 2h).
LICENSING_REFRESH_JITTER License session refresh duration variance, 0.0-1.0 (default: 0.1).
LICENSING_LIMITER_SESSION_EVERY New license sessions creation rate limiter to allow every x interval (default: 10m).
LICENSING_LIMITER_BURST_TOTAL New license sessions creation rate limiter max burst worth in session time (default: 8h).
LICENSING_LIMITER_CACHE_EXPIRATION New license sessions creation rate limiter cache expiration (default: 24h).
LICENSING_LIMITER_CACHE_CLEANUP_INTERVAL New license sessions creation rate limiter cache cleanup interval (default: 1h).
MIN_PASSWD_ENTROPY Minimum required entropy for issuer passwords, see zxcvbn (default: 30).

See cmd/server/config.go.

licensing-system's People

Contributors

sewiti avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.