20190813_jeffrey - silenceuncrio/diary GitHub Wiki

0905

M330 - P1 - All modules related to OpenSSl need to check (new 1.0.2)

source code 的 proscend 外層 make 已完成

proscend 裡 make distclean

make menuconfig - profile 選 generic wifi

make clean 後再 make


透過 https 將每個頁面都點了一次

沒發現有什麼問題

0920

回顧一下這一陣子解的 mantis issue

M300, M330 以及 M360P 都試著同步一下


0000637: if browser's width is not enough, status button will be coverd by the "fat" top banner

M300 還未套用

build 個 image 來試試 - M300/0_GENERIC

PASS


M300[develop] - limit the max-height of top banner and give it a 'overflow-y: auto'

commit a352643109008a57fd1ee3366b688222f28decda
Refs: [develop], {origin/develop}
Author: jeffrey <[email protected]>
Date:   Tue Aug 13 10:20:14 2019 +0800

    limit the max-height of top banner and give it a 'overflow-y: auto'
    - prevent it covers the menu if browser's width is not enough

 proscend/prosrc/www/brand_advice/brand/custom.css  | 3 +++
 proscend/prosrc/www/brand_ctcu/brand/custom.css    | 3 +++
 proscend/prosrc/www/brand_cxr/brand/custom.css     | 3 +++
 proscend/prosrc/www/brand_hytec/brand/custom.css   | 3 +++
 proscend/prosrc/www/brand_nobrand/brand/custom.css | 3 +++
 proscend/prosrc/www/brand_planet/brand/custom.css  | 3 +++
 proscend/prosrc/www/brand_xentino/brand/custom.css | 3 +++
 7 files changed, 21 insertions(+)

M360P 也還未套用

M360P[develop] - limit the max-height of top banner and give it a 'overflow-y: auto'

commit ff42cec5f866c8a05c453b2a4835a2011d5d8b2a
Refs: [develop], {origin/develop}
Author: jeffrey <[email protected]>
Date:   Tue Aug 13 10:26:00 2019 +0800

    limit the max-height of top banner and give it a 'overflow-y: auto'
    - prevent it covers the menu if browser's width is not enough

 proscend/prosrc/www/brand_nobrand/brand/custom.css  | 3 +++
 proscend/prosrc/www/brand_proscend/brand/custom.css | 3 +++
 2 files changed, 6 insertions(+)

沉住氣 build 個 image 來試試

PASS

1035

M330[release/v0.06] 新 issue

0000654: [Multi-User] Read-only Level, modify password no effect

解這個 bug 的同時也發現我欠卻考慮的地方

這在 M300 也會發生

M330 解完後要同步到 M300 去

M360P 沒有 multi user 所以不用解

解完多測一下

不用急著 commit

1305

修改的地方可不少

