wilchn / BlazingQuartz

Blazor web UI to manage Quartz.NET scheduler jobs.
Apache License 2.0
70 stars 20 forks source link
aspnetcore blazor dotnet quartz-scheduler task-scheduler

BlazingQuartz

BlazingQuartz is an easy to use Blazor web UI to manage Quartz.NET scheduler jobs.

BlazingQuartz is created with ASP.NET Core Blazor Server and use MudBlazor component library.

Overview page

Requirements

Features

Quick Start

Using Docker

  1. Create the following folders:

    • /logs
    • /certs
  2. Copy BlazingQuartzDb.db to

  3. Run below docker command:

    docker run -d \
    --name=BlazingQuartzApp \
    -e TZ=<your_timezone> \
    -e ASPNETCORE_HTTP_PORTS=8080 \
    -v /<blazingquartz_path>/BlazingQuartzDb.db:/app/BlazingQuartzDb.db \
    -v /<blazingquartz_path>/logs:/app/logs \
    -v /<blazingquartz_path>/certs:/app/certs \
    -p 9090:8080 \
    wilchn/blazingquartzapp:latest

    Note: Replace the following:

    • <blazingquartz_path>
    • <your_timezone> - See list of acceptable values. Ex. Asia/Singapore
  4. Navigate to http://localhost:9090

Configuration

Enable HTTPS

To support https, you will need SSL certificate. Put the SSL certificate file to <blazingquartz_path>/certs. Then add the following lines to appsettings.json:

  "Kestrel": {
    "Certificates": {
        "Default": {
            "Path": "certs/<your_ssl_cert>.pfx",
            "Password": ""
        }
    }
  }

NOTE: Replace

Configure the docker container to use the https port. Ex. https on 9091

docker run -d \
...
-p 9090:8080 \
-p 9091:8081 \
-e ASPNETCORE_HTTPS_PORTS=8081 \
wilchn/blazingquartzapp:latest

Use other database

Below steps shows you how to use PostgreSQL database to store execution logs.

NOTE: Below steps assume that you already created the database and have imported the DB tables used by Quartz. For more info, refer to configure ADO.NET JobStore.

  1. Copy appsettings.json to
  2. Modify appsettings.json From

    "ConnectionStrings": {
     "BlazingQuartzDb": "DataSource=BlazingQuartzDb.db;Cache=Shared"
    },
    "Quartz": {
     ...
     "quartz.jobStore.driverDelegateType": "Quartz.Impl.AdoJobStore.SQLiteDelegate, Quartz",
     ...
     "quartz.dataSource.myDS.provider": "SQLite-Microsoft"
    },
    "BlazingQuartz": {
     "DataStoreProvider": "Sqlite",

    To

    "ConnectionStrings": {
     "BlazingQuartzDb": "Host=<db_host>;Port=5432;Database=<db_name>;Username=<db_user>;Password=<db_password>"
    },
    "Quartz": {
     ...
     "quartz.jobStore.driverDelegateType": "Quartz.Impl.AdoJobStore.PostgreSQLDelegate, Quartz",
     ...
     "quartz.dataSource.myDS.provider": "Npgsql"
    },
    "BlazingQuartz": {
     "DataStoreProvider": "PostgreSQL",

    NOTE: Replace below with actual database value:

    To use MSSQL, change DataStoreProvider to SqlServer and update the connection string.

  3. Configure the docker container to mount appsettings.json volume. Example docker command:
    docker run -d \
    --name=BlazingQuartzApp \
    -e TZ=<your_timezone> \
    -v /<blazingquartz_path>/appsettings.json:/app/appsettings.json \
    -v /<blazingquartz_path>/logs:/app/logs \
    -v /<blazingquartz_path>/certs:/app/certs \
    -p 9090:80 \
    wilchn/blazingquartzapp:latest

    NOTE: Replace and

Advance Details

Dynamic Variables

Dynamic variables provide pre-defined set of variables that can be used when assigning value to JobDataMap. Their values are generated at the time of job execution. Any JobDataMap field that support DataMapValueType.InterpolatedString can use dynamic variable in format {{$variable}}. For example, "list/{{$datetime 'yyyy-mm-dd'}}" will be replaced to "list/2022-09-26" during job execution.

Below are list of pre-defined variables. Note that variable names are case-sensitive.

$datetime and $localDatetime supports below offset units: Unit Description
y Year
M Month
d Day
h Hour
m Minute
s Second
ms Millisecond

Upgrading

Refer to upgrading page to see if any additional steps require to upgrade to newer version.