mirror of
https://github.com/sirpdboy/sirpdboy-package.git
synced 2025-01-08 11:57:57 +08:00
up fierbower install transmission161
This commit is contained in:
parent
27f8cf47fd
commit
edc37a10c2
@ -2,7 +2,7 @@
|
||||
margin-top: 1rem;
|
||||
}
|
||||
.fb-container .cbi-button {
|
||||
height: 1.9rem;
|
||||
height: 2.6rem;
|
||||
}
|
||||
.fb-container .cbi-input-text {
|
||||
margin-bottom: 1rem;
|
||||
@ -18,7 +18,7 @@
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding-bottom: 1rem;
|
||||
border-bottom: 1px solid #eee;
|
||||
border-bottom: 1px solid #aaa;
|
||||
}
|
||||
.fb-container .upload-container {
|
||||
display: none;
|
||||
|
@ -176,11 +176,11 @@ String.prototype.replaceAll = function(search, replacement) {
|
||||
icon: (f[1][0] === 'd') ? "folder-icon" : (isLink ? "link-icon" : "file-icon")
|
||||
};
|
||||
|
||||
var install_btn = '<button class="cbi-button cbi-button-install" style="visibility: hidden;">安装</button>';
|
||||
var install_btn = '<button class="cbi-button cbi-button-reload" style="visibility: hidden;">安装</button>';
|
||||
var index= o.filename.lastIndexOf(".");
|
||||
var ext = o.filename.substr(index+1);
|
||||
if (ext === 'ipk') {
|
||||
install_btn = '<button class="cbi-button cbi-button-install">安装</button>';
|
||||
install_btn = '<button class="cbi-button cbi-button-reload">安装</button>';
|
||||
}
|
||||
|
||||
listHtml += '<tr class="cbi-section-table-row cbi-rowstyle-' + (1 + i%2)
|
||||
|
@ -19,7 +19,8 @@ function index()
|
||||
page.leaf = true
|
||||
|
||||
page = entry({"admin", "system", "filebrowser_upload"}, call("filebrowser_upload"), nil)
|
||||
page = entry({"admin", "system", "filebrowser_install"}, call("fileassistant_install"), nil)
|
||||
page.leaf = true
|
||||
page = entry({"admin", "system", "filebrowser_install"}, call("filebrowser_install"), nil)
|
||||
page.leaf = true
|
||||
|
||||
end
|
||||
@ -81,7 +82,7 @@ function filebrowser_rename()
|
||||
list_response(nixio.fs.dirname(filepath), success)
|
||||
end
|
||||
|
||||
function fileassistant_install()
|
||||
function filebrowser_install()
|
||||
local filepath = luci.http.formvalue("filepath")
|
||||
local isdir = luci.http.formvalue("isdir")
|
||||
local ext = filepath:match(".+%.(%w+)$")
|
||||
@ -104,7 +105,7 @@ function installIPK(filepath)
|
||||
return true;
|
||||
end
|
||||
|
||||
function fileassistant_upload()
|
||||
function filebrowser_upload()
|
||||
local filecontent = luci.http.formvalue("upload-file")
|
||||
local filename = luci.http.formvalue("upload-filename")
|
||||
local uploaddir = luci.http.formvalue("upload-dir")
|
||||
|
@ -6,11 +6,11 @@
|
||||
<input id="current-path" type="text" class="current-path cbi-input-text" value="/"/>
|
||||
<div class="panel-container">
|
||||
<div class="panel-title">文件列表</div>
|
||||
<button id="upload-toggle" class="upload-toggle cbi-button cbi-button-edit">上传</button>
|
||||
<button id="upload-toggle" class="upload-toggle cbi-button cbi-button-edit">上传文件</button>
|
||||
</div>
|
||||
<div class="upload-container" id="upload-container">
|
||||
<input id="upload-file" name="upload-file" class="upload-file" type="file">
|
||||
<button type="button" class="cbi-button cbi-input-apply">点我上传</button>
|
||||
<button type="button" class="cbi-button cbi-button-reload">执行上传</button>
|
||||
</div>
|
||||
<div id="list-content"></div>
|
||||
</fieldset>
|
||||
|
@ -7,7 +7,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
LUCI_TITLE:=LuCI Support for Transmission
|
||||
LUCI_DEPENDS:=+transmission-daemon-openssl +transmission-web-control
|
||||
LUCI_DEPENDS:=+transmission-cli-openssl +transmission-daemon-openssl +transmission-remote-openssl +transmission-web-control
|
||||
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
|
@ -33,7 +33,6 @@ config PACKAGE_$(PKG_NAME)_INCLUDE_flow-offload
|
||||
|
||||
config PACKAGE_$(PKG_NAME)_INCLUDE_bbr-cca
|
||||
bool "Include BBR CCA"
|
||||
default n if LINUX_4_9
|
||||
default y
|
||||
|
||||
config PACKAGE_$(PKG_NAME)_INCLUDE_dnsforwarder
|
||||
|
@ -21,7 +21,6 @@ define Package/transmission-web-control
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=BitTorrent
|
||||
DEPENDS:=+transmission-daemon-openssl
|
||||
CONFLICTS:=transmission-web
|
||||
TITLE:=Transmission Web Control
|
||||
URL:=https://github.com/ronggang/transmission-web-control
|
||||
PKGARCH:=all
|
||||
|
@ -0,0 +1,22 @@
|
||||
--- a/src/index.html
|
||||
+++ b/src/index.html
|
||||
@@ -61,9 +61,6 @@
|
||||
<!-- 切换到移动版 -->
|
||||
<a id="toolbar_mobile" href="javascript:location.href = 'index.mobile.html';" class="easyui-linkbutton" data-options="iconCls:'icon-mobile',plain:true" system-tip-lang="toolbar.tip['ui-mobile']"><span system-lang="toolbar['ui-mobile']"></span></a>
|
||||
<span class="button-split">|</span>
|
||||
- <!-- 切换到原版 -->
|
||||
- <a id="" href="javascript:location.href = 'index.original.html';" class="easyui-linkbutton" data-options="iconCls:'icon-transmission',plain:true" system-tip-lang="toolbar.tip['ui-original']"><span system-lang="toolbar['ui-original']"></span></a>
|
||||
- <span class="button-split">|</span>
|
||||
<!-- 关于 -->
|
||||
<a id="toolbar_about" href="javascript:void(0);" onclick="javascript:system.openDialogFromTemplate({id: 'dialog-about',options: {title: system.lang.toolbar['about'],width: 420,height: 370}});" class="easyui-linkbutton" data-options="iconCls:'icon-about',plain:true" system-tip-lang="toolbar.about"><span system-lang="toolbar.about"></span></a>
|
||||
</div>
|
||||
--- a/src/index.mobile.html
|
||||
+++ b/src/index.mobile.html
|
||||
@@ -69,7 +69,6 @@
|
||||
<ul data-role="listview" data-divider-theme="a" data-theme="c" data-icon="false" style="margin-top:15px;">
|
||||
<li data-role='list-divider'>UI</li>
|
||||
<li><a href="#" onclick="location.href = 'index.html?devicetype=computer';"><img src="tr-web-control/style/images/computer.png" class="ui-li-icon"/><span system-lang="toolbar['ui-computer']"></span></a></li>
|
||||
- <li><a href="#" onclick="location.href = 'index.original.html';"><img src="tr-web-control/style/images/transmission.png" class="ui-li-icon"/><span system-lang="toolbar['ui-original']"></span></a></li>
|
||||
</ul>
|
||||
<ul data-role="listview" data-divider-theme="a" data-theme="c" data-icon="false" style="margin-top:15px;">
|
||||
<li data-role='list-divider'><span system-lang="title.status"></span></li>
|
@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=transmission
|
||||
PKG_VERSION:=3.00
|
||||
PKG_RELEASE:=11
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=@GITHUB/transmission/transmission-releases/master
|
||||
@ -20,19 +20,10 @@ PKG_LICENSE:=GPL-2.0-or-later
|
||||
PKG_LICENSE_FILES:=COPYING
|
||||
PKG_CPE_ID:=cpe:/a:transmissionbt:transmission
|
||||
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_INSTALL:=1
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_CONFIG_DEPENDS:= \
|
||||
CONFIG_LIBCURL_GNUTLS \
|
||||
CONFIG_LIBCURL_MBEDTLS \
|
||||
CONFIG_LIBCURL_OPENSSL \
|
||||
CONFIG_LIBCURL_WOLFSSL \
|
||||
CONFIG_LIBCURL_NOSSL
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/package-seccomp.mk
|
||||
include $(INCLUDE_DIR)/nls.mk
|
||||
|
||||
define Package/transmission/template
|
||||
SUBMENU:=BitTorrent
|
||||
@ -40,56 +31,96 @@ define Package/transmission/template
|
||||
CATEGORY:=Network
|
||||
TITLE:=BitTorrent client
|
||||
URL:=https://www.transmissionbt.com
|
||||
DEPENDS:=+libcurl +libevent2 +libminiupnpc +libnatpmp +libpthread +librt +zlib +LIBCURL_NOSSL:libmbedtls +LIBCURL_GNUTLS:libmbedtls +LIBCURL_WOLFSSL:libmbedtls $(ICONV_DEPENDS)
|
||||
DEPENDS:=+libcurl +libevent2 +libminiupnpc +libnatpmp +libpthread +librt +zlib
|
||||
endef
|
||||
|
||||
define Package/transmission-daemon
|
||||
define Package/transmission-daemon/Default
|
||||
$(call Package/transmission/template)
|
||||
USERID:=transmission=224:transmission=224
|
||||
endef
|
||||
|
||||
define Package/transmission-cli
|
||||
$(call Package/transmission/template)
|
||||
TITLE+= (utilities)
|
||||
define Package/transmission-daemon-openssl
|
||||
$(call Package/transmission-daemon/Default)
|
||||
TITLE+= (with OpenSSL)
|
||||
DEPENDS+=+libopenssl
|
||||
VARIANT:=openssl
|
||||
endef
|
||||
|
||||
define Package/transmission-remote
|
||||
define Package/transmission-daemon-mbedtls
|
||||
$(call Package/transmission-daemon/Default)
|
||||
TITLE+= (with mbed TLS)
|
||||
DEPENDS+=+libmbedtls
|
||||
VARIANT:=mbedtls
|
||||
endef
|
||||
|
||||
define Package/transmission-cli-openssl
|
||||
$(call Package/transmission/template)
|
||||
TITLE+= (remote)
|
||||
TITLE+= (with OpenSSL)
|
||||
DEPENDS+=+libopenssl
|
||||
VARIANT:=openssl
|
||||
endef
|
||||
|
||||
define Package/transmission-cli-mbedtls
|
||||
$(call Package/transmission/template)
|
||||
TITLE+= (with mbed TLS)
|
||||
DEPENDS+=+libmbedtls
|
||||
VARIANT:=mbedtls
|
||||
endef
|
||||
|
||||
define Package/transmission-remote-openssl
|
||||
$(call Package/transmission/template)
|
||||
TITLE+= (with OpenSSL)
|
||||
DEPENDS+=+libopenssl
|
||||
VARIANT:=openssl
|
||||
endef
|
||||
|
||||
define Package/transmission-remote-mbedtls
|
||||
$(call Package/transmission/template)
|
||||
TITLE+= (with mbed TLS)
|
||||
DEPENDS+=+libmbedtls
|
||||
VARIANT:=mbedtls
|
||||
endef
|
||||
|
||||
define Package/transmission-web
|
||||
$(call Package/transmission/template)
|
||||
TITLE+= (webinterface)
|
||||
DEPENDS:=+transmission-daemon
|
||||
DEPENDS:=@(PACKAGE_transmission-daemon-openssl||PACKAGE_transmission-daemon-mbedtls)
|
||||
PKGARCH:=all
|
||||
endef
|
||||
|
||||
define Package/transmission-daemon/description
|
||||
|
||||
define Package/transmission-daemon/Default/description
|
||||
Transmission is a simple BitTorrent client.
|
||||
It features a very simple, intuitive interface
|
||||
on top on an efficient, cross-platform back-end.
|
||||
This package contains the daemon itself.
|
||||
endef
|
||||
Package/transmission-daemon-openssl/description = $(Package/transmission-daemon/Default/description)
|
||||
Package/transmission-daemon-mbedtls/description = $(Package/transmission-daemon/Default/description)
|
||||
|
||||
define Package/transmission-cli/description
|
||||
define Package/transmission-cli/Default/description
|
||||
CLI utilities for transmission.
|
||||
endef
|
||||
Package/transmission-cli-openssl/description = $(Package/transmission-cli/Default/description)
|
||||
Package/transmission-cli-mbedtls/description = $(Package/transmission-cli/Default/description)
|
||||
|
||||
define Package/transmission-remote/description
|
||||
define Package/transmission-remote/Default/description
|
||||
CLI remote interface for transmission.
|
||||
endef
|
||||
Package/transmission-remote-openssl/description = $(Package/transmission-remote/Default/description)
|
||||
Package/transmission-remote-mbedtls/description = $(Package/transmission-remote/Default/description)
|
||||
|
||||
define Package/transmission-web/description
|
||||
Webinterface resources for transmission.
|
||||
endef
|
||||
|
||||
define Package/transmission-daemon/conffiles
|
||||
define Package/transmission-daemon-openssl/conffiles
|
||||
/etc/config/transmission
|
||||
endef
|
||||
Package/transmission-daemon-mbedtls/conffiles = $(Package/transmission-daemon-openssl/conffiles)
|
||||
|
||||
TARGET_CFLAGS += -ffunction-sections -fdata-sections -flto
|
||||
TARGET_LDFLAGS += -Wl,--gc-sections -Wl,--as-needed -liconv
|
||||
TARGET_LDFLAGS += -Wl,--gc-sections -Wl,--as-needed
|
||||
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-cli \
|
||||
@ -99,14 +130,18 @@ CONFIGURE_ARGS += \
|
||||
--enable-lightweight \
|
||||
--without-gtk \
|
||||
--without-kqueue \
|
||||
--without-systemd-daemon \
|
||||
$(if $(CONFIG_LIBCURL_NOSSL),--with-crypto=polarssl) \
|
||||
$(if $(CONFIG_LIBCURL_GNUTLS),--with-crypto=polarssl) \
|
||||
$(if $(CONFIG_LIBCURL_MBEDTLS),--with-crypto=polarssl) \
|
||||
$(if $(CONFIG_LIBCURL_OPENSSL),--with-crypto=openssl) \
|
||||
$(if $(CONFIG_LIBCURL_WOLFSSL),--with-crypto=polarssl)
|
||||
--without-systemd-daemon
|
||||
|
||||
define Package/transmission-daemon/install
|
||||
ifeq ($(BUILD_VARIANT),mbedtls)
|
||||
CONFIGURE_ARGS += --with-crypto=polarssl
|
||||
CONFIGURE_VARS += \
|
||||
MBEDTLS_CFLAGS="-I$(STAGING_DIR)/usr/include/mbedtls" \
|
||||
MBEDTLS_LIBS="-lmbedtls -lmbedcrypto"
|
||||
else
|
||||
CONFIGURE_ARGS += --with-crypto=openssl
|
||||
endif
|
||||
|
||||
define Package/transmission-daemon-openssl/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/transmission-daemon $(1)/usr/bin/
|
||||
$(INSTALL_DIR) $(1)/etc/init.d/
|
||||
@ -115,10 +150,10 @@ define Package/transmission-daemon/install
|
||||
$(INSTALL_CONF) files/transmission.config $(1)/etc/config/transmission
|
||||
$(INSTALL_DIR) $(1)/etc/sysctl.d/
|
||||
$(INSTALL_CONF) files/transmission.sysctl $(1)/etc/sysctl.d/20-transmission.conf
|
||||
$(call InstallSeccomp,$(1),./files/transmission-daemon.json)
|
||||
endef
|
||||
Package/transmission-daemon-mbedtls/install = $(Package/transmission-daemon-openssl/install)
|
||||
|
||||
define Package/transmission-cli/install
|
||||
define Package/transmission-cli-openssl/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/transmission-cli \
|
||||
$(PKG_INSTALL_DIR)/usr/bin/transmission-create \
|
||||
@ -126,18 +161,23 @@ define Package/transmission-cli/install
|
||||
$(PKG_INSTALL_DIR)/usr/bin/transmission-show \
|
||||
$(1)/usr/bin/
|
||||
endef
|
||||
Package/transmission-cli-mbedtls/install = $(Package/transmission-cli-openssl/install)
|
||||
|
||||
define Package/transmission-remote/install
|
||||
define Package/transmission-remote-openssl/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/transmission-remote $(1)/usr/bin/
|
||||
endef
|
||||
Package/transmission-remote-mbedtls/install = $(Package/transmission-remote-openssl/install)
|
||||
|
||||
define Package/transmission-web/install
|
||||
$(INSTALL_DIR) $(1)/usr/share/transmission
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/share/transmission/web $(1)/usr/share/transmission/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,transmission-daemon))
|
||||
$(eval $(call BuildPackage,transmission-cli))
|
||||
$(eval $(call BuildPackage,transmission-remote))
|
||||
$(eval $(call BuildPackage,transmission-daemon-openssl))
|
||||
$(eval $(call BuildPackage,transmission-daemon-mbedtls))
|
||||
$(eval $(call BuildPackage,transmission-cli-openssl))
|
||||
$(eval $(call BuildPackage,transmission-cli-mbedtls))
|
||||
$(eval $(call BuildPackage,transmission-remote-openssl))
|
||||
$(eval $(call BuildPackage,transmission-remote-mbedtls))
|
||||
$(eval $(call BuildPackage,transmission-web))
|
||||
|
@ -1,89 +0,0 @@
|
||||
{
|
||||
"defaultAction": "SCMP_ACT_KILL_PROCESS",
|
||||
"syscalls": [
|
||||
{
|
||||
"names": [
|
||||
"accept",
|
||||
"accept4",
|
||||
"access",
|
||||
"arm_fadvise64_64",
|
||||
"bind",
|
||||
"brk",
|
||||
"clock_gettime",
|
||||
"clone",
|
||||
"close",
|
||||
"connect",
|
||||
"epoll_create1",
|
||||
"epoll_ctl",
|
||||
"epoll_pwait",
|
||||
"exit",
|
||||
"exit_group",
|
||||
"fadvise64",
|
||||
"fadvise64_64",
|
||||
"fallocate",
|
||||
"fchmod",
|
||||
"fcntl",
|
||||
"fcntl64",
|
||||
"fstat",
|
||||
"fstat64",
|
||||
"fsync",
|
||||
"futex",
|
||||
"getdents64",
|
||||
"getpeername",
|
||||
"getpid",
|
||||
"getsockname",
|
||||
"getsockopt",
|
||||
"getuid",
|
||||
"getuid32",
|
||||
"ioctl",
|
||||
"listen",
|
||||
"_llseek",
|
||||
"lseek",
|
||||
"madvise",
|
||||
"membarrier",
|
||||
"mkdir",
|
||||
"mmap",
|
||||
"mmap2",
|
||||
"mprotect",
|
||||
"mremap",
|
||||
"munmap",
|
||||
"nanosleep",
|
||||
"_newselect",
|
||||
"open",
|
||||
"pipe",
|
||||
"pipe2",
|
||||
"poll",
|
||||
"pread64",
|
||||
"prlimit64",
|
||||
"pwrite64",
|
||||
"quotactl",
|
||||
"read",
|
||||
"readlink",
|
||||
"readv",
|
||||
"recvfrom",
|
||||
"rename",
|
||||
"rmdir",
|
||||
"rt_sigaction",
|
||||
"rt_sigprocmask",
|
||||
"rt_sigreturn",
|
||||
"select",
|
||||
"sendto",
|
||||
"setsockopt",
|
||||
"shutdown",
|
||||
"sigreturn",
|
||||
"socket",
|
||||
"stat",
|
||||
"stat64",
|
||||
"socketpair",
|
||||
"umask",
|
||||
"uname",
|
||||
"unlink",
|
||||
"statfs64",
|
||||
"umask",
|
||||
"write",
|
||||
"writev"
|
||||
],
|
||||
"action": "SCMP_ACT_ALLOW"
|
||||
}
|
||||
]
|
||||
}
|
@ -1,8 +1,8 @@
|
||||
config transmission
|
||||
option enabled 0
|
||||
option config_dir '/tmp/transmission'
|
||||
option config_dir '/opt/transmission'
|
||||
option config_overwrite '1'
|
||||
option user 'transmission'
|
||||
option user 'root'
|
||||
option group 'transmission'
|
||||
option mem_percentage 50
|
||||
option nice 10
|
||||
@ -18,7 +18,7 @@ config transmission
|
||||
option bind_address_ipv6 '::'
|
||||
option blocklist_enabled false
|
||||
option blocklist_url ''
|
||||
option cache_size_mb 2
|
||||
option cache_size_mb 64
|
||||
option dht_enabled true
|
||||
option download_dir '/mnt/sda1/download/'
|
||||
option download_queue_enabled true
|
||||
@ -26,7 +26,7 @@ config transmission
|
||||
option encryption 1
|
||||
option idle_seeding_limit 30
|
||||
option idle_seeding_limit_enabled false
|
||||
option incomplete_dir '/tmp/transmission/incomplete'
|
||||
option incomplete_dir '/opt/transmission/incomplete'
|
||||
option incomplete_dir_enabled false
|
||||
option lazy_bitfield_enabled true
|
||||
option lpd_enabled false
|
||||
|
@ -2,105 +2,86 @@
|
||||
# Copyright (C) 2010-2015 OpenWrt.org
|
||||
|
||||
START=99
|
||||
STOP=10
|
||||
USE_PROCD=1
|
||||
PROG="/usr/bin/transmission-daemon"
|
||||
|
||||
LIST_SEP="
|
||||
"
|
||||
|
||||
append_params() {
|
||||
local p; local v; local s="$1"; shift
|
||||
IFS="$LIST_SEP"
|
||||
for p in "$@"; do
|
||||
config_get v "$s" "$p"
|
||||
IFS="$LIST_SEP"
|
||||
for v in $v; do
|
||||
[ -n "$v" ] && echo "\"$p\": $v," | sed -e 's|_|-|g'
|
||||
[ -n "$v" ] && (
|
||||
echo "\"$p\": $v," | sed -e 's|_|-|g'
|
||||
) >> "$config_file"
|
||||
done
|
||||
unset IFS
|
||||
done
|
||||
unset IFS
|
||||
}
|
||||
|
||||
append_params_quotes() {
|
||||
local p; local v; local s="$1"; shift
|
||||
IFS="$LIST_SEP"
|
||||
for p in "$@"; do
|
||||
config_get v "$s" "$p"
|
||||
IFS="$LIST_SEP"
|
||||
for v in $v; do
|
||||
[ -n "$v" ] && {
|
||||
[ -n "$v" ] && (
|
||||
printf "\"%s" "$p" | sed -e 's|/|\\/|g;s|_|-|g'; \
|
||||
echo "\": \"$v\","
|
||||
}
|
||||
) >> "$config_file"
|
||||
done
|
||||
unset IFS
|
||||
done
|
||||
unset IFS
|
||||
}
|
||||
|
||||
section_enabled() {
|
||||
config_get_bool enabled "$1" enabled 0
|
||||
[ $enabled -gt 0 ]
|
||||
}
|
||||
|
||||
transmission() {
|
||||
local cfg="$1"
|
||||
local USE
|
||||
|
||||
local enabled
|
||||
config_get_bool enabled "$cfg" enabled 0
|
||||
[ "$enabled" -gt 0 ] || {
|
||||
echo "Transmission not enabled. Please enable in /etc/config/transmission"
|
||||
logger -t "transmission" -p "daemon.info" "Transmission not enabled. Please enable in /etc/config/transmission"
|
||||
return 1
|
||||
}
|
||||
|
||||
local config_dir
|
||||
config_get config_dir "$cfg" 'config_dir' '/var/etc/transmission'
|
||||
local user
|
||||
config_get user "$cfg" 'user'
|
||||
local group
|
||||
config_get group "$cfg" 'group'
|
||||
local download_dir
|
||||
config_get download_dir "$cfg" 'download_dir' '/var/etc/transmission'
|
||||
local incomplete_dir
|
||||
config_get incomplete_dir "$cfg" 'incomplete_dir' '/var/etc/transmission'
|
||||
local incomplete_dir_enabled
|
||||
config_get incomplete_dir_enabled "$cfg" 'incomplete_dir_enabled' 0
|
||||
local mem_percentage
|
||||
config_get mem_percentage "$cfg" 'mem_percentage' '50'
|
||||
local config_overwrite
|
||||
config_get config_overwrite "$cfg" config_overwrite 1
|
||||
local download_dir config_dir
|
||||
local mem_percentage
|
||||
local nice
|
||||
config_get nice "$cfg" nice 0
|
||||
local web_home
|
||||
|
||||
section_enabled "$section" || return 1
|
||||
|
||||
config_get config_dir "$cfg" 'config_dir' '/var/etc/transmission'
|
||||
config_get user "$cfg" 'user'
|
||||
config_get group "$cfg" 'group'
|
||||
config_get download_dir "$cfg" 'download_dir' '/var/etc/transmission'
|
||||
config_get mem_percentage "$cfg" 'mem_percentage' '50'
|
||||
config_get config_overwrite "$cfg" config_overwrite 1
|
||||
config_get nice "$cfg" nice 0
|
||||
config_get web_home "$cfg" 'web_home'
|
||||
local seccomp_path
|
||||
|
||||
local MEM
|
||||
|
||||
MEM=$(sed -ne 's!^MemTotal:[[:space:]]*\([0-9]*\) kB$!\1!p' /proc/meminfo)
|
||||
local USE
|
||||
[ "$MEM" -gt 1 ] && USE=$((MEM * mem_percentage * 10))
|
||||
if test "$MEM" -gt 1;then
|
||||
USE=$((MEM * mem_percentage * 10))
|
||||
fi
|
||||
|
||||
config_file="$config_dir/settings.json"
|
||||
[ -d "$config_dir" ] || {
|
||||
mkdir -p "$config_dir"
|
||||
chmod 0755 "$config_dir"
|
||||
touch "$config_file"
|
||||
mkdir -p "$config_dir/resume"
|
||||
mkdir -p "$config_dir/torrents"
|
||||
mkdir -p "$config_dir/blocklists"
|
||||
[ -e "$config_dir/stats.json" ] || touch "$config_dir/stats.json"
|
||||
[ -z "$user" ] || chown -R "$user:$group" "$config_dir"
|
||||
}
|
||||
|
||||
[ -d "$download_dir" ] || {
|
||||
mkdir -p "$download_dir"
|
||||
chmod 0755 "$download_dir"
|
||||
[ -z "$user" ] || chown -R "$user:$group" "$download_dir"
|
||||
}
|
||||
|
||||
[ "$incomplete_dir_enabled" = "0" ] || [ -d "$incomplete_dir" ] || {
|
||||
mkdir -p "$incomplete_dir"
|
||||
chmod 0755 "$incomplete_dir"
|
||||
[ -z "$user" ] || chown -R "$user:$group" "$incomplete_dir"
|
||||
}
|
||||
|
||||
[ "$config_overwrite" = 0 ] || {
|
||||
|
||||
echo "{"
|
||||
echo "{" > "$config_file"
|
||||
|
||||
append_params "$cfg" \
|
||||
alt_speed_down alt_speed_enabled alt_speed_time_begin alt_speed_time_day \
|
||||
@ -125,25 +106,21 @@ transmission() {
|
||||
peer_congestion_algorithm peer_socket_tos rpc_bind_address rpc_password rpc_url \
|
||||
rpc_username rpc_host_whitelist rpc_whitelist script_torrent_done_filename watch_dir
|
||||
|
||||
{
|
||||
echo "\"invalid-key\": false"
|
||||
echo "}"
|
||||
|
||||
} > "$config_file"
|
||||
} >> "$config_file"
|
||||
}
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param command "$PROG"
|
||||
procd_append_param command -f -g "$config_dir"
|
||||
procd_set_param command "/usr/bin/transmission-daemon"
|
||||
procd_append_param command -f --log-error -g "$config_dir"
|
||||
procd_set_param user "$user"
|
||||
procd_set_param group "$group"
|
||||
procd_set_param nice "$nice"
|
||||
procd_set_param stderr 1
|
||||
procd_set_param respawn
|
||||
|
||||
seccomp_path="/etc/seccomp/transmission-daemon.json"
|
||||
if [ -f "$seccomp_path" ]; then
|
||||
procd_set_param seccomp "$seccomp_path"
|
||||
fi
|
||||
|
||||
if [ -z "$USE" ]; then
|
||||
procd_set_param limits core="0 0"
|
||||
else
|
||||
@ -151,16 +128,13 @@ transmission() {
|
||||
logger -t transmission "Starting with $USE virt mem"
|
||||
fi
|
||||
|
||||
[ -d "$web_home" ] && procd_set_param env TRANSMISSION_WEB_HOME="$web_home"
|
||||
if test -d "$web_home"; then
|
||||
procd_set_param env TRANSMISSION_WEB_HOME="$web_home"
|
||||
fi
|
||||
|
||||
procd_add_jail transmission log
|
||||
procd_add_jail_mount "$config_file"
|
||||
procd_add_jail_mount_rw "$config_dir/resume"
|
||||
procd_add_jail_mount_rw "$config_dir/torrents"
|
||||
procd_add_jail_mount_rw "$config_dir/blocklists"
|
||||
procd_add_jail_mount_rw "$config_dir/stats.json"
|
||||
procd_add_jail_mount_rw "$download_dir"
|
||||
[ -d "$web_home" ] && procd_add_jail_mount_rw "$web_home"
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
@ -169,10 +143,3 @@ start_service() {
|
||||
config_foreach transmission 'transmission'
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
procd_send_signal "$PROG"
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "transmission"
|
||||
}
|
||||
|
@ -1,12 +0,0 @@
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -555,9 +555,6 @@ dnl it should be safe to re-edit 0.40 ba
|
||||
use_nls=no
|
||||
if test "x$enable_nls" = "xyes" ; then
|
||||
use_nls=yes
|
||||
- m4_ifdef([IT_PROG_INTLTOOL],
|
||||
- [IT_PROG_INTLTOOL([0.35.0],[no-xml])],
|
||||
- [AC_MSG_ERROR("--enable-nls requires intltool to be installed.")])
|
||||
AC_CHECK_HEADERS([libintl.h])
|
||||
GETTEXT_PACKAGE=transmission-gtk
|
||||
AC_SUBST(GETTEXT_PACKAGE)
|
@ -1,13 +0,0 @@
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -152,8 +152,8 @@ AS_IF([test "x$want_crypto" = "xauto" -o
|
||||
)
|
||||
])
|
||||
AS_IF([test "x$want_crypto" = "xauto" -o "x$want_crypto" = "xpolarssl"], [
|
||||
- PKG_CHECK_MODULES(MBEDTLS, [mbedtls >= $POLARSSL_MINIMUM],
|
||||
- [want_crypto="polarssl"; CRYPTO_PKG="polarssl"; CRYPTO_CFLAGS="$MBEDTLS_CFLAGS"; CRYPTO_LIBS="$MBEDTLS_LIBS"; POLARSSL_IS_MBEDTLS=yes],
|
||||
+ AC_CHECK_LIB(mbedcrypto, mbedtls_strerror,
|
||||
+ [want_crypto="polarssl"; CRYPTO_PKG="polarssl"; CRYPTO_LIBS="-lmbedcrypto"; POLARSSL_IS_MBEDTLS=yes],
|
||||
[AC_CHECK_HEADER([polarssl/version.h],
|
||||
[AC_EGREP_CPP([version_ok], [#include <polarssl/version.h>
|
||||
#if defined (POLARSSL_VERSION_NUMBER) && POLARSSL_VERSION_NUMBER >= $POLARSSL_MINIMUM
|
@ -1,6 +1,6 @@
|
||||
--- a/libtransmission/webseed.c
|
||||
+++ b/libtransmission/webseed.c
|
||||
@@ -510,8 +510,6 @@ static void webseed_timer_func(evutil_so
|
||||
@@ -510,8 +510,6 @@ static void webseed_timer_func(evutil_socket_t foo UNUSED, short bar UNUSED, voi
|
||||
++w->retry_tickcount;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user