Invalid config generation for tinyproxy

Hi guys.
I'm using tinyproxy and noticed that when main config in /var/etc/tinyproxy.conf is being generated from /etc/config/tinyproxy it lacks http flag in this line:
upstream <ip_addr>:<port>
and hence tinyproxy fails to start

root@Router:/etc/config# /usr/bin/tinyproxy -d -c /var/etc/tinyproxy.conf
ERROR: Syntax error on line 25
Unable to parse config file. Not starting.

Should be upstream http <ip_addr>:<port> in order to work properly.

Also if I change upstream to Upstream in /etc/config/tinyproxy, final string in /var/etc/tinyproxy.conf is not generated at all.

Also following options are deprecated:
line 21: deprecated option FilterExtended, use FilterType

option MinSpareServers 5
option MaxSpareServers 20
option StartServers 10
option MaxRequestsPerChild 0

Make a PR on github?

yes. https://github.com/openwrt/packages/issues/25670

This solves my problem too!
One more issue, the tinyproxy luci prvents me to enter .google.com into the taeget host field, which it is definitly valid for tinyproxy.conf.

The site can be specified in various forms as a hostname, domain name or as an IP range:
Here is the extraction from tinyproxy online docuemnt.

  • name matches host exactly
  • .name matches any host in domain "name"
  • . matches any host with no domain (in 'empty' domain)
  • IP/bits matches network/mask
  • IP/mask matches network/mask

One more issue for reject case. The code should change to


write_upstream() {
        local type
        local via
        local target

        config_get "type" "$1" "type"
        config_get via "$1" via
        config_get target "$1" target
        [ -n "$target" ] && target=' "'"$target"'"'

        [ "$type" = "proxy" ] && [ -n "$via" ] && \
                echo "upstream http $via$target"

        [ "$type" = "reject" ] && [ -n "$target" ] && \
                echo "upstream none $target"
}