diff --git a/aria2/Config.in b/aria2/Config.in index a5c6bcde5..23003c32f 100644 --- a/aria2/Config.in +++ b/aria2/Config.in @@ -34,7 +34,7 @@ endchoice choice prompt "XML Library" - default ARIA2_EXPAT + default ARIA2_NOXML config ARIA2_LIBXML2 bool "Libxml2" diff --git a/aria2/Makefile b/aria2/Makefile index 7d9c9a6d3..2096a9e47 100644 --- a/aria2/Makefile +++ b/aria2/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2012-2021 OpenWrt.org +# Copyright (C) 2012-2018 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -7,15 +7,14 @@ include $(TOPDIR)/rules.mk PKG_NAME:=aria2 -PKG_VERSION:=1.37.0 -PKG_RELEASE:=1 +PKG_VERSION:=1.36.0 +PKG_RELEASE:=21 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://github.com/aria2/aria2/releases/download/release-$(PKG_VERSION)/ -PKG_HASH:=60a420ad7085eb616cb6e2bdf0a7206d68ff3d37fb5a956dc44242eb2f79b66b +PKG_HASH:=skip PKG_INSTALL:=1 PKG_BUILD_PARALLEL:=1 -PKG_USE_MIPS16:=0 PKG_MAINTAINER:=Imre Kaloz , \ Hsing-Wang Liao @@ -56,7 +55,7 @@ define Package/aria2 DEPENDS:=+zlib +libstdcpp +ARIA2_OPENSSL:libopenssl +ARIA2_GNUTLS:libgnutls \ +ARIA2_NETTLE:libnettle +ARIA2_LIBGCRYPT:libgcrypt +ARIA2_GMP:libgmp \ +ARIA2_LIBXML2:libxml2 +ARIA2_EXPAT:libexpat +ARIA2_SFTP:libssh2 \ - +ARIA2_ASYNC_DNS:libcares +ARIA2_COOKIE:libsqlite3 +block-mount + +ARIA2_ASYNC_DNS:libcares +ARIA2_COOKIE:libsqlite3 USERID:=aria2=6800:aria2=6800 endef @@ -85,12 +84,26 @@ CONFIGURE_ARGS += \ --with-libz TARGET_CXXFLAGS += -ffunction-sections -fdata-sections -flto -TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed,--no-undefined,--no-allow-shlib-undefined -flto +TARGET_LDFLAGS += -Wl,--gc-sections -flto define Package/aria2/conffiles /etc/config/aria2 endef +define Download/aria2.conf + URL:=https://github.com/P3TERX/aria2.conf/archive + URL_FILE:=master.zip + FILE:=aria2.conf + HASH:=skip +endef + +define Build/Prepare + $(call Build/Prepare/Default) + unzip $(DL_DIR)/aria2.conf -d $(PKG_BUILD_DIR)/ + sed -i '/rpc-secret/d' $(PKG_BUILD_DIR)/aria2.conf-master/* +endef + + define Package/aria2/install $(INSTALL_DIR) $(1)/usr/bin $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/aria2c $(1)/usr/bin @@ -100,9 +113,10 @@ define Package/aria2/install $(INSTALL_DIR) $(1)/etc/config $(INSTALL_CONF) ./files/aria2.conf $(1)/etc/config/aria2 - - $(INSTALL_DIR) $(1)/etc/uci-defaults - $(INSTALL_BIN) ./files/99_aria2-settings $(1)/etc/uci-defaults/99_aria2-settings + + $(INSTALL_DIR) $(1)/usr/share/aria2 + $(INSTALL_BIN) $(PKG_BUILD_DIR)/aria2.conf-master/* $(1)/usr/share/aria2/ endef +$(eval $(call Download,aria2.conf)) $(eval $(call BuildPackage,aria2)) diff --git a/aria2/files/99_aria2-settings b/aria2/files/99_aria2-settings deleted file mode 100644 index b94042d2f..000000000 --- a/aria2/files/99_aria2-settings +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -mem="$(awk '/^MemTotal:/ {print $2}' /proc/meminfo)" - -if [ "$mem" -gt 131072 ]; then # mem > 128M - disk_cache='16M' -elif [ "$mem" -gt 65536 ]; then # 64M < mem <= 128M - disk_cache='8M' -elif [ "$mem" -gt 32768 ]; then # 32M < mem <= 64M - disk_cache='2M' -else - disk_cache='1M' -fi - -uci -q set aria2.main.disk_cache="$disk_cache" -uci commit aria2 - -exit 0 diff --git a/aria2/files/aria2.conf b/aria2/files/aria2.conf index cfd6f40f4..0181adce2 100644 --- a/aria2/files/aria2.conf +++ b/aria2/files/aria2.conf @@ -1,33 +1,23 @@ + +# You can use most aria2 command-line options, replace '-' with '_'. +# eg. 'rpc-secret' ==> 'rpc_secret' +# +# We do not support all options at this time. But you can add any option +# with 'list extra_settings'. +# +# You can also add new config sections to define multi instance. +# config aria2 'main' option enabled '0' - option nice '0' - option user 'root' + option user 'aria2' + option dir '/mnt/sda1/aria2' option config_dir '/var/etc/aria2' option bt_enable_lpd 'true' option enable_dht 'true' - option bt_max_peers '100' option follow_torrent 'true' - option quiet 'false' option file_allocation 'none' option save_session_interval '30' - option enable_logging '0' - option rpc_auth_method 'none' - option rpc_secure 'false' - option enable_proxy '0' - option check_certificate 'true' - option enable_dht6 'false' - option enable_log 'false' - option max_connection_per_server '8' - option split '8' - option overall_speed_limit '1' - option max_overall_upload_limit '1' - option max_concurrent_downloads '5' - option enable_peer_exchange 'true' - option disk_cache 64M - option peer_agent 'Deluge 1.3.15' - option peer_id_prefix '-DE13F0-' - option user_agent 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.63 Safari/537.36 Edg/93.0.961.47' - list extra_settings 'check-certificate=false' - list extra_settings 'seed-time=0' - - + option split '128' + option min_split_size '100K' + option max_connection_per_server '128' + list extra_settings 'dht-file-path=/usr/share/aria2/dht.dat' diff --git a/aria2/files/aria2.init b/aria2/files/aria2.init index f98507c3e..d68057082 100644 --- a/aria2/files/aria2.init +++ b/aria2/files/aria2.init @@ -9,297 +9,355 @@ NAME=aria2 PROG=/usr/bin/aria2c _info() { - echo -e "$(date "+%Y-%m-%d %H:%M:%S"): $*" >> "$log_dir"/aria2_syslog.log + logger -p daemon.info -t "$NAME" "$*" } -make_dir() { - for d in "$@"; do - [ -d "$d" ] || mkdir -p "$d" 2>/dev/null || { - _info "无法创建$d目录。" - return 1 - } - done +_err() { + logger -p daemon.err -t "$NAME" "$*" } -create_file() { - for file in "$@"; do - [ -f "$file" ] || touch "$file" || { - _info "无法创建文件:$file" - return 1 - } - done +_make_dir() { + local d + for d in "$@"; do + if [ ! -d "$d" ]; then + mkdir -p "$d" 2>/dev/null || return 1 + fi + done + + return 0 +} + +_create_file() { + touch "$@" 2>/dev/null } _change_owner() { - local u="$1"; shift - for d in "$@"; do - if [ -f "$d" ]; then - chown "$u" "$d" 2>/dev/null || return 1 - elif [ -d "$d" ]; then - chown -R "$u" "$d" 2>/dev/null || return 1 - fi - done - return 0 + local u="$1"; shift + + local d + for d in "$@"; do + if [ -f "$d" ]; then + chown "$u" "$d" 2>/dev/null || return 1 + elif [ -d "$d" ]; then + chown -R "$u" "$d" 2>/dev/null || return 1 + fi + done + + return 0 +} + +_change_file_mode() { + local mod="$1"; shift + chmod "$mod" "$@" 2>/dev/null +} + +_reset_dir_mode() { + local d + for d in "$@"; do + if [ -d "$d" ]; then + find "$d" -type d -exec chmod 755 {} \; 2>/dev/null + find "$d" -type f -exec chmod 644 {} \; 2>/dev/null + fi + done } append_options() { - for o in "$@"; do - eval "v=\$$o" - [ -n "$v" ] && echo "${o//_/-}=$v" >> "$config_file_tmp" - done + local o; local v + for o in "$@"; do + v="$(eval echo "\$$o")" + [ -n "$v" ] && \ + echo "${o//_/-}=$v" >>"$config_file_tmp" + done } append_setting() { - while [ "$#" -gt 0 ]; do - [ "${1#*=}" ] && echo "$1" >> "$config_file_tmp" - shift - done + local s="$1" + [ -n "$s" ] && \ + echo "$s" >>"$config_file_tmp" } append_header() { - [ -n "$1" ] && echo "header=\"$1\"" >>"$config_file_tmp" + local h="$1" + [ -n "$h" ] && \ + echo "header=\"$h\"" >>"$config_file_tmp" } aria2_validate() { - uci_load_validate "$NAME" aria2 "$1" "$2" \ - 'pro:string:/usr/share/aria2' \ - 'all_proxy:string' \ - 'all_proxy_passwd:string' \ - 'all_proxy_user:string' \ - 'auto_save_interval:range(0,600)' \ - 'bt_detach_seed_only:or("true","false")' \ - 'bt_enable_lpd:or("true","false")' \ - 'bt_load_saved_metadata:or("true","false")' \ - 'bt_max_open_files:uinteger' \ - 'bt_max_peers:uinteger' \ - 'bt_prioritize_piece:string' \ - 'bt_remove_unselected_file:or("true","false")' \ - 'bt_request_peer_speed_limit:string' \ - 'bt_save_metadata:or("true","false")' \ - 'bt_seed_unverified:or("true","false")' \ - 'bt_stop_timeout:uinteger' \ - 'bt_tracker:list(string)' \ - 'ca_certificate:file' \ - 'certificate:file' \ - 'check_certificate:or("true","false"):true' \ - 'check_integrity:or("true","false")' \ - 'config_dir:string:/var/etc/aria2' \ - 'connect_timeout:uinteger' \ - 'dht_listen_port:string' \ - 'dir:string' \ - 'disable_ipv6:or("true","false")' \ - 'disk_cache:string' \ - 'enable_pro:bool' \ - 'enable_dht6:or("true","false")' \ - 'enable_dht:or("true","false"):true' \ - 'enable_logging:bool' \ - 'enable_peer_exchange:or("true","false")' \ - 'enable_proxy:bool' \ - 'enabled:bool:0' \ - 'event_poll:or("epoll","kqueue","port","poll","select")' \ - 'file_allocation:or("none","prealloc","trunc","falloc")' \ - 'follow_torrent:or("true","false","mem")' \ - 'force_save:or("true","false")' \ - 'http_accept_gzip:or("true","false")' \ - 'http_no_cache:or("true","false")' \ - 'listen_port:string' \ - 'log_dir:string:/var/log' \ - 'log_level:or("debug","info","notice","warn","error")' \ - 'lowest_speed_limit:string' \ - 'max_concurrent_downloads:uinteger' \ - 'max_connection_per_server:uinteger' \ - 'max_download_limit:string' \ - 'max_overall_download_limit:string' \ - 'max_overall_upload_limit:string' \ - 'max_tries:uinteger' \ - 'max_upload_limit:string' \ - 'min_split_size:string' \ - 'pause:or("true","false")' \ - 'pause_metadata:or("true","false")' \ - 'peer_id_prefix:string' \ - 'peer_agent:string' \ - 'private_key:file' \ - 'retry_wait:uinteger' \ - 'rpc_auth_method:or("none","user_pass","token")' \ - 'rpc_certificate:file' \ - 'rpc_listen_port:range(1024,65535)' \ - 'rpc_passwd:string' \ - 'rpc_private_key:file' \ - 'rpc_secret:string' \ - 'rpc_secure:or("true","false")' \ - 'rpc_user:string' \ - 'save_session_interval:uinteger' \ - 'seed_ratio:ufloat' \ - 'seed_time:ufloat' \ - 'split:uinteger' \ - 'timeout:uinteger' \ - 'user:string' \ - 'user_agent:string' -} - -pro_conf() { - cd $pro - if [ ! -s aria2.conf ]; then - for i in core aria2.conf clean.sh delete.sh tracker.sh dht.dat dht6.dat script.conf; do - wget -qN -t2 -T3 raw.githubusercontent.com/P3TERX/aria2.conf/master/$i || \ - wget -qN -t2 -T3 cdn.jsdelivr.net/gh/P3TERX/aria2.conf/$i || \ - curl -fsSLO p3terx.github.io/aria2.conf/$i - [ -s $i ] && _info " $i 下载成功 !" || _info " $i 下载失败 !" - done - sed -i "{ - /033/d - s|^#!.*|#!/bin/sh|g - s|/root/.aria2|$pro|g - /CONF_DIR/{s/aria2.conf/$NAME.conf.$section/g} - }" * - chmod +x *.sh && sh ./tracker.sh - _info "Aria2加强配置下载完成!" - fi - [ ! -s aria2.conf ] && return 1 - [ x"$rpc_secret" = x ] && sed -i '/^rpc-secret/s/^/#/' aria2.conf - sed '/^$/{N;/\n$/D};' aria2.conf >"$config_file" - echo -e "# 以下是系统生成,如和上面的配置有重复以下面为准。#" >>"$config_file" - while read p; do - grep -q "^${p%%=*}" $config_file && { - sed -i "s|^${p%%=*}=.*|$p|" $config_file - } || echo "$p" >> $config_file - done < $config_file_tmp + uci_load_validate "$NAME" aria2 "$1" "$2" \ + 'enabled:bool:0' \ + 'enable_logging:bool' \ + 'enable_proxy:bool' \ + 'config_dir:string:/var/etc/aria2' \ + 'user:string' \ + 'all_proxy:string' \ + 'all_proxy_passwd:string' \ + 'all_proxy_user:string' \ + 'auto_save_interval:range(0,600)' \ + 'bt_enable_lpd:or("true","false")' \ + 'bt_detach_seed_only:or("true","false")' \ + 'bt_load_saved_metadata:or("true","false")' \ + 'bt_prioritize_piece:string' \ + 'bt_max_open_files:uinteger' \ + 'bt_max_peers:uinteger' \ + 'bt_remove_unselected_file:or("true","false")' \ + 'bt_request_peer_speed_limit:string' \ + 'bt_save_metadata:or("true","false")' \ + 'bt_seed_unverified:or("true","false")' \ + 'bt_stop_timeout:uinteger' \ + 'bt_tracker:list(string)' \ + 'ca_certificate:file' \ + 'certificate:file' \ + 'check_certificate:or("true","false"):true' \ + 'check_integrity:or("true","false")' \ + 'connect_timeout:uinteger' \ + 'dht_listen_port:string' \ + 'dir:string' \ + 'disable_ipv6:or("true","false")' \ + 'disk_cache:string' \ + 'enable_dht:or("true","false"):true' \ + 'enable_dht6:or("true","false")' \ + 'enable_peer_exchange:or("true","false")' \ + 'event_poll:or("epoll","kqueue","port","poll","select")' \ + 'file_allocation:or("none","prealloc","trunc","falloc")' \ + 'follow_torrent:or("true","false","mem")' \ + 'force_save:or("true","false")' \ + 'http_accept_gzip:or("true","false")' \ + 'http_no_cache:or("true","false")' \ + 'listen_port:string' \ + 'log:string' \ + 'log_level:or("debug","info","notice","warn","error")' \ + 'lowest_speed_limit:string' \ + 'max_concurrent_downloads:uinteger' \ + 'max_connection_per_server:uinteger' \ + 'max_download_limit:string' \ + 'max_overall_download_limit:string' \ + 'max_overall_upload_limit:string' \ + 'max_tries:uinteger' \ + 'max_upload_limit:string' \ + 'min_split_size:string' \ + 'pause:or("true","false")' \ + 'pause_metadata:or("true","false")' \ + 'peer_id_prefix:string' \ + 'private_key:file' \ + 'retry_wait:uinteger' \ + 'rpc_auth_method:or("none","user_pass","token")' \ + 'rpc_certificate:file' \ + 'rpc_listen_port:range(1024,65535)' \ + 'rpc_passwd:string' \ + 'rpc_private_key:file' \ + 'rpc_secret:string' \ + 'rpc_secure:or("true","false")' \ + 'rpc_user:string' \ + 'save_session_interval:uinteger' \ + 'seed_ratio:ufloat' \ + 'seed_time:ufloat' \ + 'split:uinteger' \ + 'timeout:uinteger' \ + 'user_agent:string' } aria2_start() { - local section="$1" - [ "$2" = "0" ] || { _info "验证失败。"; return 1; } - [ "$enabled" = "1" ] || return 1 - [ -n "$dir" ] && make_dir "$dir" || { _info "请设置下载目录。"; return 1; } - if [ "$enable_pro" = "1" ]; then - a="$pro" - make_dir "$pro" - else - a="$config_dir" - [ -d "$pro" ] && rm -rf "$pro"; _info "扩展功能已关闭,删除原来的 $pro 目录" - make_dir "$config_dir" - chmod 755 "$config_dir" - fi - - session_file="$a/$NAME.session" - config_file_tmp="$a/$NAME.conf.tmp" - config_file="$a/$NAME.$section.conf" - - create_file "$session_file" - if [ ."$enable_dht" = ."true" -a ! -f "$a"/dht.dat ]; then - dht_file="$a/dht.dat" - create_file "$dht_file" - append_setting "enable-dht=true" "dht-file-path=$dht_file" - fi - - append_setting "all-proxy-passwd=$all_proxy_passwd" "all-proxy-user=$all_proxy_user" \ - "enable-rpc=true" "quiet=true" "input-file=$session_file" "log-level=$log_level" "log_dir=$log_dir" "log=$log" \ - "save-session=$a/$NAME.session" "rpc-allow-origin-all=true" "rpc-listen-all=true" \ - "rpc-private-key=$rpc_private_key" - - if [ -z "$enable_logging" ]; then - append_options "log_dir" "log_level" "log" - elif [ "$enable_logging" = "1" ]; then - make_dir "$log_dir" - [ x$log_dir = x ] && log="/var/log/aria2.log" || log="${log_dir}/aria2.log" - append_setting "log_dir=$log_dir" "log=$log" - append_options "log_level" - [ -s "$log_dir"/aria2.log ] || echo > "$log_dir"/aria2.log - fi - - if [ -z "$enable_proxy" ] || [ "$enable_proxy" = "1" ]; then - append_options "all_proxy" "all_proxy_user" "all_proxy_passwd" - fi - - if [ "$rpc_auth_method" = "token" ]; then - if [ -n "$rpc_secret" ]; then - append_setting "rpc-secret=$rpc_secret" - else - append_setting rpc-secret="" - fi - fi - - if [ ."$rpc_secure" = ."true" ] && [ -n "$rpc_certificate" ]; then - append_setting "rpc-secure=true" - append_options "rpc_certificate" "rpc_private_key" - fi - - if [ ."$check_certificate" = ."true" ]; then - append_setting "check-certificate=true" - append_options "ca_certificate" - elif [ ."$check_certificate" = ."false" ]; then - append_setting "check-certificate=false" - fi - - if [ ."$enable_dht6" = ."true" ] && [ ."$disable_ipv6" != ."true" ]; then - dht6_file="$a/dht6.dat" - create_file "$dht6_file" - append_setting "enable-dht6=true" "dht-file-path6=$dht6_file" - fi - - if [ -n "$bt_tracker" ]; then - for t in $bt_tracker; do - if [ -z "$bt_tracker_list" ]; then - bt_tracker_list="$t" - else - bt_tracker_list="$bt_tracker_list,$t" - fi - done - append_setting "bt-tracker=$bt_tracker_list" - fi - - append_options "auto_save_interval" "bt_enable_lpd" "bt_max_open_files" "bt_max_peers" \ - "bt_remove_unselected_file" "bt_request_peer_speed_limit" "pause" "bt_prioritize_piece" \ - "bt_stop_timeout" "bt_detach_seed_only" "bt_save_metadata" "bt_load_saved_metadata" \ - "bt_seed_unverified" "certificate" "check_integrity" "connect_timeout" "dht_listen_port" \ - "disable_ipv6" "disk_cache" "enable_peer_exchange" "event_poll" "file_allocation" \ - "follow_torrent" "force_save" "http_accept_gzip" "http_no_cache" "listen_port" "split" \ - "lowest_speed_limit" "max_concurrent_downloads" "max_connection_per_server" "user_agent" \ - "max_download_limit" "max_overall_download_limit" "max_overall_upload_limit" "max_tries" \ - "max_upload_limit" "min_split_size" "pause_metadata" "peer_id_prefix" "peer_agent" "private_key" \ - "dir" "retry_wait" "rpc_listen_port" "save_session_interval" "seed_ratio" "seed_time" "timeout" - - config_list_foreach "$section" "header" append_header - config_list_foreach "$section" "extra_settings" append_setting - - if [ "$enable_pro" = "1" ]; then - [ ! -s "$config_file" ] && (pro_conf || cat "$config_file_tmp" >>"$config_file") - else - echo -e "#===以下是系统生成,对此文件修改将无法正常运行===#" >$config_file - cat "$config_file_tmp" >>"$config_file" - fi - rm -f "$config_file_tmp" - - procd_open_instance "$NAME.$section" - procd_set_param command "$PROG" - procd_append_param command --conf-path="$config_file" - procd_set_param respawn - procd_set_param stdout 1 - procd_set_param stderr 1 - procd_set_param file "$config_file" - - if [ -n "$user" ]; then - if ( user_exists "$user" && _change_owner "$user" "$a" "$log" ); then - _info "Aria2将以 $user 的用户身份运行。" - [ "$user" != "root" ] && _info "请确保用户$user具有下载目录$dir的写入权限。" - procd_set_param user "$user" - else - user="" - _info "设置$user用户运行失败,使用默认用户。" - fi - fi - procd_add_jail "$NAME.$section" log - procd_add_jail_mount "$config_file" - procd_add_jail_mount_rw "$dir" "$a" "$log" - procd_close_instance + local section="$1" + [ "$2" = "0" ] || { _err "Validation failed."; return 1; } + + [ "$enabled" = "1" ] || { _info "Instance \"$section\" disabled."; return 1; } + [ -n "$dir" ] || { _err "Please set download dir."; return 1; } + [ -d "$dir" ] || _make_dir "$dir" || { + _err "Can't create download dir: $dir" + return 1 + } + + config_file="$config_dir/$NAME.conf.$section" + config_file_tmp="$config_dir/$NAME.conf.tmp" + session_file="$config_dir/$NAME.session.$section" + + _make_dir "$config_dir" || { + _err "Can't create config dir: $config_dir" + return 1 + } + + _create_file "$session_file" "$config_file" "$config_file_tmp" || { + _err "Can't create files: $session_file, $config_file, $config_file_tmp" + return 1 + } + + # create tmp file + cat >"$config_file_tmp" <<-EOF + # Auto generated file, changes to this file will be lost. + EOF + + append_setting "dir=$dir" + append_setting "enable-rpc=true" + append_setting "rpc-allow-origin-all=true" + append_setting "rpc-listen-all=true" + append_setting "quiet=true" + append_setting "continue=true" + append_setting "input-file=$session_file" + append_setting "save-session=$session_file" + + if [ -z "$enable_logging" ]; then + append_options "log" "log_level" + elif [ "$enable_logging" = "1" ]; then + log=${log:-"/var/log/aria2.log"} + + local log_dir + log_dir="$(dirname "$log")" + + _make_dir "$log_dir" || { + _err "Can't create log dir: $log_dir" + return 1 + } + + # create or clear log file + echo >"$log" + + append_setting "log=$log" + append_options "log_level" + fi + + if [ -z "$enable_proxy" ] || [ "$enable_proxy" = "1" ]; then + append_options "all_proxy" "all_proxy_user" "all_proxy_passwd" + fi + + unset_auth_method() { + uci -q batch <<-EOF + set $NAME.$section.rpc_auth_method="" + commit $NAME + EOF + } + + if [ -z "$rpc_auth_method" ]; then + if [ -n "$rpc_secret" ]; then + append_setting "rpc-secret=$rpc_secret" + elif [ -n "$rpc_user" ]; then + append_setting "rpc-user=$rpc_user" + append_setting "rpc-passwd=$rpc_passwd" + else + _info "It is recommended to set RPC secret." + fi + elif [ "$rpc_auth_method" = "token" ]; then + if [ -n "$rpc_secret" ]; then + append_setting "rpc-secret=$rpc_secret" + else + unset_auth_method + fi + elif [ "$rpc_auth_method" = "user_pass" ]; then + if [ -n "$rpc_user" ]; then + append_setting "rpc-user=$rpc_user" + append_setting "rpc-passwd=$rpc_passwd" + else + _info "Please set RPC user." + unset_auth_method + fi + fi + + if [ ."$rpc_secure" = ."true" ] && [ -n "$rpc_certificate" ]; then + append_setting "rpc-secure=true" + append_options "rpc_certificate" "rpc_private_key" + fi + + if [ ."$check_certificate" = ."true" ]; then + append_setting "check-certificate=true" + append_options "ca_certificate" + elif [ ."$check_certificate" = ."false" ]; then + append_setting "check-certificate=false" + fi + + if [ ."$enable_dht" = ."true" ]; then + dht_file="$config_dir/dht.dat.$section" + _create_file "$dht_file" || { + _err "Can't create DHT file: $dht_file" + return 1 + } + + append_setting "enable-dht=true" + append_setting "dht-file-path=$dht_file" + fi + + if [ ."$enable_dht6" = ."true" ] && [ ."$disable_ipv6" != ."true" ]; then + dht6_file="$config_dir/dht6.dat.$section" + _create_file "$dht6_file" || { + _err "Can't create DHT6 file: $dht6_file" + return 1 + } + + append_setting "enable-dht6=true" + append_setting "dht-file-path6=$dht6_file" + fi + + if [ -n "$bt_tracker" ]; then + local bt_tracker_list; local t + for t in $bt_tracker; do + if [ -z "$bt_tracker_list" ]; then + bt_tracker_list="$t" + else + bt_tracker_list="$bt_tracker_list,$t" + fi + done + + append_setting "bt-tracker=$bt_tracker_list" + fi + + append_options "auto_save_interval" "bt_enable_lpd" "bt_max_open_files" "bt_max_peers" \ + "bt_remove_unselected_file" "bt_request_peer_speed_limit" "bt_prioritize_piece" \ + "bt_stop_timeout" "bt_detach_seed_only" "bt_save_metadata" "bt_load_saved_metadata" \ + "bt_seed_unverified" "certificate" "check_integrity" "connect_timeout" "dht_listen_port" \ + "disable_ipv6" "disk_cache" "enable_peer_exchange" "event_poll" "file_allocation" \ + "follow_torrent" "force_save" "http_accept_gzip" "http_no_cache" "listen_port" \ + "lowest_speed_limit" "max_concurrent_downloads" "max_connection_per_server" \ + "max_download_limit" "max_overall_download_limit" "max_overall_upload_limit" "max_tries" \ + "max_upload_limit" "min_split_size" "pause" "pause_metadata" "peer_id_prefix" "private_key" \ + "retry_wait" "rpc_listen_port" "save_session_interval" "seed_ratio" "seed_time" "split" "timeout" \ + "user_agent" + + config_list_foreach "$section" "header" append_header + config_list_foreach "$section" "extra_settings" append_setting + + cd /usr/share/aria2 && sh ./tracker.sh >/dev/null 2>&1 & + cat /usr/share/aria2/aria2.conf > "$config_file" + echo '' >> "$config_file" + sed '/^$/d' "$config_file_tmp" >> "$config_file" + rm -f "$config_file_tmp" + + _reset_dir_mode "$config_dir" + _change_file_mode 600 "$config_file" + + if [ -n "$user" ]; then + if ( user_exists "$user" && _change_owner "$user" "$config_dir" "$log" ); then + _info "Aria2 will run with user '$user'." + if [ "$user" != "root" ]; then + _info "Please make sure user '$user' has write access to download dir: $dir" + fi + else + _info "Setting run user to '$user' failed, default user will be used." + user= + fi + fi + + procd_open_instance "$NAME.$section" + procd_set_param command "$PROG" + procd_append_param command --conf-path="$config_file" + + procd_set_param respawn + procd_set_param stdout 1 + procd_set_param stderr 1 + + procd_set_param file "$config_file" + [ -n "$user" ] && \ + procd_set_param user "$user" + + procd_add_jail "$NAME.$section" log + procd_add_jail_mount "$ca_certificate" "$certificate" "$rpc_certificate" "$rpc_private_key" + procd_add_jail_mount_rw "$dir" "$config_dir" "$log" + procd_close_instance } service_triggers() { - procd_add_reload_trigger "$NAME" - procd_add_validation aria2_validate + procd_add_reload_trigger "$NAME" + procd_add_validation aria2_validate } start_service() { - config_load "$NAME" - config_foreach aria2_validate "aria2" aria2_start + config_load "$NAME" + config_foreach aria2_validate "aria2" aria2_start } diff --git a/aria2/patch/9999-001-options-unlock-connection-per-server-limit.patch b/aria2/patches/0001-options-unlock-connection-per-server-limit.patch similarity index 53% rename from aria2/patch/9999-001-options-unlock-connection-per-server-limit.patch rename to aria2/patches/0001-options-unlock-connection-per-server-limit.patch index e19d5c419..65c283787 100644 --- a/aria2/patch/9999-001-options-unlock-connection-per-server-limit.patch +++ b/aria2/patches/0001-options-unlock-connection-per-server-limit.patch @@ -1,33 +1,24 @@ -From 95c292519967adebb1815fbb0941ade5f3a50dc0 Mon Sep 17 00:00:00 2001 -From: P3TERX -Date: Sat, 2 May 2020 17:40:09 +0800 -Subject: [PATCH] options: unlock connection-per-server limit - ---- - src/OptionHandlerFactory.cc | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - ---- a/src/OptionHandlerFactory.cc -+++ b/src/OptionHandlerFactory.cc -@@ -440,7 +440,7 @@ std::vector OptionHandle +--- /src/OptionHandlerFactory.cc 2018-05-15 20:33:25.000000000 +0800 ++++ /src/OptionHandlerFactory.cc 2018-07-05 10:40:25.000000000 +0800 +@@ -440,7 +440,7 @@ { OptionHandler* op(new NumberOptionHandler(PREF_MAX_CONNECTION_PER_SERVER, TEXT_MAX_CONNECTION_PER_SERVER, - "1", 1, 16, 'x')); -+ "1", 1, -1, 'x')); ++ "64", 1, -1, 'x')); op->addTag(TAG_BASIC); op->addTag(TAG_FTP); op->addTag(TAG_HTTP); -@@ -501,7 +501,7 @@ std::vector OptionHandle +@@ -501,7 +501,7 @@ } { OptionHandler* op(new UnitNumberOptionHandler( - PREF_MIN_SPLIT_SIZE, TEXT_MIN_SPLIT_SIZE, "20M", 1_m, 1_g, 'k')); -+ PREF_MIN_SPLIT_SIZE, TEXT_MIN_SPLIT_SIZE, "20M", 1_k, 1_g, 'k')); ++ PREF_MIN_SPLIT_SIZE, TEXT_MIN_SPLIT_SIZE, "1M", 1_k, 1_g, 'k')); op->addTag(TAG_BASIC); op->addTag(TAG_FTP); op->addTag(TAG_HTTP); -@@ -905,7 +905,7 @@ std::vector OptionHandle +@@ -905,7 +905,7 @@ std::vector OptionHandlerFactory::createOptionHandlers() } { OptionHandler* op(new UnitNumberOptionHandler( diff --git a/aria2/patch/9999-002-download-retry-on-slow-speed-and-conection-close.patch b/aria2/patches/0002-download-retry-on-slow-speed-and-reset.patch similarity index 76% rename from aria2/patch/9999-002-download-retry-on-slow-speed-and-conection-close.patch rename to aria2/patches/0002-download-retry-on-slow-speed-and-reset.patch index 34420054c..68361cd8a 100644 --- a/aria2/patch/9999-002-download-retry-on-slow-speed-and-conection-close.patch +++ b/aria2/patches/0002-download-retry-on-slow-speed-and-reset.patch @@ -1,7 +1,7 @@ -From b4e7d6859f11e425260ea9aed881a29d993fdb4a Mon Sep 17 00:00:00 2001 +From 66524bee738e98742c908d93c993d0a78a2d9891 Mon Sep 17 00:00:00 2001 From: myfreeer Date: Sat, 18 Nov 2017 11:55:04 +0800 -Subject: [PATCH] download: retry on slow speed and conection close +Subject: [PATCH 3/4] download: retry on slow speed and conection close This would provide better speed on bad network conditions --- @@ -10,9 +10,11 @@ This would provide better speed on bad network conditions src/SocketCore.cc | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) +diff --git a/src/DownloadCommand.cc b/src/DownloadCommand.cc +index 2db41e4..f49eb80 100644 --- a/src/DownloadCommand.cc +++ b/src/DownloadCommand.cc -@@ -306,7 +306,7 @@ void DownloadCommand::checkLowestDownloa +@@ -306,7 +306,7 @@ void DownloadCommand::checkLowestDownloadSpeed() const startupIdleTime_) { int nowSpeed = peerStat_->calculateDownloadSpeed(); if (nowSpeed <= lowestDownloadSpeedLimit_) { @@ -21,6 +23,8 @@ This would provide better speed on bad network conditions lowestDownloadSpeedLimit_, getRequest()->getHost().c_str()), error_code::TOO_SLOW_DOWNLOAD_SPEED); +diff --git a/src/SocketBuffer.cc b/src/SocketBuffer.cc +index 62862ff..1906173 100644 --- a/src/SocketBuffer.cc +++ b/src/SocketBuffer.cc @@ -39,6 +39,7 @@ @@ -40,9 +44,11 @@ This would provide better speed on bad network conditions } // A2_LOG_NOTICE(fmt("num=%zu, amount=%d, bufq.size()=%zu, SEND=%d", // num, amount, bufq_.size(), slen)); +diff --git a/src/SocketCore.cc b/src/SocketCore.cc +index 77dc30c..537375a 100644 --- a/src/SocketCore.cc +++ b/src/SocketCore.cc -@@ -1016,7 +1016,7 @@ bool SocketCore::tlsHandshake(TLSContext +@@ -1009,7 +1009,7 @@ bool SocketCore::tlsHandshake(TLSContext* tlsctx, const std::string& hostname) if (rv == TLS_ERR_ERROR) { // Damn those error. @@ -51,3 +57,5 @@ This would provide better speed on bad network conditions handshakeError.empty() ? tlsSession_->getLastErrorString().c_str() : handshakeError.c_str())); +-- +2.17.1 diff --git a/aria2/patch/9999-003-option-add-option-to-retry-on-http-400-403-406-or-un.patch b/aria2/patches/0003-option-add-option-to-retry-on-http-4xx.patch similarity index 89% rename from aria2/patch/9999-003-option-add-option-to-retry-on-http-400-403-406-or-un.patch rename to aria2/patches/0003-option-add-option-to-retry-on-http-4xx.patch index b3c0cd594..cde2a9000 100644 --- a/aria2/patch/9999-003-option-add-option-to-retry-on-http-400-403-406-or-un.patch +++ b/aria2/patches/0003-option-add-option-to-retry-on-http-4xx.patch @@ -1,8 +1,7 @@ -From a050b0a37815cbd0e31a2f30e3e7eca87d2caee6 Mon Sep 17 00:00:00 2001 +From 8adbc01dc5975a64c55fe594d8c758c71e8183b3 Mon Sep 17 00:00:00 2001 From: myfreeer Date: Sun, 22 Jul 2018 19:59:02 +0800 -Subject: [PATCH] option: add option to retry on http 400, 403, 406, or - unknown +Subject: [PATCH] option: add option to retry on http 400, 403, 406, or unknown --retry-on-400[=true|false] Configure whether retry or not when HTTP server returns 400 Bad Request. @@ -43,9 +42,11 @@ Subject: [PATCH] option: add option to retry on http 400, 403, 406, or src/usage_text.h | 16 +++++++++++++ 5 files changed, 108 insertions(+), 6 deletions(-) +diff --git a/src/HttpSkipResponseCommand.cc b/src/HttpSkipResponseCommand.cc +index a722d77..de4ad6c 100644 --- a/src/HttpSkipResponseCommand.cc +++ b/src/HttpSkipResponseCommand.cc -@@ -204,7 +204,7 @@ bool HttpSkipResponseCommand::processRes +@@ -204,7 +204,7 @@ bool HttpSkipResponseCommand::processResponse() auto statusCode = httpResponse_->getStatusCode(); if (statusCode >= 400) { switch (statusCode) { @@ -54,7 +55,7 @@ Subject: [PATCH] option: add option to retry on http 400, 403, 406, or if (getOption()->getAsBool(PREF_HTTP_AUTH_CHALLENGE) && !httpResponse_->getHttpRequest()->authenticationUsed() && getDownloadEngine()->getAuthConfigFactory()->activateBasicCred( -@@ -213,15 +213,41 @@ bool HttpSkipResponseCommand::processRes +@@ -213,15 +213,41 @@ bool HttpSkipResponseCommand::processResponse() return prepareForRetry(0); } throw DL_ABORT_EX2(EX_AUTH_FAILED, error_code::HTTP_AUTH_FAILED); @@ -99,7 +100,7 @@ Subject: [PATCH] option: add option to retry on http 400, 403, 406, or // Only retry if pretry-wait > 0. Hammering 'busy' server is not // a good idea. if (getOption()->getAsInt(PREF_RETRY_WAIT) > 0) { -@@ -230,12 +256,16 @@ bool HttpSkipResponseCommand::processRes +@@ -230,12 +256,16 @@ bool HttpSkipResponseCommand::processResponse() } throw DL_ABORT_EX2(fmt(EX_BAD_STATUS, statusCode), error_code::HTTP_SERVICE_UNAVAILABLE); @@ -118,12 +119,16 @@ Subject: [PATCH] option: add option to retry on http 400, 403, 406, or throw DL_ABORT_EX2(fmt(EX_BAD_STATUS, statusCode), error_code::HTTP_PROTOCOL_ERROR); } +diff --git a/src/OptionHandlerFactory.cc b/src/OptionHandlerFactory.cc +index 5768f7b..decb03e 100644 --- a/src/OptionHandlerFactory.cc +++ b/src/OptionHandlerFactory.cc -@@ -936,6 +936,46 @@ std::vector OptionHandle +@@ -934,6 +934,46 @@ std::vector OptionHandlerFactory::createOptionHandlers() + op->setChangeOptionForReserved(true); + handlers.push_back(op); } - { - OptionHandler* op(new BooleanOptionHandler( ++ { ++ OptionHandler* op(new BooleanOptionHandler( + PREF_RETRY_ON_400, TEXT_RETRY_ON_400, A2_V_FALSE, OptionHandler::OPT_ARG)); + op->addTag(TAG_ADVANCED); + op->addTag(TAG_HTTP); @@ -162,14 +167,14 @@ Subject: [PATCH] option: add option to retry on http 400, 403, 406, or + op->setChangeOptionForReserved(true); + handlers.push_back(op); + } -+ { -+ OptionHandler* op(new BooleanOptionHandler( + { + OptionHandler* op(new BooleanOptionHandler( PREF_REUSE_URI, TEXT_REUSE_URI, A2_V_TRUE, OptionHandler::OPT_ARG)); - op->addTag(TAG_FTP); - op->addTag(TAG_HTTP); +diff --git a/src/prefs.cc b/src/prefs.cc +index 937e927..33eff91 100644 --- a/src/prefs.cc +++ b/src/prefs.cc -@@ -326,6 +326,14 @@ PrefPtr PREF_ENABLE_ASYNC_DNS6 = makePre +@@ -327,6 +327,14 @@ PrefPtr PREF_ENABLE_ASYNC_DNS6 = makePref("enable-async-dns6"); PrefPtr PREF_MAX_DOWNLOAD_RESULT = makePref("max-download-result"); // value: 1*digit PrefPtr PREF_RETRY_WAIT = makePref("retry-wait"); @@ -184,9 +189,11 @@ Subject: [PATCH] option: add option to retry on http 400, 403, 406, or // value: string PrefPtr PREF_ASYNC_DNS_SERVER = makePref("async-dns-server"); // value: true | false +diff --git a/src/prefs.h b/src/prefs.h +index e1f8397..019e774 100644 --- a/src/prefs.h +++ b/src/prefs.h -@@ -279,6 +279,14 @@ extern PrefPtr PREF_ENABLE_ASYNC_DNS6; +@@ -280,6 +280,14 @@ extern PrefPtr PREF_ENABLE_ASYNC_DNS6; extern PrefPtr PREF_MAX_DOWNLOAD_RESULT; // value: 1*digit extern PrefPtr PREF_RETRY_WAIT; @@ -201,6 +208,8 @@ Subject: [PATCH] option: add option to retry on http 400, 403, 406, or // value: string extern PrefPtr PREF_ASYNC_DNS_SERVER; // value: true | false +diff --git a/src/usage_text.h b/src/usage_text.h +index d73b50d..75d34a0 100644 --- a/src/usage_text.h +++ b/src/usage_text.h @@ -64,6 +64,22 @@ @@ -226,3 +235,5 @@ Subject: [PATCH] option: add option to retry on http 400, 403, 406, or #define TEXT_TIMEOUT \ _(" -t, --timeout=SEC Set timeout in seconds.") #define TEXT_MAX_TRIES \ +-- +2.18.0 diff --git a/aria2/patches/0004-Disable-auto-added-Want-Digest-header.patch b/aria2/patches/0004-Disable-auto-added-Want-Digest-header.patch new file mode 100644 index 000000000..65a473d66 --- /dev/null +++ b/aria2/patches/0004-Disable-auto-added-Want-Digest-header.patch @@ -0,0 +1,123 @@ +From b938aa51e50852d1b185db3188357073ad374416 Mon Sep 17 00:00:00 2001 +From: myfreeer +Date: Sun, 13 Dec 2020 15:40:56 +0800 +Subject: [PATCH] option: add option to disable Want-Digest header + +Sending this HTTP header should be optional. +Should close https://github.com/myfreeer/aria2-build-msys2/issues/10 + + --http-want-digest[=true|false] Send Want-Digest HTTP requser header + with only limited hash algorithms: + SHA-512, SHA-256, and SHA-1. + The Want-Digest HTTP header is primarily used + in a HTTP request, to ask the responder to + provide a digest of the requested resource + using the Digest response header + + Possible Values: true, false + Default: false + Tags: #advanced, #http +--- + src/AbstractProxyRequestCommand.cc | 1 + + src/HttpRequestCommand.cc | 1 + + src/OptionHandlerFactory.cc | 12 ++++++++++++ + src/prefs.cc | 2 ++ + src/prefs.h | 2 ++ + src/usage_text.h | 8 ++++++++ + 6 files changed, 26 insertions(+) + +diff --git a/src/AbstractProxyRequestCommand.cc b/src/AbstractProxyRequestCommand.cc +index bd2bcb3..1feed07 100644 +--- a/src/AbstractProxyRequestCommand.cc ++++ b/src/AbstractProxyRequestCommand.cc +@@ -72,6 +72,7 @@ bool AbstractProxyRequestCommand::executeInternal() + if (httpConnection_->sendBufferIsEmpty()) { + auto httpRequest = make_unique(); + httpRequest->setUserAgent(getOption()->get(PREF_USER_AGENT)); ++ httpRequest->setNoWantDigest(!getOption()->getAsBool(PREF_HTTP_WANT_DIGEST)); + httpRequest->setRequest(getRequest()); + httpRequest->setProxyRequest(proxyRequest_); + +diff --git a/src/HttpRequestCommand.cc b/src/HttpRequestCommand.cc +index a2b8e7e..8c50153 100644 +--- a/src/HttpRequestCommand.cc ++++ b/src/HttpRequestCommand.cc +@@ -90,6 +90,7 @@ createHttpRequest(const std::shared_ptr& req, + { + auto httpRequest = make_unique(); + httpRequest->setUserAgent(option->get(PREF_USER_AGENT)); ++ httpRequest->setNoWantDigest(!option->getAsBool(PREF_HTTP_WANT_DIGEST)); + httpRequest->setRequest(req); + httpRequest->setFileEntry(fileEntry); + httpRequest->setSegment(segment); +diff --git a/src/OptionHandlerFactory.cc b/src/OptionHandlerFactory.cc +index a058eb9..9ff615a 100644 +--- a/src/OptionHandlerFactory.cc ++++ b/src/OptionHandlerFactory.cc +@@ -1106,6 +1106,18 @@ std::vector OptionHandlerFactory::createOptionHandlers() + op->setChangeOptionForReserved(true); + handlers.push_back(op); + } ++ { ++ OptionHandler* op( ++ new BooleanOptionHandler(PREF_HTTP_WANT_DIGEST, ++ TEXT_HTTP_WANT_DIGEST, ++ A2_V_FALSE, OptionHandler::OPT_ARG)); ++ op->addTag(TAG_ADVANCED); ++ op->addTag(TAG_HTTP); ++ op->setInitialOption(true); ++ op->setChangeGlobalOption(true); ++ op->setChangeOptionForReserved(true); ++ handlers.push_back(op); ++ } + { + OptionHandler* op(new BooleanOptionHandler( + PREF_ENABLE_HTTP_KEEP_ALIVE, TEXT_ENABLE_HTTP_KEEP_ALIVE, A2_V_TRUE, +diff --git a/src/prefs.cc b/src/prefs.cc +index 9793706..bdb33e2 100644 +--- a/src/prefs.cc ++++ b/src/prefs.cc +@@ -437,6 +437,8 @@ PrefPtr PREF_HTTP_ACCEPT_GZIP = makePref("http-accept-gzip"); + // value: true | false + PrefPtr PREF_CONTENT_DISPOSITION_DEFAULT_UTF8 = + makePref("content-disposition-default-utf8"); ++// values: true | false ++PrefPtr PREF_HTTP_WANT_DIGEST = makePref("http-want-digest"); + + /** + * Proxy related preferences +diff --git a/src/prefs.h b/src/prefs.h +index f014d9c..c88f2d0 100644 +--- a/src/prefs.h ++++ b/src/prefs.h +@@ -389,6 +389,8 @@ extern PrefPtr PREF_HTTP_NO_CACHE; + extern PrefPtr PREF_HTTP_ACCEPT_GZIP; + // value: true | false + extern PrefPtr PREF_CONTENT_DISPOSITION_DEFAULT_UTF8; ++// value: true | false ++extern PrefPtr PREF_HTTP_WANT_DIGEST; + + /**; + * Proxy related preferences +diff --git a/src/usage_text.h b/src/usage_text.h +index 7a0a981..aee3ac0 100644 +--- a/src/usage_text.h ++++ b/src/usage_text.h +@@ -560,6 +560,14 @@ + " Content-Disposition header as UTF-8 instead of\n" \ + " ISO-8859-1, for example, the filename parameter,\n" \ + " but not the extended version filename*.") ++#define TEXT_HTTP_WANT_DIGEST \ ++ _(" --http-want-digest[=true|false] Send Want-Digest HTTP requser header\n" \ ++ " with only limited hash algorithms:\n" \ ++ " SHA-512, SHA-256, and SHA-1.\n" \ ++ " The Want-Digest HTTP header is primarily used\n" \ ++ " in a HTTP request, to ask the responder to\n" \ ++ " provide a digest of the requested resource\n" \ ++ " using the Digest response header") + #define TEXT_EVENT_POLL \ + _(" --event-poll=POLL Specify the method for polling events.") + #define TEXT_BT_EXTERNAL_IP \ +-- +2.29.2 + diff --git a/ariang/Makefile b/ariang/Makefile deleted file mode 100644 index 66ac20b3d..000000000 --- a/ariang/Makefile +++ /dev/null @@ -1,70 +0,0 @@ -include $(TOPDIR)/rules.mk - -PKG_NAME:=ariang -PKG_VERSION:=1.3.6 -PKG_RELEASE:=$(AUTORELEASE) - -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).zip -PKG_SOURCE_URL:=https://github.com/mayswind/AriaNg/releases/download/$(PKG_VERSION) -PKG_HASH:=skip -UNPACK_CMD=unzip -q -d $(1) $(DL_DIR)/$(PKG_SOURCE) - -PKG_MAINTAINER:=Ansuel Smith -PKG_LICENSE:=MIT -PKG_LICENSE_FILES:=LICENSE - -include $(INCLUDE_DIR)/package.mk - -define Package/ariang/default - SECTION:=net - CATEGORY:=Network - SUBMENU:=Download Manager - DEPENDS:=+aria2 - TITLE:=AriaNg webui - URL:=https://ariang.mayswind.net - PKGARCH:=all -endef - -define Package/ariang/description - AriaNg is a web frontend making aria2 easier to use. AriaNg is written in pure html & javascript, thus it does not need any compilers or runtime environment. -endef - -Package/ariang-nginx/description = $(Package/ariang/description) - -define Package/ariang - $(Package/ariang/default) - DEPENDS:=+uhttpd - TITLE:=for uhttpd webserver -endef - -define Package/ariang-nginx - $(Package/ariang/default) - DEPENDS:=+nginx - TITLE:=for nginx webserver -endef - -define Build/Compile -endef - -define Package/ariang/install - $(INSTALL_DIR) \ - $(1)/www/ariang - $(CP) \ - $(PKG_BUILD_DIR)/{langs,css,js,fonts} \ - $(PKG_BUILD_DIR)/index.html \ - $(PKG_BUILD_DIR)/LICENSE \ - $(PKG_BUILD_DIR)/{favicon.*,*.png} \ - $(PKG_BUILD_DIR)/robots.txt \ - $(1)/www/ariang -endef - -define Package/ariang-nginx/install - $(Package/ariang/install) - $(INSTALL_DIR) $(1)/etc/nginx/conf.d/ - $(INSTALL_BIN) ./files/ariang.locations $(1)/etc/nginx/conf.d/ - $(INSTALL_DIR) $(1)/etc/uci-defaults - $(INSTALL_BIN) ./files/80_ariang-nginx-support $(1)/etc/uci-defaults/80_ariang-nginx-support -endef - -$(eval $(call BuildPackage,ariang)) -$(eval $(call BuildPackage,ariang-nginx)) diff --git a/ariang/files/80_ariang-nginx-support b/ariang/files/80_ariang-nginx-support deleted file mode 100644 index 0a89ccd1b..000000000 --- a/ariang/files/80_ariang-nginx-support +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -[ -x /etc/init.d/nginx ] && /etc/init.d/nginx running && /etc/init.d/nginx reload - -exit 0 diff --git a/ariang/files/ariang.locations b/ariang/files/ariang.locations deleted file mode 100644 index 28b0a8ada..000000000 --- a/ariang/files/ariang.locations +++ /dev/null @@ -1,4 +0,0 @@ -location /ariang { - index index.html; - alias /www/ariang/; -} \ No newline at end of file diff --git a/ddns-go/ddns-go/Makefile b/ddns-go/ddns-go/Makefile index 1835d03fe..a5c4308c9 100644 --- a/ddns-go/ddns-go/Makefile +++ b/ddns-go/ddns-go/Makefile @@ -8,15 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ddns-go -KG_VERSION:=6.0.3 +PKG_VERSION:=5.7.1 PKG_RELEASE:=1 -PKG_SOURCE_PROTO:=git PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://github.com/jeessy2/ddns-go.git -PKG_MIRROR_HASH:=8d4caef96cbf8c3276c50e1a27b79950e3efe9bc1aa9d4509ded98071cf3098a -PKG_SOURCE_VERSION:=fe9f437d9b1c600bdafd5af9c15f2ed9ce193538 - +PKG_SOURCE_URL:=https://codeload.github.com/jeessy2/ddns-go/tar.gz/v$(PKG_VERSION)? +PKG_HASH:=6f59151f36fbba207d156a905c8de80e26c7b54be9da5d0821d3417204d0eca8 PKG_LICENSE:=AGPL-3.0-only PKG_LICENSE_FILES:=LICENSE @@ -24,7 +21,6 @@ PKG_MAINTAINER:=herboy2008 PKG_BUILD_DEPENDS:=golang/host PKG_BUILD_PARALLEL:=1 -PKG_USE_MIPS16:=0 PKG_BUILD_FLAGS:=no-mips16 GO_PKG:=github.com/jeessy2/ddns-go/v5 @@ -48,15 +44,14 @@ define Package/ddns-go/description support Alidns Dnspod Cloudflare Hicloud Callback Baiducloud porkbun GoDaddy Google Domains. endef - define Package/ddns-go/install $(call GoPackage/Package/Install/Bin,$(1)) $(INSTALL_DIR) $(1)/etc/init.d - $(INSTALL_BIN) ./file/ddns-go.init $(1)/etc/init.d/ddns-go + $(INSTALL_BIN) $(CURDIR)/file/ddns-go.init $(1)/etc/init.d/ddns-go $(INSTALL_DIR) $(1)/etc/uci-defaults - $(INSTALL_BIN) ./file/luci-ddns-go.uci-default $(1)/etc/uci-defaults/luci-ddns-go + $(INSTALL_BIN) $(CURDIR)/file/luci-ddns-go.uci-default $(1)/etc/uci-defaults/luci-ddns-go endef $(eval $(call GoBinPackage,ddns-go)) diff --git a/luci-app-aria2/Makefile b/luci-app-aria2/Makefile index e2255eceb..e628e8123 100644 --- a/luci-app-aria2/Makefile +++ b/luci-app-aria2/Makefile @@ -1,23 +1,17 @@ -include $(TOPDIR)/rules.mk - -PKG_NAME:=luci-app-aria2 +# +# Copyright (C) 2017-2019 Xingwang Liao +# +# This is free software, licensed under the MIT License. +# -PKG_VERSION:=1.0.1 -PKG_RELEASE:=3 +include $(TOPDIR)/rules.mk -PKG_LICENSE:=Apache-2.0 -PKG_MAINTAINER:=Hsing-Wang Liao LUCI_TITLE:=LuCI Support for Aria2 LUCI_DEPENDS:=+aria2 +ariang LUCI_PKGARCH:=all -define Package/$(PKG_NAME)/config -help - $(LUCI_TITLE) - . - Version: $(PKG_VERSION)-$(PKG_RELEASE) - $(PKG_MAINTAINER) -endef +PKG_MAINTAINER:=Xingwang Liao +PKG_LICENSE:=MIT include $(TOPDIR)/feeds/luci/luci.mk diff --git a/luci-app-aria2/luasrc/controller/aria2.lua b/luci-app-aria2/luasrc/controller/aria2.lua index 34954ebec..15e8f0733 100644 --- a/luci-app-aria2/luasrc/controller/aria2.lua +++ b/luci-app-aria2/luasrc/controller/aria2.lua @@ -1,43 +1,39 @@ -local sys = require "luci.sys" -local uci = require "luci.model.uci".cursor() +module("luci.controller.aria2",package.seeall) +local ucic = luci.model.uci.cursor() +local http = require "luci.http" +local util = require "luci.util" -module("luci.controller.aria2", package.seeall) function index() - if not nixio.fs.access("/etc/config/aria2") then return end - - entry({ "admin", "nas", "aria2" }, firstchild(), _("Aria2")).dependent = false - entry({ "admin", "nas", "aria2", "config" }, cbi("aria2/config"), _("Configuration"), 1) - entry({ "admin", "nas", "aria2", "file" }, form("aria2/files"), _("Files"), 2) - entry({ "admin", "nas", "aria2", "log" }, form("aria2/log"), _("Log"), 3).leaf = true - entry({ "admin", "nas", "aria2", "action_log_read" }, call("action_log_read")) - entry({ "admin", "nas", "aria2", "clear_log" }, call("clear_log")).leaf = true - entry({ "admin", "nas", "aria2", "status" }, call("action_status")) + if not nixio.fs.access("/etc/config/aria2")then return end + entry({"admin","nas","aria2"},firstchild(),_("Aria2")).dependent=false + entry({"admin","nas","aria2","config"},cbi("aria2/config"),_("Configuration"),1) + entry({"admin","nas","aria2","file"},form("aria2/files"),_("Files"),2) + entry({"admin","nas","aria2","log"},firstchild(),_("Log"),3) + entry({"admin","nas","aria2","log","view"},template("aria2/log_template")) + entry({"admin","nas","aria2","log","read"},call("action_log_read")) + entry({"admin", "nas", "aria2", "clear_log"}, call("clear_log")).leaf = true + entry({"admin","nas","aria2","status"},call("action_status")) end function action_status() - luci.http.prepare_content("application/json") - luci.http.write_json({ - running = sys.call("ps 2>/dev/null | grep aria2c 2>/dev/null | grep /usr/bin >/dev/null") == 0 - }) +local t={ +running=(luci.sys.call("pidof aria2c >/dev/null")==0) +} +http.prepare_content("application/json") +http.write_json(t) end -local log_dir = uci:get("aria2", "main", "log_dir") or "/var/log" -local log = log_dir .. '/aria2.log' -local syslog = log_dir .. '/aria2_syslog.log' - -function action_log_read() - luci.http.prepare_content("application/json") - luci.http.write_json({ - log = nixio.fs.access(log) and sys.exec("tail -n 60 %s" % log) or "", - syslog = nixio.fs.access(syslog) and sys.exec("tail -n 60 %s" % syslog) or "" - }) +function clear_log() + luci.sys.call("cat > /var/log/aria2_1.log") end -function clear_log() - if nixio.fs.access(log) then - sys.call(":> " .. log) - end - if nixio.fs.access(syslog) then - sys.call(":> " .. syslog) - end +function action_log_read() + local t={log="",syslog=""} + local o=ucic:get("aria2","main","log")or"/var/log/aria2.log" + if nixio.fs.access(o) then + t.log=util.trim(luci.sys.exec("tail -n 50 %s | sed 'x;1!H;$!d;x'"%o)) + end + t.syslog=util.trim(luci.sys.exec("[ -f '/var/log/aria2_1.log' ] && cat /var/log/aria2_1.log")) + http.prepare_content("application/json") + http.write_json(t) end diff --git a/luci-app-aria2/luasrc/model/cbi/aria2/config.lua b/luci-app-aria2/luasrc/model/cbi/aria2/config.lua index 3c94140f6..c5009f77c 100644 --- a/luci-app-aria2/luasrc/model/cbi/aria2/config.lua +++ b/luci-app-aria2/luasrc/model/cbi/aria2/config.lua @@ -1,476 +1,411 @@ -local sys = require "luci.sys" -local util = require "luci.util" - -local function checkAria2c() - if sys.call("command -v aria2c >/dev/null") ~= 0 then - return nil - end - - local t = {} - for e in util.execi("aria2c -v 2>/dev/null | grep -E '^(aria2 version|Enabled Features)'") do - if e:match("^aria2 version") then - t.version = e:match("([%d%.]+)$") - elseif e:match("^Enabled Features") then - t.gzip = e:find("GZip") ~= nil - t.https = e:find("HTTPS") ~= nil - t.bt = e:find("BitTorrent") ~= nil - t.sftp = e:find("SFTP") ~= nil - t.adns = e:find("Async DNS") ~= nil - t.cookie = e:find("Firefox3 Cookie") ~= nil - end - end - return t +local a=require"luci.sys" +local i=require"luci.util" +local o,t,e +local function n() +if a.call("command -v aria2c >/dev/null")~=0 then +return nil end -local aria2cInfo = checkAria2c() - -local o = Map("aria2", "Aria2 - %s" % translate("Settings"), - translate("Aria2 is a lightweight multi-protocol & multi-source, cross platform download utility.")) -if not aria2cInfo then - o:section(SimpleSection, nil, "%s" % - translate("Error: Can't find aria2c in PATH, please reinstall aria2.")) - o.reset = false - o.submit = false - return o +local t={} +local e +for e in i.execi("aria2c -v 2>/dev/null | grep -E '^(aria2 version|Enabled Features)'")do +if e:match("^aria2 version")then +local a,a,e=e:find("([%d%.]+)$") +t.version=e +elseif e:match("^Enabled Features")then +t.gzip=e:find("GZip")~=nil +t.https=e:find("HTTPS")~=nil +t.bt=e:find("BitTorrent")~=nil +t.sftp=e:find("SFTP")~=nil +t.adns=e:find("Async DNS")~=nil +t.cookie=e:find("Firefox3 Cookie")~=nil +end +end +return t +end +local a=n() +o=Map("aria2","%s - %s"%{translate("Aria2"),translate("Settings")}, +"

