Skip to content

Commit

Permalink
relay: all empty web token
Browse files Browse the repository at this point in the history
  • Loading branch information
Ehco1996 committed Oct 6, 2023
1 parent 85ab6f6 commit ac7fc6d
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 5 deletions.
24 changes: 24 additions & 0 deletions apps/proxy/migrations/0018_alter_relaynode_web_token.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Generated by Django 4.1.3 on 2023-10-06 02:29

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("proxy", "0017_proxynode_current_used_download_bandwidth_bytes_and_more"),
]

operations = [
migrations.AlterField(
model_name="relaynode",
name="web_token",
field=models.CharField(
blank=True,
default="",
max_length=64,
null=True,
verbose_name="Web验证Token",
),
),
]
4 changes: 3 additions & 1 deletion apps/proxy/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,9 @@ class RelayNode(BaseNodeModel):
enable_ping = models.BooleanField("是否开启PING", default=True)
enable_udp = models.BooleanField("是否开启UDP 转发", default=True)
web_port = models.IntegerField("Web端口", default=0)
web_token = models.CharField("Web验证Token", max_length=64, default="")
web_token = models.CharField(
"Web验证Token", max_length=64, default="", null=True, blank=True
)

class Meta:
verbose_name = "中转节点"
Expand Down
10 changes: 7 additions & 3 deletions templates/clash/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ socks-port: 7891
allow-lan: true
bind-address: "*"
mode: rule
log-level: silent
log-level: info
external-controller: 0.0.0.0:9090

proxy-groups:
Expand All @@ -18,15 +18,17 @@ proxy-groups:
- name: Final
type: select
proxies:
- Proxy
- DIRECT
- Proxy

- name: auto
type: url-test
use:
- {{ provider_name }}
url: 'http://www.gstatic.com/generate_204'
interval: 300
tolerance: 150
lazy: true

proxy-providers:
{{ provider_name }}:
Expand All @@ -36,7 +38,9 @@ proxy-providers:
path: ./providers/{{ provider_name }}.yaml
health-check:
enable: true
interval: 600
interval: 300
tolerance: 150
lazy: true
url: http://www.gstatic.com/generate_204

{% if sub_client == "clash" %}
Expand Down
2 changes: 1 addition & 1 deletion templates/clash/rule_sets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,4 @@ rules:
- RULE-SET,telegramcidr,Proxy
- GEOIP,LAN,DIRECT
- GEOIP,CN,DIRECT
- MATCH,Proxy
- MATCH,DIRECT

0 comments on commit ac7fc6d

Please sign in to comment.