From 97fbce71d912cd9557686a25d6f0c2b6283e4403 Mon Sep 17 00:00:00 2001 From: Toastman Date: Thu, 31 Mar 2016 12:51:29 +0700 Subject: [PATCH] Remove TomatoAnon --- release/src/router/httpd/misc.c | 27 ----- release/src/router/httpd/tomato.c | 7 -- release/src/router/httpd/tomato.h | 1 - release/src/router/nvram/defaults.c | 6 -- release/src/router/others/Makefile | 3 - release/src/router/others/tomatoanon | 161 ---------------------------- release/src/router/rc/Makefile | 1 - release/src/router/rc/rc.h | 3 - release/src/router/rc/services.c | 10 -- release/src/router/rc/tomatoanon.c | 30 ------ release/src/router/www/about.asp | 1 - release/src/router/www/admin-tomatoanon.asp | 129 ---------------------- release/src/router/www/status-data.jsx | 5 +- release/src/router/www/status-overview.asp | 24 ----- release/src/router/www/tomato.js | 1 - 15 files changed, 1 insertion(+), 408 deletions(-) delete mode 100755 release/src/router/others/tomatoanon delete mode 100644 release/src/router/rc/tomatoanon.c delete mode 100644 release/src/router/www/admin-tomatoanon.asp diff --git a/release/src/router/httpd/misc.c b/release/src/router/httpd/misc.c index a9c44ac8d7..2035dcb3c1 100644 --- a/release/src/router/httpd/misc.c +++ b/release/src/router/httpd/misc.c @@ -446,33 +446,6 @@ void asp_etherstates(int argc, char **argv) } } -void asp_anonupdate(int argc, char **argv) -{ - FILE *f; - char s[32], *a, b[16]; - unsigned n; - - if ( nvram_match("tomatoanon_answer", "1") && nvram_match("tomatoanon_enable", "1") && nvram_match("tomatoanon_notify", "1") ) { - - web_puts("\nanonupdate = {"); - - n = 0; - if ((f = fopen("/tmp/anon.version", "r")) != NULL) { - while (fgets(s, sizeof(s), f)) { - if (sscanf(s, "have_update=%s", b) == 1) a="update"; - else continue; - - web_printf("%s\t%s: '%s'", n ? ",\n" : "", a, b); - n++; - } - fclose(f); - } - web_puts("\n};\n"); - } else { - web_puts("\nanonupdate = {\tupdate: 'no'\n};\n"); - } -} - void asp_sysinfo(int argc, char **argv) { struct sysinfo si; diff --git a/release/src/router/httpd/tomato.c b/release/src/router/httpd/tomato.c index 5445ebf376..27214d60f8 100644 --- a/release/src/router/httpd/tomato.c +++ b/release/src/router/httpd/tomato.c @@ -411,7 +411,6 @@ const aspapi_t aspapi[] = { { "mmcid", asp_mmcid }, //MMC Support #endif { "etherstates", asp_etherstates }, //Ethernet States - { "anonupdate", asp_anonupdate }, //Tomato update notification system #ifdef TCONFIG_IPV6 { "calc6rdlocalprefix", asp_calc6rdlocalprefix }, #endif @@ -1091,12 +1090,6 @@ static const nvset_t nvset_list[] = { { "mmc_exec_umount", V_LENGTH(0, 64) }, #endif -// admin-tomatoanon - { "tomatoanon_answer", V_RANGE(0, 1) }, - { "tomatoanon_enable", V_RANGE(-1, 1) }, - { "tomatoanon_id", V_LENGTH(0, 32) }, - { "tomatoanon_notify", V_01 }, - // nas-usb - !!TB #ifdef TCONFIG_USB { "usb_enable", V_01 }, diff --git a/release/src/router/httpd/tomato.h b/release/src/router/httpd/tomato.h index 801a3ca96e..98f6c1efce 100644 --- a/release/src/router/httpd/tomato.h +++ b/release/src/router/httpd/tomato.h @@ -80,7 +80,6 @@ extern void asp_notice(int argc, char **argv); extern void asp_mmcid(int argc, char **argv); #endif extern void asp_etherstates(int argc, char **argv); -extern void asp_anonupdate(int argc, char **argv); extern void wo_wakeup(char *url); extern void asp_dns(int argc, char **argv); extern void wo_resolve(char *url); diff --git a/release/src/router/nvram/defaults.c b/release/src/router/nvram/defaults.c index 5aaa48f728..7f15fc20cb 100644 --- a/release/src/router/nvram/defaults.c +++ b/release/src/router/nvram/defaults.c @@ -699,12 +699,6 @@ const defaults_t defaults[] = { { "jffs2_on", "0" }, { "jffs2_exec", "" }, -// admin-tomatoanon - { "tomatoanon_enable", "-1" }, - { "tomatoanon_answer", "0" }, - { "tomatoanon_id", "" }, - { "tomatoanon_notify", "1" }, - #ifdef TCONFIG_USB // nas-usb - !!TB { "usb_enable", "1" }, diff --git a/release/src/router/others/Makefile b/release/src/router/others/Makefile index 7642fde662..0701b0aaf0 100644 --- a/release/src/router/others/Makefile +++ b/release/src/router/others/Makefile @@ -24,9 +24,6 @@ ifeq ($(TCONFIG_DNSCRYPT),y) install -m 0700 ntp2ip $(INSTALLDIR)/usr/sbin endif -#TomatoAnon project - install -m 0700 tomatoanon $(INSTALLDIR)/usr/sbin - #TTB project install -m 0700 ttb $(INSTALLDIR)/usr/sbin diff --git a/release/src/router/others/tomatoanon b/release/src/router/others/tomatoanon deleted file mode 100755 index 23d13f2c14..0000000000 --- a/release/src/router/others/tomatoanon +++ /dev/null @@ -1,161 +0,0 @@ -#!/bin/sh - -############################### -# Copyright (C) 2012/2013 shibby -# -# This script send anonymous or incompleted information about model of router and installed tomato version. -# Those information will be used ONLY for stats. -# Any of private information will be NOT sended! -# Results you can explore on http://anon.groov.pl page. -# If you don`t agree to run this script you can disable it in GUI. -# -# Sended information: -# - MD5SUM of WAN+LAN MAC addresses - this will identify a router. Ex: 1c1dbd4202d794251ec1acf1211bb2c8 -# - Model of router. Ex: Asus RT-N66U -# - Version of installed tomato. Ex: 110 K26 USB -# - Builtype. Ex: Mega-VPN-64K -# - Uptime of your router. Ex: 3 days -# - Number of version for tomato update notification system. Ex: 110 -# -# That`s all -############################### - -ANON_ENABLED=`nvram get tomatoanon_enable` -ANON_ANSWER=`nvram get tomatoanon_answer` -ANON_NOTIFY=`nvram get tomatoanon_notify` - -if [ "$ANON_ANSWER" == "1" ]; then - if [ "$ANON_ENABLED" == "1" ]; then - -############################ - MOD=Shibby -############################ - - #Detect Version and Buildtype - KERNEL=`uname -r | cut -d "." -f1,2` - if [ "$KERNEL" == "2.6" ]; then - IS_USB=`nvram get os_version | grep USB | wc -l` - if [ "$IS_USB" == "0" ]; then #if K26 - VER=`nvram get os_version | awk '{ print $2" "$3 }' | cut -d "-" -f2` - BUILDTYPE=`nvram get os_version | awk '{ print $4 }'` - else #if K26USB - VER=`nvram get os_version | awk '{ print $2" "$3" "$4 }' | cut -d "-" -f2` - BUILDTYPE=`nvram get os_version | awk '{ print $5 }'` - fi - else #K2.4 - IS_USB=`nvram get os_version | grep USB | wc -l` - if [ "$IS_USB" == "0" ]; then #if K24 - VER=`nvram get os_version | awk '{ print $2" "$3 }'` - BUILDTYPE=`nvram get os_version | awk '{ print $4 }'` - else # if K24USB - VER=`nvram get os_version | awk '{ print $2" "$3" "$4 }'` - BUILDTYPE=`nvram get os_version | awk '{ print $5 }'` - fi - fi - - if [ "$1" == "checkver" -a "$ANON_NOTIFY" == "1" ]; then - # Tomato Update Notification Script - # This works only for Shibby`s builds !!! - CHECK_VER=`echo $VER | awk '{print $1}' | cut -d "." -f1 | sed 's/[^0-9]*//g` - - #Change all spaces to %20 - echo "http://anon.groov.pl/index.php?v=$CHECK_VER&mod=$MOD&anon=2" > /tmp/AnonLink - sed -i "s/ /%20/g" /tmp/AnonLink - ANONSEND=`cat /tmp/AnonLink` - rm /tmp/AnonLink - - RESULT="/tmp/anon.version" - wget -O $RESULT $ANONSEND - - #do we have result? If don`t, then set no update needed - if [ ! -f "$RESULT" ]; then - echo "have_update=no" > $RESULT - fi - - #Thanks. Now add cron job - - ISCRU=`cru l | grep checkver | wc -l` - if [ "$ISCRU" == "0" ]; then - - #random minutes 0..59 - MINUTES=`awk 'BEGIN {srand(); printf "%d", 60*rand()}'` - - #random hour 0..23 - HOUR=`awk 'BEGIN {srand(); printf "%d", 23*rand()}'` - - #checkver daily - cru a checkver "$MINUTES $HOUR * * * /usr/sbin/tomatoanon checkver" - fi - - else #just update anon database - #Collect datas - MOD=Shibby - UPTIME=`uptime | cut -d "," -f1 | cut -d " " -f4,5` - WANMAC=`nvram get wan_hwaddr` - LANMAC=`nvram get lan_hwaddr` - MODEL=`nvram get t_model_name` - DRIVER=`wl ver | grep version | awk '{ print $7 }'` - WANMAC_MD5=`echo "$WANMAC+$LANMAC" | md5sum | awk '{ print $1 }'` - - ROUTERID=`nvram get tomatoanon_id` - if [ ! "$ROUTERID" == "$WANMAC_MD5" ]; then - nvram set tomatoanon_id="$WANMAC_MD5" - nvram commit - fi - - #Change all spaces to %20. - echo "http://anon.groov.pl/index.php?wanmac_md5=$WANMAC_MD5&model=$MODEL&version=$VER&buildtype=$BUILDTYPE&driver=$DRIVER&uptime=$UPTIME&mod=$MOD&anon=1" > /tmp/AnonLink - sed -i "s/ /%20/g" /tmp/AnonLink - ANONSEND=`cat /tmp/AnonLink` - rm /tmp/AnonLink - - #We have all we need well we can send datas to Anon database - RESULT="/tmp/anon.result" - wget -O $RESULT $ANONSEND - - #Thanks. Now add cron job - - ISCRU=`cru l | grep anonupdate | wc -l` - if [ "$ISCRU" == "0" ]; then - - #random minutes 0..59 - MINUTES=`awk 'BEGIN {srand(); printf "%d", 60*rand()}'` - - #random hour 0..23 - HOUR=`awk 'BEGIN {srand(); printf "%d", 23*rand()}'` - - #random day of week 0..6 - DAY=`awk 'BEGIN {srand(); printf "%d", 6*rand()}'` - - #update anon one time per week - cru a anonupdate "$MINUTES $HOUR * * $DAY /usr/sbin/tomatoanon" - fi - fi - - else #if anon is not enabled or was disabled right now - - ISCRU=`cru l | grep anonupdate | wc -l` - if [ "$ISCRU" == "0" ]; then - cru d anonupdate - fi - - ISCRU=`cru l | grep checkver | wc -l` - if [ "$ISCRU" == "0" ]; then - cru d checkver - fi - - fi #end ANON_ENABLE - -else #if answer is not enabled or was disabled right now - - ISCRU=`cru l | grep anonupdate | wc -l` - if [ "$ISCRU" == "0" ]; then - cru d anonupdate - fi - - ISCRU=`cru l | grep checkver | wc -l` - if [ "$ISCRU" == "0" ]; then - cru d checkver - fi - -fi #end ANON_ANSWER diff --git a/release/src/router/rc/Makefile b/release/src/router/rc/Makefile index 40bce1c178..9770c68ffb 100644 --- a/release/src/router/rc/Makefile +++ b/release/src/router/rc/Makefile @@ -15,7 +15,6 @@ OBJS += firewall.o ppp.o telssh.o wnas.o OBJS += listen.o redial.o led.o qos.o forward.o misc.o mtd.o OBJS += buttons.o restrict.o gpio.o sched.o OBJS += new_qoslimit.o arpbind.o -OBJS += tomatoanon.o ifeq ($(TCONFIG_USB),y) OBJS += usb.o diff --git a/release/src/router/rc/rc.h b/release/src/router/rc/rc.h index 4b6246b7cd..025b3b1d2e 100644 --- a/release/src/router/rc/rc.h +++ b/release/src/router/rc/rc.h @@ -540,9 +540,6 @@ extern void start_mysql(); extern void stop_mysql(); #endif -// tomatoanon.c -extern void start_tomatoanon(); -extern void stop_tomatoanon(); #endif diff --git a/release/src/router/rc/services.c b/release/src/router/rc/services.c index 50b0057643..e6730cd098 100644 --- a/release/src/router/rc/services.c +++ b/release/src/router/rc/services.c @@ -2282,8 +2282,6 @@ void start_services(void) start_snmp(); #endif - start_tomatoanon(); - #ifdef TCONFIG_TOR start_tor(); #endif @@ -2321,8 +2319,6 @@ void stop_services(void) stop_tor(); #endif - stop_tomatoanon(); - #ifdef TCONFIG_NFS stop_nfs(); #endif @@ -2838,12 +2834,6 @@ TOP: } #endif - if (strcmp(service, "tomatoanon") == 0) { - if (action & A_STOP) stop_tomatoanon(); - if (action & A_START) start_tomatoanon(); - goto CLEAR; - } - #ifdef TCONFIG_USB // !!TB - USB Support if (strcmp(service, "usb") == 0) { diff --git a/release/src/router/rc/tomatoanon.c b/release/src/router/rc/tomatoanon.c deleted file mode 100644 index 50f959031f..0000000000 --- a/release/src/router/rc/tomatoanon.c +++ /dev/null @@ -1,30 +0,0 @@ -/* - * tomatoanon.c - * - * Copyright (C) 2012 shibby - * - */ -#include -#include - -void start_tomatoanon(void) -{ - -// only if enable... - if (!nvram_match("tomatoanon_enable", "1")) return; - if (!nvram_match("tomatoanon_answer", "1")) return; - - xstart( "tomatoanon" ); - - if (nvram_match("tomatoanon_notify", "1")) - xstart( "tomatoanon", "checkver" ); - - return; -} - -void stop_tomatoanon(void) -{ - xstart( "cru", "d", "anonupdate" ); - xstart( "cru", "d", "checkver" ); - return; -} diff --git a/release/src/router/www/about.asp b/release/src/router/www/about.asp index ca8f59e8f3..130547fbc6 100644 --- a/release/src/router/www/about.asp +++ b/release/src/router/www/about.asp @@ -165,7 +165,6 @@ Captive Portal Copyright (C) 2011 Ofer Chen & Vicente Soriano
- OpenVPN: Routing Policy -- TomatoAnon project integration and GUI
- TomatoThemeBase project integration and GUI
- Ethernet Ports State
- Extended MOTD (written by @Monter, modified by @Shibby)
diff --git a/release/src/router/www/admin-tomatoanon.asp b/release/src/router/www/admin-tomatoanon.asp deleted file mode 100644 index ad2b345802..0000000000 --- a/release/src/router/www/admin-tomatoanon.asp +++ /dev/null @@ -1,129 +0,0 @@ - - - - - - -[<% ident(); %>] Admin: TomatoAnon Project - - - - - - - - - - - - -
-
<% ident(); %>
-
- - - -
About TomatoAnon Project
-
-Hello,
-
-I would like to present you with a new project I've been working on, called TomatoAnon.
-The TomatoAnon script will send (to a database) information about your router's model and installed version of Tomato.
-The information submitted is 100% anonymous and will ONLY be used for statistical purposes.
-This script does NOT send any private or personal information whatsoever (like MAC`s, IP`s etc)!
-Script is fully open, and written in bash. Anyone is free to look at the content that is submitted to the database.
-
-The submitted results can be viewed on the http://anon.groov.pl page.
-This information may help you when choosing the best and most popular router available in your country.
-You can check which version of Tomato is most commonly used and which one is the most stable.
-
-If you don't agree with this script, or do not wish to use it, you can simply disable it.
-You can always re-enable it at any time.
-
-The following data is sent by TomatoAnon:
- - MD5SUM of WAN+LAN MAC addresses - this will identify a router. Ex: 1c1dbd4202d794251ec1acf1211bb2c8
- - Model of router. Ex: Asus RT-N66U
- - Installed version of Tomato. Ex: 102 K26 USB
- - Builtype. Ex: Mega-VPN-64K
- - Uptime of your router. Ex: 3 days
-That`s it !!
-
-Thank you for reading and please make the right choice to help this project.
-
-Best Regards! -
-
-
-
TomatoAnon Settings
-
- -
- -
Tomato Update Notification System
-
- -
    -
  • When new tomato version will be available, you will be notified about this on status-overview page. -
-
-
-
-
- - - diff --git a/release/src/router/www/status-data.jsx b/release/src/router/www/status-data.jsx index d4693356e3..4f107605e5 100644 --- a/release/src/router/www/status-data.jsx +++ b/release/src/router/www/status-data.jsx @@ -7,7 +7,7 @@ No part of this file may be used without permission. */ -//<% nvram("ppp_get_ip,pptp_server_ip,router_name,wan_ipaddr_buf,wan_domain,wan_gateway,wan_gateway_get,wan_get_domain,wan_hostname,wan_hwaddr,wan_ipaddr,wan_netmask,wan_proto,wan_run_mtu,et0macaddr,lan_proto,lan_ipaddr,dhcp_start,dhcp_num,dhcpd_startip,dhcpd_endip,lan_netmask,wl_security_mode,wl_crypto,wl_mode,wl_wds_enable,wl_hwaddr,wl_net_mode,wl_radio,wl_channel,lan_gateway,wl_ssid,wl_closed,t_model_name,t_features,pptp_dhcp,dhcp1_start,dhcp1_num,dhcpd1_startip,dhcpd1_endip,dhcp2_start,dhcp2_num,dhcpd2_startip,dhcpd2_endip,dhcp3_start,dhcp3_num,dhcpd3_startip,dhcpd3_endip,lan1_proto,lan1_ipaddr,lan1_netmask,lan2_proto,lan2_ipaddr,lan2_netmask,lan3_proto,lan3_ipaddr,lan3_netmask,lan_ifname,lan1_ifname,lan2_ifname,lan3_ifname,lan_ifnames,lan1_ifnames,lan2_ifnames,lan3_ifnames,wan_ifnames,tomatoanon_enable,tomatoanon_answer,lan_desc"); %> +//<% nvram("ppp_get_ip,pptp_server_ip,router_name,wan_ipaddr_buf,wan_domain,wan_gateway,wan_gateway_get,wan_get_domain,wan_hostname,wan_hwaddr,wan_ipaddr,wan_netmask,wan_proto,wan_run_mtu,et0macaddr,lan_proto,lan_ipaddr,dhcp_start,dhcp_num,dhcpd_startip,dhcpd_endip,lan_netmask,wl_security_mode,wl_crypto,wl_mode,wl_wds_enable,wl_hwaddr,wl_net_mode,wl_radio,wl_channel,lan_gateway,wl_ssid,wl_closed,t_model_name,t_features,pptp_dhcp,dhcp1_start,dhcp1_num,dhcpd1_startip,dhcpd1_endip,dhcp2_start,dhcp2_num,dhcpd2_startip,dhcpd2_endip,dhcp3_start,dhcp3_num,dhcpd3_startip,dhcpd3_endip,lan1_proto,lan1_ipaddr,lan1_netmask,lan2_proto,lan2_ipaddr,lan2_netmask,lan3_proto,lan3_ipaddr,lan3_netmask,lan_ifname,lan1_ifname,lan2_ifname,lan3_ifname,lan_ifnames,lan1_ifnames,lan2_ifnames,lan3_ifnames,wan_ifnames,lan_desc"); %> //<% uptime(); %> //<% sysinfo(); %> //<% wlstats(1); %> @@ -18,9 +18,6 @@ do { var a, b, i; var xifs = ['wan', 'lan', 'lan1', 'lan2', 'lan3']; - stats.anon_enable = nvram.tomatoanon_enable; - stats.anon_answer = nvram.tomatoanon_answer; - stats.lan_desc = nvram.lan_desc; if (typeof(last_wan_proto) == 'undefined') { diff --git a/release/src/router/www/status-overview.asp b/release/src/router/www/status-overview.asp index 2eb42a4827..c6854c8e11 100644 --- a/release/src/router/www/status-overview.asp +++ b/release/src/router/www/status-overview.asp @@ -37,7 +37,6 @@ // <% nvstat(); %> // <% etherstates(); %> -// <% anonupdate(); %> wmo = {'ap':'Access Point','sta':'Wireless Client','wet':'Wireless Ethernet Bridge','wds':'WDS'}; auth = {'disabled':'-','wep':'WEP','wpa_personal':'WPA Personal (PSK)','wpa_enterprise':'WPA Enterprise','wpa2_personal':'WPA2 Personal (PSK)','wpa2_enterprise':'WPA2 Enterprise','wpaX_personal':'WPA / WPA2 Personal','wpaX_enterprise':'WPA / WPA2 Enterprise','radius':'Radius'}; @@ -217,18 +216,6 @@ function ethstates() code += '» Configure'; E("ports").innerHTML = code; } - -function anon_update() -{ - update = anonupdate.update; - if (update == "no") { return 0; } - - var code = '
!! Attention !!
'; - code += '
Tomato by Shibby ' + update + ' is now available. Click here to read more.
'; - code += '
'; - E("nversion").innerHTML = code; -} - function show() { c('cpu', stats.cpuload); @@ -287,8 +274,6 @@ function show() function earlyInit() { - if ((stats.anon_enable == '-1') || (stats.anon_answer == '0')) - E('att1').style.display = ''; elem.display('b_dhcpc', show_dhcpc); elem.display('b_connect', 'b_disconnect', show_codi); @@ -301,8 +286,6 @@ function earlyInit() ethstates(); - anon_update() - show(); } @@ -349,13 +332,6 @@ function toggleVisibility(whichone) {
- -
System (hide)