20161006_jeffrey - silenceuncrio/diary GitHub Wiki

Index

1045

pioneer 原本在 vpn 機種實作的 openvpn 的 CGI 實在是做了太多不適合在 CGI 做的事情

m300 負責 openvpn 的 jammy 要離職了

接手 openvpn 的 aaron 也還不熟悉

我目前的處境很尷尬... 因為 CGI 很多需要調整的東西都要需要跟 ICOS 做協調

我目前光 createServerCert() 就失敗了

雖然有 /tmp/.syslog 可以查

但這實在不是負責 web 的人的責任

還是等 aaron 熟悉 openvpn 再來改吧

先做別的

1055

目前 m300 在瀏覽器上打 192.168.1.1 後會開啟 rpAuth.html

web_define.h 有定義

#define  WEBLOGIN_URL			    "rpAuth.html"

竟然寫死在 m300 的 web server mini_httpd.c 裡面

#define LOGIN_PAGE	"/rpAuth.html"

先 trace 一下... 暈... rpAuth.html 還要依賴 z_web.cgi

帳密對了之後才會導到 index.html... 也就是目前新網頁的入口...

1125

追一下 Request URL:http://192.168.1.1/cgi-bin/z_web.cgi?module=sysadmin&act=getSetting

webmain.c

int main(void) {
    ...
    if (STRCMP(module, "xxx")) {
       ...
    } else if (STRCMP(module, "sysadmin")) {
        res = handle_module_sysadmin(act);
    }
    ...

web_sysadmin.c

int handle_module_sysadmin(const char *act) {
    int no = www_getactno(act);
    switch (no) {
    case ACT_GET:
        return sysadmin_get();
    case ACT_APPLY:
        return sysadmin_apply();
    }
    return fail("Unknown act");
}

1225

Revision: 865
Author: jeffrey
Date: 2016年10月6日 下午 12:27:06
Message:
Modify system.cgi
- apply admin_password and user_password

----
Modified : /fsl-release-bsp/proscend/prosrc/webcgi/Makefile
Modified : /fsl-release-bsp/proscend/prosrc/webcgi/system.c
Revision: 866
Author: jeffrey
Date: 2016年10月6日 下午 12:28:06
Message:
Modify management_administration.html and management_administration.js
- apply admin_password and user_password

----
Modified : /fsl-release-bsp/proscend/prosrc/www/app/feature/management_administration.html
Modified : /fsl-release-bsp/proscend/prosrc/www/app/feature/management_administration.js

1255

Revision: 867
Author: jeffrey
Date: 2016年10月6日 下午 12:58:27
Message:
calculate the sysUpTime before display to user

----
Modified : /fsl-release-bsp/proscend/prosrc/www/app/feature/management_identification.html
Modified : /fsl-release-bsp/proscend/prosrc/www/app/feature/management_identification.js

1300

來做 z_web.cgi?module=systime&act=getSetting 原本的網頁為 rpTimeZone.html

原本的 CGI 在 web_system.c

int handle_module_systime(const char *act) {
	int no = www_getactno(act);
	switch (no) {
		case ACT_GET:
			return systime_getSetting();
		case ACT_APPLY:
			return systime_apply();
	}
    return fail("Unknown act");
}

不過 systime_getSetting() 實在有點複雜...

1720

Revision: 874
Author: jeffrey
Date: 2016年10月6日 下午 05:24:33
Message:
Add sntp.cgi
- CGI for MODULE_SNTP

----
Modified : /fsl-release-bsp/proscend/prosrc/webcgi/Makefile
Added : /fsl-release-bsp/proscend/prosrc/webcgi/sntp.c
Revision: 875
Author: jeffrey
Date: 2016年10月6日 下午 05:25:57
Message:
Add "sntp" web page

----
Modified : /fsl-release-bsp/proscend/prosrc/www/app/app.route-config.js
Added : /fsl-release-bsp/proscend/prosrc/www/app/feature/timeAndDate.html
Added : /fsl-release-bsp/proscend/prosrc/www/app/feature/timeAndDate.js
Modified : /fsl-release-bsp/proscend/prosrc/www/app/services/icos.service.js
Modified : /fsl-release-bsp/proscend/prosrc/www/index.html
Deleted : /fsl-release-bsp/proscend/prosrc/www/pages/timeAndDate.html

1810

monkeyjj 再來要看這一篇

PHP CRUD Tutorial (part 1)