Skip to content

Latest commit

 

History

History
108 lines (76 loc) · 3.13 KB

index.md

File metadata and controls

108 lines (76 loc) · 3.13 KB
layout title
doc-page
Getting Started

Create database

Create a database schema before install an application. Also, schema name is anything will be fine.

CREATE DATABASE qualtet;

Configuration

Qualtet reads all settings from the system environment variable. You have to set the following system environment variables.

Database

Property Description Type Default Example
QUALTET_DB_DATASOURCE_URL Data source url for JDBC connection. string - jdbc:mariadb://127.0.0.1/cahsper?useUnicode=true&characterEncoding=utf8mb4
QUALTET_DB_USER Database user name. string - root
QUALTET_DB_PASSWORD Database user password. string - pass

HTTP Server

Property Description Type Default Example
QUALTET_HTTP_BIND_ADDRESS Http server bind address. string 127.0.0.1 0.0.0.0
QUALTET_HTTP_PORT Http server port. int 9001 9001

Endpoints

Property Description Type Default Example
QUALTET_HTTP_ENDPOINT_SYSTEM_METADATA_ENABLED Allow to return application metadata (e.g Java version, commit hash etc). boolean false false

CORS

By default Qualtet allow CORS requests from any origin.

Property Description Type Default Example
QUALTET_CORS_ALLOW_ORIGINS.<n> CORS allow origin string - http://localhost:8080

Qualtet can specify multiple allow-origins.

# example
env 'QUALTET_CORS_ALLOW_ORIGINS.0'="http://localhost:8080"
env 'QUALTET_CORS_ALLOW_ORIGINS.1'="http://127.0.0.1:8080"
env 'QUALTET_CORS_ALLOW_ORIGINS.2'="http://localhost:3000"
...

Authentication

Qualtet uses JWT for auth endpoint. You have to set ISS and AUD for generationg JWT.

Property Description Type Default Example
QUALTET_JWT_ISS jwt iss string - -
QUALTET_JWT_AUD jwt aud string - -
QUALTET_JWT_EXPIRATION jwt expiration time (sec) int 3600 -

Cacheing

Some of endpoint has in-memory cache.

Property Description Type Default Example
QUALTET_CACHE_CONTENT_TYPE content type cache (sec) int 604800 -
QUALTET_CACHE_SITEMAP sitemap cache (sec) int 3600 -
QUALTET_CACHE_FEED feed cache (sec) int 7200 -

Search

Qualtet using full-text-search. So, please specify --innodb-ft-min-token-size=<n> on your MariaDB.

Property Description Type Default Example
QUALTET_SEARCH_MAX_NUM_OF_WORDS Maximum specifiable search words int 3 -
QUALTET_SEARCH_WORD_MIN_LENGTH Minimum length of search word int 2 -
QUALTET_SEARCH_WORD_MAX_LENGTH Maximum length of search word int 15 -

Create an author

Qualtet does not support the signup endpoint. Need to create an author with sbt task, like below.

$ sbt

...

$ sbt:qualtet> createAuthor <name> <displayName> <password>

// example
$ sbt:qualtet> createAuthor jhonDue JD pass

// result
2021-08-03 21:54:03 +0900 [INFO] from net.yoshinorin.qualtet.tasks.createAuthor$ - author created: {
  "id" : "01fgvhkzpyghp23wvp4p87nx29",
  "name" : "jhonDue",
  "displayName" : "JD",
  "createdAt" : 1627995242
}