update 2025-01-17 16:24:53

This commit is contained in:
kenzok8 2025-01-17 16:24:53 +08:00
parent 94b5d8abb4
commit bc8be83225
5 changed files with 249 additions and 90 deletions

View File

@ -392,8 +392,7 @@ if (!isEmpty(main_node)) {
if (length(direct_domain_list))
push(config.dns.rules, {
rule_set: 'direct-domain',
server: (routing_mode === 'bypass_mainland_china' ) ? 'china-dns' : 'default-dns',
address_resolver: 'default-dns'
server: (routing_mode === 'bypass_mainland_china' ) ? 'china-dns' : 'default-dns'
});
/* Filter out SVCB/HTTPS queries for "exquisite" Apple devices */
@ -408,6 +407,7 @@ if (!isEmpty(main_node)) {
push(config.dns.servers, {
tag: 'china-dns',
address: china_dns_server,
address_resolver: 'default-dns',
detour: 'direct-out'
});

View File

@ -3,8 +3,8 @@ msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-08-13 16:16+0200\n"
"PO-Revision-Date: 2024-12-20 20:38+0000\n"
"Last-Translator: Oleksandr Nychyporuk <olexandr.nychyporuk@gmail.com>\n"
"PO-Revision-Date: 2025-01-14 15:18+0000\n"
"Last-Translator: Максим Горпиніч <maksimgorpinic2005a@gmail.com>\n"
"Language-Team: Ukrainian <https://hosted.weblate.org/projects/openwrt/"
"luciapplicationstransmission/uk/>\n"
"Language: uk\n"
@ -33,19 +33,19 @@ msgstr "День для альтернативної швидкості"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:280
msgid "Alternative speed time end"
msgstr ""
msgstr "Кінець часу альтернативної швидкості"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:274
msgid "Alternative speed timing enabled"
msgstr ""
msgstr "Увімкнено альтернативну швидкість"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:62
msgid "Alternative upload speed"
msgstr ""
msgstr "Альтернативна швидкість завантаження"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:113
msgid "Automatically start added torrents"
msgstr ""
msgstr "Автоматично запускати додані торренти"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:56
msgid "Bandwidth settings"
@ -65,11 +65,11 @@ msgstr "Список заблокованих увімкнено"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:89
msgid "Blocklist URL"
msgstr ""
msgstr "URL-адреса чорного списку"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:83
msgid "Blocklists"
msgstr ""
msgstr "Чорні списки"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:131
msgid "Cache size in MB"
@ -80,13 +80,12 @@ msgid "Config file directory"
msgstr "Каталог файлів конфігурації"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:53
#, fuzzy
msgid "Custom Web UI directory"
msgstr "Каталог файлів конфігурації"
msgstr "Користувацький каталог веб-інтерфейсу"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:133
msgid "DHT enabled"
msgstr ""
msgstr "DHT увімкнено"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:151
msgid "Debug"
@ -98,15 +97,15 @@ msgstr "Каталог завантажень"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:211
msgid "Download queue enabled"
msgstr ""
msgstr "Черга завантажень увімкнена"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:217
msgid "Download queue size"
msgstr ""
msgstr "Розмір черги завантаження"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:121
msgid "Enable watch directory"
msgstr ""
msgstr "Увімкнути каталог перегляду"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:47
msgid "Enabled"
@ -122,11 +121,11 @@ msgstr "Помилка"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:107
msgid "Fast"
msgstr ""
msgstr "швидко"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:94
msgid "Files and Locations"
msgstr ""
msgstr "Файли та розташування"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:108
msgid "Full"
@ -134,31 +133,31 @@ msgstr ""
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:183
msgid "Global peer limit"
msgstr ""
msgstr "Глобальний ліміт однорангових користувачів"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:44
msgid "Global settings"
msgstr ""
msgstr "Глобальні налаштування"
#: applications/luci-app-transmission/root/usr/share/rpcd/acl.d/luci-app-transmission.json:3
msgid "Grant UCI access for luci-app-transmission"
msgstr ""
msgstr "Надайте доступ UCI для передачі luci-app"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:289
msgid "Idle seeding limit"
msgstr ""
msgstr "Обмеження простою посіву"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:286
msgid "Idle seeding limit enabled"
msgstr ""
msgstr "Увімкнено ліміт простою заповнення"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:102
msgid "Incomplete directory"
msgstr ""
msgstr "Неповний каталог"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:99
msgid "Incomplete directory enabled"
msgstr ""
msgstr "Увімкнено неповний каталог"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:150
msgid "Info"
@ -166,19 +165,19 @@ msgstr "Інформація"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:144
msgid "LPD enabled"
msgstr ""
msgstr "LPD увімкнено"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:141
msgid "Lazy bitfield enabled"
msgstr ""
msgstr "Ледаче бітове поле ввімкнено"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:147
msgid "Message level"
msgstr ""
msgstr "Рівень повідомлення"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:128
msgid "Miscellaneous"
msgstr ""
msgstr "Різне"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:148
msgid "None"
@ -190,6 +189,9 @@ msgid ""
"enabled, add a value. For Sunday - 1, Monday - 2, Tuesday - 4, Wednesday - "
"8, Thursday - 16, Friday - 32, Saturday - 64"
msgstr ""
"Номер/бітове поле. Почніть з 0, потім додайте значення для кожного дня, коли "
"планувальник потрібно ввімкнути. За неділю - 1, понеділок - 2, вівторок - 4, "
"середу - 8, четвер - 16, п'ятницю - 32, суботу - 64"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:106
msgid "Off"
@ -197,104 +199,103 @@ msgstr "Вимк."
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:38
msgid "Open Web Interface"
msgstr ""
msgstr "Відкрити веб-інтерфейс"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:153
msgid "PEX enabled"
msgstr ""
msgstr "PEX увімкнено"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:190
msgid "Peer Port settings"
msgstr ""
msgstr "Параметри однорангового порту"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:178
msgid "Peer congestion algorithm"
msgstr ""
msgstr "Алгоритм перевантаження однорангового вузла"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:185
msgid "Peer limit per torrent"
msgstr ""
msgstr "Ліміт однорангового доступу на торрент"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:193
msgid "Peer port"
msgstr ""
msgstr "Одноранговий порт"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:198
msgid "Peer port random high"
msgstr ""
msgstr "Одноранговий порт випадково високий"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:201
msgid "Peer port random low"
msgstr ""
msgstr "Одноранговий порт випадково низький"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:195
msgid "Peer port random on start"
msgstr ""
msgstr "Одноранговий порт випадковий під час запуску"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:171
msgid "Peer settings"
msgstr ""
msgstr "Налаштування однорангового пристрою"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:187
msgid "Peer socket <abbr title=\"Type of Service\">TOS</abbr>"
msgstr ""
msgstr "Одноранговий сокет <abbr title=\"Type of Service\">TOS</abbr>"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:204
msgid "Port forwarding enabled"
msgstr ""
msgstr "Перенаправлення портів увімкнено"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:105
msgid "Preallocation"
msgstr ""
msgstr "Попередній розподіл"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:138
msgid "Prefer encrypted"
msgstr ""
msgstr "Надаю перевагу зашифрованому"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:137
msgid "Prefer unencrypted"
msgstr ""
msgstr "Віддавайте перевагу незашифрованому"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:156
msgid "Prefetch enabled"
msgstr ""
msgstr "Попередня вибірка ввімкнена"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:214
msgid "Queue stalled enabled"
msgstr ""
msgstr "Черга зупинилася ввімкнено"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:223
msgid "Queue stalled minutes"
msgstr ""
msgstr "Черга зупинилася хвилин"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:208
msgid "Queueing"
msgstr ""
msgstr "Постановка в чергу"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:242
msgid "RPC URL"
msgstr ""
msgstr "RPC URL"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:259
msgid "RPC authentication required"
msgstr ""
msgstr "Потрібна автентифікація RPC"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:236
msgid "RPC bind address"
msgstr ""
msgstr "Адреса прив’язки RPC"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:233
msgid "RPC enabled"
msgstr ""
msgstr "RPC увімкнено"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:249
msgid "RPC host whitelist"
msgstr ""
msgstr "Білий список хостів RPC"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:245
#, fuzzy
msgid "RPC host whitelist enabled"
msgstr "Список заблокованих увімкнено"
msgstr "Білий список хостів RPC увімкнено"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:266
msgid "RPC password"
@ -306,7 +307,7 @@ msgstr "Порт RPC"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:230
msgid "RPC settings"
msgstr ""
msgstr "Налаштування RPC"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:263
msgid "RPC username"
@ -314,31 +315,31 @@ msgstr "Ім'я користувача RPC"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:256
msgid "RPC whitelist"
msgstr ""
msgstr "Білий список RPC"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:252
msgid "RPC whitelist enabled"
msgstr ""
msgstr "Білий список RPC увімкнено"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:295
msgid "Ratio limit"
msgstr ""
msgstr "Ліміт співвідношення"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:292
msgid "Ratio limit enabled"
msgstr ""
msgstr "Обмеження співвідношення ввімкнено"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:181
msgid "Recycle peer id after"
msgstr ""
msgstr "Переробити ідентифікатор однорангового пристрою після"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:110
msgid "Rename partial files"
msgstr ""
msgstr "Перейменувати часткові файли"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:139
msgid "Require encrypted"
msgstr ""
msgstr "Вимагати зашифроване"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:52
msgid "Run daemon as group"
@ -350,43 +351,43 @@ msgstr "Запустити демона від імені користувача
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:271
msgid "Scheduling"
msgstr ""
msgstr "Планування"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:158
msgid "Scrape paused torrents enabled"
msgstr ""
msgstr "Увімкнено скачування призупинених торрентів"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:161
msgid "Script torrent done enabled"
msgstr ""
msgstr "Торрент-скрипт увімкнено"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:164
msgid "Script torrent done filename"
msgstr ""
msgstr "Скрипт torrent done ім'я файлу"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:220
msgid "Seed queue enabled"
msgstr ""
msgstr "Черга заповнення ввімкнена"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:226
msgid "Seed queue size"
msgstr ""
msgstr "Розмір черги насіння"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:71
msgid "Speed limit down"
msgstr ""
msgstr "Обмеження швидкості знижено"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:68
msgid "Speed limit down enabled"
msgstr ""
msgstr "Увімкнено обмеження швидкості"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:77
msgid "Speed limit up"
msgstr ""
msgstr "Обмеження швидкості збільшено"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:74
msgid "Speed limit up enabled"
msgstr ""
msgstr "Увімкнено обмеження швидкості"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:179
msgid ""
@ -394,33 +395,37 @@ msgid ""
"tcp-congestion-control.html\" target=\"_blank\" rel=\"noreferrer noopener"
"\">tcp-congestion-control</a>."
msgstr ""
"Це задокументовано на <a href="
"\"https://www.irif.fr/~jch/software/bittorrent/tcp-congestion-control.html\" "
"target=\"_blank\" rel=\"noreferrer noopener\">tcp-congestion- керування</a>."
#: applications/luci-app-transmission/root/usr/share/luci/menu.d/luci-app-transmission.json:3
#, fuzzy
msgid "Transmission"
msgstr "Transmission"
msgstr "Спосіб передавання"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:42
msgid ""
"Transmission daemon is a simple bittorrent client, here you can configure "
"the settings."
msgstr ""
"Transmission daemon — це простий торрент-клієнт, тут ви можете налаштувати "
"параметри."
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:116
msgid "Trash original torrent files"
msgstr ""
msgstr "Видалити оригінальні торрент-файли"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:80
msgid "Upload slots per torrent"
msgstr ""
msgstr "Завантажувати слоти на торрент"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:124
msgid "Watch directory"
msgstr ""
msgstr "Дивитися каталог"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:274
msgid "When enabled, this will toggle the <b>alt-speed-enabled</b> setting"
msgstr ""
msgstr "Якщо ввімкнено, це перемикатиме параметр <b>alt-speed-enabled</b>"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:181
msgid "hours"
@ -429,8 +434,8 @@ msgstr "годин"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:277
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:280
msgid "in minutes from midnight"
msgstr ""
msgstr "за хвилини з півночі"
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:167
msgid "uTP enabled"
msgstr ""
msgstr "uTP увімкнено"

View File

@ -21,7 +21,7 @@ PKG_LICENSE_FILES:=COPYING
PKG_CPE_ID:=cpe:/a:transmissionbt:transmission
PKG_INSTALL:=1
PKG_BUILD_DEPENDS:=libb64 node/host
PKG_BUILD_DEPENDS:=libb64
PKG_BUILD_PARALLEL:=1
PKG_BUILD_FLAGS:=gc-sections lto
PKG_CONFIG_DEPENDS:= \

View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=vsftpd
PKG_VERSION:=3.0.5
PKG_RELEASE:=2
PKG_RELEASE:=5
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://security.appspot.com/downloads/
@ -49,6 +49,7 @@ endef
define Package/vsftpd/conffiles
/etc/vsftpd.conf
/etc/vsftpd
/etc/config/vsftpd
endef
Package/vsftpd-tls/conffiles=$(Package/vsftpd/conffiles)
@ -96,11 +97,11 @@ define Package/vsftpd/install
$(INSTALL_BIN) ./files/$(PKG_NAME)_prepare $(1)/usr/sbin/
#$(INSTALL_DIR) $(1)/etc
#$(INSTALL_CONF) ./files/$(PKG_NAME).conf $(1)/etc/$(PKG_NAME).conf
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_BIN) ./files/vsftpd.uci $(1)/etc/config/vsftpd
$(INSTALL_DIR) $(1)/etc/init.d
#$(INSTALL_BIN) ./files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME)
$(INSTALL_BIN) ./files/$(PKG_NAME)-uci.init $(1)/etc/init.d/$(PKG_NAME)
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_CONF) ./files/$(PKG_NAME).uci $(1)/etc/config/$(PKG_NAME)
$(INSTALL_DIR) $(1)/etc/vsftpd
endef

