diff --git a/fly.toml b/fly.toml index b3736b0..345eef5 100644 --- a/fly.toml +++ b/fly.toml @@ -1,9 +1,9 @@ -# fly.toml app configuration file generated for shy-field-2671 on 2023-05-02T01:26:21Z +# fly.toml app configuration file generated for lyz05-danmaku on 2024-01-11T19:54:43+08:00 # # See https://fly.io/docs/reference/configuration/ for information about how to use this file. # -app = "shy-field-2671" +app = "lyz05-danmaku" primary_region = "sea" kill_signal = "SIGINT" kill_timeout = "5s" @@ -11,29 +11,20 @@ kill_timeout = "5s" [experimental] auto_rollback = true +[build] + [env] PORT = "8080" -[[services]] - protocol = "tcp" +[http_service] internal_port = 8080 + force_https = true + auto_stop_machines = true + auto_start_machines = true + min_machines_running = 0 processes = ["app"] - [[services.ports]] - port = 80 - handlers = ["http"] - force_https = true - - [[services.ports]] - port = 443 - handlers = ["tls", "http"] - [services.concurrency] - type = "connections" - hard_limit = 25 - soft_limit = 20 - - [[services.tcp_checks]] - interval = "15s" - timeout = "2s" - grace_period = "1s" - restart_limit = 0 +[[vm]] + cpu_kind = "shared" + cpus = 1 + memory_mb = 256 diff --git a/routes/airportsub.js b/routes/airportsub.js index baf6fb7..3b39ad1 100644 --- a/routes/airportsub.js +++ b/routes/airportsub.js @@ -4,7 +4,7 @@ const leancloud = require("../utils/leancloud"); /* GET users listing. */ router.get("/", async function (req, res) { - await leancloud.add("SubAccess", { + leancloud.add("SubAccess", { remoteIP: req.ip, UA: req.headers["user-agent"], user: req.query.user, diff --git a/routes/danmaku.js b/routes/danmaku.js index e7b8651..e40b190 100644 --- a/routes/danmaku.js +++ b/routes/danmaku.js @@ -63,7 +63,7 @@ async function build_response(url, req) { console.log(e); let err = JSON.stringify(e, Object.getOwnPropertyNames(e)); err = JSON.parse(err); - await leancloud.add("DanmakuError", { + leancloud.add("DanmakuError", { ip: req.ip, url, err @@ -108,7 +108,7 @@ async function index(req, res) { /* GET home page. */ router.get("/", apiLimiter, async function (req, res) { - await leancloud.add("DanmakuAccess", { + leancloud.add("DanmakuAccess", { remoteIP: req.ip, url: req.query.url, UA: req.headers["user-agent"] diff --git a/s.yaml b/s.yaml index 047d14b..8fc2750 100644 --- a/s.yaml +++ b/s.yaml @@ -1,3 +1,4 @@ +# 内存吃不消 edition: 1.0.0 name: fc-danmaku access: default