Skip to content

A simple http server provides Memorial Schedule service, can be easily deployed with docker.

License

Notifications You must be signed in to change notification settings

HIT-ReFreSH/Memorial

Repository files navigation

Memorial Server

DockerHub-v DockerHub-DL DockerHub-size GitHub GitHub last commit GitHub repo size GitHub code size

View at DockerHub

A simple http server provides Memorial Schedule service, can be easily deployed with docker.

Usage

Create config.json

In this format:

{
  "Subscriptions": [
    {
      "Name": "MyMemorials",

      "Events": [
        {
          "Expression": "No. %NOC% Year of 21st Centry",
          "Since": "2020-01-12",
          "Repeat": 4,
          "Notification": [
            {
              "Expression": "%Offset% days To the New Year",
              "DayOffset": 1,
              "Time": "08:00:00"
            }
          ]
        }
      ],
      "TimeZone": "Asia/Shanghai",
      "Secret": "Jinitaimei"
    }
  ]
}

Obviously, you may add may subscriptions with different Name & Secret, where TimeZone is calendar's timezone, and several events contained. Each event has its first date Since, repeat type Repeat, and its expression ("%NOC%" means number of cycles, will be replaced by the value, starts from 0). Notifications may be configured for each event.

Definitions of RepeatType and EventNotification are shown as following.

public enum RepeatType
{
    None = 0,
    EveryDay = 1,
    EveryWeek = 2,
    EveryMonth = 3,
    EveryYear = 4,
    Every100Days = 5, // <- NEW!!!
}
/// <summary>
/// 
/// </summary>
/// <param name="Expression">Expression of Notification</param>
/// <param name="DayOffset">The number of days the reminder needs to advance.</param>
/// <param name="Time">Time to show Notification</param>
public record EventNotification(string Expression, int DayOffset, TimeOnly Time);

Place the config.json to your server, remember to use UTF-8 encoding.

Deployment

Please deploy with docker, use your own port number & config. Remember to configure your firewall.

docker pull ferdinandsu/memorial:latest
docker run -it --name memorial -v /root/config.json:/app/config.json -p 10086:80 -d docker.io/ferdinandsu/memorial:latest

Use Subscription

GET the Subscription's Calendar with the following link:

http://ip:port/cal/<Name>?secret=<Secret>

GET the Subscription's today events with the following link:

http://ip:port/today/<Name>?secret=<Secret>

About

A simple http server provides Memorial Schedule service, can be easily deployed with docker.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published