Skip to main content

Registry

commits languages .NET Core

DroneDB Registry is a simple, user-friendly aerial data management and storage application. It features JWT authentication and implements a full REST API.

Combined with Hub, it provides a simple, fast and reliable platform for hosting and sharing geospatial images and data. It also allows you to view orthophotos, point clouds and 3d models (obj) easily and effortlessly directly in the browser.

Orthophoto and flight path

orthophoto

Files with previews

files

Point cloud interactive view

point-cloud

Example repositories

Getting started with Docker

To get started, download Docker and install it. Then run this command:

docker run -it --rm -p 5000:5000 -v ${PWD}/registry-data:/data dronedb/registry

The data will be stored in the local folder registry-data. Open https://localhost:5000 in your browser to start using the application.

Default credentials are admin and password.

Useful links:

The log file is located in registry-data/logs/registry.txt.

Getting started natively

You need to install the latest version of the DroneDB library and add it to PATH.

Download the latest release for your platform and run the following command:

./Registry.Web ./registry-data

There are several other command line options:

-a, --address              (Default: localhost:5000) Address to listen on
-c, --check Check configuration and exit.
-r, --reset-hub Reset the Hub folder by re-creating it.
--help Display this help screen.
--version Display version information.
Storage folder (pos. 0) Required. Points to a directory on a filesystem where to store Registry data.

NOTE: This configuration uses sqlite as database. It is for local testing only. If you want to use the application in a heavy load environment, check the following section.

Change admin password

Go to /account to change password. Otherwise, you can change the admin password by changing the value of the field DefaultAdmin.Password in the appsettings.json file. After changing the password you need to restart the application.

Running with docker-compose

cd docker/testing
docker-compose up -d

The stack is composed of:

  • MariaDB database
  • PHPMyAdmin, exposed on port 8080
  • Registry, exposed on port 5000

Running in production

You will need Git. Clone the repo and initialize submodules:

git clone https://github.com/DroneDB/Registry
cd Registry
git submodule update --init --recursive

And then run the following commands:

Linux

cd docker/production
chmod +x run.sh
./run.sh

Windows

cd docker/production
run.bat

Check that everything is running smoothly:

docker-compose ps
docker-compose logs -f

When all the containers are running, you can then open http://localhost:5000 in your browser, use admin:password as default credentials.

You can stop the application by issuing:

docker-compose down

The run.sh / run.bat script will create the default appsettings.json file, the database initialization script and start the Docker containers.

It is possible to customize the startup settings by creating a .env file in the same folder. Here's an example:

Linux (quotes are important)

MYSQL_ROOT_PASSWORD="default-root-password"
MYSQL_PASSWORD="default-mysql-password"
REGISTRY_ADMIN_MAIL="test@test.it"
REGISTRY_ADMIN_PASSWORD="password"
REGISTRY_SECRET="longandrandomsecrettobegeneratedusingcryptographicallystrongrandomnumbergenerator"
EXTERNAL_URL=""
CONTROL_SWITCH='$controlSwitch'

Windows (values without quotes)

MYSQL_ROOT_PASSWORD=default-root-password
MYSQL_PASSWORD=default-mysql-password
REGISTRY_ADMIN_MAIL=test@test.it
REGISTRY_ADMIN_PASSWORD=password
REGISTRY_SECRET=longandrandomsecrettobegeneratedusingcryptographicallystrongrandomnumbergenerator
EXTERNAL_URL=
CONTROL_SWITCH=$controlSwitch

If you want to reduce the log verbosity, you can change "Information" to "Warning" in appsettings.json:

    "LevelSwitches": {
"$CONTROL_SWITCH": "Warning"
}

then run

docker-compose restart registry

Info: Any changes to the configuration file need to restart the registry container

Build Docker image

If you want to build the image from scratch, you can use the following commands:

git clone https://github.com/DroneDB/Registry
cd Registry
git submodule update --init --recursive
docker build . -t dronedb/registry

Running from source

Registry is written in C# on .NET Core 6 platform and runs natively on both Linux and Windows. To install the latest .NET SDK see the official download page. Before building registry ensure you have ddblib in your path, if not, download the latest release and add it to PATH.

