Git Product home page Git Product logo

memorial's Introduction

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>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.