luci-app-homeproxy: sync upstream

last commit: 8d79f403a1
This commit is contained in:
gitea-action 2024-10-29 23:30:18 +08:00
parent f8a76a93c2
commit 570e37cd3c
4 changed files with 20 additions and 3 deletions

View File

@ -63,6 +63,16 @@ return baseclass.extend({
'1.3' '1.3'
], ],
CBIStaticList: form.DynamicList.extend({
__name__: 'CBI.StaticList',
renderWidget: function(/* ... */) {
var dl = form.DynamicList.prototype.renderWidget.apply(this, arguments);
dl.querySelector('.add-item ul > li[data-value="-"]').remove();
return dl;
}
}),
calcStringMD5: function(e) { calcStringMD5: function(e) {
/* Thanks to https://stackoverflow.com/a/41602636 */ /* Thanks to https://stackoverflow.com/a/41602636 */
function h(a, b) { function h(a, b) {

View File

@ -1004,7 +1004,7 @@ function renderNodeSettings(section, data, features, main_node, routing_mode) {
o.depends('tls', '1'); o.depends('tls', '1');
o.modalonly = true; o.modalonly = true;
o = s.option(form.MultiValue, 'tls_cipher_suites', _('Cipher suites'), o = s.option(hp.CBIStaticList, 'tls_cipher_suites', _('Cipher suites'),
_('The elliptic curves that will be used in an ECDHE handshake, in preference order. If empty, the default will be used.')); _('The elliptic curves that will be used in an ECDHE handshake, in preference order. If empty, the default will be used.'));
for (var i of hp.tls_cipher_suites) for (var i of hp.tls_cipher_suites)
o.value(i); o.value(i);

View File

@ -568,7 +568,7 @@ return view.extend({
o.depends('tls', '1'); o.depends('tls', '1');
o.modalonly = true; o.modalonly = true;
o = s.option(form.MultiValue, 'tls_cipher_suites', _('Cipher suites'), o = s.option(hp.CBIStaticList, 'tls_cipher_suites', _('Cipher suites'),
_('The elliptic curves that will be used in an ECDHE handshake, in preference order. If empty, the default will be used.')); _('The elliptic curves that will be used in an ECDHE handshake, in preference order. If empty, the default will be used.'));
for (var i of hp.tls_cipher_suites) for (var i of hp.tls_cipher_suites)
o.value(i); o.value(i);

View File

@ -14,7 +14,14 @@ PROG="/usr/bin/sing-box"
HP_DIR="/etc/homeproxy" HP_DIR="/etc/homeproxy"
RUN_DIR="/var/run/homeproxy" RUN_DIR="/var/run/homeproxy"
LOG_PATH="$RUN_DIR/homeproxy.log" LOG_PATH="$RUN_DIR/homeproxy.log"
# we don't know which is the default server, just take the first one
DNSMASQ_UCI_CONFIG="$(uci -q show "dhcp.@dnsmasq[0]" | awk 'NR==1 {split($0, conf, /[.=]/); print conf[2]}')"
if [ -f "/tmp/etc/dnsmasq.conf.$DNSMASQ_UCI_CONFIG" ]; then
DNSMASQ_DIR="$(awk -F '=' '/^conf-dir=/ {print $2}' "/tmp/etc/dnsmasq.conf.$DNSMASQ_UCI_CONFIG")/dnsmasq-homeproxy.d"
else
DNSMASQ_DIR="/tmp/dnsmasq.d/dnsmasq-homeproxy.d" DNSMASQ_DIR="/tmp/dnsmasq.d/dnsmasq-homeproxy.d"
fi
log() { log() {
echo -e "$(date "+%Y-%m-%d %H:%M:%S") [DAEMON] $*" >> "$LOG_PATH" echo -e "$(date "+%Y-%m-%d %H:%M:%S") [DAEMON] $*" >> "$LOG_PATH"