20190514_jeffrey - silenceuncrio/diary GitHub Wiki

0910

review

1015

commit 26f34ca7f7781ad0a3a0df8773c6d8e073faca51
Refs: [feature/lighttpd]
Author: jeffrey <[email protected]>
Date:   Tue May 14 10:13:29 2019 +0800

    - offer jweb.access.filter for multi-user with different level
      - TBD: find user in session information and get the user level
    - sntp.cgi use jweb.access.filter() for testing
    - implement /cgi-bin/api.cgi?act=login
      - TBD: create session
      - TBD: set cookie

 proscend/prosrc/webcgi/api.c                     | 78 ++++++++++++++++++++++++
 proscend/prosrc/webcgi/jweb.c                    | 22 +++++++
 proscend/prosrc/webcgi/jweb.h                    |  5 ++
 proscend/prosrc/webcgi/sntp.c                    |  6 +-
 proscend/prosrc/www/app/feature/login.js         | 40 +-----------
 proscend/prosrc/www/app/services/icos.service.js |  5 +-
 6 files changed, 116 insertions(+), 40 deletions(-)

url rewrite 會將 /api/login rewrite 成 /cgi-bin/api.cgi?act=login

不過 login 的 post 帶參數的方式有改變

就跟其他 module apply 動作都一樣

1025

優先處理 M330

日本客戶需要 schedule reboot 做測試

先搜尋自己的日記有關於 schedule reboot 的工作紀錄

  • 20180717_jeffrey
    • 客戶新需求 - schedule reboot
  • 20180718_jeffrey
    • start crond - /var/spool/cron: No such file or directory
  • 20180719_jeffrey
    • Use .bbappend to cause update-rc.d to disable init script start links of cronie service
    • add 'schedule-reboot' icos module
    • add CGI for 'schedule-reboot' icos module
    • add 'Management / Schedule Reboot' web page
  • 20180720_jeffrey
    • 測試 crond 是怎麼作到每 40 分鐘
  • 20180723_jeffrey
    • 不用 at 這個 recipe 了
    • schedule_reboot.sh 必須明確的指定路徑才行
  • 20180727_jeffrey
    • atd 啟動的問題有解了
  • 20180730_jeffrey
    • 目前 M300 上的 schedule reboot 因為跟時間有關
    • sntp 負責人 john 會再時間有異動的時候 broadcast event 方便我重新 apply
  • 20180823_jeffrey
    • apply the MODULE_SCHEDULE_REBOOT when receive the ICOS_TIME_UPDATE event
  • 20180827_jeffrey
    • ariel 發現 Schedule Reboot 的 interval 不 work
    • correct the behavior of 'Schedule Reboot'
  • 20180828_jeffrey
    • at command 異常
    • 放棄 atd
    • give up to use 'atd' to implement the schedule reboot with type 'interval':
      • use PeriodHandle() and SysGetUpTime() to implement that function
      • do not care about the 'ICOS_TIME_UPDATE' event when the schedule type is 'interfal'
  • 20180829_jeffrey
    • 驗收昨天下班執行的每 60 分鐘的 schedule reboot
    • give some system log while user apply the schedule reboot
    • ignore the ICOS_BOOTINIT_DONE event, or we will apply twice
  • 20180921_jeffrey
    • M360P 目前已經有 crond 可以用了
    • 每兩分鐘紀錄一下目前時間到 /tmp/xxx.txt
    • 看來沒什麼問題

1305

參考 20180921_jeffrey 在 M330 試一下

crontab -e 編輯會發現多一個 /etc/crontabs/root

root@ICR-W401:/home/admin# cat /etc/crontabs/root
*/2 * * * * date >> /tmp/xxx.txt

把 crond 叫起來

root@ICR-W401:/home/admin# crond
root@ICR-W401:/home/admin# 

過一下來看

root@ICR-W401:/home/admin# cat /tmp/xxx.txt
Thu Jan  1 02:40:01 GREEN 1970
Thu Jan  1 02:42:01 GREEN 1970
Thu Jan  1 02:44:01 GREEN 1970
Thu Jan  1 02:46:01 GREEN 1970

看來可以從 M300 icos 開始搬了

M330 V0.03 預計在 2019-05-24 release 給 QA

我只要在該日期之前完成即可

1640

https unstable 的問題 aaron 找出了一個快速解法

他查到 iweb 之所以 https 不穩是因為跟 openssl 之間在信息處理量大的時候所造成的問題

他用了 nginx 當 https proxy

原本的 iweb 還是繼續服務 http

這樣的搭配之下在 M300 就可以克服掉 https 不穩的問題

剛剛找 ariel 聊一下

短期就先用這個 solution

先在 M360 上試做看看

我就先在 M330 和 M360 把 schedule reboot 做完

然後視情況看使否徹底改寫原本的 cgi

或是先去忙 dnp3

1755

直接從 M300 把 schedule reboot 的 code porting 到 M330 吧