Git Product home page Git Product logo

authmanager's Introduction

AuthManager

Just a webhook tool

Features

Monitor the configuration file, hot restart (but the restart will fail if the configuration file format is wrong)

File & Dir

rules.json :

Define the rules of config, All RouterConifgs should contain the corresponding rule, no need to modify usually.

AuthServerStartup :

the contorlor of program, you can execute as ./AuthServerStartup.sh start/stop/status/clean.

res/ :

you can put your html or program here for router using.

RouterConfigs/ :

All routerconfigs should put in this directory with suffix .json, so that program can read of them.

bin/config/ :

save basic config of http server, it will be generated when program first startup

bin/log/ :

save log of httpserver

Startup

Envirnment

C++

C++ version >= 17

apt-get update
apt-get install -y gcc g++

Xmake

Document: https://xmake.io/#/

wget https://xmake.io/shget.text -O - | bash

Compile (project root path)

xmake

Usage

Script AuthServerStartup

Usage:  $ ./AuthServerStartup [options]
optoins:
    start       Start the AuthManager and monitor  
    stop        Stop AuthManager
    status      Show process status of AuthManager
    clean       Remove all log in bin/logs

Configs in RouterConfigs

all configs file should be set in form of JSON

Example:

{
    "default" : {
        "router" : "/hello",
        "type" : "text",
        "text" : "hello world",
        "discription" : "show text 'hello world'"
    },
    "hello" : {
        "router" : "/hello",
        "type" : "html",
        "path" : "/opt/www/hello.html",
        "discription" : "show hello page"
    },
    "ls" : {
        "router" : "/ls",
        "type" : "program",
        "command" : "ls -al",
        "discription" : "show command result"
    }
}

Key "default" "hello" "ls" has no function, you can use any name as your like

You can find the support type in rules.json

Such as type "text"

In rule file:

{
    "name": "TEXT",
    "type":"text",
    "syntax": {
        "router": "string",
        "type": "string",
        "text": "string"
    }
},

it syntax has three option "router" "type" "text" so all of three option should be set in config

"default" : {
        "router" : "/hello",
        "type" : "text",
        "text" : "hello world",
        "discription" : "show text 'hello world'"
    },

"discription" is not necessary,you can remove or change it.

authmanager's People

Contributors

beiklive avatar

Stargazers

Choo avatar

Watchers

 avatar

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.