%s

%s

"%{ +translate("Aria2 is a lightweight multi-protocol & multi-source, cross platform download utility."), +translatef("") +}) +if not a then +o:section(SimpleSection,nil,"%s"% +translate("Error: Can't find aria2c in PATH, please reinstall aria2.")) +o.reset=false +o.submit=false +return o end - o:append(Template("aria2/settings_header")) -t = o:section(NamedSection, "main", "aria2") -t.addremove = false -t.anonymous = true - -t:tab("basic", translate("Basic Options")) -e = t:taboption("basic", Flag, "enabled", translate("Enabled")) -e.description = translatef("Current version of aria2: %s", aria2cInfo.version) .. "" -e.rmempty = false - -e = t:taboption("basic", ListValue, "user", translate("Run daemon as user"), - translate("Leave blank to use default user.")) +t=o:section(NamedSection,"main","aria2") +t.addremove=false +t.anonymous=true +t:tab("basic",translate("Basic Options")) +e=t:taboption("basic",Flag,"enabled",translate("Enabled")) +e.rmempty=false +e=t:taboption("basic",ListValue,"user",translate("Run daemon as user"), +translate("Leave blank to use default user.")) e:value("") -for t in util.execi("cut -d':' -f1 /etc/passwd") do - e:value(t) +local n +for t in i.execi("cat /etc/passwd | cut -d':' -f1")do +e:value(t) end - -e = t:taboption("basic", Value, "dir", translate("Download directory"), - translate("The files are stored in the download directory automatically created under the selected mounted disk")) -local dev_map = {} -for disk in util.execi("df -h | awk '/dev.*mnt/{print $6,$2,$3,$5,$1}'") do - local diskInfo = util.split(disk, " ") - local dev = diskInfo[5] - if not dev_map[dev] then - dev_map[dev] = true - e:value(diskInfo[1] .. "/download", - translatef(("%s/download (size: %s) (used: %s/%s)"), diskInfo[1], diskInfo[2], diskInfo[3], diskInfo[4])) - end +mount=t:taboption("basic",Value,"dir",translate("Download directory"), +translate("The directory to store the downloaded file. eg. /mnt/sda1")) +mount.rmempty=false +for t in i.execi("mount | awk '{print $3}' | grep mnt")do +mount:value(t) end - -e = t:taboption("basic", Value, "config_dir", translate("Config file directory"), - translate("The directory to store the config file, session file and DHT file.")) -e.placeholder = "/var/etc/aria2" - -e = t:taboption("basic", Flag, "enable_pro", translate("Enable Aria2 pro"), - translate("When enabled, the original system configuration directory will be merged.")) -e.rmempty = false - -e = t:taboption("basic", Value, "pro", translate("Aria2 pro file"), - translate("Use the configuration scheme of p3terx to realize the enhancement and expansion of aria2 function.")) -e:depends("enable_pro", "1") -e.default = "/usr/share/aria2" - -e = t:taboption("basic", Flag, "enable_logging", translate("Enable logging")) -e.rmempty = false - -e = t:taboption("basic", Value, "log_dir", translate("Log file"), - translate("The directory where the log files are saved")) -e:depends("enable_logging", "1") -e.placeholder = "/var/log" - -e = t:taboption("basic", ListValue, "log_level", translate("Log level")) -e:depends("enable_logging", "1") -e:value("debug", translate("Debug")) -e:value("info", translate("Info")) -e:value("notice", translate("Notice")) -e:value("warn", translate("Warn")) -e:value("error", translate("Error")) -e.default = "warn" - -e = t:taboption("basic", Value, "max_concurrent_downloads", translate("Max concurrent downloads")) -e.placeholder = "5" -t:tab("rpc", translate("RPC Options")) - -e = t:taboption("rpc", Flag, "pause", translate("Pause"), translate("Pause download after added.")) -e.enabled = "true" -e.disabled = "false" -e.default = "false" - -e = t:taboption("rpc", Flag, "pause_metadata", translate("Pause metadata"), - translate("Pause downloads created as a result of metadata download.")) -e.enabled = "true" -e.disabled = "false" -e.default = "false" - -e = t:taboption("rpc", Value, "rpc_listen_port", translate("RPC port"), - translate("The webui port defaults to 6800.")) -e.datatype = "range(1024, 65535)" -e.placeholder = "6800" - -e = t:taboption("rpc", ListValue, "rpc_auth_method", - translate("RPC authentication method")) -e:value("none", translate("No Authentication")) -e:value("token", translate("Token")) - -e = t:taboption("rpc", Value, "rpc_secret", translate("RPC token")) -e:depends("rpc_auth_method", "token") -e.template = "aria2/value_with_btn" -e.btntext = translate("generate randomly") -e.btnclick = "randomToken();" - -if aria2cInfo.https then - e = t:taboption("rpc", Flag, "rpc_secure", translate("RPC secure"), - translate("RPC transport will be encrypted by SSL/TLS. The RPC clients must use https" - .. " scheme to access the server. For WebSocket client, use wss scheme.")) - e.enabled = "true" - e.disabled = "false" - e.rmempty = false - - e = t:taboption("rpc", Value, "rpc_certificate", translate("RPC certificate"), - translate("Use the certificate in FILE for RPC server. The certificate must be either" - .. " in PKCS12 (.p12, .pfx) or in PEM format.
PKCS12 files must contain the" - .. " certificate, a key and optionally a chain of additional certificates. Only PKCS12" - .. " files with a blank import password can be opened!
When using PEM, you have to" - .. " specify the \"RPC private key\" as well.")) - e:depends("rpc_secure", "true") - e.datatype = "file" - - e = t:taboption("rpc", Value, "rpc_private_key", translate("RPC private key"), - translate("Use the private key in FILE for RPC server. The private key must be" - .. " decrypted and in PEM format.")) - e:depends("rpc_secure", "true") - e.datatype = "file" +e=t:taboption("basic",Value,"config_dir",translate("Config file directory"), +translate("The directory to store the config file, session file and DHT file.")) +e.placeholder="/var/etc/aria2" +e=t:taboption("basic",Flag,"enable_Pro",translate("Enable Aria2 Pro"),translate("When enabled, the original system configuration directory will be merged.")) +e.rmempty=false +e=t:taboption("basic",Value,"Pro",translate("Aria2 Pro file"), +translate("Use the configuration scheme of p3terx to realize the enhancement and expansion of aria2 function.")) +e:depends("enable_Pro","1") +e.default="/usr/share/aria2" +e=t:taboption("basic",Flag,"enable_logging",translate("Enable logging")) +e.rmempty=false +e=t:taboption("basic",Value,"log",translate("Log file"), +translate("The file name of the log file.")) +e:depends("enable_logging","1") +e.placeholder="/var/log/aria2.log" +e=t:taboption("basic",ListValue,"log_level",translate("Log level")) +e:depends("enable_logging","1") +e:value("debug",translate("Debug")) +e:value("info",translate("Info")) +e:value("notice",translate("Notice")) +e:value("warn",translate("Warn")) +e:value("error",translate("Error")) +e.default="warn" +e=t:taboption("basic",Value,"max_concurrent_downloads",translate("Max concurrent downloads")) +e.placeholder="5" +t:tab("rpc",translate("RPC Options")) +e=t:taboption("rpc",Flag,"pause",translate("Pause"),translate("Pause download after added.")) +e.enabled="true" +e.disabled="false" +e.default="false" +e=t:taboption("rpc",Flag,"pause_metadata",translate("Pause metadata"), +translate("Pause downloads created as a result of metadata download.")) +e.enabled="true" +e.disabled="false" +e.default="false" +e=t:taboption("rpc",Value,"rpc_listen_port",translate("RPC port"),translate("The webui port defaults to 6800.")) +e.datatype="range(1024,65535)" +e.placeholder="6800" +e=t:taboption("rpc",ListValue,"rpc_auth_method",translate("RPC authentication method")) +e:value("none",translate("No Authentication")) +e:value("user_pass",translate("Username & Password")) +e:value("token",translate("Token")) +e=t:taboption("rpc",Value,"rpc_user",translate("RPC username")) +e:depends("rpc_auth_method","user_pass") +e=t:taboption("rpc",Value,"rpc_passwd",translate("RPC password")) +e:depends("rpc_auth_method","user_pass") +e.password=true +e=t:taboption("rpc",Value,"rpc_secret",translate("RPC token")) +e:depends("rpc_auth_method","token") +e.template="aria2/value_with_btn" +e.btntext=translate("generate randomly") +e.btnclick="randomToken();" +if a.https then +e=t:taboption("rpc",Flag,"rpc_secure",translate("RPC secure"), +translate("RPC transport will be encrypted by SSL/TLS. The RPC clients must use https" +.." scheme to access the server. For WebSocket client, use wss scheme.")) +e.enabled="true" +e.disabled="false" +e.rmempty=false +e=t:taboption("rpc",Value,"rpc_certificate",translate("RPC certificate"), +translate("Use the certificate in FILE for RPC server. The certificate must be either" +.." in PKCS12 (.p12, .pfx) or in PEM format.
PKCS12 files must contain the" +.." certificate, a key and optionally a chain of additional certificates. Only PKCS12" +.." files with a blank import password can be opened!
When using PEM, you have to" +.." specify the \"RPC private key\" as well.")) +e:depends("rpc_secure","true") +e.datatype="file" +e=t:taboption("rpc",Value,"rpc_private_key",translate("RPC private key"), +translate("Use the private key in FILE for RPC server. The private key must be" +.." decrypted and in PEM format.")) +e:depends("rpc_secure","true") +e.datatype="file" end - -e = t:taboption("rpc", Flag, "_use_ws", translate("Use WebSocket")) -e = t:taboption("rpc", Value, "_rpc_url", translate("Json-RPC URL")) -e.template = "aria2/value_with_btn" -e.onmouseover = "this.focus();this.select();" -e.btntext = translate("Show URL") -e.btnclick = "showRPCURL();" -t:tab("http", translate("HTTP/FTP/SFTP Options")) - -e = t:taboption("http", Flag, "enable_proxy", translate("Enable proxy")) -e.rmempty = false - -e = t:taboption("http", Value, "all_proxy", translate("All proxy"), - translate("Use a proxy server for all protocols.")) -e:depends("enable_proxy", "1") -e.placeholder = "[http://][USER:PASSWORD@]HOST[:PORT]" - -e = t:taboption("http", Value, "all_proxy_user", - translate("Proxy user")) -e:depends("enable_proxy", "1") - -e = t:taboption("http", Value, "all_proxy_passwd", - translate("Proxy password")) -e:depends("enable_proxy", "1") -e.password = true - -if aria2cInfo.https then - e = t:taboption("http", Flag, "check_certificate", translate("Check certificate"), - translate("Verify the peer using certificates specified in \"CA certificate\" option.")) - e.enabled = "true" - e.disabled = "false" - e.default = "true" - e.rmempty = false - - e = t:taboption("http", Value, "ca_certificate", translate("CA certificate"), - translate("Use the certificate authorities in FILE to verify the peers. The certificate" - .. " file must be in PEM format and can contain multiple CA certificates.")) - e:depends("check_certificate", "true") - e.datatype = "file" - - e = t:taboption("http", Value, "certificate", translate("Certificate"), - translate("Use the client certificate in FILE. The certificate must be either in PKCS12" - .. " (.p12, .pfx) or in PEM format.
PKCS12 files must contain the certificate, a" - .. " key and optionally a chain of additional certificates. Only PKCS12 files with a" - .. " blank import password can be opened!
When using PEM, you have to specify the" - .. " \"Private key\" as well.")) - e.datatype = "file" - - e = t:taboption("http", Value, "private_key", translate("Private key"), - translate("Use the private key in FILE. The private key must be decrypted and in PEM" - .. " format. The behavior when encrypted one is given is undefined.")) - e.datatype = "file" +e=t:taboption("rpc",Flag,"_use_ws",translate("Use WebSocket")) +e=t:taboption("rpc",Value,"_rpc_url",translate("Json-RPC URL")) +e.template="aria2/value_with_btn" +e.onmouseover="this.focus();this.select();" +e.btntext=translate("Show URL") +e.btnclick="showRPCURL();" +t:tab("http",translate("HTTP/FTP/SFTP Options")) +e=t:taboption("http",Flag,"enable_proxy",translate("Enable proxy")) +e.rmempty=false +e=t:taboption("http",Value,"all_proxy",translate("All proxy"), +translate("Use a proxy server for all protocols.")) +e:depends("enable_proxy","1") +e.placeholder="[http://][USER:PASSWORD@]HOST[:PORT]" +e=t:taboption("http",Value,"all_proxy_user",translate("Proxy user")) +e:depends("enable_proxy","1") +e=t:taboption("http",Value,"all_proxy_passwd",translate("Proxy password")) +e:depends("enable_proxy","1") +e.password=true +if a.https then +e=t:taboption("http",Flag,"check_certificate",translate("Check certificate"), +translate("Verify the peer using certificates specified in \"CA certificate\" option.")) +e.enabled="true" +e.disabled="false" +e.default="true" +e.rmempty=false +e=t:taboption("http",Value,"ca_certificate",translate("CA certificate"), +translate("Use the certificate authorities in FILE to verify the peers. The certificate" +.." file must be in PEM format and can contain multiple CA certificates.")) +e:depends("check_certificate","true") +e.datatype="file" +e=t:taboption("http",Value,"certificate",translate("Certificate"), +translate("Use the client certificate in FILE. The certificate must be either in PKCS12" +.." (.p12, .pfx) or in PEM format.
PKCS12 files must contain the certificate, a" +.." key and optionally a chain of additional certificates. Only PKCS12 files with a" +.." blank import password can be opened!
When using PEM, you have to specify the" +.." \"Private key\" as well.")) +e.datatype="file" +e=t:taboption("http",Value,"private_key",translate("Private key"), +translate("Use the private key in FILE. The private key must be decrypted and in PEM" +.." format. The behavior when encrypted one is given is undefined.")) +e.datatype="file" end - -if aria2cInfo.gzip then - e = t:taboption("http", Flag, "http_accept_gzip", translate("HTTP accept gzip"), - translate("Send Accept: deflate, gzip request header and inflate response" - .. " if remote server responds with Content-Encoding: gzip or" - .. " Content-Encoding: deflate.")) - e.enabled = "true" - e.disabled = "false" - e.default = "false" +if a.gzip then +e=t:taboption("http",Flag,"http_accept_gzip",translate("HTTP accept gzip"), +translate("Send Accept: deflate, gzip request header and inflate response" +.." if remote server responds with Content-Encoding: gzip or" +.." Content-Encoding: deflate.")) +e.enabled="true" +e.disabled="false" +e.default="false" end - -e = t:taboption("http", Flag, "http_no_cache", translate("HTTP no cache"), - translate("Send Cache-Control: no-cache and Pragma: no-cache" - .. " header to avoid cached content. If disabled, these headers are not sent and you" - .. " can add Cache-Control header with a directive you like using \"Header\" option.")) -e.enabled = "true" -e.disabled = "false" -e.default = "false" - -e = t:taboption("http", DynamicList, "header", translate("Header"), - translate("Append HEADERs to HTTP request header.")) - -e = t:taboption("http", Value, "connect_timeout", translate("Connect timeout"), - translate("Set the connect timeout in seconds to establish connection to HTTP/FTP/proxy server." .. - " After the connection is established, this option makes no effect and \"Timeout\" option is used instead.")) -e.datatype = "uinteger" -e.placeholder = "60" - -e = t:taboption("http", Value, "timeout", translate("Timeout")) -e.datatype = "uinteger" -e.placeholder = "60" - -e = t:taboption("http", Value, "lowest_speed_limit", translate("Lowest speed limit"), - translate("Close connection if download speed is lower than or equal to this value(bytes per sec). " .. - "0 means has no lowest speed limit."), - translate("You can append K or M.") -) -e.placeholder = "0" - -e = t:taboption("http", Value, "max_connection_per_server", translate("Max connection per server"), - translate("The maximum number of connections to one server for each download.")) -e.datatype = "uinteger" -e.placeholder = "1" - -e = t:taboption("http", Value, "split", translate("Max number of split"), - translate("Download a file using N connections.")) -e.datatype = "uinteger" -e.placeholder = "5" - -e = t:taboption("http", Value, "min_split_size", translate("Min split size"), - translate("Don't split less than 2*SIZE byte range. Possible values: 1M-1024M.")) -e.placeholder = "20M" - -e = t:taboption("http", Value, "max_tries", translate("Max tries")) -e.datatype = "uinteger" -e.placeholder = "5" - -e = t:taboption("http", Value, "retry_wait", translate("Retry wait"), - translate("Set the seconds to wait between retries.")) -e.datatype = "uinteger" -e.placeholder = "0" - -e = t:taboption("http", Value, "user_agent", translate("User agent"), - translate("Set user agent for HTTP(S) downloads.")) -e.placeholder = "aria2/%s" % { aria2cInfo.version and aria2cInfo.version or "$VERSION" } - -if aria2cInfo.bt then - t:tab("bt", translate("BitTorrent Options")) - e = t:taboption("bt", Flag, "enable_dht", - translatef("IPv4 DHT enabled", translate("Distributed Hash Table")), - translate("Enable IPv4 DHT functionality. It also enables UDP tracker support."), - translate("This option will be ignored if a private flag is set in a torrent.") - ) - e.enabled = "true" - e.disabled = "false" - e.default = "true" - e.rmempty = false - - e = t:taboption("bt", Flag, "enable_dht6", - translatef("IPv6 DHT enabled", translate("Distributed Hash Table")), - translate("Enable IPv6 DHT functionality."), - translate("This option will be ignored if a private flag is set in a torrent.") - ) - e.enabled = "true" - e.disabled = "false" - - e = t:taboption("bt", Flag, "bt_enable_lpd", - translatef("LPD enabled", translate("Local Peer Discovery")), - translate("Enable Local Peer Discovery."), - translate("This option will be ignored if a private flag is set in a torrent.") - ) - e.enabled = "true" - e.disabled = "false" - e.default = "false" - - e = t:taboption("bt", Flag, "enable_peer_exchange", translate("Enable peer exchange"), - translate("Enable Peer Exchange extension."), - translate("This option will be ignored if a private flag is set in a torrent.") - ) - e.enabled = "true" - e.disabled = "false" - e.default = "true" - e.rmempty = false - - e = t:taboption("bt", Flag, "bt_save_metadata", translate("Sava metadata"), - translate("Save meta data as \".torrent\" file. This option has effect only when BitTorrent" - .. " Magnet URI is used. The file name is hex encoded info hash with suffix \".torrent\".")) - e.enabled = "true" - e.disabled = "false" - e.default = "false" - - e = t:taboption("bt", Flag, "bt_remove_unselected_file", translate("Remove unselected file"), - translate("Removes the unselected files when download is completed in BitTorrent. Please" - .. " use this option with care because it will actually remove files from your disk.")) - e.enabled = "true" - e.disabled = "false" - e.default = "false" - - e = t:taboption("bt", Flag, "bt_seed_unverified", translate("Seed unverified"), - translate("Seed previously downloaded files without verifying piece hashes.")) - e.enabled = "true" - e.disabled = "false" - e.default = "false" - - e = t:taboption("bt", Value, "listen_port", translate("BitTorrent listen port"), - translate("Set TCP port number for BitTorrent downloads. Accept format: \"6881,6885\", " - .. "\"6881-6999\" and \"6881-6889,6999\". Make sure that the specified ports are " - .. "open for incoming TCP traffic.")) - e.placeholder = "6881-6999" - - e = t:taboption("bt", Value, "dht_listen_port", translate("DHT Listen port"), - translate("Set UDP listening port used by DHT(IPv4, IPv6) and UDP tracker. Make sure that the " - .. "specified ports are open for incoming UDP traffic.")) - e:depends("enable_dht", "true") - e:depends("enable_dht6", "true") - e.placeholder = "6881-6999" - - e = t:taboption("bt", ListValue, "follow_torrent", translate("Follow torrent")) - e:value("true", translate("True")) - e:value("false", translate("False")) - e:value("mem", translate("Keep in memory")) - - e = t:taboption("bt", Value, "max_overall_upload_limit", translate("Max overall upload limit"), - translate("Set max overall upload speed in bytes/sec. 0 means unrestricted."), - translate("You can append K or M.") - ) - e.placeholder = "0" - - e = t:taboption("bt", Value, "max_upload_limit", translate("Max upload limit"), - translate("Set max upload speed per each torrent in bytes/sec. 0 means unrestricted."), - translate("You can append K or M.") - ) - e.placeholder = "0" - e = t:taboption("bt", Value, "bt_max_open_files", translate("Max open files"), - translate("Specify maximum number of files to open in multi-file BitTorrent download globally.")) - e.datatype = "uinteger" - e.placeholder = "100" - - e = t:taboption("bt", Value, "bt_max_peers", translate("Max peers"), - translate("Specify the maximum number of peers per torrent, 0 means unlimited.")) - e.datatype = "uinteger" - e.placeholder = "55" - - e = t:taboption("bt", Value, "bt_request_peer_speed_limit", translate("Request peer speed limit"), - translate("If the whole download speed of every torrent is lower than SPEED, aria2" - .. " temporarily increases the number of peers to try for more download speed." - .. " Configuring this option with your preferred download speed can increase your" - .. " download speed in some cases."), - translate("You can append K or M.") - ) - e.placeholder = "50K" - - e = t:taboption("bt", Value, "bt_stop_timeout", translate("Stop timeout"), - translate("Stop BitTorrent download if download speed is 0 in consecutive N seconds. If 0 is" - .. " given, this feature is disabled.")) - e.datatype = "uinteger" - e.placeholder = "0" - - e = t:taboption("bt", Value, "peer_agent", translate("Peer-agent")) - e.placeholder = "Deluge 1.3.15" - - e = t:taboption("bt", Value, "peer_id_prefix", translate("Prefix of peer ID"), - translate("Specify the prefix of peer ID. The peer ID in BitTorrent is 20 byte length." - .. " If more than 20 bytes are specified, only first 20 bytes are used. If less than 20" - .. " bytes are specified, random byte data are added to make its length 20 bytes.")) - e.placeholder = "DE13F0-" - - e = t:taboption("bt", Value, "seed_ratio", translate("Seed ratio"), - translate("Specify share ratio. Seed completed torrents until share ratio reaches RATIO." - .. " You are strongly encouraged to specify equals or more than 1.0 here. Specify 0.0 if" - .. " you intend to do seeding regardless of share ratio.")) - e.datatype = "ufloat" - e.placeholder = "1.0" - - e = t:taboption("bt", Value, "seed_time", translate("Seed time"), - translate("Specify seeding time in minutes. If \"Seed ratio\" option is" - .. " specified along with this option, seeding ends when at least one of the conditions" - .. " is satisfied. Specifying 0 disables seeding after download completed.")) - e.datatype = "ufloat" - - e = t:taboption("bt", DynamicList, "bt_tracker", translate("Additional BT tracker"), - translate("List of additional BitTorrent tracker's announce URI.")) - e.placeholder = "http://tracker.example.com/announce" +e=t:taboption("http",Flag,"http_no_cache",translate("HTTP no cache"), +translate("Send Cache-Control: no-cache and Pragma: no-cache" +.." header to avoid cached content. If disabled, these headers are not sent and you" +.." can add Cache-Control header with a directive you like using \"Header\" option.")) +e.enabled="true" +e.disabled="false" +e.default="false" +e=t:taboption("http",DynamicList,"header",translate("Header"), +translate("Append HEADERs to HTTP request header.")) +e=t:taboption("http",Value,"connect_timeout",translate("Connect timeout"), +translate("Set the connect timeout in seconds to establish connection to HTTP/FTP/proxy server.".. +" After the connection is established, this option makes no effect and \"Timeout\" option is used instead.")) +e.datatype="uinteger" +e.placeholder="60" +e=t:taboption("http",Value,"timeout",translate("Timeout")) +e.datatype="uinteger" +e.placeholder="60" +e=t:taboption("http",Value,"lowest_speed_limit",translate("Lowest speed limit"), +"%s %s"%{ +translate("Close connection if download speed is lower than or equal to this value(bytes per sec). ".. +"0 means has no lowest speed limit."), +translate("You can append K or M.") +}) +e.placeholder="0" +e=t:taboption("http",Value,"max_connection_per_server",translate("Max connection per server"), +translate("The maximum number of connections to one server for each download.")) +e.datatype="uinteger" +e.placeholder="1" +e=t:taboption("http",Value,"split",translate("Max number of split"), +translate("Download a file using N connections.")) +e.datatype="uinteger" +e.placeholder="5" +e=t:taboption("http",Value,"min_split_size",translate("Min split size"), +translate("Don't split less than 2*SIZE byte range. Possible values: 1M-1024M.")) +e.placeholder="20M" +e=t:taboption("http",Value,"max_tries",translate("Max tries")) +e.datatype="uinteger" +e.placeholder="5" +e=t:taboption("http",Value,"retry_wait",translate("Retry wait"), +translate("Set the seconds to wait between retries.")) +e.datatype="uinteger" +e.placeholder="0" +e=t:taboption("http",Value,"user_agent",translate("User agent"), +translate("Set user agent for HTTP(S) downloads.")) +e.placeholder="aria2/%s"%{a.version and a.version or"$VERSION"} +if a.bt then +t:tab("bt",translate("BitTorrent Options")) +e=t:taboption("bt",Flag,"enable_dht",translate("IPv4 DHT enabled"), +"%s %s"%{ +translate("Enable IPv4 DHT functionality. It also enables UDP tracker support."), +translate("This option will be ignored if a private flag is set in a torrent.") +}) +e.enabled="true" +e.disabled="false" +e.default="true" +e.rmempty=false +e=t:taboption("bt",Flag,"enable_dht6",translate("IPv6 DHT enabled"), +"%s %s"%{ +translate("Enable IPv6 DHT functionality."), +translate("This option will be ignored if a private flag is set in a torrent.") +}) +e.enabled="true" +e.disabled="false" +e=t:taboption("bt",Flag,"bt_enable_lpd",translate("LPD enabled"), +"%s %s"%{ +translate("Enable Local Peer Discovery."), +translate("This option will be ignored if a private flag is set in a torrent.") +}) +e.enabled="true" +e.disabled="false" +e.default="false" +e=t:taboption("bt",Flag,"enable_peer_exchange",translate("Enable peer exchange"), +"%s %s"%{ +translate("Enable Peer Exchange extension."), +translate("This option will be ignored if a private flag is set in a torrent.") +}) +e.enabled="true" +e.disabled="false" +e.default="true" +e.rmempty=false +e=t:taboption("bt",Flag,"bt_save_metadata",translate("Sava metadata"), +translate("Save meta data as \".torrent\" file. This option has effect only when BitTorrent" +.." Magnet URI is used. The file name is hex encoded info hash with suffix \".torrent\".")) +e.enabled="true" +e.disabled="false" +e.default="false" +e=t:taboption("bt",Flag,"bt_remove_unselected_file",translate("Remove unselected file"), +translate("Removes the unselected files when download is completed in BitTorrent. Please" +.." use this option with care because it will actually remove files from your disk.")) +e.enabled="true" +e.disabled="false" +e.default="false" +e=t:taboption("bt",Flag,"bt_seed_unverified",translate("Seed unverified"), +translate("Seed previously downloaded files without verifying piece hashes.")) +e.enabled="true" +e.disabled="false" +e.default="false" +e=t:taboption("bt",Value,"listen_port",translate("BitTorrent listen port"), +translate("Set TCP port number for BitTorrent downloads. Accept format: \"6881,6885\"," +.." \"6881-6999\" and \"6881-6889,6999\". Make sure that the specified ports are open" +.." for incoming TCP traffic.")) +e.placeholder="6881-6999" +e=t:taboption("bt",Value,"dht_listen_port",translate("DHT Listen port"), +translate("Set UDP listening port used by DHT(IPv4, IPv6) and UDP tracker. Make sure that the " +.."specified ports are open for incoming UDP traffic.")) +e:depends("enable_dht","true") +e:depends("enable_dht6","true") +e.placeholder="6881-6999" +e=t:taboption("bt",ListValue,"follow_torrent",translate("Follow torrent")) +e:value("true",translate("True")) +e:value("false",translate("False")) +e:value("mem",translate("Keep in memory")) +e=t:taboption("bt",Value,"max_overall_upload_limit",translate("Max overall upload limit"), +"%s %s"%{ +translate("Set max overall upload speed in bytes/sec. 0 means unrestricted."), +translate("You can append K or M.") +}) +e.placeholder="0" +e=t:taboption("bt",Value,"max_upload_limit",translate("Max upload limit"), +"%s %s"%{ +translate("Set max upload speed per each torrent in bytes/sec. 0 means unrestricted."), +translate("You can append K or M.") +}) +e.placeholder="0" +e=t:taboption("bt",Value,"bt_max_open_files",translate("Max open files"), +translate("Specify maximum number of files to open in multi-file BitTorrent download globally.")) +e.datatype="uinteger" +e.placeholder="100" +e=t:taboption("bt",Value,"bt_max_peers",translate("Max peers"), +translate("Specify the maximum number of peers per torrent, 0 means unlimited.")) +e.datatype="uinteger" +e.placeholder="55" +e=t:taboption("bt",Value,"bt_request_peer_speed_limit",translate("Request peer speed limit"), +"%s %s"%{ +translate("If the whole download speed of every torrent is lower than SPEED, aria2" +.." temporarily increases the number of peers to try for more download speed." +.." Configuring this option with your preferred download speed can increase your" +.." download speed in some cases."), +translate("You can append K or M.") +}) +e.placeholder="50K" +e=t:taboption("bt",Value,"bt_stop_timeout",translate("Stop timeout"), +translate("Stop BitTorrent download if download speed is 0 in consecutive N seconds. If 0 is" +.." given, this feature is disabled.")) +e.datatype="uinteger" +e.placeholder="0" +e=t:taboption("bt",Value,"peer_id_prefix",translate("Prefix of peer ID"), +translate("Specify the prefix of peer ID. The peer ID in BitTorrent is 20 byte length." +.." If more than 20 bytes are specified, only first 20 bytes are used. If less than 20" +.." bytes are specified, random byte data are added to make its length 20 bytes.")) +e.placeholder="A2-%s-"%{ +a.version and string.gsub(a.version,"%.","-")or"$MAJOR-$MINOR-$PATCH" +} +e=t:taboption("bt",Value,"seed_ratio",translate("Seed ratio"), +translate("Specify share ratio. Seed completed torrents until share ratio reaches RATIO." +.." You are strongly encouraged to specify equals or more than 1.0 here. Specify 0.0 if" +.." you intend to do seeding regardless of share ratio.")) +e.datatype="ufloat" +e.placeholder="1.0" +e=t:taboption("bt",Value,"seed_time",translate("Seed time"), +translate("Specify seeding time in minutes. If \"Seed ratio\" option is" +.." specified along with this option, seeding ends when at least one of the conditions" +.." is satisfied. Specifying 0 disables seeding after download completed.")) +e.datatype="ufloat" +e=t:taboption("bt",DynamicList,"bt_tracker",translate("Additional BT tracker"), +translate("List of additional BitTorrent tracker's announce URI.")) +e.placeholder="http://tracker.example.com/announce" end - -t:tab("advance", translate("Advanced Options")) -e = t:taboption("advance", Flag, "disable_ipv6", translate("IPv6 disabled"), - translate("Disable IPv6. This is useful if you have to use broken DNS and want to avoid terribly" - .. " slow AAAA record lookup.")) -e.enabled = "true" -e.disabled = "false" -e.default = "false" - -e = t:taboption("advance", Value, "auto_save_interval", translate("Auto save interval"), - translate("Save a control file(*.aria2) every N seconds. If 0 is given, a control file is not" - .. " saved during download.")) -e.datatype = "range(0, 600)" -e.placeholder = "60" - -e = t:taboption("advance", Value, "save_session_interval", translate("Save session interval"), - translate("Save error/unfinished downloads to session file every N seconds. If 0 is given, file" - .. " will be saved only when aria2 exits.")) -e.datatype = "uinteger" -e.placeholder = "0" - -e = t:taboption("advance", Value, "disk_cache", translate("Disk cache"), - translate("Enable disk cache (in bytes), set 0 to disabled."), - translate("You can append K or M.") -) -e.placeholder = "64M" - -e = t:taboption("advance", ListValue, "file_allocation", translate("File allocation"), - translate("Specify file allocation method. If you are using newer file systems such as ext4" - .. " (with extents support), btrfs, xfs or NTFS(MinGW build only), \"falloc\" is your best choice." - .. " It allocates large(few GiB) files almost instantly, but it may not be available if your system" - .. " doesn't have posix_fallocate(3) function. Don't use \"falloc\" with legacy file systems such as" - .. " ext3 and FAT32 because it takes almost same time as \"prealloc\" and it blocks aria2 entirely" - .. " until allocation finishes.")) -e:value("none", translate("None")) -e:value("prealloc", translate("prealloc")) -e:value("trunc", translate("trunc")) -e:value("falloc", translate("falloc")) -e.default = "none" - -e = t:taboption("advance", Flag, "force_save", translate("Force save"), - translate("Save download to session file even if the download is completed or removed." - .. " This option also saves control file in that situations. This may be useful to save" - .. " BitTorrent seeding which is recognized as completed state.")) -e.enabled = "true" -e.disabled = "false" -e.default = "false" - -e = t:taboption("advance", Value, "max_overall_download_limit", translate("Max overall download limit"), - translate("Set max overall download speed in bytes/sec. 0 means unrestricted."), - translate("You can append K or M.") -) -e.placeholder = "0" - -e = t:taboption("advance", Value, "max_download_limit", translate("Max download limit"), - translate("Set max download speed per each download in bytes/sec. 0 means unrestricted."), - translate("You can append K or M.") -) -e.placeholder = "0" - -t = o:section(NamedSection, "main", "aria2", translate("Extra Settings"), - translate("Settings in this section will be added to config file.")) -t.addremove = false -t.anonymous = true - -e = t:option(DynamicList, "extra_settings", translate("Settings list"), - translate("List of extra settings. Format: option=value, eg. netrc-path=/tmp/.netrc.")) -e.placeholder = "option = value" - +t:tab("advance",translate("Advanced Options")) +e=t:taboption("advance",Flag,"disable_ipv6",translate("IPv6 disabled"), +translate("Disable IPv6. This is useful if you have to use broken DNS and want to avoid terribly" +.." slow AAAA record lookup.")) +e.enabled="true" +e.disabled="false" +e.default="false" +e=t:taboption("advance",Value,"auto_save_interval",translate("Auto save interval"), +translate("Save a control file(*.aria2) every N seconds. If 0 is given, a control file is not" +.." saved during download.")) +e.datatype="range(0, 600)" +e.placeholder="60" +e=t:taboption("advance",Value,"save_session_interval",translate("Save session interval"), +translate("Save error/unfinished downloads to session file every N seconds. If 0 is given, file" +.." will be saved only when aria2 exits.")) +e.datatype="uinteger" +e.placeholder="0" +e=t:taboption("advance",Value,"disk_cache",translate("Disk cache"), +"%s %s"%{ +translate("Enable disk cache (in bytes), set 0 to disabled."), +translate("You can append K or M.") +}) +e.placeholder="16M" +e=t:taboption("advance",ListValue,"file_allocation",translate("File allocation"), +translate("Specify file allocation method. If you are using newer file systems such as ext4" +.." (with extents support), btrfs, xfs or NTFS(MinGW build only), \"falloc\" is your best choice." +.." It allocates large(few GiB) files almost instantly, but it may not be available if your system" +.." doesn't have posix_fallocate(3) function. Don't use \"falloc\" with legacy file systems such as" +.." ext3 and FAT32 because it takes almost same time as \"prealloc\" and it blocks aria2 entirely" +.." until allocation finishes.")) +e:value("none",translate("None")) +e:value("prealloc",translate("prealloc")) +e:value("trunc",translate("trunc")) +e:value("falloc",translate("falloc")) +e.default="falloc" +e=t:taboption("advance",Flag,"force_save",translate("Force save"), +translate("Save download to session file even if the download is completed or removed." +.." This option also saves control file in that situations. This may be useful to save" +.." BitTorrent seeding which is recognized as completed state.")) +e.enabled="true" +e.disabled="false" +e.default="false" +e=t:taboption("advance",Value,"max_overall_download_limit",translate("Max overall download limit"), +"%s %s"%{ +translate("Set max overall download speed in bytes/sec. 0 means unrestricted."), +translate("You can append K or M.") +}) +e.placeholder="0" +e=t:taboption("advance",Value,"max_download_limit",translate("Max download limit"), +"%s %s"%{ +translate("Set max download speed per each download in bytes/sec. 0 means unrestricted."), +translate("You can append K or M.") +}) +e.placeholder="0" +t=o:section(NamedSection,"main","aria2",translate("Extra Settings"), +translate("Settings in this section will be added to config file.")) +t.addremove=false +t.anonymous=true +e=t:option(DynamicList,"extra_settings",translate("Settings list"), +translate("List of extra settings. Format: option=value, eg. netrc-path=/tmp/.netrc.")) +e.placeholder="option=value" return o diff --git a/luci-app-aria2/luasrc/model/cbi/aria2/files.lua b/luci-app-aria2/luasrc/model/cbi/aria2/files.lua index e098ed9dd..05d065608 100644 --- a/luci-app-aria2/luasrc/model/cbi/aria2/files.lua +++ b/luci-app-aria2/luasrc/model/cbi/aria2/files.lua @@ -1,35 +1,41 @@ -local fs = require "nixio.fs" -local util = require "luci.util" -local uci = require "luci.model.uci".cursor() - -local conf = uci:get("aria2", "main", "pro") or uci:get("aria2", "main", "config_dir") -local files = { - a = conf .. "/aria2.main.conf", - b = conf .. "/aria2.session", - c = "/etc/config/aria2" -} - -local t = SimpleForm("aria2", "Aria2 - %s" % translate("Files"), - translate("Here shows the files used by aria2.")) -for i, conffiles in pairs(files) do - if fs.access(conffiles) then - local s = t:section(SimpleSection, nil, - translatef("This is the content of the configuration file under %s:", conffiles)) - local o = s:option(TextValue, 'files' .. i) - local fileContent = fs.readfile(conffiles) - o.rows = util.trim(fileContent) ~= "" and 20 or 2 - o.readonly = i ~= 'a' - - o.cfgvalue = function(self, section) - return util.trim(fileContent) ~= "" and fileContent or translate("Empty file.") - end - - o.write = function(self, section, value) - if value and value ~= fileContent then - fs.writefile(conffiles, value:gsub("\r\n?", "\n")) - end - end - end +local t,a,e +local n=require"nixio.fs" +local o=require"luci.util" +local i=require"luci.model.uci".cursor() +if i:get("aria2","main","Pro")then +config_dir=i:get("aria2","main","Pro")or"" +else +config_dir=i:get("aria2","main","config_dir")or"" +end +local s="%s/aria2.conf.main"%config_dir +local h="%s/aria2.session"%config_dir +local i="/etc/config/aria2"%config_dir +t=SimpleForm("aria2","%s - %s"%{translate("Aria2"),translate("Files")}, +translate("Here shows the files used by aria2.")) +t.reset=false +t.submit=false +a=t:section(SimpleSection,nil,translatef("在%s下的config文件内容",i)) +e=a:option(TextValue,"_session") +e.rows=20 +e.readonly=true +e.cfgvalue=function() +local e=n.readfile(i)or translate("File does not exist.") +return o.trim(e)~=""and e or translate("Empty file.") +end +a=t:section(SimpleSection,nil,translatef("在%s下的config文件内容",s)) +e=a:option(TextValue,"_config") +e.rows=20 +e.readonly=true +e.cfgvalue=function() +local e=n.readfile(s)or translate("File does not exist.") +return o.trim(e)~=""and e or translate("Empty file.") +end +a=t:section(SimpleSection,nil,translatef("在%s下的session文件内容",h)) +e=a:option(TextValue,"_session") +e.rows=20 +e.readonly=true +e.cfgvalue=function() +local e=n.readfile(h)or translate("File does not exist.") +return o.trim(e)~=""and e or translate("Empty file.") end - return t diff --git a/luci-app-aria2/luasrc/model/cbi/aria2/log.lua b/luci-app-aria2/luasrc/model/cbi/aria2/log.lua deleted file mode 100644 index f2b3327bf..000000000 --- a/luci-app-aria2/luasrc/model/cbi/aria2/log.lua +++ /dev/null @@ -1,6 +0,0 @@ -local f = SimpleForm("aria2") -f.reset = false -f.submit = false -f:append(Template("aria2/log_template")) - -return f diff --git a/luci-app-aria2/luasrc/view/aria2/aria2_log.htm b/luci-app-aria2/luasrc/view/aria2/aria2_log.htm deleted file mode 100644 index f2f25c109..000000000 --- a/luci-app-aria2/luasrc/view/aria2/aria2_log.htm +++ /dev/null @@ -1,29 +0,0 @@ - -
- - -
diff --git a/luci-app-aria2/luasrc/view/aria2/log_template.htm b/luci-app-aria2/luasrc/view/aria2/log_template.htm index 36523ca76..65ad9f64e 100644 --- a/luci-app-aria2/luasrc/view/aria2/log_template.htm +++ b/luci-app-aria2/luasrc/view/aria2/log_template.htm @@ -1,75 +1,71 @@ - + #log_text { + padding: 15px; + text-align: left; + } + #log_text pre { + word-break: break-all; + margin: 0; + font-size : 10pt; + font-family :Arial; + + + } + .description { + background-color: #93ccff; + font-size : 15pt; - +
-

