runs-on: ubuntu-latest
strategy:
matrix:
- go: [ '1.22' ]
+ go: [ '1.23' ]
steps:
- name: Set up Go${{ matrix.go }}
uses: actions/setup-go@v5
runs-on: ubuntu-latest
strategy:
matrix:
- go: [ '1.22' ]
+ go: [ '1.23' ]
steps:
- name: Set up Go${{ matrix.go }}
uses: actions/setup-go@v5
runs-on: windows-latest
strategy:
matrix:
- go: [ '1.22' ]
+ go: [ '1.23' ]
steps:
- name: Set up Go${{ matrix.go }}
uses: actions/setup-go@v5
runs-on: macos-latest
strategy:
matrix:
- go: [ '1.22' ]
+ go: [ '1.23' ]
steps:
- name: Set up Go${{ matrix.go }}
uses: actions/setup-go@v5
runs-on: ubuntu-latest
strategy:
matrix:
- go: [ '1.22' ]
+ go: [ '1.23' ]
steps:
- name: Set up Go${{ matrix.go }}
uses: actions/setup-go@v5
runs-on: ubuntu-latest
strategy:
matrix:
- go: [ '1.22' ]
+ go: [ '1.23' ]
steps:
- name: Set up Go${{ matrix.go }}
uses: actions/setup-go@v5
runs-on: windows-latest
strategy:
matrix:
- go: [ '1.22' ]
+ go: [ '1.23' ]
steps:
- name: Set up Go${{ matrix.go }}
uses: actions/setup-go@v5
runs-on: macos-latest
strategy:
matrix:
- go: [ '1.22' ]
+ go: [ '1.23' ]
steps:
- name: Set up Go${{ matrix.go }}
uses: actions/setup-go@v5
reqf "github.com/qydysky/part/reqf"
psql "github.com/qydysky/part/sql"
syncmap "github.com/qydysky/part/sync"
+ sys "github.com/qydysky/part/sys"
web "github.com/qydysky/part/web"
_ "modernc.org/sqlite"
)
panic(e)
}
+ port := `80`
+ if s := strings.Split(serAdress, ":"); len(s) > 1 {
+ port = s[1]
+ }
+
+ var ips []string
+ {
+ // 启动时显示ip
+ showIpOnBoot, _ := t.K_v.LoadV("启动时显示ip").(bool)
+ for ip := range sys.GetIpByCidr() {
+ if showIpOnBoot {
+ if ip.To4() != nil {
+ fmt.Printf("当前地址 http://%s:%s\n", ip.String(), port)
+ } else {
+ fmt.Printf("当前地址 http://[%s]:%s\n", ip.String(), port)
+ }
+ }
+ ips = append(ips, ip.String())
+ }
+ }
+
var (
readTimeout = 3
readHeaderTimeout = 3
}
}
+ if val, ok := t.K_v.LoadV("ip路径").(string); ok && val != "" {
+ t.SerF.Store(val, func(w http.ResponseWriter, r *http.Request) {
+ if DefaultHttpCheck(t, w, r, http.MethodGet) {
+ return
+ }
+ for _, v := range ips {
+ if _, e := w.Write([]byte(v + "\n")); e != nil {
+ return
+ }
+ }
+ })
+ }
+
if val, ok := t.K_v.LoadV("性能路径").(string); ok && val != "" {
var cache web.Cache
t.SerF.Store(val, func(w http.ResponseWriter, r *http.Request) {
### 说明
本项目使用github action自动构建,构建过程详见[yml](https://github.com/qydysky/bili_danmu/blob/master/.github/workflows/go.yml)
+#### ip路径
+配置文件中添加配置项`ip路径`(>v0.14.16)。不为空时,将会在指定路径显示出当前主机ip,从而可以使用主机名来获取主机ipv6,以便于[ddns-go](https://github.com/jeessy2/ddns-go)等通过命令获取ipv6。默认空。
+
+例子:
+```
+{
+ "Web服务地址":"0.0.0.0:11000",
+ "ip路径":"/ip/"
+}
+```
+
+```
+curl -s http://{主机名}:11000/ip/
+192.168.31.230
+172.16.0.1
+172.17.144.244
+172.17.0.1
+172.17.0.10
+172.17.121.35
+2409:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:8ce5
+fd55:d4a5:a9e7:0:aab8:e0ff:fe03:8ce5
+fe80::aab8:e0ff:fe03:8ce5
+fe80::d8dc:35ff:fe21:d71b
+fe80::785f:8dff:fe34:9443
+fe80::440a:9fff:fe6d:5da6
+fe80::60ff:4cff:fee7:c226
+fe80::4c24:e3ff:fe65:b955
+fe80::8099:ecff:fefa:f36c
+fe80::68fe:63ff:fe74:6e35
+```
+
+```
+curl -s http://{主机名}:11000/ip/ | awk '/240:?/'
+
+2409:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:8ce5
+```
+
#### 保持粉丝牌点亮
配置文件中添加配置项`保持牌子亮着_指定时间`(>v0.14.11)。将会在指定时间启动保持。默认`00:00:00`
}
}()
- // 启动时显示ip
- if v, ok := c.C.K_v.LoadV("启动时显示ip").(bool); ok && v {
- for _, v := range sys.GetIntranetIp(``) {
- danmulog.L(`I: `, `当前ip:http://`+v)
- }
- }
-
{
//如果连接中断,则等待
F.KeepConnect()
"debug路径":"",
"性能路径-help":"当Web服务地址不为空时, 访问此路径可以获取性能信息,为空时关闭",
"性能路径":"/state/",
+ "ip路径":"",
"生成pgo-help":"将在退出后生成pgo文件在指定路径,default.pgo将有助于下次构建的优化,但会导致gc频繁,构建缓慢,为空时不生成",
"生成pgo":"",
"登陆二维码-白":"OO",
require (
github.com/gotk3/gotk3 v0.6.4
github.com/mdp/qrterminal/v3 v3.2.0
- github.com/qydysky/part v0.28.20240821214546
+ github.com/qydysky/part v0.28.20240823183215
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
golang.org/x/text v0.17.0
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/qydysky/biliApi v0.0.0-20240725184407-15076dddb6fb h1:dtSpNF9hLQa09TUfR+xbYFkHcx2breAFsXeU7e599gE=
github.com/qydysky/biliApi v0.0.0-20240725184407-15076dddb6fb/go.mod h1:om024vfxALQ5vxsbaGoMm8IS0esLYBnEOpJI8FsGoDg=
-github.com/qydysky/part v0.28.20240821214546 h1:MtOxggPvVKa9t24QhxxDuIxuuSjJUCaAwVCJRsN+gWs=
-github.com/qydysky/part v0.28.20240821214546/go.mod h1:lv0lIlm2keVMdwnOzXdRCUL8Ky8HoAAYw8coaBW6rb8=
+github.com/qydysky/part v0.28.20240823183215 h1:irnWS/3QsVDrx8xSoFtmxkkyVPzFhnyvBFTf6mwCMpk=
+github.com/qydysky/part v0.28.20240823183215/go.mod h1:lv0lIlm2keVMdwnOzXdRCUL8Ky8HoAAYw8coaBW6rb8=
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE=
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI=