Git Product home page Git Product logo

Comments (3)

shankerwangmiao avatar shankerwangmiao commented on May 31, 2024 1

这几个文件的情况各不相同,isoinfo.json 是有脚本在定时生成,脚本在 https://github.com/tuna/mirror-web/blob/master/geninfo/genisolist.py

tunasync.json 由 nginx 反代给 tunasync 的 manager,由 manager 产生输出,相关代码在 https://github.com/tuna/tunasync/blob/master/manager/status.go

tunet.json 直接由 nginx 产生,本意是用于判断用户是否在校园网内,却访问了镜像站校园网外的 IP 地址;如果是,则在前端产生提醒,提醒用户防止产生过多流量。目前该功能已经废除,因为镜像站已经没有校园网外的地址了。相关代码如下:

geo $ipwhitelist {
        default 1;
        127.0.0.0/8 0;
        172.18.0.0/16 0;
        166.111.0.0/16 0;
        59.66.0.0/16 0;
        101.5.0.0/16 0;
        101.6.0.0/16 0;
        183.172.0.0/16 0;
        183.173.0.0/16 0;
        118.20.0.0/20 0;
        :: 0;
}

map $ipwhitelist $limit {
        1 $binary_remote_addr;
        0 "";
}

limit_conn_zone $limit zone=limit:10m;

location = /static/tunet.json {
        return 200 "false";
        # F**k nginx does not support nested if nor "and" "or" "else" "not"
        # Halt! Magic here! Don't Touch!
        
        # set $outer "0";
        # if ($limit) {
        #       set $outer 1;
        # }
        # set $insider_out "0";
        # if ($server_addr = "202.112.3.6") {
        #       set $insider_out "1+${outer}";
        # }
        # if ($insider_out = "1+0") {
        #       return 200 "true";
        # }
        # return 200 "false";
}

from mirror-web.

bubbleatgit avatar bubbleatgit commented on May 31, 2024 1

tunasync.json 其实是tunasync管理器的manager提供的一个接口,接口地址为 http://manager:listenport>/jobs。

接口作用及接口名称查看 https://github.com/tuna/tunasync/blob/master/manager/server.go

生成tunasync.json的代码,查看 https://github.com/tuna/tunasync/blob/master/internal/status_web.go

from mirror-web.

alick avatar alick commented on May 31, 2024

我猜是服务器端一些脚本生成的。

from mirror-web.

Related Issues (20)

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.