<%:Aria2%> - <%:Log Data%>

-
-
- - <%:Refresh every 5 seconds.%> -
- - -
-
- <%:Loading%> - <%:Collecting data...%> -
+

<%:Aria2%> - <%:Log Data%>

+
+ +
+ <%:Loading%> + <%:Collecting data...%> +
+
<%:Refresh every 10 seconds.%>
+
+ +<%+footer%> diff --git a/luci-app-aria2/luasrc/view/aria2/settings_header.htm b/luci-app-aria2/luasrc/view/aria2/settings_header.htm index c10d91fe4..a567656ab 100644 --- a/luci-app-aria2/luasrc/view/aria2/settings_header.htm +++ b/luci-app-aria2/luasrc/view/aria2/settings_header.htm @@ -1,101 +1,118 @@ +<%# + Copyright 2017-2019 Xingwang Liao + Licensed to the public under the MIT License. +-%> + <% - local ipkg = require "luci.model.ipkg" - local has_ui = false + local ipkg = require "luci.model.ipkg" + local has_ui = false - local uilist = { - supported = { - ["yaaw"] = "YAAW", - ["ariang"] = "AriaNg", - ["webui-aria2"] = "WebUI-Aria2" - }, - installed = {} - } + local uilist = { + supported = { + ["ariang"] = "AriaNg", + ["webui-aria2"] = "WebUI-Aria2", + ["yaaw"] = "YAAW" + }, + installed = {} + } - for k in pairs(uilist.supported) do - if ipkg.installed(k) then - uilist.installed[#uilist.installed + 1] = k - has_ui = true - end - end - - local running = luci.sys.call("ps 2>/dev/null | grep aria2c 2>/dev/null | grep /usr/bin >/dev/null") == 0 + for k in pairs(uilist.supported) do + if ipkg.installed(k) then + uilist.installed[#uilist.installed + 1] = k + has_ui = true + end + end + + local ar_state = (luci.sys.call("ps 2>/dev/null | grep aria2c 2>/dev/null | grep /usr/bin >/dev/null") == 0) %>
-

