Changeset 68 in code


Ignore:
Timestamp:
Feb 11, 2024, 12:56:18 AM (16 months ago)
Author:
yakumo.izuru
Message:

インストール手順の更新、例の追加、リミッターの再構成

Signed-off-by: Izuru Yakumo <yakumo.izuru@…>

Location:
trunk
Files:
3 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/INSTALL.md

    r67 r68  
    22
    33```shell
    4 $ git clone https://git.chaotic.ninja/yakumo.izuru/mai
     4$ git clone git://git.chaotic.ninja/yakumo_izuru/mai
    55$ cd mai
    66$ make
     
    88```
    99* Read the [mai.ini(5)](mai.ini.5) manual page
    10 * Use any web server than is able to reverse proxy, like Apache, h2o, or NGINX.
    11 
     10* Use any web server than is able to reverse proxy, like [Apache](https://httpd.apache.org), [h2o](https://h2o.examp1e.net), or [NGINX](https://www.nginx.com).
     11  * Examples are provided on the repository
  • trunk/cmd/mai/main.go

    r67 r68  
    5858                fiber.Config{
    5959                        AppName: "Mai",
     60                        ProxyHeader: fiber.HeaderXForwardedFor,
     61                        TrustedProxies: []string{"0.0.0.0/0"},
    6062                        ServerHeader: "Mai (using Fiber v2.x)",
    6163                        Views: engine,
     
    7678        ))
    7779
    78         app.Use(limiter.New())
     80        app.Use(limiter.New(limiter.Config{
     81                Max: 10,
     82                Expiration: 180 * time.Second,
     83                LimitReached: func(c *fiber.Ctx) error {
     84                        return c.SendStatus(429)
     85                        return c.SendFile(conf.tmplpath + "/429.html")
     86                },
     87        }))
    7988
    8089        app.All("/", func(c *fiber.Ctx) error {
Note: See TracChangeset for help on using the changeset viewer.