Skip to content

Commit

Permalink
Merge pull request #66 from izhdahawrt/izhdahawrt-wrtfocus
Browse files Browse the repository at this point in the history
RFC: proposing new openwrt package
  • Loading branch information
hiddify-com authored Sep 28, 2024
2 parents 628b7d9 + d6082a8 commit 6764653
Show file tree
Hide file tree
Showing 57 changed files with 317 additions and 61 deletions.
24 changes: 13 additions & 11 deletions wrt/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=hiddify-core
PKG_VERSION:=1.2.0
PKG_VERSION:=2.3.0
PKG_RELEASE:=1

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/hiddify/hiddify-core/tar.gz/v$(PKG_VERSION)?
PKG_HASH:=481098a29b0b08d225598e5e74eddfe4cbdd4560b7ac74d210dcc923792a3e24
PKG_HASH:=45500fcc59f7f8601eb8d5922692a24991b1c494ac753ce54f8216595f8101d4

PKG_LICENSE:=https://github.com/hiddify/hiddify-next/edit/main/LICENSE.md
PKG_LICENSE_FILES:=LICENSE
Expand All @@ -30,7 +30,7 @@ define Package/hiddify-core
CATEGORY:=Network
URL:=https://hiddify.com/
DEPENDS:=$(GO_ARCH_DEPENDS) +ca-bundle +kmod-inet-diag +kmod-tun
USERID:=hiddify-core=5566:hiddify-core=5566
USERID:=hiddify=15566:hiddify=15566
endef

define Package/hiddify-core/description
Expand All @@ -41,23 +41,25 @@ endef
GO_PKG_TAGS:=with_gvisor,with_quic,with_wireguard,with_ech,with_utls,with_clash_api,with_grpc,with_low_memory,with_conntrack

define Package/hiddify-core/conffiles
/etc/config/hiddify-core
/etc/hiddify-core/
/etc/config/hiddify
/etc/hiddify/
endef

define Package/hiddify-core/install

$(INSTALL_DIR) $(1)/usr/bin/
$(INSTALL_BIN) $(GO_PKG_BUILD_BIN_DIR)/HiddifyCli $(1)/usr/bin/hiddify-cli
$(INSTALL_BIN) $(GO_PKG_BUILD_BIN_DIR)/HiddifyCli $(1)/usr/bin/HiddifyCli
$(INSTALL_BIN) $(GO_PKG_BUILD_BIN_DIR)/cli $(1)/usr/bin/hiddify-cli

$(INSTALL_DIR) $(1)/etc/hiddify-core
$(INSTALL_DATA) $(PKG_BUILD_DIR)/release/config/config.json $(1)/etc/hiddify-core
$(INSTALL_DIR) $(1)/etc/hiddify
$(INSTALL_DATA) ./files/hiddify.json $(1)/etc/hiddify/appconfig.json

$(INSTALL_DIR) $(1)/etc/config/
$(INSTALL_CONF) ./files/hiddify.conf $(1)/etc/config/hiddify-core
$(INSTALL_CONF) ./files/hiddify.conf $(1)/etc/config/hiddify

$(INSTALL_DIR) $(1)/etc/init.d/
$(INSTALL_BIN) ./files/hiddify.init $(1)/etc/init.d/hiddify-core
$(INSTALL_BIN) ./files/hiddify.init $(1)/etc/init.d/hiddify

$(CP) ./files/webui $(1)/usr/bin/
endef

$(eval $(call BuildPackage,hiddify-core))
6 changes: 0 additions & 6 deletions wrt/files/hiddify-core.conf

This file was deleted.

39 changes: 0 additions & 39 deletions wrt/files/hiddify-core.init

This file was deleted.

4 changes: 4 additions & 0 deletions wrt/files/hiddify.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
config hiddify 'main'
option enabled '0'
option config '/config/file/or/sublink'
option appconfig '/etc/hiddify/appconfig.json'
27 changes: 27 additions & 0 deletions wrt/files/hiddify.init
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/sh /etc/rc.common

USE_PROCD=1
START=99

NAME="hiddify"
PROG="/usr/bin/hiddify-cli"


start_service() {
config_load "$NAME"

local enabled config appconfig
config_get_bool enabled "main" "enabled" "0"
[ "$enabled" -eq "1" ] || return 0

config_get config "main" "config"
config_get appconfig "main" "appconfig"
args=""
args="$args run -c $config -d $appconfig"
procd_open_instance
procd_set_param command $PROG $args
# procd_set_param stdout 1
# procd_set_param stderr 1
procd_set_param respawn
procd_close_instance
}
9 changes: 4 additions & 5 deletions wrt/files/hiddify.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"region": "ir",
"web-secret": "your-hidden-secret",
"enable-tun": true,
"mixed-port": 2334,
"tproxy-port": 2335,
"allow-connection-from-lan": false,
"allow-connection-from-lan": true,
"tls-tricks": {
"enable-fragment": false,
"fragment-size": "1-500",
Expand All @@ -25,7 +26,7 @@
"local-dns-port": 6450,
"tun-implementation": "gvisor",
"mtu": 9000,
"strict-route": true,
"strict-route": false,
"connection-test-url": "http://cp.cloudflare.com/",
"url-test-interval": 600,
"enable-clash-api": true,
Expand All @@ -36,8 +37,6 @@
"enable-fake-dns": false,
"enable-dns-routing": true,
"independent-dns-cache": true,
"geoip-path": "geo-assets\\sagernet-sing-geoip-geoip.db",
"geosite-path": "geo-assets\\sagernet-sing-geosite-geosite.db",
"rules": [],
"mux": {
"enable": false,
Expand All @@ -54,4 +53,4 @@
"noise": "5-10",
"noise-delay": "20-200"
}
}
}
1 change: 1 addition & 0 deletions wrt/files/webui/CNAME
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
yacd.metacubex.one
12 changes: 12 additions & 0 deletions wrt/files/webui/_headers
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# for netlify hosting
# https://docs.netlify.com/routing/headers/#syntax-for-the-headers-file

/*
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Referrer-Policy: same-origin
/*.css
Cache-Control: public, max-age=31536000, immutable
/*.js
Cache-Control: public, max-age=31536000, immutable
Binary file added wrt/files/webui/apple-touch-icon-precomposed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions wrt/files/webui/assets/BaseModal-ab8cd8e0.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions wrt/files/webui/assets/BaseModal-e9f180d4.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions wrt/files/webui/assets/Config-7eb3f1bb.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions wrt/files/webui/assets/Config-d98df917.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 6764653

Please sign in to comment.