🌴 Sync 2026-03-05 23:51:42
No files matched your search
@@ -0,0 +1,2 @@
|
||||
# Auto detect text files and perform LF normalization
|
||||
* text=auto
|
||||
@@ -0,0 +1,201 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
@@ -0,0 +1,60 @@
|
||||
# Copyright 2023- Douglas Orend <doug.orend2@gmail.com>
|
||||
# This is free software, licensed under the Apache License, Version 2.0
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_LICENSE:=Apache-2.0
|
||||
PKG_NAME:=luci-app-squid-adv
|
||||
PKG_VERSION:=2.0
|
||||
PKG_RELEASE:=1
|
||||
PKG_MAINTAINER:=Douglas Orend <doug.orend2@gmail.com>
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/luci-app-squid-adv
|
||||
SECTION:=luci
|
||||
CATEGORY:=LuCI
|
||||
SUBMENU:=3. Applications
|
||||
TITLE:=Advanced LuCI support for Squid
|
||||
PKGARCH:=all
|
||||
DEPENDS:=+squid +luci-base
|
||||
endef
|
||||
|
||||
define Package/luci-app-squid-adv/description
|
||||
LuCI Support for Squid, complete with Transparent Proxy support for both HTTP and HTTPS!
|
||||
endef
|
||||
|
||||
define Package/luci-app-squid-adv/conffiles
|
||||
/www/ca/
|
||||
/etc/squid/cert/
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/luci-app-squid-adv/install
|
||||
$(INSTALL_DIR) $(1)/www/luci-static/resources/view/squid-adv/
|
||||
$(INSTALL_DATA) ./htdocs/*.js $(1)/www/luci-static/resources/view/squid-adv/
|
||||
|
||||
$(INSTALL_DIR) $(1)/www/luci-static/resources/view/squid-adv/svg/
|
||||
$(INSTALL_DATA) ./htdocs/svg/*.svg $(1)/www/luci-static/resources/view/squid-adv/svg/
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/libexec/rpcd/
|
||||
$(INSTALL_BIN) ./files/luci.squid-adv $(1)/usr/libexec/rpcd/
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) ./files/squid.uci-defaults $(1)/etc/uci-defaults/99-luci-app-squid-adv
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/share/luci/menu.d/
|
||||
$(INSTALL_DATA) ./files/luci-menu.d.json $(1)/usr/share/luci/menu.d/luci-app-squid-adv.json
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/share/rpcd/acl.d
|
||||
$(INSTALL_DATA) ./files/rpc-acl.d.json $(1)/usr/share/rpcd/acl.d/luci-app-squid-adv.json
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,luci-app-squid-adv))
|
||||
@@ -0,0 +1,18 @@
|
||||
# luci-app-nodogsplash
|
||||
|
||||
Package for luci-app-nodogsplash for OpenWRT
|
||||
|
||||
### Status Tab
|
||||

|
||||
|
||||
### General Tab
|
||||

|
||||
|
||||
### MAC Filter Tab
|
||||

|
||||
|
||||
### Firewall Tab
|
||||

|
||||
|
||||
### Advanced Tab
|
||||

|
||||
@@ -0,0 +1,56 @@
|
||||
{
|
||||
"admin/services/squid": {
|
||||
"title": "Squid",
|
||||
"action": {
|
||||
"type": "firstchild"
|
||||
},
|
||||
"depends": {
|
||||
"acl": [
|
||||
"luci-app-squid-adv"
|
||||
],
|
||||
"uci": {
|
||||
"squid": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"admin/services/squid/general": {
|
||||
"title": "General",
|
||||
"order": 10,
|
||||
"action": {
|
||||
"type": "view",
|
||||
"path": "squid-adv/general"
|
||||
}
|
||||
},
|
||||
"admin/services/squid/transparent": {
|
||||
"title": "Transparent Proxy",
|
||||
"order": 20,
|
||||
"action": {
|
||||
"type": "view",
|
||||
"path": "squid-adv/transparent"
|
||||
}
|
||||
},
|
||||
"admin/services/squid/openssl": {
|
||||
"title": "OpenSSL Cert",
|
||||
"order": 30,
|
||||
"action": {
|
||||
"type": "view",
|
||||
"path": "squid-adv/openssl"
|
||||
}
|
||||
},
|
||||
"admin/services/squid/installation": {
|
||||
"title": "How To Install",
|
||||
"order": 40,
|
||||
"action": {
|
||||
"type": "view",
|
||||
"path": "squid-adv/install"
|
||||
}
|
||||
},
|
||||
"admin/services/squid/advanced": {
|
||||
"title": "Advanced",
|
||||
"order": 50,
|
||||
"action": {
|
||||
"type": "view",
|
||||
"path": "squid-adv/advanced"
|
||||
}
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,195 @@
|
||||
#!/bin/sh
|
||||
. /usr/share/libubox/jshn.sh
|
||||
. /lib/functions.sh
|
||||
CERTS=/etc/squid/cert
|
||||
FILE=/tmp/luci.squid-adv.tmp
|
||||
CONF=$(uci get squid.@squid[0].config_file)
|
||||
trap 'rm ${FILE} 2> /dev/null' EXIT
|
||||
|
||||
##########################################################################################################
|
||||
# Function to check firewall to see if proxy firewall rule is setup correctly:
|
||||
##########################################################################################################
|
||||
check_firewall() {
|
||||
src_port=$1
|
||||
dst_port=$2
|
||||
dst_ip=${dst_port%:*}
|
||||
dst_port=${dst_port#*:}
|
||||
[[ "${dst_port}" == "${dst_ip}" ]] && dst_ip=${ip_addr}
|
||||
[[ "$src_port" -eq 80 ]] && proto=HTTP || proto=HTTPS
|
||||
|
||||
# Does the firewall settings need to be changed? If not, abort:
|
||||
uci -q show firewall.tproxy_${src_port} > ${FILE}
|
||||
CUR_ZONE=$(grep ".src=" ${FILE} | cut -d= -f 2 | sed "s|'||g")
|
||||
CUR_PORT=$(grep ".dest_port=" ${FILE} | cut -d= -f 2 | sed "s|'||g")
|
||||
CUR_SRC=$(grep ".src_dip=" ${FILE} | cut -d= -f 2 | sed "s|'||g" | sed "s|\!||g")
|
||||
CUR_DST=$(grep ".dest_ip=" ${FILE} | cut -d= -f 2 | sed "s|'||g")
|
||||
[[ "${CUR_ZONE}" == "${zone}" && "${CUR_PORT}" == "${http_port}" && "${CUR_SRC}" == "${ip_addr}" && "${CUR_DST}" == "${ip_addr}" ]] && return
|
||||
|
||||
# Setup transparent proxy firewall rules for specified outgoing port:
|
||||
uci -q delete firewall.tproxy_${src_port}
|
||||
uci set firewall.tproxy_${src_port}='redirect'
|
||||
uci set firewall.tproxy_${src_port}.name="$(echo ${interface} | tr 'a-z' 'A-Z') ${proto} to Squid"
|
||||
uci set firewall.tproxy_${src_port}.src="${interface}"
|
||||
uci set firewall.tproxy_${src_port}.proto="tcp"
|
||||
uci set firewall.tproxy_${src_port}.src_dport="${src_port}"
|
||||
uci set firewall.tproxy_${src_port}.dest_port="${dst_port}"
|
||||
uci set firewall.tproxy_${src_port}.src_dip='!'${dst_ip}
|
||||
uci set firewall.tproxy_${src_port}.dest_ip="${dst_ip}"
|
||||
uci set firewall.tproxy_${src_port}.target="dnat"
|
||||
}
|
||||
|
||||
##########################################################################################################
|
||||
# Main code
|
||||
##########################################################################################################
|
||||
case "$1" in
|
||||
list)
|
||||
json_init
|
||||
json_add_object "cert_info"
|
||||
json_close_object
|
||||
json_add_object "reconfigure"
|
||||
json_close_object
|
||||
json_add_object "generate"
|
||||
json_add_string 'bits' 'Integer'
|
||||
json_add_string 'days' 'Integer'
|
||||
json_add_string 'countryName' 'String'
|
||||
json_add_int 'stateOrProvinceName' 'String'
|
||||
json_add_string 'localityName' 'String'
|
||||
json_add_int 'organizationName' 'String'
|
||||
json_close_object
|
||||
json_add_object "ip_info"
|
||||
json_close_object
|
||||
json_add_object "parse_config"
|
||||
json_close_object
|
||||
json_dump
|
||||
;;
|
||||
|
||||
############################################################################################
|
||||
config)
|
||||
case "$2" in
|
||||
####################################################################################
|
||||
read)
|
||||
cat ${CONF}
|
||||
;;
|
||||
|
||||
####################################################################################
|
||||
move)
|
||||
mv /tmp/luci-app-squid-adv.data ${CONF}
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
|
||||
############################################################################################
|
||||
call)
|
||||
case "$2" in
|
||||
####################################################################################
|
||||
parse_config)
|
||||
# Determine which interface zone current configuration is using:
|
||||
echo -n "{"
|
||||
IFACE=$(uci -q show firewall.tproxy_80.src | cut -d= -f 2 | sed "s|'||g")
|
||||
[[ -z "${IFACE}" ]] && IFACE=$(uci -q show firewall.tproxy_443.src | cut -d= -f 2 | sed "s|'||g")
|
||||
echo -n "\"interface\":\"${IFACE}\","
|
||||
|
||||
# Determine if transparent HTTP proxy is in use:
|
||||
echo -n "\"http_port\":\"$(grep "^http_port .* intercept$" ${SRC} | awk '{print $2}')\","
|
||||
|
||||
# Determine if transparent HTTPS proxy is in use:
|
||||
echo "\"https_port\":\"$(grep "^http_port .* intercept .*ssl-bump" ${SRC} | awk '{print $2}')\"}"
|
||||
;;
|
||||
|
||||
####################################################################################
|
||||
reconfigure)
|
||||
# Get the settings we need for this action:
|
||||
config_load squid
|
||||
config_get interface transparent interface
|
||||
config_get http_enabled transparent http_enabled
|
||||
config_get http_port transparent http_port
|
||||
config_get https_enabled transparent https_enabled
|
||||
config_get https_port transparent https_port
|
||||
|
||||
# Specify defaults if not specified, then get IP address of specified interface:
|
||||
interface=${interface:-"lan"}
|
||||
http_port=${http_port:-"3126"}
|
||||
https_port=${https_port:-"3127"}
|
||||
ip_addr=$(uci get network.${interface}.ipaddr)
|
||||
|
||||
# Update HTTP intercept lines in "squid.conf":
|
||||
if [[ "${http_enabled}" != "1" ]]; then
|
||||
uci -q delete firewall.tproxy_80
|
||||
sed -i "/^http_port .* intercept$/d" ${CONF}
|
||||
else
|
||||
check_firewall 80 ${http_port}
|
||||
sed -i "/^http_port .* intercept$/d" ${CONF}
|
||||
echo "http_port ${http_port} intercept" >> ${CONF}
|
||||
fi
|
||||
|
||||
# Update HTTPS intercept lines in "squid.conf":
|
||||
if [[ "${https_enabled}" != "1" ]]; then
|
||||
uci -q delete firewall.tproxy_443
|
||||
sed -i "/^http_port .* intercept.*ssl-bump/d" ${CONF}
|
||||
else
|
||||
check_firewall 443 ${https_port}
|
||||
sed -i "/^http_port .* intercept.*ssl-bump/d" ${CONF}
|
||||
echo "http_port ${https_port} intercept tcpkeepalive=60,30,3 ssl-bump generate-host-certificates=on dynamic_cert_mem_cache_size=4MB cert=${CERTS}/ca.pem key=${CERTS}/ca.key cipher=HIGH:MEDIUM:!LOW:!RC4:!SEED:!IDEA:!3DES:!MD5:!EXP:!PSK:!DSS options=NO_TLSv1,NO_SSLv3 tls-dh=prime256v1:${CERTS}/dhparam.pem" >> ${CONF}
|
||||
fi
|
||||
|
||||
# Restart services as required:
|
||||
uci commit firewall
|
||||
/sbin/service firewall restart
|
||||
;;
|
||||
|
||||
####################################################################################
|
||||
generate)
|
||||
read input
|
||||
json_load "$input"
|
||||
json_get_var bits "bits"
|
||||
json_get_var days "days"
|
||||
json_get_var country "country"
|
||||
json_get_var state "state"
|
||||
json_get_var locality "locality"
|
||||
json_get_var organization "organization"
|
||||
|
||||
# Generate OpenSSL certificates, using defaults if option is not set:
|
||||
mkdir -p ${CERTS}
|
||||
rm ${CERTS}/ca.* 2> /dev/null
|
||||
openssl req -new -x509 -newkey rsa:${bits} -days ${days} -nodes -keyout ${CERTS}/ca.key -out ${CERTS}/ca.pem -subj "/C=${country}/ST=${state}/L=${locality}/O=${organization}" 2>&1
|
||||
openssl x509 -in ${CERTS}/ca.pem -outform DER -out ${CERTS}/ca.der 2>&1
|
||||
openssl pkcs12 -export -out ${CERTS}/ca.p12 -in ${CERTS}/ca.pem -inkey ${CERTS}/ca.key -passout pass: -nokeys 2>&1
|
||||
chmod 0644 ${CERTS}/ca.*
|
||||
chmod 0600 ${CERTS}/ca.key
|
||||
|
||||
# Generate needed symlinks to make the web portion work properly:
|
||||
DST=/www/ca
|
||||
mkdir -p ${DST}
|
||||
ln -sf ${CERTS}/ca.der ${DST}/squid-ca.cer
|
||||
ln -sf ${CERTS}/ca.pem ${DST}/squid-ca.pem
|
||||
ln -sf ${CERTS}/ca.p12 ${DST}/squid-ca.p12
|
||||
;;
|
||||
|
||||
####################################################################################
|
||||
cert_info)
|
||||
VALID=false
|
||||
test -f ${CERTS}/ca.pem && openssl x509 -noout -subject -in ${CERTS}/ca.pem -nameopt multiline -checkdates -dates -dateopt iso_8601 > ${FILE} && VALID=true
|
||||
echo -n "{"
|
||||
if [[ "${VALID}" == "true" ]]; then
|
||||
cat ${FILE} | while read LINE; do
|
||||
VAR=$(echo "${LINE%%=*}" | xargs)
|
||||
VAL="$(echo "${LINE#*=}" | xargs)"
|
||||
[[ "${#VAL}" -gt 0 ]] && echo -n "\"${VAR}\":\"${VAL}\","
|
||||
if [[ "${VAR}" == "notBefore" || "${VAR}" == "notAfter" ]]; then
|
||||
VAL=$(echo "${VAL}" | sed "s/[[:alpha:]]//g")
|
||||
[[ "${VAR}" == "notBefore" ]] && DAYS=$(date -d"${VAL}" +%s)
|
||||
[[ "${VAR}" == "notAfter" ]] && echo -n "\"days\":\"$(( ($(date -d"${VAL}" +%s) - ${DAYS}) / (60*60*24) ))\","
|
||||
fi
|
||||
done
|
||||
echo -n "\"bits\":\"$(openssl x509 -noout -in ${CERTS}/ca.pem -text | grep "Public-Key" | grep -o "[0-9]*")\","
|
||||
fi
|
||||
echo "\"valid\":${VALID}}"
|
||||
;;
|
||||
|
||||
####################################################################################
|
||||
ip_info)
|
||||
curl ipinfo.io 2> /dev/null || echo "{}"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"luci-app-squid-adv": {
|
||||
"description": "Grant permissions for the Squid LuCI app",
|
||||
"read": {
|
||||
"ubus": {
|
||||
"luci.squid-adv": [
|
||||
"cert_info",
|
||||
"reconfigure",
|
||||
"generate",
|
||||
"ip_info",
|
||||
"parse_config",
|
||||
]
|
||||
},
|
||||
"uci": [
|
||||
"squid",
|
||||
],
|
||||
"file": {
|
||||
"/usr/libexec/rpcd/luci.squid-adv config read": [ "exec" ],
|
||||
},
|
||||
},
|
||||
"write": {
|
||||
"uci": [
|
||||
"squid",
|
||||
],
|
||||
"file": {
|
||||
"/tmp/luci-app-squid-adv.data": [ "write" ],
|
||||
"/usr/libexec/rpcd/luci.squid-adv config move": [ "exec" ],
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
[ ! -f "/usr/share/ucitrack/luci-app-squid.json" ] && {
|
||||
cat > /usr/share/ucitrack/luci-app-squid.json << EEOF
|
||||
{
|
||||
"config": "squid",
|
||||
"init": "squid"
|
||||
}
|
||||
EEOF
|
||||
}
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
delete ucitrack.@squid[-1]
|
||||
add ucitrack squid
|
||||
set ucitrack.@squid[-1].init=squid
|
||||
commit ucitrack
|
||||
set squid.transparent='transparent'
|
||||
commit squid
|
||||
EOF
|
||||
exit 0
|
||||
@@ -0,0 +1,31 @@
|
||||
'use strict';
|
||||
'require fs';
|
||||
'require view';
|
||||
'require form';
|
||||
|
||||
return view.extend({
|
||||
// Rendering function:
|
||||
render: function(data) {
|
||||
var s, o, m, t;
|
||||
m = new form.Map('squid', _('Advanced Settings'));
|
||||
|
||||
s = m.section(form.TypedSection, 'squid');
|
||||
s.anonymous = true;
|
||||
|
||||
o = s.option(form.TextValue, "squid_config_file")
|
||||
o.wrap = "off"
|
||||
o.rows = 25
|
||||
o.rmempty = false
|
||||
o.cfgvalue = function() {
|
||||
return fs.exec_direct("/usr/libexec/rpcd/luci.squid-adv", [ "config", "read" ]);
|
||||
}
|
||||
o.write = function() {
|
||||
return Promise.all([
|
||||
fs.write( "/tmp/luci-app-squid-adv.data", document.getElementById("widget.cbid.squid.squid.squid_config_file").value ),
|
||||
fs.exec_direct("/usr/libexec/rpcd/luci.squid-adv", [ "config", "move" ]),
|
||||
]);
|
||||
}
|
||||
|
||||
return m.render();
|
||||
},
|
||||
})
|
||||
@@ -0,0 +1,37 @@
|
||||
'use strict';
|
||||
'require view';
|
||||
'require form';
|
||||
|
||||
return view.extend({
|
||||
// Validate whether string passed is a valid IP/Port combination or just a valid Port:
|
||||
validate_ip: function(section_id, value) {
|
||||
var ipv4 = /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?):(6553[0-5]|655[0-2][0-9]|65[0-4][0-9][0-9]|6[0-4][0-9][0-9][0-9][0-9]|[1-5](\d){4}|[1-9](\d){0,3})$/;
|
||||
var ipv6 = /^(?:(?:[a-fA-F\d]{1,4}:){7}(?:[a-fA-F\d]{1,4}|:)|(?:[a-fA-F\d]{1,4}:){6}(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|:[a-fA-F\d]{1,4}|:)|(?:[a-fA-F\d]{1,4}:){5}(?::(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,2}|:)|(?:[a-fA-F\d]{1,4}:){4}(?:(?::[a-fA-F\d]{1,4}){0,1}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,3}|:)|(?:[a-fA-F\d]{1,4}:){3}(?:(?::[a-fA-F\d]{1,4}){0,2}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,4}|:)|(?:[a-fA-F\d]{1,4}:){2}(?:(?::[a-fA-F\d]{1,4}){0,3}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,5}|:)|(?:[a-fA-F\d]{1,4}:){1}(?:(?::[a-fA-F\d]{1,4}){0,4}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,6}|:)|(?::(?:(?::[a-fA-F\d]{1,4}){0,5}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,7}|:)))(?:%[0-9a-zA-Z]{1,})?$/gm;
|
||||
var port_only = /^(6553[0-5]|655[0-2][0-9]|65[0-4][0-9][0-9]|6[0-4][0-9][0-9][0-9][0-9]|[1-5](\d){4}|[1-9](\d){0,3})$/;
|
||||
if (ipv4.test(value) || ipv6.test(value) || port_only.test(value)) {
|
||||
return true;
|
||||
} else {
|
||||
return _("Invalid IP/Port or Port Range");
|
||||
}
|
||||
},
|
||||
|
||||
// Rendering function:
|
||||
render: function() {
|
||||
var s, o, m, t;
|
||||
m = new form.Map('squid', _('Squid Proxy Settings'));
|
||||
|
||||
s = m.section(form.TypedSection, 'squid');
|
||||
s.anonymous = true;
|
||||
|
||||
o = s.option(form.Value, 'http_port', _('Regular Squid Proxy Port'));
|
||||
o.validate = this.validate_ip;
|
||||
|
||||
o = s.option(form.Value, "visible_hostname", _("Visible Hostname"))
|
||||
o.placeholder = "OpenWrt"
|
||||
|
||||
o = s.option(form.Value, "coredump_dir", _("Coredump files directory"))
|
||||
o.placeholder = "/tmp/squid"
|
||||
|
||||
return m.render();
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,207 @@
|
||||
'use strict';
|
||||
'require view';
|
||||
'require form';
|
||||
|
||||
return view.extend({
|
||||
render: function() {
|
||||
var s, o, m, t;
|
||||
m = new form.Map('squid', _('How To Install Certificate'), _('Other squid users cannot intercept your connection. This page is served by your OpenWrt squid LuCI application. The certificate you are about to install has been uniquely generated by the LuCI squid application and is not shared between squid installations. '));
|
||||
|
||||
s = m.section(form.TypedSection, 'squid');
|
||||
s.anonymous = true;
|
||||
|
||||
o = s.option( form.DummyValue, 'meh');
|
||||
o.renderWidget = function() {
|
||||
return E([], [
|
||||
E('style', {}, [
|
||||
'.media { min-height: 110px; vertical-align: top; }',
|
||||
'.media-img { width: 64px; margin-right: 1rem !important; margin: 10px; vertical-align: top; }',
|
||||
'.media-body { padding-top: 1rem; padding-bottom: 1rem; margin-top: -20px; }',
|
||||
'.instructions { padding-top: 1rem; padding-bottom: 1rem; }',
|
||||
'.show-instructions:target, .hide-instructions, .instructions { display: none; }',
|
||||
'.show-instructions:target ~ .hide-instructions { display: inline-block; }',
|
||||
'.show-instructions:target ~ .instructions { display: inherit; }',
|
||||
'h4 { margin: 0; }',
|
||||
'h5 { margin: 0; }',
|
||||
]),
|
||||
E('table', { 'width': '100%' }, [
|
||||
E('tr', {}, [
|
||||
E('th', { 'style': 'width: 96px' }, ''),
|
||||
E('th', { 'style': 'width: 100%' }, ''),
|
||||
]),
|
||||
E('tr', {}, [
|
||||
E('td', { 'class': 'media-img' }, [
|
||||
E('img', { 'class': 'media-img', 'src': '/luci-static/resources/view/squid-adv/svg/windows.svg' }, ''),
|
||||
]),
|
||||
E('td', { 'class': 'media-body' }, [
|
||||
E('h4', {}, 'Windows'),
|
||||
E('a', { 'class': 'btn btn-sm cbi-button-apply', 'href': '/ca/squid-ca.p12' }, '🔏 ' + _('Get') + ' squid-ca.p12'), ' ',
|
||||
E('a', { 'class': 'btn btn-sm cbi-button show-instructions', 'href': '#Windows', 'id': 'Windows' }, _('Show Instructions')),
|
||||
E('a', { 'class': 'btn btn-sm btn-info hide-instructions', 'href': '#' }, '📖 ' + _('Hide Instructions')),
|
||||
E('div', { 'class': 'instructions' }, [
|
||||
E('h5', {}, _('Manual Installation')),
|
||||
E('ol', {}, [
|
||||
E('li', {}, _('Double-click the P12 file to start the import wizard.')),
|
||||
E('li', {}, _('Select a certificate store location. This determines who will trust the certificate – only the current Windows user or everyone on the machine. Click Next')),
|
||||
E('li', {}, _('Click Next again.')),
|
||||
E('li', {}, _('Leave Password blank and click Next.')),
|
||||
E('li', {}, _('Select Place all certificates in the following store, then click Browse, and select Trusted Root Certification Authorities.') + '<br>' + _('Click OK and Next.')),
|
||||
E('li', {}, _('Click Finish.')),
|
||||
E('li', {}, _('Click Yes to confirm the warning dialog.')),
|
||||
]),
|
||||
E('br'),
|
||||
E('h5', {}, _('Automated Installation')),
|
||||
E('ol', {}, [
|
||||
E('li', {}, [
|
||||
E('code', {}, 'certutil.exe -addstore root squid-ca.cer'),
|
||||
' (', E('a', { 'href': 'https://technet.microsoft.com/en-us/library/cc732443.aspx' }, _('details')), ')',
|
||||
]),
|
||||
]),
|
||||
]),
|
||||
]),
|
||||
]),
|
||||
E('tr', {}, [
|
||||
E('td', { 'class': 'media-img' }, [
|
||||
E('img', { 'class': 'media-img', 'src': '/luci-static/resources/view/squid-adv/svg/linux.svg' }, ''),
|
||||
]),
|
||||
E('td', { 'class': 'media-body' }, [
|
||||
E('h4', {}, 'Linux'),
|
||||
E('a', { 'class': 'btn btn-sm cbi-button-apply', 'href': '/ca/squid-ca.pem' }, '🔏 ' + _('Get') + ' squid-ca.pem'), ' ',
|
||||
E('a', { 'class': 'btn btn-sm cbi-button show-instructions', 'href': '#Linux', 'id': 'Linux' }, _('Show Instructions')),
|
||||
E('a', { 'class': 'btn btn-sm btn-info hide-instructions', 'href': '#' }, '📖 ' + _('Hide Instructions')),
|
||||
E('div', { 'class': 'instructions' }, [
|
||||
E('h5', {}, 'Ubuntu/Debian'),
|
||||
E('ol', {}, [
|
||||
E('li', {}, [ E('code', {}, 'mv squid-ca.pem /usr/local/share/ca-certificates/squid.crt') ]),
|
||||
E('li', {}, [ E('code', {}, 'sudo update-ca-certificates') ]),
|
||||
]),
|
||||
E('br'),
|
||||
E('h5', {}, 'Fedora'),
|
||||
E('ol', {}, [
|
||||
E('li', {}, [ E('code', {}, 'mv squid-ca.pem /etc/pki/ca-trust/source/anchors/') ]),
|
||||
E('li', {}, [ E('code', {}, 'sudo update-ca-trust') ]),
|
||||
]),
|
||||
]),
|
||||
]),
|
||||
]),
|
||||
E('tr', {}, [
|
||||
E('td', { 'class': 'media-img' }, [
|
||||
E('img', { 'class': 'media-img', 'src': '/luci-static/resources/view/squid-adv/svg/mac.svg' }, ''),
|
||||
]),
|
||||
E('td', { 'class': 'media-body' }, [
|
||||
E('h4', {}, 'Mac'),
|
||||
E('a', { 'class': 'btn btn-sm cbi-button-apply', 'href': '/ca/squid-ca.pem' }, '🔏 ' + _('Get') + ' squid-ca.pem'), ' ',
|
||||
E('a', { 'class': 'btn btn-sm cbi-button show-instructions', 'href': '#Mac', 'id': 'Mac' }, _('Show Instructions')),
|
||||
E('a', { 'class': 'btn btn-sm btn-info hide-instructions', 'href': '#' }, '📖 ' + _('Hide Instructions')),
|
||||
E('div', { 'class': 'instructions' }, [
|
||||
E('h5', {}, _('Manual Installation')),
|
||||
E('ol', {}, [
|
||||
E('li', {}, _('Double-click the PEM file to open the Keychain Access application.')),
|
||||
E('li', {}, _('Locate the new certificate "squid" in the list and double-click it.')),
|
||||
E('li', {}, _('Change Secure Socket Layer (SSL) to Always Trust.')),
|
||||
E('li', {}, _('Close the dialog window and enter your password if prompted.')),
|
||||
]),
|
||||
E('br'),
|
||||
E('h5', {}, _('Automated Installation')),
|
||||
E('oi', {}, [
|
||||
E('li', {}, [ E('code', {}, 'sudo security add-trusted-cert -d -p ssl -p basic -k /Library/Keychains/System.keychain squid-ca.pem') ]),
|
||||
]),
|
||||
]),
|
||||
]),
|
||||
]),
|
||||
E('tr', {}, [
|
||||
E('td', { 'class': 'media-img' }, [
|
||||
E('img', { 'class': 'media-img', 'src': '/luci-static/resources/view/squid-adv/svg/ios.svg' }, ''),
|
||||
]),
|
||||
E('td', { 'class': 'media-body' }, [
|
||||
E('h4', {}, [ 'iOS ', E('small', {}, [ '(', _('please read the instructions!'), ')' ]) ]),
|
||||
E('a', { 'class': 'btn btn-sm cbi-button-apply', 'href': '/ca/squid-ca.pem' }, '🔏 ' + _('Get') + ' squid-ca.pem'), ' ',
|
||||
E('a', { 'class': 'btn btn-sm cbi-button show-instructions', 'href': '#iOS', 'id': 'iOS' }, _('Show Instructions')),
|
||||
E('a', { 'class': 'btn btn-sm btn-info hide-instructions', 'href': '#' }, '📖 ' + _('Hide Instructions')),
|
||||
E('div', { 'class': 'instructions' }, [
|
||||
E('h5', {}, 'iOS 13+'),
|
||||
E('ol', {}, [
|
||||
E('li', {}, _('Use Safari to download the certificate. Other browsers may not open the proper installation prompt.')),
|
||||
E('li', {}, _('Install the new Profile (Settings -> General -> VPN & Device Management).')),
|
||||
E('li', {}, [
|
||||
E('strong', {}, _('Important:')), ' ',
|
||||
_('Go to Settings -> General -> About -> Certificate Trust Settings. Toggle squid to ON.'),
|
||||
]),
|
||||
]),
|
||||
]),
|
||||
]),
|
||||
]),
|
||||
E('tr', {}, [
|
||||
E('td', { 'class': 'media-img' }, [
|
||||
E('img', { 'class': 'media-img', 'src': '/luci-static/resources/view/squid-adv/svg/android.svg' }, ''),
|
||||
]),
|
||||
E('td', { 'class': 'media-body' }, [
|
||||
E('h4', {}, 'Android'),
|
||||
E('a', { 'class': 'btn btn-sm cbi-button-apply', 'href': '/ca/squid-ca.cer' }, '🔏 ' + _('Get') + ' squid-ca.cer'), ' ',
|
||||
E('a', { 'class': 'btn btn-sm cbi-button show-instructions', 'href': '#Android', 'id': 'Android' }, _('Show Instructions')),
|
||||
E('a', { 'class': 'btn btn-sm btn-info hide-instructions', 'href': '#' }, '📖 ' + _('Hide Instructions')),
|
||||
E('div', { 'class': 'instructions' }, [
|
||||
E('h5', {}, 'Android 10+'),
|
||||
E('ol', { 'class': 'mb-2' }, [
|
||||
E('li', {}, _('Open the downloaded CER file.')),
|
||||
E('li', {}, _('Enter squid (or anything else) as the certificate name.')),
|
||||
E('li', {}, _('For credential use, select VPN and apps.')),
|
||||
E('li', {}, _('Click OK.')),
|
||||
]),
|
||||
E('br'),
|
||||
E('p', {}, _('Some Android distributions require you to install the certificate via Settings -> Security -> Advanced -> Encryption and credentials -> Install a certificate -> CA certificate (or similar) instead.')),
|
||||
E('div', { 'class': 'alert alert-warning', 'role': 'alert' }, [
|
||||
E('p', {}, [
|
||||
E('strong', {}, _('Warning')), ': ',
|
||||
_('Apps that target Android API Level 24 (introduced in 2016) and above only accept certificates from the system trust store. User-added CAs are not accepted unless the application manually opts in. Except for browsers, you need to patch most apps manually'),
|
||||
' (', E('a', { 'href': 'https://developer.android.com/training/articles/security-config' }, 'Android network security config'), ')'
|
||||
]),
|
||||
E('p', {}, [
|
||||
_('Alternatively, if you have rooted the device and have Magisk installed, you can install'), ' ',
|
||||
E('a', { 'href': 'https://themagisk.com/move-certificates-magisk-module/' }, _('this Magisk module')), ' ',
|
||||
_('via the Magisk Manager app.'),
|
||||
]),
|
||||
]),
|
||||
]),
|
||||
]),
|
||||
]),
|
||||
E('tr', {}, [
|
||||
E('td', { 'class': 'media-img' }, [
|
||||
E('img', { 'class': 'media-img', 'src': '/luci-static/resources/view/squid-adv/svg/firefox.svg' }, ''),
|
||||
]),
|
||||
E('td', { 'class': 'media-body' }, [
|
||||
E('h4', {}, 'Android'),
|
||||
E('a', { 'class': 'btn btn-sm cbi-button-apply', 'href': '/ca/squid-ca.pem' }, '🔏 ' + _('Get') + ' squid-ca.pem'), ' ',
|
||||
E('a', { 'class': 'btn btn-sm cbi-button show-instructions', 'href': '#FireFox', 'id': 'FireFox' }, _('Show Instructions')),
|
||||
E('a', { 'class': 'btn btn-sm btn-info hide-instructions', 'href': '#' }, '📖 ' + _('Hide Instructions')),
|
||||
E('div', { 'class': 'instructions' }, [
|
||||
E('h5', {}, 'FireFox'),
|
||||
E('ol', {}, [
|
||||
E('li', {}, _('Open Options -> Privacy & Security and click View Certificates... at the bottom of the page.')),
|
||||
E('li', {}, _('Click Import... and select the downloaded certificate.')),
|
||||
E('li', {}, _('Enable Trust this CA to identify websites and click OK.')),
|
||||
]),
|
||||
]),
|
||||
]),
|
||||
]),
|
||||
E('tr', {}, [
|
||||
E('td', { 'class': 'media-img' }, [
|
||||
E('img', { 'class': 'media-img', 'src': '/luci-static/resources/view/squid-adv/svg/other.svg' }, ''),
|
||||
]),
|
||||
E('td', { 'class': 'media-body' }, [
|
||||
E('h4', {}, 'Other Platforms'),
|
||||
E('a', { 'class': 'btn btn-sm cbi-button-apply', 'href': '/ca/squid-ca.pem' }, '🔏 ' + _('Get') + ' squid-ca.pem'), ' ',
|
||||
E('a', { 'class': 'btn btn-sm cbi-button-apply', 'href': '/ca/squid-ca.p12' }, '🔏 ' + _('Get') + ' squid-ca.p12'), ' ',
|
||||
]),
|
||||
]),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
|
||||
return m.render();
|
||||
},
|
||||
|
||||
handleSave: null,
|
||||
handleSaveApply: null,
|
||||
handleReset: null,
|
||||
})
|
||||
@@ -0,0 +1,133 @@
|
||||
'use strict';
|
||||
'require ui';
|
||||
'require view';
|
||||
'require uci';
|
||||
'require form';
|
||||
'require rpc';
|
||||
'require tools.widgets as widgets';
|
||||
|
||||
return view.extend({
|
||||
cert_valid: rpc.declare({
|
||||
object: 'luci.squid-adv',
|
||||
method: 'cert_info',
|
||||
}),
|
||||
get_ipinfo: rpc.declare({
|
||||
object: 'luci.squid-adv',
|
||||
method: 'ip_info',
|
||||
}),
|
||||
generate: rpc.declare({
|
||||
object: 'luci.squid-adv',
|
||||
method: 'generate',
|
||||
params: [ 'bits', 'days', 'country', 'state', 'locality', 'organization' ],
|
||||
}),
|
||||
|
||||
// Loading function:
|
||||
load: function () {
|
||||
return Promise.all([
|
||||
this.cert_valid(),
|
||||
]);
|
||||
},
|
||||
|
||||
// Rendering function:
|
||||
render: function(data) {
|
||||
var s, o, m, t;
|
||||
m = new form.Map('squid', _('OpenSSL Certificate'));
|
||||
this.valid = data[0].valid;
|
||||
|
||||
if (this.valid) {
|
||||
s = m.section(form.TypedSection, 'squid', _("Certificate Valid Period"));
|
||||
s.anonymous = true;
|
||||
|
||||
o = s.option(form.Value, "_notBefore", _("Current Certificate Valid Starting:"), _("ISO-8601 formatted date: YY-MM-DD HH:MM:SS"))
|
||||
o.cfgvalue = function() { return data[0].notBefore != undefined ? data[0].notBefore : 'Invalid'; }
|
||||
o.write = null;
|
||||
o.readonly = true;
|
||||
|
||||
o = s.option(form.Value, "_notAfter", _("Current Certificate Not Valid After:"), _("ISO-8601 formatted date: YY-MM-DD HH:MM:SS"))
|
||||
o.cfgvalue = function() { return data[0].notAfter != undefined ? data[0].notAfter : 'Invalid'; }
|
||||
o.write = null;
|
||||
o.readonly = true;
|
||||
}
|
||||
|
||||
s = m.section(form.TypedSection, 'squid', _("Certificate Settings"));
|
||||
s.anonymous = true;
|
||||
|
||||
o = s.option(form.ListValue, "bits", _("RSA Key Bit Size:"))
|
||||
o.value("4096", "4096 bits (" + _("Best") + ")")
|
||||
o.value("2048", "2048 bits (" + _("Better") + ")")
|
||||
o.value("1024", "1024 bits (" + _("Not Recommended") + ")")
|
||||
o.value("512", "512 bits (" + _("Not Recommended") + ")")
|
||||
o.write = null;
|
||||
o.rmempty = false
|
||||
o.cfgvalue = function() { return data[0].bits != undefined ? data[0].bits : '4096'; }
|
||||
|
||||
o = s.option(form.Value, "days", _("Days The Certificate Is Good For:"))
|
||||
o.default = "3650"
|
||||
o.datatype = 'integer';
|
||||
o.cfgvalue = function() { if (data[0].days != undefined) { return data[0].days; } }
|
||||
o.write = null;
|
||||
o.validate = function(section_id, value) { return value > 0 ? true : _("Number of days cannot be negative!"); }
|
||||
|
||||
o = s.option(form.Value, "countryName", _("Country Name:"))
|
||||
o.cfgvalue = function() { return data[0].countryName != undefined ? data[0].countryName : 'XX'; }
|
||||
o.write = null;
|
||||
o.validate = function(section_id, value) { return value.length == 2 ? true : _("Must be a two-letter country code!"); }
|
||||
|
||||
o = s.option(form.Value, "stateOrProvinceName", _("State Or Province Name:"))
|
||||
o.cfgvalue = function() { return data[0].stateOrProvinceName != undefined ? data[0].stateOrProvinceName : 'Unspecified'; }
|
||||
o.write = null;
|
||||
|
||||
o = s.option(form.Value, "localityName", _("Locality Name:"))
|
||||
o.default = data[0].localityName != undefined ? data[0].localityName : 'Unspecified';
|
||||
o.cfgvalue = function() { return null; }
|
||||
o.write = null;
|
||||
|
||||
o = s.option(form.Value, "organizationName", _("Organization Name:"))
|
||||
o.cfgvalue = function() { return data[0].organizationName != undefined ? data[0].organizationName : 'OpenWrt Router'; }
|
||||
o.write = null;
|
||||
|
||||
return m.render();
|
||||
},
|
||||
|
||||
regenerate_cert: function() {
|
||||
if (confirm( _("Regenerating the certificate will overwrite the current OpenSSL certificate, and will require installing the new certificate on all devices.\n\nAre you SURE you want to do this?") )) {
|
||||
return this.generate_cert();
|
||||
}
|
||||
},
|
||||
|
||||
generate_cert: function() {
|
||||
// Gather information:
|
||||
var bits = document.getElementById("widget.cbid.squid.squid.bits").value;
|
||||
var days = document.getElementById("widget.cbid.squid.squid.days").value;
|
||||
var country = document.getElementById("widget.cbid.squid.squid.countryName").value;
|
||||
var state = document.getElementById("widget.cbid.squid.squid.stateOrProvinceName").value;
|
||||
var locality = document.getElementById("widget.cbid.squid.squid.localityName").value;
|
||||
var organization = document.getElementById("widget.cbid.squid.squid.organizationName").value;
|
||||
|
||||
// Create a promise for the OpenSSL Certificate Generation task:
|
||||
var tasks = [
|
||||
this.generate( bits, days, country, state, locality, organization ),
|
||||
];
|
||||
return Promise.all(tasks).then(function() {
|
||||
classes.ui.changes.apply(false);
|
||||
});
|
||||
},
|
||||
|
||||
populate: function() {
|
||||
return Promise.all([ this.get_ipinfo() ]).then(function(data) {
|
||||
console.log(data);
|
||||
document.getElementById("widget.cbid.squid.squid.countryName").value = data[0].country != undefined ? data[0].country : 'XX';
|
||||
document.getElementById("widget.cbid.squid.squid.stateOrProvinceName").value = data[0].region != undefined ? data[0].region : 'Unspecified';
|
||||
document.getElementById("widget.cbid.squid.squid.localityName").value = data[0].city != undefined ? data[0].city : 'Unspecified';
|
||||
});
|
||||
},
|
||||
|
||||
addFooter: function() {
|
||||
return E('div', { 'class': 'cbi-page-actions' }, [
|
||||
this.valid ?
|
||||
E('button', {'class': 'cbi-button cbi-button-positive', 'click': L.ui.createHandlerFn(this, 'regenerate_cert')}, [ _('Regenerate Certificate'), ' ' ]) :
|
||||
E('button', {'class': 'cbi-button cbi-button-positive', 'click': L.ui.createHandlerFn(this, 'generate_cert')}, [ _('Generate Certificate'), ' ' ]),
|
||||
E('button', {'class': 'cbi-button cbi-button-negative', 'click': L.ui.createHandlerFn(this, 'populate')}, [ _('Populate Fields') ])
|
||||
]);
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
|
||||
<svg width="800px" height="800px" viewBox="-3 0 48 48" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
|
||||
<title>Android-color</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs>
|
||||
|
||||
</defs>
|
||||
<g id="Icons" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="Color-" transform="translate(-304.000000, -560.000000)" fill="#95CF00">
|
||||
<path d="M330.727009,569.600905 C329.935377,569.600905 329.294532,568.977195 329.294532,568.206729 C329.294532,567.436264 329.935377,566.815376 330.727009,566.815376 C331.518641,566.815376 332.159486,567.436264 332.159486,568.206729 C332.159486,568.977195 331.518641,569.600905 330.727009,569.600905 L330.727009,569.600905 Z M319.272991,569.600905 C318.481359,569.600905 317.840514,568.977195 317.840514,568.206729 C317.840514,567.436264 318.481359,566.815376 319.272991,566.815376 C320.064623,566.815376 320.705468,567.436264 320.705468,568.206729 C320.705468,568.977195 320.064623,569.600905 319.272991,569.600905 L319.272991,569.600905 Z M331.573737,564.018558 L332.107291,563.233981 L332.640845,562.460694 L333.829743,560.722208 C333.97763,560.507719 333.916736,560.219853 333.696355,560.078742 C333.478873,559.934809 333.180199,559.994075 333.038111,560.208564 L331.222867,562.852982 L330.677713,563.648847 C328.952361,562.996915 327.029826,562.632849 325,562.632849 C322.973074,562.632849 321.047639,562.996915 319.322287,563.648847 L318.780033,562.852982 L318.243579,562.071228 L316.967688,560.208564 C316.819801,559.994075 316.524027,559.937631 316.303645,560.078742 C316.086164,560.219853 316.025269,560.507719 316.170257,560.722208 L317.359155,562.460694 L317.892709,563.233981 L318.429163,564.018558 C314.37821,565.855822 311.637945,569.335616 311.637945,573.317766 L338.362055,573.317766 C338.362055,569.335616 335.62179,565.855822 331.573737,564.018558 Z M311.843828,575.174785 L311.637945,575.174785 L311.637945,595.613286 C311.637945,597.236061 312.992129,598.556859 314.662386,598.556859 L316.842999,598.556859 C316.767606,598.802392 316.727009,599.059214 316.727009,599.330147 L316.727009,605.214471 C316.727009,606.75258 318.011599,608 319.591964,608 C321.172328,608 322.456918,606.75258 322.456918,605.214471 L322.456918,599.330147 C322.456918,599.059214 322.413422,598.802392 322.340928,598.556859 L327.659072,598.556859 C327.586578,598.802392 327.545982,599.059214 327.545982,599.330147 L327.545982,605.214471 C327.545982,606.75258 328.827672,608 330.408036,608 C331.991301,608 333.275891,606.75258 333.275891,605.214471 L333.275891,599.330147 C333.275891,599.059214 333.232394,598.802392 333.157001,598.556859 L335.340514,598.556859 C337.010771,598.556859 338.362055,597.236061 338.362055,595.613286 L338.362055,575.174785 L311.843828,575.174785 Z M306.864954,575.174785 C305.28169,575.174785 304,576.422205 304,577.960314 L304,589.884184 C304,591.422293 305.28169,592.669713 306.864954,592.669713 C308.445319,592.669713 309.727009,591.422293 309.727009,589.884184 L309.727009,577.960314 C309.727009,576.422205 308.445319,575.174785 306.864954,575.174785 Z M343.137945,575.174785 C341.554681,575.174785 340.272991,576.422205 340.272991,577.960314 L340.272991,589.884184 C340.272991,591.422293 341.554681,592.669713 343.137945,592.669713 C344.71831,592.669713 346,591.422293 346,589.884184 L346,577.960314 C346,576.422205 344.71831,575.174785 343.137945,575.174785 Z" id="Android">
|
||||
|
||||
</path>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.5 KiB |
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
|
||||
<svg width="800px" height="800px" viewBox="-1.5 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
|
||||
<title>apple [#173]</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs>
|
||||
|
||||
</defs>
|
||||
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="Dribbble-Light-Preview" transform="translate(-102.000000, -7439.000000)" fill="#000000">
|
||||
<g id="icons" transform="translate(56.000000, 160.000000)">
|
||||
<path d="M57.5708873,7282.19296 C58.2999598,7281.34797 58.7914012,7280.17098 58.6569121,7279 C57.6062792,7279.04 56.3352055,7279.67099 55.5818643,7280.51498 C54.905374,7281.26397 54.3148354,7282.46095 54.4735932,7283.60894 C55.6455696,7283.69593 56.8418148,7283.03894 57.5708873,7282.19296 M60.1989864,7289.62485 C60.2283111,7292.65181 62.9696641,7293.65879 63,7293.67179 C62.9777537,7293.74279 62.562152,7295.10677 61.5560117,7296.51675 C60.6853718,7297.73474 59.7823735,7298.94772 58.3596204,7298.97372 C56.9621472,7298.99872 56.5121648,7298.17973 54.9134635,7298.17973 C53.3157735,7298.17973 52.8162425,7298.94772 51.4935978,7298.99872 C50.1203933,7299.04772 49.0738052,7297.68074 48.197098,7296.46676 C46.4032359,7293.98379 45.0330649,7289.44985 46.8734421,7286.3899 C47.7875635,7284.87092 49.4206455,7283.90793 51.1942837,7283.88393 C52.5422083,7283.85893 53.8153044,7284.75292 54.6394294,7284.75292 C55.4635543,7284.75292 57.0106846,7283.67793 58.6366882,7283.83593 C59.3172232,7283.86293 61.2283842,7284.09893 62.4549652,7285.8199 C62.355868,7285.8789 60.1747177,7287.09489 60.1989864,7289.62485" id="apple-[#173]">
|
||||
|
||||
</path>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.8 KiB |
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
|
||||
<svg width="800px" height="800px" viewBox="0 -2.5 48 48" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
|
||||
<title>firefox-color</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs>
|
||||
|
||||
</defs>
|
||||
<g id="Icons" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="Color-" transform="translate(-301.000000, -1045.000000)" fill="#FF8000">
|
||||
<path d="M317.687745,1052.7291 C317.875434,1051.14046 318.943782,1049.07983 320.955235,1048.13538 C317.933104,1047.67735 315.478934,1049.07994 314.256567,1050.88304 C312.316998,1050.46821 311.125272,1050.44546 309.174751,1050.80671 C307.937006,1049.87681 306.481397,1047.75773 306.595338,1045.54038 C304.253478,1048.27477 303.770916,1050.33667 304.059615,1052.79817 C295.046,1068.78088 307.172968,1088 324.458413,1088 C339.988016,1087.99988 349,1076.22702 349,1064.16348 C349,1056.02799 345.285016,1048.96607 341.491975,1047.43922 C342.907157,1048.98525 344.514921,1053.01228 344.206882,1055.79898 C341.14549,1047.89736 333.501504,1044.84353 330.925586,1045.00614 C339.393376,1048.27904 341.419858,1059.42054 340.668636,1062.7088 C339.932443,1058.85292 337.583244,1055.53174 336.177848,1054.65381 C344.378727,1073.69855 324.572937,1079.54993 318.529841,1072.94037 C320.088207,1073.341 323.164396,1073.14409 325.468974,1071.61424 C327.625009,1070.18301 327.827844,1070.09905 329.213084,1069.99245 C330.858479,1069.86565 329.113939,1066.64495 325.519654,1067.18981 C324.040744,1067.41409 321.6037,1069.13796 318.606152,1068.0018 C314.989265,1066.63074 315.10309,1061.73663 318.837996,1063.20909 C319.646422,1062.16936 319.049685,1060.204 319.049685,1060.204 C320.134809,1059.21901 321.504671,1058.52494 322.339077,1058.03712 C322.886299,1057.71722 324.328627,1056.83155 324.246957,1055.10941 C323.953132,1054.88167 323.478259,1054.59064 322.40863,1054.6515 C318.240677,1054.91343 317.961997,1053.42064 317.687745,1052.7291 L317.687745,1052.7291 Z" id="firefox">
|
||||
|
||||
</path>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.1 KiB |
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
|
||||
<svg width="800px" height="800px" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M30 16C30 23.728 23.735 30 16 30C8.265 30 2 23.728 2 16C2 8.265 8.265 2 16 2C23.735 2 30 8.265 30 16Z" fill="#283544"/>
|
||||
<path d="M7.08597 20.8394H8.61506V13.7443H7.08597V20.8394ZM7.84745 12.8139C8.3203 12.8139 8.70103 12.4123 8.70103 11.9103C8.70103 11.3949 8.3203 11 7.84745 11C7.38074 11 7 11.3949 7 11.9103C7 12.4123 7.38074 12.8139 7.84745 12.8139Z" fill="white"/>
|
||||
<path d="M13.9577 11.0201C11.3723 11.0201 9.75113 12.9411 9.75113 16.0134C9.75113 19.0857 11.3723 21 13.9577 21C16.5368 21 18.158 19.0857 18.158 16.0134C18.158 12.9411 16.5368 11.0201 13.9577 11.0201ZM13.9577 12.4926C15.5359 12.4926 16.543 13.8581 16.543 16.0134C16.543 18.162 15.5359 19.5274 13.9577 19.5274C12.3733 19.5274 11.3723 18.162 11.3723 16.0134C11.3723 13.8581 12.3733 12.4926 13.9577 12.4926Z" fill="white"/>
|
||||
<path d="M19.0608 18.1218C19.1283 19.9023 20.467 21 22.5058 21C24.649 21 26 19.8487 26 18.0147C26 16.5756 25.2385 15.7657 23.4392 15.3173L22.4198 15.0629C21.3329 14.7818 20.8846 14.407 20.8846 13.7644C20.8846 12.9612 21.5601 12.4257 22.5611 12.4257C23.5743 12.4257 24.2683 12.9679 24.342 13.8715H25.8526C25.8158 12.1714 24.5262 11.0201 22.5734 11.0201C20.6451 11.0201 19.2757 12.178 19.2757 13.8916C19.2757 15.2704 20.0495 16.1272 21.6829 16.5355L22.8313 16.83C23.9489 17.1178 24.4034 17.5194 24.4034 18.2155C24.4034 19.0187 23.6603 19.5944 22.5918 19.5944C21.511 19.5944 20.6942 19.012 20.596 18.1218H19.0608Z" fill="white"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.6 KiB |
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
|
||||
<svg width="800px" height="800px" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fill="none"><path fill="#202020" d="M13.338 12.033c-.1-.112-.146-.319-.197-.54-.05-.22-.107-.457-.288-.61v-.001a.756.756 0 00-.223-.134c.252-.745.153-1.487-.1-2.157-.312-.823-.855-1.54-1.27-2.03-.464-.586-.918-1.142-.91-1.963.014-1.254.138-3.579-2.068-3.582-.09 0-.183.004-.28.012-2.466.198-1.812 2.803-1.849 3.675-.045.638-.174 1.14-.613 1.764-.515.613-1.24 1.604-1.584 2.637-.162.487-.24.984-.168 1.454-.023.02-.044.041-.064.063-.151.161-.263.357-.388.489-.116.116-.282.16-.464.225-.183.066-.383.162-.504.395v.001a.702.702 0 00-.077.339c0 .108.016.217.032.322.034.22.068.427.023.567-.144.395-.163.667-.061.865.102.199.31.286.547.335.473.1 1.114.075 1.619.342l.043-.082-.043.082c.54.283 1.089.383 1.526.284a.99.99 0 00.706-.552c.342-.002.717-.146 1.318-.18.408-.032.918.145 1.503.113a.806.806 0 00.068.183l.001.001c.227.455.65.662 1.1.627.45-.036.928-.301 1.315-.762l-.07-.06.07.06c.37-.448.982-.633 1.388-.878.203-.123.368-.276.38-.499.013-.222-.118-.471-.418-.805z"/><path fill="#F8BF11" d="M13.571 12.828c-.007.137-.107.24-.29.35-.368.222-1.019.414-1.434.918-.362.43-.802.665-1.19.696-.387.03-.721-.13-.919-.526v-.002c-.123-.233-.072-.6.031-.987s.251-.785.271-1.108v-.001c.02-.415.044-.776.114-1.055.07-.28.179-.468.373-.575a.876.876 0 01.027-.014c.022.359.2.725.514.804.343.09.838-.204 1.047-.445l.122-.004c.184-.005.337.006.495.143v.001c.121.102.179.296.229.512.05.217.09.453.239.621.287.32.38.534.371.672zM6.592 13.843v.003c-.034.435-.28.672-.656.758-.377.086-.888 0-1.398-.266-.565-.3-1.237-.27-1.667-.36-.216-.045-.357-.113-.421-.238-.064-.126-.066-.345.071-.72v-.001l.001-.002c.068-.209.018-.438-.015-.653-.033-.214-.049-.41.024-.546l.001-.001c.094-.181.232-.246.403-.307.17-.062.373-.11.533-.27l.001-.001h.001c.148-.157.26-.353.39-.492.11-.117.22-.195.385-.196h.005a.61.61 0 01.093.008c.22.033.411.187.596.437l.533.971v.001c.142.296.441.622.695.954.254.333.45.666.425.921z"/><path fill="#D6A312" d="M9.25 4.788c-.043-.084-.13-.164-.28-.225-.31-.133-.444-.142-.617-.254-.28-.181-.513-.244-.706-.244a.834.834 0 00-.272.047c-.236.08-.392.25-.49.342-.02.019-.044.035-.104.08-.06.043-.15.11-.28.208-.117.086-.154.2-.114.332.04.132.167.285.4.417h.001c.145.085.244.2.358.291a.801.801 0 00.189.117c.072.031.156.052.26.058.248.015.43-.06.59-.151.16-.092.296-.204.452-.255h.001c.32-.1.548-.301.62-.493a.324.324 0 00-.008-.27z"/><path fill="#202020" d="M8.438 5.26c-.255.133-.552.294-.869.294-.316 0-.566-.146-.745-.289-.09-.07-.163-.142-.218-.193-.096-.075-.084-.181-.045-.178.066.008.076.095.117.134.056.052.126.12.211.187.17.135.397.266.68.266.284 0 .614-.166.816-.28.115-.064.26-.179.379-.266.09-.067.087-.147.162-.138.075.009.02.089-.085.18-.105.092-.27.214-.403.283z"/><path fill="#ffffff" d="M12.337 10.694a1.724 1.724 0 00-.104 0h-.01c.088-.277-.106-.48-.621-.713-.534-.235-.96-.212-1.032.265-.005.025-.009.05-.011.076a.801.801 0 00-.12.054c-.252.137-.389.386-.465.692-.076.305-.098.674-.119 1.09-.013.208-.099.49-.186.79-.875.624-2.09.894-3.122.19-.07-.11-.15-.22-.233-.328a13.85 13.85 0 00-.16-.205.65.65 0 00.268-.05.34.34 0 00.186-.192c.063-.17 0-.408-.202-.68-.201-.273-.542-.58-1.043-.888-.368-.23-.574-.51-.67-.814-.097-.305-.084-.635-.01-.96.143-.625.51-1.233.743-1.614.063-.046.023.086-.236.567-.232.44-.667 1.455-.072 2.248.016-.564.15-1.14.377-1.677.329-.747 1.018-2.041 1.072-3.073.029.02.125.086.169.11.126.075.221.184.344.283a.85.85 0 00.575.2c.24 0 .427-.079.582-.168.17-.096.304-.204.433-.245.27-.085.486-.235.608-.41.21.83.7 2.027 1.014 2.611.167.31.5.969.643 1.762.091-.002.191.01.299.038.375-.973-.319-2.022-.636-2.314-.128-.124-.135-.18-.07-.177.343.304.795.917.96 1.608.075.315.09.646.01.973.04.017.08.034.12.054.603.293.826.548.719.897z"/><path fill="#E6E6E6" d="M8.04 8.062c-.556.002-1.099.251-1.558.716-.46.464-.814 1.122-1.018 1.888l.061.038v.004c.47.298.805.598 1.012.878.219.296.316.584.223.834a.513.513 0 01-.27.283l-.041.015c.074.097.146.197.213.3.944.628 2.042.396 2.867-.172.08-.278.153-.536.163-.698.021-.415.042-.792.124-1.12.082-.33.242-.63.544-.795.017-.01.034-.015.051-.023a.756.756 0 01.022-.094c-.242-.622-.591-1.14-1.01-1.5-.42-.36-.897-.551-1.382-.554zm2.37 2.155l-.002.005v-.002l.001-.004z"/><path fill="#ffffff" d="M9.278 3.833a1.05 1.05 0 01-.215.656 4.119 4.119 0 00-.218-.09l-.127-.045c.029-.035.085-.075.107-.127a.669.669 0 00.05-.243l.001-.01a.673.673 0 00-.035-.236.434.434 0 00-.108-.184.223.223 0 00-.156-.07H8.57a.228.228 0 00-.151.06.434.434 0 00-.122.175.676.676 0 00-.05.243v.01a.718.718 0 00.009.14 1.773 1.773 0 00-.354-.12 1.196 1.196 0 01-.01-.133v-.013a1.035 1.035 0 01.088-.447.793.793 0 01.25-.328.554.554 0 01.346-.123h.006c.125 0 .232.036.342.116a.78.78 0 01.257.324c.063.138.094.273.097.433l.001.012zM7.388 3.997a1.05 1.05 0 00-.277.125.623.623 0 00.002-.15v-.008a.651.651 0 00-.048-.192.37.37 0 00-.096-.141.158.158 0 00-.119-.045c-.042.004-.077.024-.11.065a.372.372 0 00-.07.156.626.626 0 00-.013.205v.008a.634.634 0 00.048.193.367.367 Line truncated
|
||||
|
After Width: | Height: | Size: 5.6 KiB |
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
|
||||
<svg width="800px" height="800px" viewBox="-1.5 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
|
||||
<title>apple [#173]</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs>
|
||||
|
||||
</defs>
|
||||
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="Dribbble-Light-Preview" transform="translate(-102.000000, -7439.000000)" fill="#000000">
|
||||
<g id="icons" transform="translate(56.000000, 160.000000)">
|
||||
<path d="M57.5708873,7282.19296 C58.2999598,7281.34797 58.7914012,7280.17098 58.6569121,7279 C57.6062792,7279.04 56.3352055,7279.67099 55.5818643,7280.51498 C54.905374,7281.26397 54.3148354,7282.46095 54.4735932,7283.60894 C55.6455696,7283.69593 56.8418148,7283.03894 57.5708873,7282.19296 M60.1989864,7289.62485 C60.2283111,7292.65181 62.9696641,7293.65879 63,7293.67179 C62.9777537,7293.74279 62.562152,7295.10677 61.5560117,7296.51675 C60.6853718,7297.73474 59.7823735,7298.94772 58.3596204,7298.97372 C56.9621472,7298.99872 56.5121648,7298.17973 54.9134635,7298.17973 C53.3157735,7298.17973 52.8162425,7298.94772 51.4935978,7298.99872 C50.1203933,7299.04772 49.0738052,7297.68074 48.197098,7296.46676 C46.4032359,7293.98379 45.0330649,7289.44985 46.8734421,7286.3899 C47.7875635,7284.87092 49.4206455,7283.90793 51.1942837,7283.88393 C52.5422083,7283.85893 53.8153044,7284.75292 54.6394294,7284.75292 C55.4635543,7284.75292 57.0106846,7283.67793 58.6366882,7283.83593 C59.3172232,7283.86293 61.2283842,7284.09893 62.4549652,7285.8199 C62.355868,7285.8789 60.1747177,7287.09489 60.1989864,7289.62485" id="apple-[#173]">
|
||||
|
||||
</path>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.8 KiB |
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
␍<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
|
||||
<svg width="800px" height="800px" viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--emojione" preserveAspectRatio="xMidYMid meet">
|
||||
␍<g fill="#ffe62e">
|
||||
␍<path d="M20.5 59.7l7-7.2c-2.5-.5-4.8-1.5-6.9-2.9l-.1 10.1">
|
||||
␍</path>
|
||||
␍<path d="M43.5 4.3l-7 7.2c2.5.5 4.8 1.5 6.9 2.9l.1-10.1">
|
||||
␍</path>
|
||||
␍<path d="M4.3 43.5l10.1-.1C13 41.3 12 39 11.5 36.5l-7.2 7">
|
||||
␍</path>
|
||||
␍<path d="M59.7 20.5l-10.1.1c1.3 2.1 2.3 4.4 2.9 6.9l7.2-7">
|
||||
␍</path>
|
||||
␍<path d="M4.3 20.5l7.2 7c.5-2.5 1.5-4.8 2.9-6.9l-10.1-.1">
|
||||
␍</path>
|
||||
␍<path d="M59.7 43.5l-7.2-7c-.5 2.5-1.5 4.8-2.9 6.9l10.1.1">
|
||||
␍</path>
|
||||
␍<path d="M20.5 4.3l.1 10.1c2.1-1.3 4.4-2.3 6.9-2.9l-7-7.2">
|
||||
␍</path>
|
||||
␍<path d="M43.5 59.7l-.1-10.1C41.3 51 39 52 36.5 52.5l7 7.2">
|
||||
␍</path>
|
||||
␍</g>
|
||||
␍<g fill="#ffce31">
|
||||
␍<path d="M14.8 44l-4 9.3l9.3-4C18 47.8 16.2 46 14.8 44">
|
||||
␍</path>
|
||||
␍<path d="M49.2 20l4-9.3l-9.2 4c2 1.5 3.8 3.3 5.2 5.3">
|
||||
␍</path>
|
||||
␍<path d="M11.4 28.3L2 32l9.4 3.7c-.3-1.2-.4-2.4-.4-3.7s.1-2.5.4-3.7">
|
||||
␍</path>
|
||||
␍<path d="M52.6 35.7L62 32l-9.4-3.7c.2 1.2.4 2.5.4 3.7c0 1.3-.1 2.5-.4 3.7">
|
||||
␍</path>
|
||||
␍<path d="M20 14.8l-9.3-4l4 9.3c1.5-2.1 3.3-3.9 5.3-5.3">
|
||||
␍</path>
|
||||
␍<path d="M44 49.2l9.3 4l-4-9.3C47.8 46 46 47.8 44 49.2">
|
||||
␍</path>
|
||||
␍<path d="M35.7 11.4L32 2l-3.7 9.4c1.2-.2 2.5-.4 3.7-.4s2.5.1 3.7.4">
|
||||
␍</path>
|
||||
␍<path d="M28.3 52.6L32 62l3.7-9.4c-1.2.3-2.4.4-3.7.4s-2.5-.1-3.7-.4">
|
||||
␍</path>
|
||||
␍<circle cx="32" cy="32" r="19">
|
||||
␍</circle>
|
||||
␍</g>
|
||||
␍</svg>
|
||||
|
After Width: | Height: | Size: 1.6 KiB |
@@ -0,0 +1,72 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
|
||||
<svg version="1.1" id="Icons" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
viewBox="0 0 32 32" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{fill:#FFFFFF;}
|
||||
.st1{fill:#3A559F;}
|
||||
.st2{fill:#F4F4F4;}
|
||||
.st3{fill:#FF0084;}
|
||||
.st4{fill:#0063DB;}
|
||||
.st5{fill:#00ACED;}
|
||||
.st6{fill:#FFEC06;}
|
||||
.st7{fill:#FF0000;}
|
||||
.st8{fill:#25D366;}
|
||||
.st9{fill:#0088FF;}
|
||||
.st10{fill:#314358;}
|
||||
.st11{fill:#EE6996;}
|
||||
.st12{fill:#01AEF3;}
|
||||
.st13{fill:#FFFEFF;}
|
||||
.st14{fill:#F06A35;}
|
||||
.st15{fill:#00ADEF;}
|
||||
.st16{fill:#1769FF;}
|
||||
.st17{fill:#1AB7EA;}
|
||||
.st18{fill:#6001D1;}
|
||||
.st19{fill:#E41214;}
|
||||
.st20{fill:#05CE78;}
|
||||
.st21{fill:#7B519C;}
|
||||
.st22{fill:#FF4500;}
|
||||
.st23{fill:#00F076;}
|
||||
.st24{fill:#FFC900;}
|
||||
.st25{fill:#00D6FF;}
|
||||
.st26{fill:#FF3A44;}
|
||||
.st27{fill:#FF6A36;}
|
||||
.st28{fill:#0061FE;}
|
||||
.st29{fill:#F7981C;}
|
||||
.st30{fill:#EE1B22;}
|
||||
.st31{fill:#EF3561;}
|
||||
.st32{fill:none;stroke:#FFFFFF;stroke-width:2;stroke-miterlimit:10;}
|
||||
.st33{fill:#0097D3;}
|
||||
.st34{fill:#01308A;}
|
||||
.st35{fill:#019CDE;}
|
||||
.st36{fill:#FFD049;}
|
||||
.st37{fill:#16A05D;}
|
||||
.st38{fill:#4486F4;}
|
||||
.st39{fill:none;}
|
||||
.st40{fill:#34A853;}
|
||||
.st41{fill:#4285F4;}
|
||||
.st42{fill:#FBBC05;}
|
||||
.st43{fill:#EA4335;}
|
||||
</style>
|
||||
<g>
|
||||
<g>
|
||||
<g>
|
||||
<path class="st15" d="M30,15H17c-0.6,0-1-0.4-1-1V3.3c0-0.5,0.4-0.9,0.8-1l13-2.3c0.3,0,0.6,0,0.8,0.2C30.9,0.4,31,0.7,31,1v13
|
||||
C31,14.6,30.6,15,30,15z"/>
|
||||
</g>
|
||||
<g>
|
||||
<path class="st15" d="M13,15H1c-0.6,0-1-0.4-1-1V6c0-0.5,0.4-0.9,0.8-1l12-2c0.3,0,0.6,0,0.8,0.2C13.9,3.4,14,3.7,14,4v10
|
||||
C14,14.6,13.6,15,13,15z"/>
|
||||
</g>
|
||||
<g>
|
||||
<path class="st15" d="M30,32c-0.1,0-0.1,0-0.2,0l-13-2.3c-0.5-0.1-0.8-0.5-0.8-1V18c0-0.6,0.4-1,1-1h13c0.6,0,1,0.4,1,1v13
|
||||
c0,0.3-0.1,0.6-0.4,0.8C30.5,31.9,30.2,32,30,32z"/>
|
||||
</g>
|
||||
<g>
|
||||
<path class="st15" d="M13,29c-0.1,0-0.1,0-0.2,0l-12-2C0.4,26.9,0,26.5,0,26v-8c0-0.6,0.4-1,1-1h12c0.6,0,1,0.4,1,1v10
|
||||
c0,0.3-0.1,0.6-0.4,0.8C13.5,28.9,13.2,29,13,29z"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.0 KiB |
@@ -0,0 +1,90 @@
|
||||
'use strict';
|
||||
'require ui';
|
||||
'require view';
|
||||
'require uci';
|
||||
'require form';
|
||||
'require rpc';
|
||||
'require tools.widgets as widgets';
|
||||
|
||||
return view.extend({
|
||||
// RPC call to properly configure proxies:
|
||||
configure_proxies: rpc.declare({
|
||||
object: 'luci.squid-adv',
|
||||
method: 'reconfigure',
|
||||
}),
|
||||
cert_info: rpc.declare({
|
||||
object: 'luci.squid-adv',
|
||||
method: 'cert_info',
|
||||
}),
|
||||
|
||||
// Validate whether string passed is a valid IP/Port combination or just a valid Port:
|
||||
validate_ip: function(section_id, value) {
|
||||
var ipv4 = /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?):(6553[0-5]|655[0-2][0-9]|65[0-4][0-9][0-9]|6[0-4][0-9][0-9][0-9][0-9]|[1-5](\d){4}|[1-9](\d){0,3})$/;
|
||||
var ipv6 = /^(?:(?:[a-fA-F\d]{1,4}:){7}(?:[a-fA-F\d]{1,4}|:)|(?:[a-fA-F\d]{1,4}:){6}(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|:[a-fA-F\d]{1,4}|:)|(?:[a-fA-F\d]{1,4}:){5}(?::(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,2}|:)|(?:[a-fA-F\d]{1,4}:){4}(?:(?::[a-fA-F\d]{1,4}){0,1}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,3}|:)|(?:[a-fA-F\d]{1,4}:){3}(?:(?::[a-fA-F\d]{1,4}){0,2}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,4}|:)|(?:[a-fA-F\d]{1,4}:){2}(?:(?::[a-fA-F\d]{1,4}){0,3}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,5}|:)|(?:[a-fA-F\d]{1,4}:){1}(?:(?::[a-fA-F\d]{1,4}){0,4}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,6}|:)|(?::(?:(?::[a-fA-F\d]{1,4}){0,5}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,7}|:)))(?:%[0-9a-zA-Z]{1,})?$/gm;
|
||||
var port_only = /^(6553[0-5]|655[0-2][0-9]|65[0-4][0-9][0-9]|6[0-4][0-9][0-9][0-9][0-9]|[1-5](\d){4}|[1-9](\d){0,3})$/;
|
||||
if (ipv4.test(value) || ipv6.test(value) || port_only.test(value)) {
|
||||
return true;
|
||||
} else {
|
||||
return _("Invalid IP/Port or Port Range");
|
||||
}
|
||||
},
|
||||
|
||||
// Loading function:
|
||||
load: function () {
|
||||
return Promise.all([
|
||||
this.cert_info(),
|
||||
]);
|
||||
},
|
||||
|
||||
// Rendering function:
|
||||
render: function(data) {
|
||||
var m, o, i, s, t, valid = data[0].valid;
|
||||
if (!valid) {
|
||||
ui.addNotification(null, _("NOTICE: Server certificate missing! ") + """ + _("Enable Transparent HTTPS Proxy") + "" " + _("setting will be not be shown until the server certificate has been generated!"), 'error' );
|
||||
}
|
||||
m = new form.Map('squid', _('Transparent Proxy Configuration'));
|
||||
|
||||
s = m.section(form.TypedSection, 'transparent');
|
||||
s.anonymous = true;
|
||||
|
||||
o = s.option(widgets.NetworkSelect, 'interface', _('Interface'), _('Transparent proxy only works on the specified interface.') + "<br />" + _("Do not use on interfaces controlled by programs like nodogsplash!"));
|
||||
o.multiple = false;
|
||||
o.default = 'lan';
|
||||
|
||||
o = s.option(form.Flag, "http_enabled", _("Enable Transparent HTTP Proxy") + ":")
|
||||
|
||||
o = s.option(form.Value, "http_port", _("Bind for Transparent HTTP Proxy:"), _("Specify either IP address and Port combination, or just the Port."))
|
||||
o.validate = this.validate_ip;
|
||||
o.default = '3126'
|
||||
o.placeholder = "0-65535"
|
||||
o.depends("http_enabled", '1');
|
||||
|
||||
o = s.option(form.HiddenValue, "cert_valid")
|
||||
o.cfgvalue = function(section_id) { return valid ? "1" : "0"; }
|
||||
o.write = null;
|
||||
|
||||
o = s.option(form.Flag, "https_enabled", _("Enable Transparent HTTPS Proxy") + ":")
|
||||
o.depends("cert_valid", '1')
|
||||
|
||||
o = s.option(form.Value, "https_port", _("Bind for Transparent HTTPS Proxy:"), _("Specify either IP address and Port combination, or just the Port."))
|
||||
o.validate = this.validate_ip;
|
||||
o.default = '3127'
|
||||
o.placeholder = "0-65535"
|
||||
o.depends("https_enabled", '1');
|
||||
|
||||
// mac_list = s.option(DynamicList, "transparent_mac", _("Allowed MACs for Transparent HTTPS Proxy:"))
|
||||
// nt.mac_hints(function(mac, name) mac_list :value(mac, "%s (%s)" %{ mac, name }) end)
|
||||
|
||||
return m.render();
|
||||
},
|
||||
|
||||
handleSaveApply: function(ev, mode) {
|
||||
var tasks = [
|
||||
this.handleSave(ev),
|
||||
this.configure_proxies(),
|
||||
];
|
||||
return Promise.all(tasks).then(function() {
|
||||
classes.ui.changes.apply(mode == '0');
|
||||
});
|
||||
},
|
||||
})
|
||||