Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "xunlei"
version = "3.5.2-6"
version = "3.5.2-7"
edition = "2021"
description = "Synology Nas Thunder runs on Linux"
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion openwrt/luci-app-xunlei/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=luci-app-xunlei
PKG_VERSION:=1.0.1-4
PKG_VERSION:=1.0.1-5

PKG_MAINTAINER:=gngpp <[email protected]>

Expand Down
8 changes: 4 additions & 4 deletions openwrt/luci-app-xunlei/luasrc/model/cbi/xunlei/client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ o = s:option(Value, "auth_user", translate("Username"))
o = s:option(Value, "auth_password", translate("Password"))
o.password = true

o = s:option(Value, "config_path", translate("Data Storage Path"))
o.default = "/etc/xunlei"
o = s:option(Value, "config_path", translate("Data Storage Path"), translate("Note: Please keep your user data safe"))
o.default = "/opt/xunlei"

o = s:option(Value, "download_path", translate("Default Download Path"))
o.default = "/tmp/downloads"
o = s:option(Value, "download_path", translate("Default Download Path"), translate("Note: Please change the download directory you determined for the first time, otherwise you will not be able to change the directory after startup"))
o.default = "/opt/xunlei/downloads"

return m
6 changes: 6 additions & 0 deletions openwrt/luci-app-xunlei/po/zh-cn/xunlei.po
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,9 @@ msgstr "数据储存路径"

msgid "Default Download Path"
msgstr "默认下载路径"

msgid "Note: Please change the download directory you determined for the first time, otherwise you will not be able to change the directory after startup"
msgstr "注意: 初次启动请更改你确定的下载目录,否则启动后将无法更改目录"

msgid "Note: Please keep your user data safe"
msgstr "注意: 请保管好你的用户数据"
8 changes: 7 additions & 1 deletion openwrt/xunlei/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk

PKG_NAME:=xunlei

PKG_VERSION:=3.5.2-6
PKG_VERSION:=3.5.2-7

PKG_LICENSE:=MIT
PKG_MAINTAINER:=gngpp <[email protected]>
Expand Down Expand Up @@ -56,6 +56,12 @@ define Package/$(PKG_NAME)/postrm
exit 0
endef

define Package/$(PKG_NAME)/postinst
#!/bin/sh
/etc/init.d/xunlei disable && /etc/init.d/xunlei enable
exit 0
endef

define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/xunlei $(1)/usr/bin/xunlei
Expand Down
4 changes: 2 additions & 2 deletions openwrt/xunlei/files/xunlei.config
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ config xunlei
option 'port' '5055'
option 'auth_user' ''
option 'auth_password' ''
option 'download_path' '/tmp/downloads'
option 'config_path' '/etc/xunlei'
option 'download_path' '/opt/xunlei/downloads'
option 'config_path' '/opt/xunlei'
4 changes: 2 additions & 2 deletions openwrt/xunlei/files/xunlei.init
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ get_config() {
config_get port $1 port 5051
config_get auth_user $1 auth_user ''
config_get auth_password $1 auth_password ''
config_get config_path $1 config_path "/etc/xunlei"
config_get download_path $1 download_path "/tmp/downloads"
config_get config_path $1 config_path "/opt/xunlei"
config_get download_path $1 download_path "/opt/xunlei/downloads"
}

start_service() {
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ pub struct Config {
#[clap(short, long, default_value = standard::SYNOPKG_PKGBASE)]
config_path: PathBuf,
/// Xunlei download directory
#[clap(short, long, default_value = standard::TMP_DOWNLOAD_PATH)]
#[clap(short, long, default_value = standard::DEFAULT_DOWNLOAD_PATH)]
download_path: PathBuf,
}

Expand Down
2 changes: 1 addition & 1 deletion src/standard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub const LAUNCH_LOG_FILE: &str =
"/var/packages/pan-xunlei-com/target/var/pan-xunlei-com-launcher.log";
pub const INST_LOG: &str = "/var/packages/pan-xunlei-com/target/var/pan-xunlei-com_install.log";
pub const SYNOPKG_WEB_UI_HOME: &str = "/webman/3rdparty/pan-xunlei-com/index.cgi/";
pub const TMP_DOWNLOAD_PATH: &str = "/tmp/downloads";
pub const DEFAULT_DOWNLOAD_PATH: &str = "/opt/xunlei/downloads";

pub fn set_permissions(target_path: &str, uid: u32, gid: u32) -> anyhow::Result<()> {
let filename = std::ffi::OsStr::new(target_path).as_bytes();
Expand Down