Clone the repository:

git clone https://github.com/DroneDB/Registry
cd Registry
git submodule update --init --recursive

Build the Hub interface (need NodeJS 14+):

cd Registry.Web/ClientApp
npm install -g webpack@4
npm install
webpack

Build the solution from the command line:

dotnet build

Run the tests to make sure the project is working correctly:

dotnet test

Then you can run the application:

dotnet run --project Registry.Web ./registry-data

Updating

In order to update the application, you need to replace the executable with the latest version. It will perform the required migrations and update the database at the next startup.

With docker or docker-compose, you update the application by pulling the latest image and restarting the container:

docker-compose down
docker-compose pull
docker-compose up -d

Project architecture

dronedb-registry-architecture

Configuration Reference

The configuration file is appsettings.json, if not present it will be created with default values (appsettings-default.json).

AuthCookieName

The name of the authorization cookie.

info

The default value is jwtToken.

AuthProvider

The authentication provider, supported values:

  • Sqlite: SQLite database
  • Mysql: MySQL or MariaDB, (compatibility)
  • Mssql: Microsoft SQL Server (no migrations)
info

The default value is Sqlite

The IdentityConnection connection string should be changed accordingly

BatchTokenLength

The length of the token generated in the share endpoint.

info

The default value is 32.

CachePath

The path to the cache folder. This is used to store the generated tiles and thumbnails.

info

The default value is ./cache.

CacheProvider

The additional cache provider, supported values:

  • InMemory: In-memory cache provider. Example value:
{ "type": "InMemory" }
  • Redis: Redis cache provider. Example value:
{
"type": "Redis",
"settings": {
"InstanceAddress": "localhost:5002",
"InstanceName": "registry"
}
}
info

The default value is null (InMemory is used).

ClearCacheInterval

The interval to clear the file cache (TimeSpan).

info

The default value is 01:00:00 (1 hour).

DefaultAdmin

The default admin user.

info

The default value is:

{
"Email": "admin@example.com",
"UserName": "admin",
"Password": "password"
},

EnableStorageLimiter

Enable the storage limiter. Registry will limit the storage usage of the user based on its metadata (maxStorageMB key).

info

The default value is false.

ExternalAuthUrl

The URL of the external authentication provider.

info

The default value is null.

ExternalUrlOverride

The external URL of Registry. This is used when the application is behind a reverse proxy.

info

The default value is null.

HangfireProvider

The Hangfire provider, supported values:

  • InMemory: In-memory provider. Example value:
  • Mysql: MySQL or MariaDB
info

The default value is InMemory

The HangfireConnection connection string should be changed accordingly

MaxRequestBodySize

The maximum request body size. It sets the MultipartBodyLengthLimit of the kestrel FormOptions.

info

The default value is null (default).

RandomDatasetNameLength

The length of the random dataset name, generated when calling the share endpoint.

info

The default value is 16.

RegistryProvider

The Registry database provider, supported values:

  • Sqlite: SQLite database
  • Mysql: MySQL or MariaDB, (compatibility)
  • Mssql: Microsoft SQL Server (no migrations)
info

The default value is Sqlite

The RegistryConnection connection string should be changed accordingly

RevokedTokens

The list of revoked JWT tokens.

Secret

The secret used as key to generate the JWT tokens. Do not use the same secret for multiple applications.

StoragePath

The path to the storage folder.

info

The default value is ./data

ThumbnailsCacheExpiration

The expiration time of the thumbnails cache (TimeSpan).

info

The default value is 00:30:00 (30 minutes).

TilesCacheExpiration

The expiration time of the tiles cache (TimeSpan).

info

The default value is 00:30:00 (30 minutes).

TokenExpirationInDays

The number of days after which the JWT tokens will expire.

info

The default value is 30 days.

UploadBatchTimeout

The timeout for the share upload endpoint. It is the maximum time allowed between the uploads.

info

The default value is 01:00:00 (1 hour).

WorkerThreads

The number of worker threads used by the application.

info

The default value is 0

Getting Help

Commercial support is available. Get in touch.