Skip to content

Commit

Permalink
feat: rule selections
Browse files Browse the repository at this point in the history
  • Loading branch information
7Sageer committed Aug 10, 2024
1 parent 4fcdb69 commit 5bb6914
Show file tree
Hide file tree
Showing 3 changed files with 243 additions and 42 deletions.
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@

## 最近更新

### 10/8

- 添加快速选择规则集
- 细化规则集
- 增添更多分类
- 将OpenAI改为AI服务,包含Claude,Jetbrains-AI等规则
- 优化显示

### 7/8

- 优化UI
Expand All @@ -34,12 +42,6 @@

---

### 4/8

- 重构配置文件生成逻辑

---

## 部署

[![Deploy to Cloudflare Workers](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/7Sageer/sublink-worker)
Expand Down
59 changes: 48 additions & 11 deletions src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ export const UNIFIED_RULES = [
name: 'Ad Block',
outbound: '🛑 广告拦截',
site_rules: ['category-ads-all'],
ip_rules: ['ad']
ip_rules: []
},
{
name: 'OpenAI',
outbound: '💬 OpenAI',
site_rules: ['openai'],
name: 'AI 服务',
outbound: '💬 AI 服务',
site_rules: ['openai', 'anthropic','jetbrains-ai'],
ip_rules: []
},
{
Expand All @@ -33,12 +33,6 @@ export const UNIFIED_RULES = [
site_rules: ['google'],
ip_rules: ['google']
},
{
name: 'Netflix',
outbound: '🎥 奈飞视频',
site_rules: ['netflix'],
ip_rules: ['netflix']
},

{
name: 'Private',
Expand Down Expand Up @@ -77,6 +71,49 @@ export const UNIFIED_RULES = [
ip_rules: []
},

{
name: 'Social Media',
outbound: '🌐 社交媒体',
site_rules: ['facebook', 'instagram', 'twitter', 'tiktok', 'linkedin'],
ip_rules: []
},
{
name: 'Streaming',
outbound: '🎬 流媒体',
site_rules: ['netflix', 'hulu', 'disney', 'hbo', 'amazon'],
ip_rules: []
},
{
name: 'Gaming',
outbound: '🎮 游戏平台',
site_rules: ['steam', 'epicgames', 'ea', 'ubisoft', 'blizzard'],
ip_rules: []
},
{
name: 'Github',
outbound: '🐱 Github',
site_rules: ['github', 'gitlab'],
ip_rules: []
},
{
name: 'Education',
outbound: '📚 教育资源',
site_rules: ['coursera', 'edx', 'udemy', 'khanacademy'],
ip_rules: []
},
{
name: 'Financial',
outbound: '💰 金融服务',
site_rules: ['paypal', 'visa', 'mastercard'],
ip_rules: []
},
{
name: 'Cloud Services',
outbound: '☁️ 云服务',
site_rules: ['aws', 'azure', 'digitalocean', 'heroku', 'dropbox'],
ip_rules: []
}

];

// Generate SITE_RULE_SETS and IP_RULE_SETS from UNIFIED_RULES
Expand Down Expand Up @@ -136,7 +173,7 @@ export function generateRuleSets(selectedRuleNames = []) {
url: `${SITE_RULE_SET_BASE_URL}${SITE_RULE_SETS[rule]}`,
download_detour: '⚡ 自动选择'
})),
ip_rule_sets: ipRuleSets.map(rule => ({
ip_rule_sets: ipRuleSets.map(rule => ({
tag: `${rule}-ip`,
type: 'remote',
format: 'binary',
Expand Down
Loading

0 comments on commit 5bb6914

Please sign in to comment.