diff --git a/proscend/prosrc/webcgi/icos_config.c b/proscend/prosrc/webcgi/icos_config.c
index 883589b..04ad2f9 100644
--- a/proscend/prosrc/webcgi/icos_config.c
+++ b/proscend/prosrc/webcgi/icos_config.c
@@ -47,7 +47,7 @@ int main(void)

     if      (STRCMP(jweb.in.act, "coldreboot"))
     {
-        jweb.access.filter(ATTVAL_SYSTEM_LEVEL2, _coldreboot);
+        jweb.access.filter(ATTVAL_SYSTEM_LEVEL1, _coldreboot);
     }
     else if (STRCMP(jweb.in.act, "load_factory_and_reboot"))
     {
diff --git a/proscend/prosrc/webcgi/system.c b/proscend/prosrc/webcgi/system.c
index 5efa419..16892c0 100644
--- a/proscend/prosrc/webcgi/system.c
+++ b/proscend/prosrc/webcgi/system.c
@@ -75,6 +75,52 @@ static void _apply()



+static void _apply_by_name()
+{
+    int res;
+
+    sSystemConfig _config;
+    res = ICOS_GetSetting(MODULE_SYSTEM, 0, 0, &_config, sizeof(_config));
+    if (res != ICOS_SUCCESS)
+    {
+        jweb.http.status(500);
+        jweb.out.json.fail("ICOS_GetSetting fail");
+    }
+
+    char name[SYS_USERNAME_SIZE];
+    jweb.in.to_nstring("user_name", name, SYS_USERNAME_SIZE - 1);
+
+    for (int i = 0; i < SYSTEM_USER_NUM; i ++)
+    {
+        if (strcmp(name, _config.user[i].szUsername) == 0)
+        {
+            json_object *user_password;
+            if (json_object_object_get_ex(jweb.in.config, "user_password", &user_password))
+            {
+                char buf[100];
+                strcpy(buf,  json_object_get_string(user_password));
+                if (buf[0])
+                {
+                    strcpy(_config.user[i].szPassword, crypt(buf,"$1$"));
+                }
+            }
+        }
+    }
+
+
+
+    res = ICOS_Apply(MODULE_SYSTEM, 0, 0, &_config, sizeof(_config));
+    if (res != ICOS_SUCCESS)
+    {
+        jweb.http.status(500);
+        jweb.out.json.fail("ICOS_Apply fail");
+    }
+
+    jweb.out.json.ok();
+}
+
+
+
 static json_object * _get_status()
 {
     sSystemInformation _status;
@@ -191,6 +237,10 @@ int main(void)
     {
         jweb.access.filter(ATTVAL_SYSTEM_LEVEL1, _apply);
     }
+    else if (STRCMP(jweb.in.act, "apply_by_name"))
+    {
+        jweb.access.filter(ATTVAL_SYSTEM_LEVEL1, _apply_by_name);
+    }
     else if (STRCMP(jweb.in.act, "status"))
     {
         jweb.access.filter(ATTVAL_SYSTEM_LEVEL1, _status);
diff --git a/proscend/prosrc/www/app/feature/administration.js b/proscend/prosrc/www/app/feature/administration.js
index b5bdc7e..47664d0 100644
--- a/proscend/prosrc/www/app/feature/administration.js
+++ b/proscend/prosrc/www/app/feature/administration.js
@@ -224,7 +224,8 @@
       } else {

         vm.applying = true;
-        icos.system.apply(vm.system)
+        vm.system.user_name = vm.whoAmI.name;^M
+        icos.system.apply_by_name(vm.system)^M
           .then( function(response) {
             vm.applying = false;
             swal({title:"Apply ok", text:"Please reboot to take effect", confirmButtonText: "Reboot", type:"success", },
diff --git a/proscend/prosrc/www/app/services/icos.service.js b/proscend/prosrc/www/app/services/icos.service.js
index c9ef064..61ecd9a 100644
--- a/proscend/prosrc/www/app/services/icos.service.js
+++ b/proscend/prosrc/www/app/services/icos.service.js
@@ -260,6 +260,9 @@ function icos($http, $q) {
     system.apply = function(config) {
         return $http.post('cgi-bin/system.cgi?act=apply', angular.copy(config));
     }
+    system.apply_by_name = function(config) {
+        return $http.post('cgi-bin/system.cgi?act=apply_by_name', angular.copy(config));
+    }
     factory.system = system;


真的覺得殘塊

只是從 M300 porting 過來的功能還會漏掉那麼多

就是沒有花時間測試阿

我給自己的工作表現打幾分呢

這次好好表現


M330[release/v0.06] - fix multi user related issue

commit db71655845735dabee0f636694f59a8e2e2f94a2
Refs: [release/v0.06], {origin/release/v0.06}
Author: jeffrey <[email protected]>
Date:   Tue Aug 13 13:33:45 2019 +0800

    fix multi user related issue:
    - the access level of icos_config.cgi?act=coldreboot should be level1 or read_only user will not be able to reboot the device
    - add system.cgi?act=apply_by_name
    - correct the javascript behaviour at 'Management > Administration'

 proscend/prosrc/webcgi/icos_config.c              |  2 +-
 proscend/prosrc/webcgi/system.c                   | 50 +++++++++++++++++++++++
 proscend/prosrc/www/app/feature/administration.js |  3 +-
 proscend/prosrc/www/app/services/icos.service.js  |  3 ++
 4 files changed, 56 insertions(+), 2 deletions(-)

M300 也好好 review 一下


M300 非 root 的 user login 之後不應該重導至 wizard

因為 wizard 可以設定 super user password

怎麼會讓一個權限比 super user (level 3) 還要低的 user 去設定 super user 的密碼呢


diff --git a/proscend/prosrc/webcgi/icos_config.c b/proscend/prosrc/webcgi/icos_config.c
index 883589b..04ad2f9 100644
--- a/proscend/prosrc/webcgi/icos_config.c
+++ b/proscend/prosrc/webcgi/icos_config.c
@@ -47,7 +47,7 @@ int main(void)

     if      (STRCMP(jweb.in.act, "coldreboot"))
     {
-        jweb.access.filter(ATTVAL_SYSTEM_LEVEL2, _coldreboot);
+        jweb.access.filter(ATTVAL_SYSTEM_LEVEL1, _coldreboot);
     }
     else if (STRCMP(jweb.in.act, "load_factory_and_reboot"))
     {
diff --git a/proscend/prosrc/webcgi/system.c b/proscend/prosrc/webcgi/system.c
index cfa5bb5..2435e50 100644
--- a/proscend/prosrc/webcgi/system.c
+++ b/proscend/prosrc/webcgi/system.c
@@ -336,7 +336,7 @@ int main(void)
     }
     else if (STRCMP(jweb.in.act, "apply_by_name"))
     {
-        jweb.access.filter(ATTVAL_SYSTEM_LEVEL2, _apply_by_name);
+        jweb.access.filter(ATTVAL_SYSTEM_LEVEL1, _apply_by_name);
     }
     else if (STRCMP(jweb.in.act, "status"))
     {
diff --git a/proscend/prosrc/www/app/feature/administration.js b/proscend/prosrc/www/app/feature/administration.js
index b5bdc7e..47664d0 100644
--- a/proscend/prosrc/www/app/feature/administration.js
+++ b/proscend/prosrc/www/app/feature/administration.js
@@ -224,7 +224,8 @@
       } else {

         vm.applying = true;
-        icos.system.apply(vm.system)
+        vm.system.user_name = vm.whoAmI.name;^M
+        icos.system.apply_by_name(vm.system)^M
           .then( function(response) {
             vm.applying = false;
             swal({title:"Apply ok", text:"Please reboot to take effect", confirmButtonText: "Reboot", type:"success", },
diff --git a/proscend/prosrc/www/app/feature/login.js b/proscend/prosrc/www/app/feature/login.js
index 6faf25f..25cf6c0 100644
--- a/proscend/prosrc/www/app/feature/login.js
+++ b/proscend/prosrc/www/app/feature/login.js
@@ -24,6 +24,7 @@ angular
     .controller('loginController', loginController);

 function loginController($http, $location, $timeout, icos, share) {
+^M
     var vm = this;

     vm.config = {};
@@ -98,20 +99,25 @@ function loginController($http, $location, $timeout, icos, share) {
     var redirect = function() {
         console.log("redirect()");

-        icos.wizard.status()
-        .then( function(result) {
-            console.log('icos.wizard.status(): ', result.data);
-            if (result.data.finish === true) {
-                redirect_not_to_wizard();
-            } else {
-                redirect_to_wizard();
-            }
+        if (share.data.whoAmI.level >= 3) {^M
+            icos.wizard.status()^M
+            .then( function(result) {^M
+                console.log('icos.wizard.status(): ', result.data);^M
+                if (result.data.finish === true) {^M
+                    redirect_not_to_wizard();^M
+                } else {^M
+                    redirect_to_wizard();^M
+                }^M
+^M
+            }, function(error) {^M
+                console.log("icos.wizard.status() fail");^M
+                console.log("re-invoke icos.wizard.status() after 1 second");^M
+                $timeout(redirect, 1000);^M
+            });^M
+        } else {^M
+            redirect_not_to_wizard();^M
+        }^M

-        }, function(error) {
-            console.log("icos.wizard.status() fail");
-            console.log("re-invoke icos.wizard.status() after 1 second");
-            $timeout(redirect, 1000);
-        });
     }



M300[develop] - fix multi user related issue:

commit 8419103694527ce0b1d5795871dea7371c3cb7e9
Refs: [develop], {origin/develop}
Author: jeffrey <[email protected]>
Date:   Tue Aug 13 15:06:45 2019 +0800

    fix multi user related issue:
    - the access level of icos_config.cgi?act=coldreboot should be level 1 or read_only user will not be able to reboot the device
    - the access level of system.cgi?act=apply_by_name should be level 1 or read_only user will not be able to apply
    - correct the javascript behaviour at 'Management > Administration'
    - after login, only redirect to wizard if user is super user (level 3)
      - since we can chnage the password of super user during wizard follow

 proscend/prosrc/webcgi/icos_config.c              |  2 +-
 proscend/prosrc/webcgi/system.c                   |  2 +-
 proscend/prosrc/www/app/feature/administration.js |  3 ++-
 proscend/prosrc/www/app/feature/login.js          | 32 ++++++++++++++---------
 4 files changed, 23 insertions(+), 16 deletions(-)

1515

繼續回顧一下這一陣子解的 mantis issue

M300, M330 以及 M360P 都試著同步一下

[M330] - 0000637: if browser's width is not enough, status button will be coverd by the "fat" top banner

  • M300 ok
  • M330 ok
  • M360 不需要

[M330] - 0000636: [WEB UI] routing table is empty

  • M300
    • commit dfc79e63 - use setenv module in lighttpd to specify a PATH for CGI scripts
  • M330
    • commit 8b28932d - use setenv module in lighttpd to specify a PATH for CGI scripts
  • M360
    • commit 15f0d613 - use setenv module in lighttpd to specify a PATH for CGI scripts

[M330] - 0000631: [WEB UI] OSPF configure KEY ID 256, apply success, but display 0

  • M300
    • commit a3235b01 - at 'IP Routing > RIP'... at 'IP Routing > OSPF'...
  • M330
    • commit d2f74732 - at 'IP Routing > OSPF', add the maxlength validator to the 'key' field
  • M360
    • 沒有 RIP 和 OSPF 所以不需要修改

[M330] - 0000630: [WEB UI] RIP configure KEY ID 256, apply success, but display 0

  • M300
    • commit a3235b01 - at 'IP Routing > RIP'... at 'IP Routing > OSPF'...
  • M330
    • commit f200aa9f - at 'IP Routing > OSPF', add the min and max validator to the 'Cost' field
  • M360
    • 沒有 RIP 和 OSPF 所以不需要修改

[M330] - 0000629: [WEB UI] RIP configure key over 16, still apply success

  • M300
    • commit a3235b01 - at 'IP Routing > RIP'... at 'IP Routing > OSPF'...
  • M330
    • commit 0f562baf - at 'IP Routing > RIP', add the maxlength validator to the 'key' field
  • M360
    • 沒有 RIP 和 OSPF 所以不需要修改

[M330] - 0000628: [WEB UI] OSPF configure cost (very big number), apply success

  • M300
    • commit a3235b01 - at 'IP Routing > RIP'... at 'IP Routing > OSPF'...
  • M330
    • commit 9f949f0c - at 'IP Routing > RIP', add the min and max validator to the 'Key ID' field
  • M360
    • 沒有 RIP 和 OSPF 所以不需要修改

[M330] - 0000627: [WEB UI] OSPF configure key over 16, still apply success

  • M300
    • commit a3235b01 - at 'IP Routing > RIP'... at 'IP Routing > OSPF'...
  • M330
    • commit 6e6b8bf8 - at 'IP Routing > OSPF', add the min and max validator to the 'Key ID' field
  • M360
    • 沒有 RIP 和 OSPF 所以不需要修改

[M330] - 0000621: Firmware upgrade from Web UI through LTE easily fail on 33%

  • M300, M330 和 M360 都有針對該 issue 做了改善

[M330] - 0000604: connected PPTP connections is always 0

  • M300
    • 連 script 都沒有...
    • 找時間做
  • M330
    • commit b8093bbe - chmod the following scrips to 755
      • /proscend/base_fs/default/rootfs/etc/ppp/ip-down.d/09pptpd
      • /proscend/base_fs/default/rootfs/etc/ppp/ip-up.d/09pptpd
  • M360
    • script 有
    • 但 script 沒有像 M330 做修正
    • 找時間做

盤一下 [M330] - 0000604: connected PPTP connections is always 0

  • M300
    • 可以發一個 issue 給自己
  • M360P
    • 測試一下

1650

臨時的需求

M330[release/v0.06] - according to PROSRC_GNSS and PROSRC_GNSS_LAB to display LTE > GPS Config'

commit 8992a88fe0a3fa3961a97e7236536ae14dbf5fcd
Refs: [release/v0.06], {origin/release/v0.06}
Author: jeffrey <[email protected]>
Date:   Tue Aug 13 16:47:14 2019 +0800

    according to PROSRC_GNSS and PROSRC_GNSS_LAB to display LTE > GPS Config'

 proscend/prosrc/www/src/manual.html.src       | 2 +-
 proscend/prosrc/www/src/manual/sidebar.h.html | 2 +-
 proscend/prosrc/www/src/menu.html.src         | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

明天還要再給 yuncore 新的 firmware images

怕會誤用

所以要附上各個 images 的 MD5