View File

@ -2,12 +2,165 @@
# Copyright (C) 2006-2011 OpenWrt.org
START=50
USE_PROCD=1
BIN="/usr/sbin/vsftpd"
start() {
mkdir -m 0755 -p /var/run/vsftpd
service_start /usr/sbin/vsftpd
. /lib/functions.sh
PORT=21
OUTPUT_CONF="/var/etc/vsftpd.conf"
readonly DEFAULT_SECURE_CHROOT="/var/run/vsftpd"
readonly TEMP_OUTPUT_CONF="/var/etc/vsftpd.conf.tmp"
write_conf() {
local key="$1"
local value="$2"
if [ -n "$key" ] && [ -n "$value" ]; then
echo "$key=$value" >> "$TEMP_OUTPUT_CONF"
fi
}
stop() {
service_stop /usr/sbin/vsftpd
write_conf_bool() {
local key="$1"
local value="$2"
if [ "$value" = "1" ]; then
write_conf "$key" "YES"
else
write_conf "$key" "NO"
fi
}
validate_vsftpd_section() {
uci_load_validate vsftpd global "$1" "$2" \
'listen:bool:1' \
'listen_ipv6:bool:0' \
'listen_port:port' \
'anonymous_enable:bool:0' \
'anon_root:directory' \
'local_enable:bool:1' \
'local_root:directory' \
'write_enable:bool:1' \
'local_umask:uinteger:022' \
'check_shell:bool:0' \
'dirmessage_enable:bool:1' \
'secure_chroot_dir:directory' \
'ftpd_banner:string' \
'session_support:bool:0' \
'syslog_enable:bool' \
'userlist_enable:bool' \
'userlist_deny:bool' \
'userlist_file:file' \
'xferlog_enable:bool' \
'xferlog_file:file' \
'xferlog_std_format:bool' \
'ssl_enable:bool' \
'allow_anon_ssl:bool' \
'force_local_data_ssl:bool' \
'force_local_logins_ssl:bool' \
'ssl_tlsv1:bool' \
'ssl_sslv2:bool' \
'ssl_sslv3:bool' \
'rsa_cert_file:file' \
'rsa_private_key_file:file'
}
setup_vsftpd() {
local section="$1"
local validation_result="$2"
if [ "$validation_result" != "0" ]; then
echo "Validation failed for section: $section"
return 1
fi
# Clean up
rm -rf "$TEMP_OUTPUT_CONF" # Clear temporary file
touch "$TEMP_OUTPUT_CONF"
# always run in foreground
write_conf_bool "background" "0"
[ -n "$listen" ] && write_conf_bool "listen" "$listen"
[ -n "$listen_ipv6" ] && write_conf_bool "listen_ipv6" "$listen_ipv6"
[ -n "$anonymous_enable" ] && write_conf_bool "anonymous_enable" "$anonymous_enable"
[ -n "$local_enable" ] && write_conf_bool "local_enable" "$local_enable"
[ -n "$write_enable" ] && write_conf_bool "write_enable" "$write_enable"
[ -n "$check_shell" ] && write_conf_bool "check_shell" "$check_shell"
[ -n "$dirmessage_enable" ] && write_conf_bool "dirmessage_enable" "$dirmessage_enable"
[ -n "$session_support" ] && write_conf_bool "session_support" "$session_support"
[ -n "$syslog_enable" ] && write_conf_bool "syslog_enable" "$syslog_enable"
[ -n "$userlist_enable" ] && write_conf_bool "userlist_enable" "$userlist_enable"
[ -n "$userlist_deny" ] && write_conf_bool "userlist_deny" "$userlist_deny"
[ -n "$xferlog_enable" ] && write_conf_bool "xferlog_enable" "$xferlog_enable"
[ -n "$xferlog_std_format" ] && write_conf_bool "xferlog_std_format" "$xferlog_std_format"
[ -n "$ssl_enable" ] && write_conf_bool "ssl_enable" "$ssl_enable"
[ -n "$allow_anon_ssl" ] && write_conf_bool "allow_anon_ssl" "$allow_anon_ssl"
[ -n "$force_local_data_ssl" ] && write_conf_bool "force_local_data_ssl" "$force_local_data_ssl"
[ -n "$force_local_logins_ssl" ] && write_conf_bool "force_local_logins_ssl" "$force_local_logins_ssl"
[ -n "$ssl_tlsv1" ] && write_conf_bool "ssl_tlsv1" "$ssl_tlsv1"
[ -n "$ssl_sslv2" ] && write_conf_bool "ssl_sslv2" "$ssl_sslv2"
[ -n "$ssl_sslv3" ] && write_conf_bool "ssl_sslv3" "$ssl_sslv3"
[ -n "$anon_root" ] && write_conf "anon_root" "$anon_root"
[ -n "$ftpd_banner" ] && write_conf "ftpd_banner" "$ftpd_banner"
[ -n "$listen_port" ] && { write_conf "listen_port" "$listen_port"; PORT="$listen_port"; }
[ -n "$local_umask" ] && write_conf "local_umask" "$local_umask"
[ -n "$local_root" ] && write_conf "local_root" "$local_root"
[ -n "$rsa_cert_file" ] && write_conf "rsa_cert_file" "$rsa_cert_file"
[ -n "$rsa_private_key_file" ] && write_conf "rsa_private_key_file" "$rsa_private_key_file"
[ -n "$userlist_file" ] && write_conf "userlist_file" "$userlist_file"
[ -n "$xferlog_file" ] && write_conf "xferlog_file" "$xferlog_file"
if [ -n "$secure_chroot_dir" ] && [ "$secure_chroot_dir" != "$DEFAULT_SECURE_CHROOT" ]; then
# remove the DEFAULT_SECURE_CHROOT directory
# it is not needed now
rm -rf "$DEFAULT_SECURE_CHROOT"
write_conf "secure_chroot_dir" "$secure_chroot_dir"
fi
# move temporary file to the main configuration file
mv "$TEMP_OUTPUT_CONF" "$OUTPUT_CONF"
}
start_service() {
local disabled mdns conf_file
# Load UCI configuration for vsftpd
config_load vsftpd
# if disabled, just return
config_get_bool disabled global disabled 0
if [ "${disabled}" -eq 1 ]; then
return
fi
# clean and create the default chroot directory
rm -rf "$DEFAULT_SECURE_CHROOT"
mkdir -m 0755 -p "$DEFAULT_SECURE_CHROOT"
chown root:root "$DEFAULT_SECURE_CHROOT"
config_get_bool conf_file global conf_file ""
if [ -n "$conf_file" ]; then
# use user defined conf file instead of UCI
OUTPUT_CONF="$conf_file"
else
# Process the global configuration
config_foreach validate_vsftpd_section global setup_vsftpd
fi
procd_open_instance "vsftpd"
config_get_bool mdns global mdns 0
[ "${mdns}" -eq 1 ] && procd_add_mdns "ftp" "tcp" "$PORT" "daemon=vsftpd"
procd_set_param command "$BIN" "$OUTPUT_CONF"
procd_set_param respawn
procd_close_instance
}
service_triggers() {
procd_add_reload_trigger "vsftpd"
procd_add_validation validate_vsftpd_section
}