- <%:Collecting data...%> -

- <% if has_ui and running then %> -

- <%:Installed web interface: %> - <%- for _, v in pairs(uilist.installed) do %> - - <%- end %> -

- <% end %> +

+ <%:Collecting data...%> +

+ <% if has_ui and ar_state then %> +

+ <%:Installed web interface: %> + <%- for _, v in pairs(uilist.installed) do %> + + <%- end %> +

+ <% end %>

+function openWebInterface(path) { + var host = window.location.host; + var protocol = window.location.protocol; + window.open(protocol + '//' + host + '/' + path); +}; +//]]> diff --git a/luci-app-aria2/luasrc/view/aria2/value_with_btn.htm b/luci-app-aria2/luasrc/view/aria2/value_with_btn.htm index 09ab82d08..487e107b6 100644 --- a/luci-app-aria2/luasrc/view/aria2/value_with_btn.htm +++ b/luci-app-aria2/luasrc/view/aria2/value_with_btn.htm @@ -1,17 +1,22 @@ +<%# + Copyright 2017-2019 Xingwang Liao + Licensed to the public under the MIT License. +-%> + <%+cbi/valueheader%> - /> - <%- if self.btntext then -%> -
><%=self.btntext%>
- <% end %> + /> + <%- if self.btntext then -%> +
><%=self.btntext%>
+ <% end %> <%+cbi/valuefooter%> diff --git a/luci-app-aria2/po/zh-cn/aria2.po b/luci-app-aria2/po/zh-cn/aria2.po index 2cb0d73e3..b93b49a2c 100644 --- a/luci-app-aria2/po/zh-cn/aria2.po +++ b/luci-app-aria2/po/zh-cn/aria2.po @@ -716,8 +716,8 @@ msgid "The directory to store the downloaded file. eg. /mnt/sda1" msgstr "用于放置下载文件的目录。例如:/mnt/sda1" #: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:81 -msgid "Log save path" -msgstr "日志保存路径。" +msgid "The file name of the log file." +msgstr "日志文件名。" #: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:249 msgid "The maximum number of connections to one server for each download." @@ -829,8 +829,8 @@ msgid "prealloc" msgstr "" #: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:456 -msgid "The directory where the log files are saved" -msgstr "日志文件的保存目录" +msgid "trunc" +msgstr "" msgid "AriaNg" msgstr "打开AriaNg的Web管理界面" @@ -841,10 +841,10 @@ msgstr "打开WebUI-Aria2的Web管理界面" msgid "YAAW" msgstr "打开YAAW的Web管理界面" -msgid "Enable Aria2 pro" +msgid "Enable Aria2 Pro" msgstr "启用扩展功能" -msgid "Aria2 pro file" +msgid "Aria2 Pro file" msgstr "扩展保存目录" msgid "Use the configuration scheme of p3terx to realize the enhancement and expansion of aria2 function." @@ -868,16 +868,4 @@ msgid "WebUI-Aria2" msgstr "打开WebUI-Aria2的Web管理界面" msgid "YAAW" -msgstr "打开YAAW的Web管理界面" - -msgid "Current version of aria2: %s" -msgstr "当前Aria2的版本: %s" - -msgid "Distributed Hash Table" -msgstr "分布式哈希表" - -msgid "Local Peer Discovery" -msgstr "本地对等发现" - -msgid "Enable peer exchange" -msgstr "启用对等交换" +msgstr "打开YAAW的Web管理界面" \ No newline at end of file diff --git a/luci-app-aria2/po/zh_Hans/aria2.po b/luci-app-aria2/po/zh_Hans/aria2.po deleted file mode 100644 index e632fdfc7..000000000 --- a/luci-app-aria2/po/zh_Hans/aria2.po +++ /dev/null @@ -1,854 +0,0 @@ -msgid "" -msgstr "" -"PO-Revision-Date: 2021-11-17 12:16+0000\n" -"Last-Translator: Eric \n" -"Language-Team: Chinese (Simplified) \n" -"Language: zh_Hans\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 4.9.1-dev\n" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:296 -msgid "LPD enabled" -msgstr "启用 LPD" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:414 -msgid "Additional BT tracker" -msgstr "附加的 BT Tracker" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:419 -msgid "Advanced Options" -msgstr "高级选项" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:169 -msgid "All proxy" -msgstr "全局代理" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:228 -msgid "Append HEADERs to HTTP request header." -msgstr "附加的 HTTP 请求头。" - -#: applications/luci-app-aria2/luasrc/controller/aria2.lua:17 -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:35 -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/files.lua:14 -#: applications/luci-app-aria2/luasrc/view/aria2/log_template.htm:45 -msgid "Aria2" -msgstr "Aria2" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:37 -msgid "" -"Aria2 is a lightweight multi-protocol & multi-source, cross platform " -"download utility." -msgstr "Aria2 是一个轻量、多线程,跨平台的下载工具。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:428 -msgid "Auto save interval" -msgstr "自动保存间隔" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:56 -msgid "Basic Options" -msgstr "基本选项" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:276 -msgid "BitTorrent Options" -msgstr "BT 选项" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:335 -msgid "BitTorrent listen port" -msgstr "BT监听端口" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:189 -msgid "CA certificate" -msgstr "CA 证书" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:195 -msgid "Certificate" -msgstr "证书" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:182 -msgid "Check certificate" -msgstr "检查证书" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:242 -msgid "" -"Close connection if download speed is lower than or equal to this value " -"(bytes per sec). 0 means has no lowest speed limit." -msgstr "" -"如果速度小于或等于这个速度(字节/秒),关闭下载下载连接。0 表示不限制下载速" -"度。" - -#: applications/luci-app-aria2/luasrc/view/aria2/log_template.htm:49 -#: applications/luci-app-aria2/luasrc/view/aria2/settings_header.htm:29 -msgid "Collecting data..." -msgstr "正在收集数据…" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:73 -msgid "Config file directory" -msgstr "配置文件目录" - -#: applications/luci-app-aria2/luasrc/controller/aria2.lua:22 -msgid "Configuration" -msgstr "配置" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:230 -msgid "Connect timeout" -msgstr "连接超时时间" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/files.lua:19 -msgid "Content of config file: %s" -msgstr "配置文件的内容:%s" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/files.lua:29 -msgid "Content of session file: %s" -msgstr "会话文件的内容:%s" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:341 -msgid "DHT Listen port" -msgstr "DHT 监听端口" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:87 -msgid "Debug" -msgstr "调试" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:422 -msgid "" -"Disable IPv6. This is useful if you have to use broken DNS and want to avoid " -"terribly slow AAAA record lookup." -msgstr "" -"禁用 IPv6。如果你的 DNS 有问题并希望避免 AAAA 查询过慢,可以启用此选项。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:440 -msgid "Disk cache" -msgstr "磁盘缓存" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:259 -msgid "Don't split less than 2*SIZE byte range. Possible values: 1M-1024M." -msgstr "当数据小于 2*SIZE 时不分割。可能的值:1M-1024M。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:254 -msgid "Download a file using N connections." -msgstr "使用 N 个线程下载文件。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:69 -msgid "Download directory" -msgstr "下载目录" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/files.lua:26 -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/files.lua:36 -msgid "Empty file." -msgstr "文件为空。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:280 -msgid "Enable IPv4 DHT functionality. It also enables UDP tracker support." -msgstr "启用 IPv4 DHT 功能。会同时启用 UDP Tracker 支持。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:290 -msgid "Enable IPv6 DHT functionality." -msgstr "启用 IPv6 DHT 功能。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:298 -msgid "Enable Local Peer Discovery." -msgstr "启用本地 Peer 查找。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:307 -msgid "Enable Peer Exchange extension." -msgstr "启用 Peer 交换扩展。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:442 -msgid "Enable disk cache (in bytes), set 0 to disabled." -msgstr "启用硬盘缓存(以字节为单位),0 表示禁用。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:77 -msgid "Enable logging" -msgstr "启用日志" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:305 -msgid "Enable peer exchange" -msgstr "启用对等交换" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:166 -msgid "Enable proxy" -msgstr "启用代理" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:58 -msgid "Enabled" -msgstr "已启用" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:91 -msgid "Error" -msgstr "错误" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:44 -msgid "Error: Can't find aria2c in PATH, please reinstall aria2." -msgstr "错误:未在 PATH 中找到 aria2c,请重新安装 Aria2。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:482 -msgid "Extra Settings" -msgstr "附加选项" - -#: applications/luci-app-aria2/luasrc/view/aria2/log_template.htm:39 -msgid "Failed to load log data." -msgstr "获取日志数据失败。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:350 -msgid "False" -msgstr "否" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:447 -msgid "File allocation" -msgstr "文件分配" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/files.lua:25 -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/files.lua:35 -msgid "File does not exist." -msgstr "文件不存在。" - -#: applications/luci-app-aria2/luasrc/controller/aria2.lua:25 -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/files.lua:14 -msgid "Files" -msgstr "文件" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:348 -msgid "Follow torrent" -msgstr "自动添加下载的种子" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:38 -msgid "For more information, please visit: %s" -msgstr "获取更多信息,请访问:%s" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:460 -msgid "Force save" -msgstr "强制保存" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:129 -msgid "Generate Randomly" -msgstr "随机生成" - -#: applications/luci-app-aria2/root/usr/share/rpcd/acl.d/luci-app-aria2.json:3 -msgid "Grant UCI access for luci-app-aria2" -msgstr "允许 luci-app-aria2 访问 UCI" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:210 -msgid "HTTP accept gzip" -msgstr "HTTP 接受 Gzip" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:219 -msgid "HTTP no cache" -msgstr "HTTP 无缓存" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:164 -msgid "HTTP/FTP/SFTP Options" -msgstr "HTTP/FTP/SFTP 选项" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:227 -msgid "Header" -msgstr "请求头" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/files.lua:15 -msgid "Here shows the files used by aria2." -msgstr "这里展示了 Aria2 使用的文件。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:278 -msgid "IPv4 DHT enabled" -msgstr "启用 IPv4 DHT" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:288 -msgid "IPv6 DHT enabled" -msgstr "启用 IPv6 DHT" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:421 -msgid "IPv6 disabled" -msgstr "禁用 IPv6" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:379 -msgid "" -"If the whole download speed of every torrent is lower than SPEED, aria2 " -"temporarily increases the number of peers to try for more download speed. " -"Configuring this option with your preferred download speed can increase your " -"download speed in some cases." -msgstr "" -"如果某个 BT 任务的下载速度小于配置的速度,Aria2 会临时提高对端的数量来尝试获" -"得更大的下载速度。在某些情况下,配置此选项能提高你的下载速度。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:88 -msgid "Info" -msgstr "信息" - -#: applications/luci-app-aria2/luasrc/view/aria2/settings_header.htm:33 -msgid "Installed web interface:" -msgstr "已安装的 WEB 界面:" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:158 -msgid "Json-RPC URL" -msgstr "Json-RPC 统一资源定位地址" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:351 -msgid "Keep in memory" -msgstr "保存在内存中" - -#: applications/luci-app-aria2/luasrc/view/aria2/log_template.htm:34 -msgid "Last 50 lines of log file:" -msgstr "日志文件的最新 50 行:" - -#: applications/luci-app-aria2/luasrc/view/aria2/log_template.htm:36 -msgid "Last 50 lines of syslog:" -msgstr "系统日志的最新 50 行:" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:62 -msgid "Leave blank to use default user." -msgstr "留空以使用默认用户。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:415 -msgid "List of additional BitTorrent tracker's announce URI." -msgstr "额外的 BT Tracker 通告链接。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:488 -msgid "" -"List of extra settings. Format: option=value, eg. netrc-path=/tmp/." -"netrc." -msgstr "" -"额外设置的列表。格式:选项=值,例如:netrc-path=/tmp/.netrc。" - -#: applications/luci-app-aria2/luasrc/view/aria2/log_template.htm:48 -msgid "Loading" -msgstr "加载中" - -#: applications/luci-app-aria2/luasrc/controller/aria2.lua:28 -msgid "Log" -msgstr "日志" - -#: applications/luci-app-aria2/luasrc/view/aria2/log_template.htm:45 -msgid "Log Data" -msgstr "日志数据" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:80 -msgid "Log file" -msgstr "日志文件" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:85 -msgid "Log level" -msgstr "日志记录等级" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:240 -msgid "Lowest speed limit" -msgstr "最低限速" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:94 -msgid "Max concurrent downloads" -msgstr "最大同时下载任务数" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:248 -msgid "Max connection per server" -msgstr "单服务器最大连接数" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:475 -msgid "Max download limit" -msgstr "最大下载限速" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:253 -msgid "Max number of split" -msgstr "单文件最大线程数" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:367 -msgid "Max open files" -msgstr "最大打开文件数" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:468 -msgid "Max overall download limit" -msgstr "最大全局下载限速" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:353 -msgid "Max overall upload limit" -msgstr "最大全局上传限速" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:372 -msgid "Max peers" -msgstr "最大 Peer 数量" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:262 -msgid "Max tries" -msgstr "最大重试次数" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:360 -msgid "Max upload limit" -msgstr "最大上传限速" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:258 -msgid "Min split size" -msgstr "最小文件分片大小" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:115 -msgid "No Authentication" -msgstr "无认证" - -#: applications/luci-app-aria2/luasrc/view/aria2/log_template.htm:35 -#: applications/luci-app-aria2/luasrc/view/aria2/log_template.htm:37 -msgid "No log data." -msgstr "无日志数据。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:454 -msgid "None" -msgstr "无" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:89 -msgid "Notice" -msgstr "注意" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:99 -msgid "Pause" -msgstr "暂停" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:99 -msgid "Pause download after added." -msgstr "在下载任务添加后暂停。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:105 -msgid "Pause downloads created as a result of metadata download." -msgstr "暂停下载内容为元数据的下载(磁力链接和 Matalink)。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:104 -msgid "Pause metadata" -msgstr "暂停元数据" - -#: applications/luci-app-aria2/luasrc/view/aria2/settings_header.htm:64 -msgid "Please input token length:" -msgstr "请输入密钥长度:" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:393 -msgid "Prefix of peer ID" -msgstr "对端 ID 前缀" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:203 -msgid "Private key" -msgstr "私钥" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:177 -msgid "Proxy password" -msgstr "代理密码" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:174 -msgid "Proxy user" -msgstr "代理用户名" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:97 -msgid "RPC Options" -msgstr "RPC 选项" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:114 -msgid "RPC authentication method" -msgstr "RPC 认证方式" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:140 -msgid "RPC certificate" -msgstr "RPC 证书" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:122 -msgid "RPC password" -msgstr "RPC 密码" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:110 -msgid "RPC port" -msgstr "RPC 端口" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:149 -msgid "RPC private key" -msgstr "RPC 私钥" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:133 -msgid "RPC secure" -msgstr "RPC 加密" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:126 -msgid "RPC token" -msgstr "RPC 令牌" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:134 -msgid "" -"RPC transport will be encrypted by SSL/TLS. The RPC clients must use https " -"scheme to access the server. For WebSocket client, use wss scheme." -msgstr "" -"用 SSL/TLS 加密 RPC 连接。RPC 客户端必须使用 HTTPS 协议来连接服务端,对于 " -"WebSocket 客户端,则使用 WSS 协议。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:119 -msgid "RPC username" -msgstr "RPC 用户名" - -#: applications/luci-app-aria2/luasrc/view/aria2/log_template.htm:51 -msgid "Refresh every 10 seconds." -msgstr "每 10 秒刷新。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:322 -msgid "Remove unselected file" -msgstr "删除未选择的文件" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:323 -msgid "" -"Removes the unselected files when download is completed in BitTorrent. " -"Please use this option with care because it will actually remove files from " -"your disk." -msgstr "BT 下载完成时删除未选择的文件。文件将从磁盘中被完全删除,请谨慎使用。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:377 -msgid "Request peer speed limit" -msgstr "单个 Peer 限速" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:266 -msgid "Retry wait" -msgstr "重试等待" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:61 -msgid "Run daemon as user" -msgstr "以此用户权限运行" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:429 -msgid "" -"Save a control file (*.aria2) every N seconds. If 0 is given, a control file " -"is not saved during download." -msgstr "" -"每 N 秒保存下载“控制文件”(*.aria2)。设置 0 表示在下载过程中不保存控制文件。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:461 -msgid "" -"Save download to session file even if the download is completed or removed. " -"This option also saves control file in that situations. This may be useful " -"to save BitTorrent seeding which is recognized as completed state." -msgstr "" -"即使下载已完成或已删除,也将其保存到会话文件。开启此选项也会同时保存“控制文" -"件”。此选项可能有助于保持被识别为已完成状态的 BT 做种。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:435 -msgid "" -"Save error/unfinished downloads to session file every N seconds. If 0 is " -"given, file will be saved only when aria2 exits." -msgstr "" -"每 N 秒将失败的/未完成的下载保存到 Session 文件。设置 0 则仅在 Aria2 退出时保" -"存。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:316 -msgid "" -"Save meta data as \".torrent\" file. This option has effect only when " -"BitTorrent Magnet URI is used. The file name is hex encoded info hash with " -"suffix \".torrent\"." -msgstr "" -"将元数据保存到 \".torrent\" 文件。此选项仅在下载连接为 BT 磁力链接时生效。文" -"件名为 Hash 值,后缀为 \".torrent\"。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:315 -msgid "Save metadata" -msgstr "保存元数据" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:434 -msgid "Save session interval" -msgstr "会话保存间隔" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:330 -msgid "Seed previously downloaded files without verifying piece hashes." -msgstr "继续之前的BT任务时, 无需再次校验分片 Hash。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:401 -msgid "Seed ratio" -msgstr "做种比率" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:408 -msgid "Seed time" -msgstr "做种时间" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:329 -msgid "Seed unverified" -msgstr "不校验种子" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:211 -msgid "" -"Send Accept: deflate, gzip request header and inflate response " -"if remote server responds with Content-Encoding: gzip or " -"Content-Encoding: deflate." -msgstr "" -"发送 Accept: deflate, gzip 请求头,当服务器响应头包含 " -"Content-Encoding: gzip 或者 Content-Encoding: deflate 时解压响应数据。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:220 -msgid "" -"Send Cache-Control: no-cache and Pragma: no-cache " -"header to avoid cached content. If disabled, these headers are not sent and " -"you can add Cache-Control header with a directive you like using \"Header\" " -"option." -msgstr "" -"发送 Cache-Control: no-cachePragma: no-cache 请" -"求头来防止缓存内容,禁用则不发送。你也可用使用“请求头”选项来设置 Cache-" -"Control 请求头。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:336 -msgid "" -"Set TCP port number for BitTorrent downloads. Accept format: \"6881,6885\", " -"\"6881-6999\" and \"6881-6889,6999\". Make sure that the specified ports are " -"open for incoming TCP traffic." -msgstr "" -"为 BT 下载设置 TCP 端口。支持的格式:\"6881,6885\",\"6881-6999\" 和 " -"\"6881-6889,6999\"。请确保正确放行了这些端口的 TCP 入站通信。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:342 -msgid "" -"Set UDP listening port used by DHT (IPv4, IPv6) and UDP tracker. Make sure " -"that the specified ports are open for incoming UDP traffic." -msgstr "" -"为 DHT(IPv4,IPv6)和 UDP tracker 设置 UDP 监听端口。请确保正确放行了这些端" -"口的 UDP 入站通信。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:477 -msgid "" -"Set max download speed per each download in bytes/sec. 0 means unrestricted." -msgstr "设置每个任务的最大下载速度(字节/秒),0 表示不限制。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:470 -msgid "Set max overall download speed in bytes/sec. 0 means unrestricted." -msgstr "设置全局最大下载速度(字节/秒),0 表示不限制。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:355 -msgid "Set max overall upload speed in bytes/sec. 0 means unrestricted." -msgstr "设置全局最大上传速度,0 表示不限制。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:362 -msgid "" -"Set max upload speed per each torrent in bytes/sec. 0 means unrestricted." -msgstr "设置每个任务的最大上传速度(字节/秒),0 表示不限制。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:231 -msgid "" -"Set the connect timeout in seconds to establish connection to HTTP/FTP/proxy " -"server. After the connection is established, this option makes no effect and " -"\"Timeout\" option is used instead." -msgstr "" -"设置 HTTP、FTP 和代理服务器的连接超时时间。当连接建立后,该选项失去作用," -"而“超时时间”选项会被使用。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:267 -msgid "Set the seconds to wait between retries." -msgstr "设置重试的时间间隔。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:272 -msgid "Set user agent for HTTP(S) downloads." -msgstr "为 HTTP(S) 下载设置用户代理。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:35 -msgid "Settings" -msgstr "设置" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:483 -msgid "Settings in this section will be added to config file." -msgstr "这个区域中的配置信息将被添加到配置文件中。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:487 -msgid "Settings list" -msgstr "设置列表" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:161 -msgid "Show URL" -msgstr "显示 URL" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:448 -msgid "" -"Specify file allocation method. If you are using newer file systems such as " -"ext4 (with extents support), btrfs, xfs or NTFS (MinGW build only), " -"\"falloc\" is your best choice. It allocates large(few GiB) files almost " -"instantly, but it may not be available if your system doesn't have " -"posix_fallocate(3) function. Don't use \"falloc\" with legacy file systems " -"such as ext3 and FAT32 because it takes almost same time as \"prealloc\" and " -"it blocks aria2 entirely until allocation finishes." -msgstr "" -"指定文件分配方式。如果你使用的文件系统较新,例如:ext4(支持扩展分区)," -"btrfs,xfs 或者 NTFS(仅限 MinGW 版本),强烈推荐 \"falloc\",这种方式几乎能" -"立即分配比较大的文件(GB),但是它要求你的系统支持 posix_fallocate(3) 函数。" -"不要在 ext3 或者 FAT32 这些旧文件系统中使用 \"falloc\",因为它花费的时间和 " -"\"prealloc\" 几乎一样多,而且在文件分配过程中会阻塞整个 Aria2 进程。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:368 -msgid "" -"Specify maximum number of files to open in multi-file BitTorrent download " -"globally." -msgstr "设置 BT 全局最大同时下载的文件数量。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:409 -msgid "" -"Specify seeding time in minutes. If \"Seed ratio\" option is specified along " -"with this option, seeding ends when at least one of the conditions is " -"satisfied. Specifying 0 disables seeding after download completed." -msgstr "" -"指定做种时间(分钟)。如果同时指定了“做种比率”选项,那么将在任一条件满足时停" -"止做种。设置 0 表示下载完成后停止做种。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:402 -msgid "" -"Specify share ratio. Seed completed torrents until share ratio reaches " -"RATIO. You are strongly encouraged to specify equals or more than 1.0 here. " -"Specify 0.0 if you intend to do seeding regardless of share ratio." -msgstr "" -"指定做种比率。BT 下载完成之后持续做种,直到比率达到指定值。强烈建议将此选项设" -"置为大于或等于 1.0。设置为 0.0 来无限做种。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:373 -msgid "Specify the maximum number of peers per torrent, 0 means unlimited." -msgstr "设置每个 BT 任务的最大 Peer 数量,0 表示不限制。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:394 -msgid "" -"Specify the prefix of peer ID. The peer ID in BitTorrent is 20 byte length. " -"If more than 20 bytes are specified, only first 20 bytes are used. If less " -"than 20 bytes are specified, random byte data are added to make its length " -"20 bytes." -msgstr "" -"配置对端 ID 前缀。对端 ID 的长度为 20 字节。如果配置超过了 20 字节,将仅使用" -"前面的 20 字节。如果配置少于 20 字节,将添加额外的随机字符来让长度达到 20 字" -"节。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:388 -msgid "" -"Stop BitTorrent download if download speed is 0 in consecutive N seconds. If " -"0 is given, this feature is disabled." -msgstr "" -"当 BT 任务在 N 秒的持续时间内的下载速度一直为 0,则停止下载。0 表示禁用。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:387 -msgid "Stop timeout" -msgstr "停止超时时间" - -#: applications/luci-app-aria2/luasrc/view/aria2/settings_header.htm:48 -msgid "The Aria2 service is not running." -msgstr "Aria2 服务未运行。" - -#: applications/luci-app-aria2/luasrc/view/aria2/settings_header.htm:47 -msgid "The Aria2 service is running." -msgstr "Aria2 服务正在运行。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:74 -msgid "The directory to store the config file, session file and DHT file." -msgstr "用于放置配置文件,会话文件和 DHT 文件的目录。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:70 -msgid "" -"The directory to store the downloaded file. For example /mnt/sda1." -msgstr "用于放置下载文件的目录。例如:/mnt/sda1。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:81 -msgid "The file name of the log file." -msgstr "日志文件名。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:249 -msgid "The maximum number of connections to one server for each download." -msgstr "单一服务器最大连接数量。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:281 -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:291 -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:299 -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:308 -msgid "This option will be ignored if a private flag is set in a torrent." -msgstr "如果种子文件具有“私有”属性,该选项将会被忽略。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:236 -msgid "Timeout" -msgstr "超时" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:117 -msgid "Token" -msgstr "令牌" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:349 -msgid "True" -msgstr "是" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:156 -msgid "Use WebSocket" -msgstr "使用 WebSocket" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:170 -msgid "Use a proxy server for all protocols." -msgstr "为所有协议设置代理服务器。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:190 -msgid "" -"Use the certificate authorities in FILE to verify the peers. The certificate " -"file must be in PEM format and can contain multiple CA certificates." -msgstr "" -"使用文件中的证书来验证对端。证书文件必须为 PEM 格式并且可以包含多个证书。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:141 -msgid "" -"Use the certificate in FILE for RPC server. The certificate must be either " -"in PKCS12 (.p12, .pfx) or in PEM format.
PKCS12 files must contain the " -"certificate, a key and optionally a chain of additional certificates. Only " -"PKCS12 files with a blank import password can be opened!
When using PEM, " -"you have to specify the \"RPC private key\" as well." -msgstr "" -"使用文件中的证书作为 RPC 服务器。证书必须为 PKCS12 (.p12, .pfx) 或者 PEM 格" -"式。
PKCS12 文件必须包含证书,一个密钥和可选的附加证书链。只有导入密码为" -"空白的 PKCS12 文件才能被打开。
使用 PEM 时,你必须同时指定“RPC 私钥”。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:196 -msgid "" -"Use the client certificate in FILE. The certificate must be either in PKCS12 " -"(.p12, .pfx) or in PEM format.
PKCS12 files must contain the " -"certificate, a key and optionally a chain of additional certificates. Only " -"PKCS12 files with a blank import password can be opened!
When using PEM, " -"you have to specify the \"Private key\" as well." -msgstr "" -"使用文件中的客户端证书。证书必须为 PKCS12 (.p12, .pfx) 或者 PEM 格式。
PKCS12 文件必须包含证书,一个密钥和可选的附加证书链。只有导入密码为空白的 " -"PKCS12 文件才能被打开。
使用 PEM 时,你必须同时指定“RPC 私钥”。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:150 -msgid "" -"Use the private key in FILE for RPC server. The private key must be " -"decrypted and in PEM format." -msgstr "使用文件中的私钥作为 RPC 服务器。私钥必须解密并且为 PEM 格式。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:204 -msgid "" -"Use the private key in FILE. The private key must be decrypted and in PEM " -"format. The behavior when encrypted one is given is undefined." -msgstr "使用文件中的私钥。私钥必须解密并且为 PEM 格式,不支持加密的私钥。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:271 -msgid "User agent" -msgstr "用户代理" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:116 -msgid "Username & Password" -msgstr "用户名与密码" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:183 -msgid "" -"Verify the peer using certificates specified in \"CA certificate\" option." -msgstr "使用“CA 证书”里配置的证书来验证对端。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:90 -msgid "Warn" -msgstr "警告" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:244 -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:356 -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:363 -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:383 -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:443 -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:471 -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:478 -msgid "You can append K or M." -msgstr "你可以追加 K 或者 M。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:457 -msgid "falloc" -msgstr "falloc系统调测" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:455 -msgid "prealloc" -msgstr "预分配" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:456 -msgid "trunc" -msgstr "trunc系统调测" - -msgid "Clear logs" -msgstr "清空日志" diff --git a/luci-app-aria2/po/zh_Hant/aria2.po b/luci-app-aria2/po/zh_Hant/aria2.po deleted file mode 100644 index 97f0f7d30..000000000 --- a/luci-app-aria2/po/zh_Hant/aria2.po +++ /dev/null @@ -1,860 +0,0 @@ -# -# Yangfl , 2017, 2018. -# -msgid "" -msgstr "" -"PO-Revision-Date: 2022-04-21 23:00+0000\n" -"Last-Translator: Hulen \n" -"Language-Team: Chinese (Traditional) \n" -"Language: zh_Hant\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 4.12-dev\n" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:296 -msgid "LPD enabled" -msgstr "啟用 LPD" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:414 -msgid "Additional BT tracker" -msgstr "附加 BitTorrent tracker" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:419 -msgid "Advanced Options" -msgstr "進階選項" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:169 -msgid "All proxy" -msgstr "全部代理" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:228 -msgid "Append HEADERs to HTTP request header." -msgstr "附加該值到 HTTP 請求頭。" - -#: applications/luci-app-aria2/luasrc/controller/aria2.lua:17 -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:35 -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/files.lua:14 -#: applications/luci-app-aria2/luasrc/view/aria2/log_template.htm:45 -msgid "Aria2" -msgstr "Aria2" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:37 -msgid "" -"Aria2 is a lightweight multi-protocol & multi-source, cross platform " -"download utility." -msgstr "Aria2 是一個輕量化且支援多協定、多來源的跨平台下載工具。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:428 -msgid "Auto save interval" -msgstr "自動儲存間隔" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:56 -msgid "Basic Options" -msgstr "基本選項" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:276 -msgid "BitTorrent Options" -msgstr "BitTorrent 選項" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:335 -msgid "BitTorrent listen port" -msgstr "BitTorrent 監聽埠號" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:189 -msgid "CA certificate" -msgstr "CA 憑證" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:195 -msgid "Certificate" -msgstr "憑證" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:182 -msgid "Check certificate" -msgstr "檢查憑證" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:242 -msgid "" -"Close connection if download speed is lower than or equal to this value " -"(bytes per sec). 0 means has no lowest speed limit." -msgstr "下載速度小於或等於該值(單位:B/s)時關閉連線,輸入 0 則表示不限速。" - -#: applications/luci-app-aria2/luasrc/view/aria2/log_template.htm:49 -#: applications/luci-app-aria2/luasrc/view/aria2/settings_header.htm:29 -msgid "Collecting data..." -msgstr "正在收集資料中…" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:73 -msgid "Config file directory" -msgstr "組態檔目錄" - -#: applications/luci-app-aria2/luasrc/controller/aria2.lua:22 -msgid "Configuration" -msgstr "組態" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:230 -msgid "Connect timeout" -msgstr "連線逾時值" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/files.lua:19 -msgid "Content of config file: %s" -msgstr "組態檔內容:%s" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/files.lua:29 -msgid "Content of session file: %s" -msgstr "工作階段檔內容:%s" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:341 -msgid "DHT Listen port" -msgstr "DHT 監聽埠號" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:87 -msgid "Debug" -msgstr "除錯" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:422 -msgid "" -"Disable IPv6. This is useful if you have to use broken DNS and want to avoid " -"terribly slow AAAA record lookup." -msgstr "" -"停用 IPv6;如果您的 IPv6 連線不穩定,並希望 DNS 避免查詢緩慢的 AAAA 紀錄,請" -"啟用此選項。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:440 -msgid "Disk cache" -msgstr "磁碟快取" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:259 -msgid "Don't split less than 2*SIZE byte range. Possible values: 1M-1024M." -msgstr "" -"檔案的最小分割大小(取值範圍:1-1024M);如果「檔案大小」小於該值的 2 倍,則" -"不會分割此檔案。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:254 -msgid "Download a file using N connections." -msgstr "檔案的最大分割數量;下載該檔案時將使用同等數量的執行緒。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:69 -msgid "Download directory" -msgstr "下載目錄" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/files.lua:26 -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/files.lua:36 -msgid "Empty file." -msgstr "檔案為空。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:280 -msgid "Enable IPv4 DHT functionality. It also enables UDP tracker support." -msgstr "" -"啟用 IPv4「分散式雜湊表」功能;這將同時啟用對「UDP tracker 協定」的支援。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:290 -msgid "Enable IPv6 DHT functionality." -msgstr "啟用 IPv6「分散式雜湊表」功能。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:298 -msgid "Enable Local Peer Discovery." -msgstr "啟用「本地節點發現」。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:307 -msgid "Enable Peer Exchange extension." -msgstr "啟用「節點交換」擴充套件。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:442 -msgid "Enable disk cache (in bytes), set 0 to disabled." -msgstr "啟用磁碟快取(單位:B),輸入 0 則表示停用。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:77 -msgid "Enable logging" -msgstr "啟用日誌記錄" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:305 -msgid "Enable peer exchange" -msgstr "啟用 PEX" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:166 -msgid "Enable proxy" -msgstr "啟用代理" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:58 -msgid "Enabled" -msgstr "啟用" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:91 -msgid "Error" -msgstr "錯誤" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:44 -msgid "Error: Can't find aria2c in PATH, please reinstall aria2." -msgstr "錯誤:PATH 中找不到 aria2c,請重新安裝 Aria2。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:482 -msgid "Extra Settings" -msgstr "額外設定" - -#: applications/luci-app-aria2/luasrc/view/aria2/log_template.htm:39 -msgid "Failed to load log data." -msgstr "日誌資料載入失敗。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:350 -msgid "False" -msgstr "否" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:447 -msgid "File allocation" -msgstr "檔案分配" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/files.lua:25 -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/files.lua:35 -msgid "File does not exist." -msgstr "檔案不存在。" - -#: applications/luci-app-aria2/luasrc/controller/aria2.lua:25 -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/files.lua:14 -msgid "Files" -msgstr "檔案" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:348 -msgid "Follow torrent" -msgstr "下載種子後自動建立其下載任務" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:38 -msgid "For more information, please visit: %s" -msgstr "請參閱 %s 以獲得更多資訊" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:460 -msgid "Force save" -msgstr "強制儲存" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:129 -msgid "Generate Randomly" -msgstr "隨機產生" - -#: applications/luci-app-aria2/root/usr/share/rpcd/acl.d/luci-app-aria2.json:3 -msgid "Grant UCI access for luci-app-aria2" -msgstr "授予 luci-app-aria2 擁有 UCI 存取的權限" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:210 -msgid "HTTP accept gzip" -msgstr "啟用 HTTP 壓縮" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:219 -msgid "HTTP no cache" -msgstr "HTTP 不快取" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:164 -msgid "HTTP/FTP/SFTP Options" -msgstr "HTTP/FTP/SFTP 選項" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:227 -msgid "Header" -msgstr "頭欄位" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/files.lua:15 -msgid "Here shows the files used by aria2." -msgstr "在這裡顯示 Aria2 使用的檔案。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:278 -msgid "IPv4 DHT enabled" -msgstr "啟用 IPv4 DHT" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:288 -msgid "IPv6 DHT enabled" -msgstr "啟用 IPv6 DHT" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:421 -msgid "IPv6 disabled" -msgstr "停用 IPv6" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:379 -msgid "" -"If the whole download speed of every torrent is lower than SPEED, aria2 " -"temporarily increases the number of peers to try for more download speed. " -"Configuring this option with your preferred download speed can increase your " -"download speed in some cases." -msgstr "" -"如果某個 BT 任務的下載速度小於設定的速度,Aria2 會臨時提高 Peer 的數量來嘗試" -"取得更大的下載速度。在某些情況下,設定此選項能提高您的下載速度。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:88 -msgid "Info" -msgstr "資訊" - -#: applications/luci-app-aria2/luasrc/view/aria2/settings_header.htm:33 -msgid "Installed web interface:" -msgstr "已安装的 Web 介面:" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:158 -msgid "Json-RPC URL" -msgstr "JSON-RPC URL" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:351 -msgid "Keep in memory" -msgstr "是,但不會儲存種子" - -#: applications/luci-app-aria2/luasrc/view/aria2/log_template.htm:34 -msgid "Last 50 lines of log file:" -msgstr "日誌檔最後 50 行內容:" - -#: applications/luci-app-aria2/luasrc/view/aria2/log_template.htm:36 -msgid "Last 50 lines of syslog:" -msgstr "系統日誌最後 50 行內容:" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:62 -msgid "Leave blank to use default user." -msgstr "如果不選擇,則使用預設使用者。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:415 -msgid "List of additional BitTorrent tracker's announce URI." -msgstr "附加 BitTorrent tracker 清單的發布 URI。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:488 -msgid "" -"List of extra settings. Format: option=value, eg. netrc-path=/tmp/." -"netrc." -msgstr "" -"額外設定清單;格式為 option=value(例如:netrc-path=/tmp/.netrc)。" - -#: applications/luci-app-aria2/luasrc/view/aria2/log_template.htm:48 -msgid "Loading" -msgstr "正在載入中" - -#: applications/luci-app-aria2/luasrc/controller/aria2.lua:28 -msgid "Log" -msgstr "日誌" - -#: applications/luci-app-aria2/luasrc/view/aria2/log_template.htm:45 -msgid "Log Data" -msgstr "日誌資料" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:80 -msgid "Log file" -msgstr "日誌檔" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:85 -msgid "Log level" -msgstr "日誌級別" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:240 -msgid "Lowest speed limit" -msgstr "最小速度限制" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:94 -msgid "Max concurrent downloads" -msgstr "最大同時下載任務數" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:248 -msgid "Max connection per server" -msgstr "同一伺服器最大連線數" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:475 -msgid "Max download limit" -msgstr "最大下載速度限制" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:253 -msgid "Max number of split" -msgstr "最大分割數量" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:367 -msgid "Max open files" -msgstr "最大檔案開啟數" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:468 -msgid "Max overall download limit" -msgstr "最大整體下載速度限制" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:353 -msgid "Max overall upload limit" -msgstr "最大整體上傳速度限制" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:372 -msgid "Max peers" -msgstr "最大節點數量" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:262 -msgid "Max tries" -msgstr "最大重試次數" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:360 -msgid "Max upload limit" -msgstr "最大上傳速度限制" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:258 -msgid "Min split size" -msgstr "最小分割大小" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:115 -msgid "No Authentication" -msgstr "不認證" - -#: applications/luci-app-aria2/luasrc/view/aria2/log_template.htm:35 -#: applications/luci-app-aria2/luasrc/view/aria2/log_template.htm:37 -msgid "No log data." -msgstr "日誌資料為空。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:454 -msgid "None" -msgstr "無" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:89 -msgid "Notice" -msgstr "注意" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:99 -msgid "Pause" -msgstr "暫停" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:99 -msgid "Pause download after added." -msgstr "加入任務後,暫停此下載任務。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:105 -msgid "Pause downloads created as a result of metadata download." -msgstr "元資料下載完成後,暫停由其建立的後續下載任務。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:104 -msgid "Pause metadata" -msgstr "暫停元資料" - -#: applications/luci-app-aria2/luasrc/view/aria2/settings_header.htm:64 -msgid "Please input token length:" -msgstr "請輸入權杖長度:" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:393 -msgid "Prefix of peer ID" -msgstr "Peer ID 字首" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:203 -msgid "Private key" -msgstr "私鑰" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:177 -msgid "Proxy password" -msgstr "代理密碼" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:174 -msgid "Proxy user" -msgstr "代理使用者名稱" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:97 -msgid "RPC Options" -msgstr "RPC 選項" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:114 -msgid "RPC authentication method" -msgstr "RPC 認證方法" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:140 -msgid "RPC certificate" -msgstr "RPC 憑證" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:122 -msgid "RPC password" -msgstr "RPC 密碼" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:110 -msgid "RPC port" -msgstr "RPC 埠號" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:149 -msgid "RPC private key" -msgstr "RPC 私鑰" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:133 -msgid "RPC secure" -msgstr "RPC 加密" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:126 -msgid "RPC token" -msgstr "RPC 權杖" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:134 -msgid "" -"RPC transport will be encrypted by SSL/TLS. The RPC clients must use https " -"scheme to access the server. For WebSocket client, use wss scheme." -msgstr "" -"通過 SSL/TLS 加密 RPC 傳輸;RPC 客戶端必須使用「HTTPS 協定」來存取伺服器," -"WebSocket 客戶端則使用「WWS 協定」。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:119 -msgid "RPC username" -msgstr "RPC 使用者名稱" - -#: applications/luci-app-aria2/luasrc/view/aria2/log_template.htm:51 -msgid "Refresh every 10 seconds." -msgstr "每 10 秒重新整理一次。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:322 -msgid "Remove unselected file" -msgstr "移除未選擇的檔案" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:323 -msgid "" -"Removes the unselected files when download is completed in BitTorrent. " -"Please use this option with care because it will actually remove files from " -"your disk." -msgstr "" -"BitTorrent 下載完成時移除未選擇的檔案;檔案將從您的磁碟中永久移除,請小心使用" -"此選項。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:377 -msgid "Request peer speed limit" -msgstr "請求節點速度限制" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:266 -msgid "Retry wait" -msgstr "重試等待" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:61 -msgid "Run daemon as user" -msgstr "執行守護行程的使用者" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:429 -msgid "" -"Save a control file (*.aria2) every N seconds. If 0 is given, a control file " -"is not saved during download." -msgstr "" -"每 N 秒儲存下載「控制檔案」(*.aria2)。設定 0 表示在下載過程中不儲存控制檔案。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:461 -msgid "" -"Save download to session file even if the download is completed or removed. " -"This option also saves control file in that situations. This may be useful " -"to save BitTorrent seeding which is recognized as completed state." -msgstr "" -"即使下載任務已完成或已移除,也將其儲存到「工作階段檔」;於此同時,啟用此選項" -"還會儲存「控制檔」。這可能有助於您儲存被辨識為「已完成狀態」的 BitTorrent 種" -"子。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:435 -msgid "" -"Save error/unfinished downloads to session file every N seconds. If 0 is " -"given, file will be saved only when aria2 exits." -msgstr "" -"每 N 秒將失敗的/未完成的下載儲存到工作階段檔案。設定 0 則僅在 Aria2 退出時儲" -"存。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:316 -msgid "" -"Save meta data as \".torrent\" file. This option has effect only when " -"BitTorrent Magnet URI is used. The file name is hex encoded info hash with " -"suffix \".torrent\"." -msgstr "" -"儲存元資料為 \".torrent\" 檔案;此選項僅在使用 BitTorrent 磁力連結下載時生" -"效。檔案名稱(包含字尾 \".torrent\")為十六進位編碼的雜湊值。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:315 -msgid "Save metadata" -msgstr "儲存元資料" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:434 -msgid "Save session interval" -msgstr "工作階段儲存間隔" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:330 -msgid "Seed previously downloaded files without verifying piece hashes." -msgstr "繼續之前的 BT 任務時, 無需再次校驗分片雜湊。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:401 -msgid "Seed ratio" -msgstr "做種比例" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:408 -msgid "Seed time" -msgstr "做種時間" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:329 -msgid "Seed unverified" -msgstr "不校驗種子" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:211 -msgid "" -"Send Accept: deflate, gzip request header and inflate response " -"if remote server responds with Content-Encoding: gzip or " -"Content-Encoding: deflate." -msgstr "" -"傳送請求頭欄位:Accept: deflate, gzip;當遠端伺服器的回應頭中具" -"有 Content-Encoding: gzipContent-Encoding: deflate 時解壓回應資料,以提高資料傳輸速度。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:220 -msgid "" -"Send Cache-Control: no-cache and Pragma: no-cache " -"header to avoid cached content. If disabled, these headers are not sent and " -"you can add Cache-Control header with a directive you like using \"Header\" " -"option." -msgstr "" -"傳送 Cache-Control: no-cachePragma: no-cache 請" -"求標頭來防止快取內容,停用則不傳送。您也可用使用「請求標頭」選項來設定 Cache-" -"Control 請求標頭。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:336 -msgid "" -"Set TCP port number for BitTorrent downloads. Accept format: \"6881,6885\", " -"\"6881-6999\" and \"6881-6889,6999\". Make sure that the specified ports are " -"open for incoming TCP traffic." -msgstr "" -"為 BitTorrent 下載設定 TCP 連接埠。支援的格式:「6881,6885」,「6881-6999」和" -"「6881-6889,6999」。請確保正確放行了這些連接埠的 TCP 入站通信。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:342 -msgid "" -"Set UDP listening port used by DHT (IPv4, IPv6) and UDP tracker. Make sure " -"that the specified ports are open for incoming UDP traffic." -msgstr "" -"設定用於 DHT (IPv4, IPv6) 和 UDP tracker 協定的 UDP 監聽埠;請確保指定的通訊" -"埠允許 UDP 傳入流量。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:477 -msgid "" -"Set max download speed per each download in bytes/sec. 0 means unrestricted." -msgstr "設定每個任務的最大下載速度(單位:B/s),輸入 0 則表示不限制。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:470 -msgid "Set max overall download speed in bytes/sec. 0 means unrestricted." -msgstr "設定整體的最大下載速度(單位:B/s),輸入 0 則表示不限制。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:355 -msgid "Set max overall upload speed in bytes/sec. 0 means unrestricted." -msgstr "設定整體的最大上傳速度(單位:B/s),輸入 0 則表示不限制。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:362 -msgid "" -"Set max upload speed per each torrent in bytes/sec. 0 means unrestricted." -msgstr "設定每個任務的最大上傳速度(單位:B/s),輸入 0 則表示不限制。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:231 -msgid "" -"Set the connect timeout in seconds to establish connection to HTTP/FTP/proxy " -"server. After the connection is established, this option makes no effect and " -"\"Timeout\" option is used instead." -msgstr "" -"設定 HTTP、FTP 和代理伺服器的連線逾時時間。當連線建立後,該選項失去作用,而" -"「逾時時間」選項會被使用。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:267 -msgid "Set the seconds to wait between retries." -msgstr "設定重試的等待間隔秒數。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:272 -msgid "Set user agent for HTTP(S) downloads." -msgstr "為 HTTP(S) 下載設定使用者代理。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:35 -msgid "Settings" -msgstr "設定" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:483 -msgid "Settings in this section will be added to config file." -msgstr "此部分的設定將被加入到組態檔。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:487 -msgid "Settings list" -msgstr "設定清單" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:161 -msgid "Show URL" -msgstr "顯示 URL" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:448 -msgid "" -"Specify file allocation method. If you are using newer file systems such as " -"ext4 (with extents support), btrfs, xfs or NTFS (MinGW build only), " -"\"falloc\" is your best choice. It allocates large(few GiB) files almost " -"instantly, but it may not be available if your system doesn't have " -"posix_fallocate(3) function. Don't use \"falloc\" with legacy file systems " -"such as ext3 and FAT32 because it takes almost same time as \"prealloc\" and " -"it blocks aria2 entirely until allocation finishes." -msgstr "" -"指定檔案分配方式。如果您使用的檔案系統較新,例如:ext4 (支援擴展分區)、" -"btrfs、xfs 或者 NTFS (僅限 MinGW 版本),強烈推薦「falloc」,這種方式幾乎能立" -"即分配比較大的檔案 (GB),但是它要求您的系統必須支援 posix_fallocate(3) 函數。" -"不要在 ext3 或者 FAT32 這些舊檔案系統中使用「falloc」,因為它花費的時間和" -"「prealloc」幾乎一樣多,而且在檔案分配過程中會阻塞整個 Aria2 處理程序。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:368 -msgid "" -"Specify maximum number of files to open in multi-file BitTorrent download " -"globally." -msgstr "設定 BitTorrent 全域最大同時下載的檔案數量。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:409 -msgid "" -"Specify seeding time in minutes. If \"Seed ratio\" option is specified along " -"with this option, seeding ends when at least one of the conditions is " -"satisfied. Specifying 0 disables seeding after download completed." -msgstr "" -"指定做種時間 (分鍾)。如果同時指定了「做種比例」選項,那麼將在任一條件滿足時停" -"止做種。設定 0 表示下載完成後停止做種。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:402 -msgid "" -"Specify share ratio. Seed completed torrents until share ratio reaches " -"RATIO. You are strongly encouraged to specify equals or more than 1.0 here. " -"Specify 0.0 if you intend to do seeding regardless of share ratio." -msgstr "" -"指定做種比例。BT 下載完成之後持續做種,直到比例達到指定值。強烈建議將此選項設" -"定為大於或等於 1.0。設定為 0.0 來無限做種。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:373 -msgid "Specify the maximum number of peers per torrent, 0 means unlimited." -msgstr "指定每個任務的最大 peer 數量,輸入 0 則表示不限制。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:394 -msgid "" -"Specify the prefix of peer ID. The peer ID in BitTorrent is 20 byte length. " -"If more than 20 bytes are specified, only first 20 bytes are used. If less " -"than 20 bytes are specified, random byte data are added to make its length " -"20 bytes." -msgstr "" -"設定 Peer ID 前綴。Peer ID 的長度為 20 位元組。如果設定超過了 20 位元組,將僅" -"使用前面的 20 位元組。如果設定少於 20 位元組,將加入額外的隨機字元來讓長度達" -"到 20 位元組。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:388 -msgid "" -"Stop BitTorrent download if download speed is 0 in consecutive N seconds. If " -"0 is given, this feature is disabled." -msgstr "" -"當 BT 任務在 N 秒的持續時間內的下載速度一直為 0,則停止下載。0 表示停用。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:387 -msgid "Stop timeout" -msgstr "停止逾時值" - -#: applications/luci-app-aria2/luasrc/view/aria2/settings_header.htm:48 -msgid "The Aria2 service is not running." -msgstr "Aria2 服務未執行。" - -#: applications/luci-app-aria2/luasrc/view/aria2/settings_header.htm:47 -msgid "The Aria2 service is running." -msgstr "Aria2 服務執行中。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:74 -msgid "The directory to store the config file, session file and DHT file." -msgstr "儲存設定檔、工作階段檔和 DHT 檔案的目錄。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:70 -msgid "" -"The directory to store the downloaded file. For example /mnt/sda1." -msgstr "儲存下載檔案的目錄(例如:/mnt/sda1)。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:81 -msgid "The file name of the log file." -msgstr "日誌檔的檔案名稱。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:249 -msgid "The maximum number of connections to one server for each download." -msgstr "每個下載任務與同一伺服器建立的最大連線數。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:281 -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:291 -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:299 -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:308 -msgid "This option will be ignored if a private flag is set in a torrent." -msgstr "如果種子檔案具有「私有」屬性,該選項將會被忽略。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:236 -msgid "Timeout" -msgstr "逾時" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:117 -msgid "Token" -msgstr "權杖" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:349 -msgid "True" -msgstr "是" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:156 -msgid "Use WebSocket" -msgstr "使用 WebSocket" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:170 -msgid "Use a proxy server for all protocols." -msgstr "為所有協定使用代理伺服器。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:190 -msgid "" -"Use the certificate authorities in FILE to verify the peers. The certificate " -"file must be in PEM format and can contain multiple CA certificates." -msgstr "" -"使用檔案中的憑證來驗證對端。憑證檔案必須為 PEM 格式並且可以包含多個憑證。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:141 -msgid "" -"Use the certificate in FILE for RPC server. The certificate must be either " -"in PKCS12 (.p12, .pfx) or in PEM format.
PKCS12 files must contain the " -"certificate, a key and optionally a chain of additional certificates. Only " -"PKCS12 files with a blank import password can be opened!
When using PEM, " -"you have to specify the \"RPC private key\" as well." -msgstr "" -"RPC 伺服器使用的「憑證檔」;憑證格式必須為 PKCS12 (.p12, .pfx) 或 PEM。
PKCS12 檔案必須包含憑證、金鑰以及可選的附加「憑證鏈」,且該檔案不能有匯入密" -"碼!
使用 PEM 時,您必須同時指定「RPC 私鑰」。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:196 -msgid "" -"Use the client certificate in FILE. The certificate must be either in PKCS12 " -"(.p12, .pfx) or in PEM format.
PKCS12 files must contain the " -"certificate, a key and optionally a chain of additional certificates. Only " -"PKCS12 files with a blank import password can be opened!
When using PEM, " -"you have to specify the \"Private key\" as well." -msgstr "" -"客戶端使用的「憑證檔」;憑證格式必須為 PKCS12 (.p12, .pfx) 或 PEM。
PKCS12 檔案必須包含憑證、金鑰以及可選的附加「憑證鏈」,且該檔案不能有匯入密" -"碼!
使用 PEM 時,您必須同時指定「私鑰」。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:150 -msgid "" -"Use the private key in FILE for RPC server. The private key must be " -"decrypted and in PEM format." -msgstr "RPC 伺服器使用的「私鑰檔」;私鑰必須被解密,且格式為 PEM。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:204 -msgid "" -"Use the private key in FILE. The private key must be decrypted and in PEM " -"format. The behavior when encrypted one is given is undefined." -msgstr "使用的「私鑰檔」;私鑰必須被解密,且格式為 PEM。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:271 -msgid "User agent" -msgstr "使用者代理" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:116 -msgid "Username & Password" -msgstr "使用者名稱與密碼" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:183 -msgid "" -"Verify the peer using certificates specified in \"CA certificate\" option." -msgstr "使用「CA 憑證」選項中指定的憑證來驗證節點。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:90 -msgid "Warn" -msgstr "警告" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:244 -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:356 -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:363 -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:383 -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:443 -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:471 -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:478 -msgid "You can append K or M." -msgstr "您可以在該值後附加單位 K 或 M。" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:457 -msgid "falloc" -msgstr "falloc系統調試" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:455 -msgid "prealloc" -msgstr "預分配" - -#: applications/luci-app-aria2/luasrc/model/cbi/aria2/config.lua:456 -msgid "trunc" -msgstr "trunc系統調試" diff --git a/luci-app-aria2/root/usr/share/rpcd/acl.d/luci-app-aria2.json b/luci-app-aria2/root/usr/share/rpcd/acl.d/luci-app-aria2.json deleted file mode 100644 index 891f97c28..000000000 --- a/luci-app-aria2/root/usr/share/rpcd/acl.d/luci-app-aria2.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "luci-app-aria2": { - "description": "Grant UCI access for luci-app-aria2", - "read": { - "uci": [ "aria2" ] - }, - "write": { - "uci": [ "aria2" ] - } - } -} diff --git a/webui-aria2/Makefile b/webui-aria2/Makefile deleted file mode 100644 index 8ef8527a2..000000000 --- a/webui-aria2/Makefile +++ /dev/null @@ -1,51 +0,0 @@ -# -# Copyright (C) 2016-2020 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk - -PKG_NAME:=webui-aria2 -PKG_RELEASE:=1 - -PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2021-09-01 -PKG_SOURCE_URL:=https://github.com/ziahamza/webui-aria2.git -PKG_SOURCE_VERSION:=109903f0e2774cf948698cd95a01f77f33d7dd2c -PKG_MIRROR_HASH:=skip - -PKG_LICENSE:=MIT -PKG_LICENSE_FILES:=LICENSE -PKG_MAINTAINER:=Hsing-Wang Liao - -include $(INCLUDE_DIR)/package.mk - -define Package/webui-aria2 - SECTION:=net - CATEGORY:=Network - SUBMENU:=Download Manager - TITLE:=An interface to interact with aria2 - URL:=https://github.com/ziahamza/webui-aria2 - DEPENDS:=+aria2 - PKGARCH:=all -endef - -define Package/webui-aria2/description - The aim for this project is to create the worlds best and hottest - interface to interact with aria2. Very simple to use. -endef - -define Build/Compile -endef - -define Package/webui-aria2/install - $(INSTALL_DIR) $(1)/www/webui-aria2 - $(CP) \ - $(PKG_BUILD_DIR)/docs/* \ - $(PKG_BUILD_DIR)/{LICENSE,favicon.ico} \ - $(1)/www/webui-aria2 -endef - -$(eval $(call BuildPackage,webui-aria2)) diff --git a/webui-aria2/patches/0001-fix-favicon-path.patch b/webui-aria2/patches/0001-fix-favicon-path.patch deleted file mode 100644 index 2fb174971..000000000 --- a/webui-aria2/patches/0001-fix-favicon-path.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/docs/index.html -+++ b/docs/index.html -@@ -3,7 +3,7 @@ - - - -- -+ - - -