- Web API
- Belayer Server Docker Image
- Create Distributions
- Installing Distributions
- Java11
And build with gradle.
$ cd webapi
$ ./gradlew clean build -x test
$ cd webapi
$ java -jar build/libs/belayer-webapi-x.x.x.jar
Ctrl-C to shutdown.
-
API
$ curl http://localhost:8000/api/hello
-
Health Check
$ curl http://localhost:18000/management/health
You can configure the Belayer Server with environment variables. See the env var table below.
Environment Variable | Description | Default Value (used when variable is not defined) |
---|---|---|
BELAYER_SERVER_PORT | server port for this web application. | 8000 |
BELAYER_MANAGEMENT_PORT | management port for this web application. | 18000 |
BELAYER_LOG_LEVEL | Log level for belaer WebAPI Server. | WARN |
BELAYER_STORAGE_ROOT | The directory path to use as Belayer storage. | /opt/belayer/storage |
TSURUGI_URL | URL to connect Tsurugi database. | tcp://localhost:12345/ |
TSURUGI_CONNECT_TIMEOUT_SEC | connect timeout seconds for Tsurugi database. | 5 |
TSURUGI_SESSION_TIMEOUT_MIN | session timeout minutes for Tsurugi database. | 15 |
TSURUGI_HOME | Tsurugi HOME directory. | /usr/lib/tsurugi |
TSURUGI_CONF | Tsurugi configuration file path. | ${TSURUGI_HOME}/var/etc/tsurugi.ini |
TSURUGI_AUTH_URL | URL for authentication server "harinoki". | http://localhost:8080/harinoki |
TSURUGI_AUTH_AT_EXPIRATION_MIN | The expiration minutes for Access Token. | 10 |
BELAYER_MAX_FILE_LIST_SIZE | Max size to list the files. | 500 |
BELAYER_JOB_EXPIRATION_DAYS | Epiration days for the job history data. | 3 |
BELAYER_DL_ZIP_COMPRESS_LEVEL | Zip compress level to download the all file contents in the specified directory. (0-9 or -1 as default) |
-1 (default compress level) |
BELAYER_BK_ZIP_COMPRESS_LEVEL | Zip compress level to archive back up files. (0-9 or -1 as default) |
-1 (default compress level) |
BELAYER_ADMIN_PAGE_ENABLED | Serve WebAdmin Contents.(optional, not supported as default) | false |
BELAYER_ADMIN_PAGE_PATH | WebAdmin page path. | /admin |
BELAYER_WEBADMIN_LOCATION | Path to WebAdmin Contents.(optional, not supported as default) | file://dev/null |
- Launch Java process with the profile option.
java -Dspring.profiles.active=authmock -jar path/to/belayer.jar
- You can use dummy users defined as uid=password in
webapi/src/main/resources/application-authmock.properties
- pull Tsurugi Docker image
$ sudo docker pull ghcr.io/project-tsurugi/tsurugidb:latest
- Start Server and Step in Docker Container.
$ docker-compose up -d
$ docker-compose exec server bash
See requirements to build each components.
$ cd distribution
$ sh create_archives.sh
The distribution files will be in the following directory.
distribution/dist
$ ls dist
tsurugi-webapp-x.x.x.tar.gz
- tsurugi-webapp-x.x.x.tar.gz
- WebAPI Server(without WebAdmin Page), installation scripts, etc.
$ tar -zxvf tsurugi-webapp-x.x.x.tar.gz
$ cd tsurugi-webapp-x.x.x
$ sudo sh install.sh
Belayer Web API Server is installed under /usr/lib
.
$ ls /usr/lib/tsurugi-webapp-*
tsurugi-webapp-x-x-x
Specify TsurugiDB installed path as TSURUGI_HOME
environment variable,
then execute /usr/lib/tsurugi-webapp-x-x-x/bin/start_server.sh
to start belayer server.
You can specify install directory using --prefix
option.
$ tar -zxvf tsurugi-webapp-x.x.x.tar.gz
$ cd tsurugi-webapp-x.x.x
$ sh install.sh --prefix=$HOME/tsurugi-webapp
$ ls $HOME/tsurugi-webapp/*
tsurugi-webapp-x-x-x
Specify TsurugiDB installed path as TSURUGI_HOME
environment variable,
then execute <your_prefix>/bin/start_server.sh
to start belayer server.
Copy service definition file to /etc/systemd/system
.
sudo cp tsurugi-webapp.service /etc/systemd/system
sudo systemctl enable tsurugi-webapp.service
Note: If you have changed the directory to be installed belayer, you have to apply your setting to the TSURUGI_HOME
path and the ExecStart
path in tsurugi-webapp.service
.
tsurugi-webapp.service
[Service]
Type=simple
Environment=TSURUGI_HOME=/usr/lib/tsurugi
ExecStart=/usr/lib/tsurugi-webapp-#VERSION#/bin/start_server.sh
Restart=no