lusa 5 лет назад
Родитель
Сommit
a7f4e6a578

BIN
app/goahead-5.1.0/build/linux-arm-static/bin/goahead


BIN
app/goahead-5.1.0/build/linux-arm-static/bin/goahead-test


BIN
app/goahead-5.1.0/build/linux-arm-static/bin/goahead-test.gdb


BIN
app/goahead-5.1.0/build/linux-arm-static/bin/goahead.gdb


BIN
app/goahead-5.1.0/build/linux-arm-static/bin/gopass


BIN
app/goahead-5.1.0/build/linux-arm-static/bin/gopass.gdb


BIN
app/goahead-5.1.0/build/linux-arm-static/bin/libgo.a


+ 0 - 0
app/goahead-5.1.0/ls


+ 14 - 24
app/goahead-5.1.0/src/auth.c

@@ -25,7 +25,6 @@
 
 #include    "goahead.h"
 #include    "ResultUtils.h"
-#include    <stdio.h>
 
 #if ME_GOAHEAD_AUTH
 
@@ -138,7 +137,6 @@ PUBLIC bool websAuthenticate(Webs *wp)
             websSetSessionVar(wp, WEBS_SESSION_USERNAME, wp->username);
         }
     }
-    printf("---> websAuthenticate, wp->username: %s\n", wp->username);
     return 1;
 }
 
@@ -187,7 +185,6 @@ PUBLIC void websCloseAuth(void)
 {
     WebsKey     *key, *next;
 
-    printf("---> websCloseAuth, users = %d, roles = %d\n", users, roles);
     wfree(masterSecret);
     if (users >= 0) {
         for (key = hashFirst(users); key; key = next) {
@@ -220,7 +217,6 @@ PUBLIC int websWriteAuthFile(char *path)
     assert(path && *path);
 
     tempFile = websTempFile(NULL, NULL);
-    printf("---> websTempFile: %s\n", tempFile);
     if ((fp = fopen(tempFile, "w" FILE_TEXT)) == 0) {
         error("Cannot open %s", tempFile);
         wfree(tempFile);
@@ -272,8 +268,6 @@ static WebsUser *createUser(cchar *username, cchar *password, cchar *roles)
     user->roles = sclone(roles);
     user->password = sclone(password);
     user->abilities = -1;
-
-    printf("---> createUser, name: %s, roles: %s, password: %s\n", user->name, user->roles, user->password);
     return user;
 }
 
@@ -282,7 +276,6 @@ WebsUser *websAddUser(cchar *username, cchar *password, cchar *roles)
 {
     WebsUser    *user;
 
-    printf("---> websAddUser, name: %s, roles: %s, password: %s\n", username, roles, password);
     if (!username) {
         error("User is missing name");
         return 0;
@@ -298,7 +291,6 @@ WebsUser *websAddUser(cchar *username, cchar *password, cchar *roles)
     if (hashEnter(users, username, valueSymbol(user), 0) == 0) {
         return 0;
     }
-
     return user;
 }
 
@@ -307,7 +299,6 @@ PUBLIC int websRemoveUser(cchar *username)
 {
     WebsKey     *key;
 
-    printf("---> websRemoveUser, name: %s\n", username);
     assert(username);
     if ((key = hashLookup(users, username)) != 0) {
         freeUser(key->content.value.symbol);
@@ -318,7 +309,6 @@ PUBLIC int websRemoveUser(cchar *username)
 
 static void freeUser(WebsUser *up)
 {
-    printf("---> freeUser\n");
     assert(up);
     hashFree(up->abilities);
     wfree(up->name);
@@ -332,7 +322,6 @@ PUBLIC int websSetUserPassword(cchar *username, cchar *password)
 {
     WebsUser    *user;
 
-    printf("---> websSetUserPassword, username: %s, password: %s\n", username, password);
     assert(username);
     if ((user = websLookupUser(username)) == 0) {
         return -1;
@@ -347,7 +336,6 @@ PUBLIC int websSetUserRoles(cchar *username, cchar *roles)
 {
     WebsUser    *user;
 
-    printf("---> websSetUserRoles, username: %s, roles: %s\n", username, roles);
     assert(username);
     if ((user = websLookupUser(username)) == 0) {
         return -1;
@@ -363,7 +351,6 @@ WebsUser *websLookupUser(cchar *username)
 {
     WebsKey     *key;
 
-    printf("---> websLookupUser, username: %s\n", username);
     assert(username);
     if ((key = hashLookup(users, username)) == 0) {
         return 0;
@@ -511,10 +498,9 @@ PUBLIC bool websLoginUser(Webs *wp, cchar *username, cchar *password)
     assert(wp->route);
     assert(username);
     assert(password);
+    logmsg(2, "%s-----------username auth0- ---------", username);
     logmsg(2, "%s-----------password auth0- ---------", password);
     logmsg(2, "%s-----------begin auth1 ---------", wp->route);
-
-    printf("---> websLoginUser, username: %s, password: %s\n", username, password);
     if (!wp->route || !wp->route->verify) {
         return 0;
     }
@@ -536,8 +522,6 @@ PUBLIC bool websLoginUser(Webs *wp, cchar *username, cchar *password)
 /*update by lusa  fix redirect to return json*/
 PUBLIC bool websLogoutUser(Webs *wp)
 {
-
-    printf("---> websLoginUser\n");
     assert(wp);
     websRemoveSessionVar(wp, WEBS_SESSION_USERNAME);
     websDestroySession(wp);
@@ -560,13 +544,17 @@ PUBLIC bool websLogoutUser(Webs *wp)
 static void loginServiceProc(Webs *wp)
 {
     WebsRoute   *route;
-    logmsg(1, "--------------login come in --------在这里用------");
-    HelloWord(wp);  //test
+    char    *username, *password;
+    username = websGetVar(wp, "username", NULL);
+    password = websGetVar(wp, "password", NULL);
+    logmsg(1, "--------------login come in --------------%s", username);
+    logmsg(1, "--------------login come in --------------%s", password);
+    // HelloWord(wp);  //test
     assert(wp);
     route = wp->route;
     assert(route);
 
-    if (websLoginUser(wp, websGetVar(wp, "username", ""), websGetVar(wp, "password", ""))) {
+    if (websLoginUser(wp, username, password)) {
         /* If the application defines a referrer session var, redirect to that */
         //update start 
        /* cchar *referrer;
@@ -623,8 +611,9 @@ PUBLIC bool websVerifyPasswordFromFile(Webs *wp)
 {
     char    passbuf[ME_GOAHEAD_LIMIT_PASSWORD * 3 + 3];
     bool    success;
-
-    logmsg(2, "***************start to auth pwd***************")
+    char    *username, *password;
+    username = websGetVar(wp, "username", NULL);
+    password = websGetVar(wp, "password", NULL);
     assert(wp);
     if (!wp->user && (wp->user = websLookupUser(wp->username)) == 0) {
         trace(5, "verifyUser: Unknown user \"%s\"", wp->username);
@@ -634,11 +623,12 @@ PUBLIC bool websVerifyPasswordFromFile(Webs *wp)
         Verify the password. If using Digest auth, we compare the digest of the password.
         Otherwise we encode the plain-text password and compare that
      */
-    // logmsg(2, "***************start to auth pwd111***************%s" , websMD5(passbuf))
+    
     if (!wp->encoded) {
         fmt(passbuf, sizeof(passbuf), "%s:%s:%s", wp->username, ME_GOAHEAD_REALM, wp->password);
         wfree(wp->password);
-        logmsg(2, "***************start to auth pwd222***************%s" , websMD5(passbuf));
+        // logmsg(2, "***************start to auth pwd222***************%s" , websMD5(passbuf));
+       
         wp->password = websMD5(passbuf);
         wp->encoded = 1;
     }

+ 1 - 1
app/goahead-5.1.0/src/auth.txt

@@ -23,6 +23,6 @@ role name=administrator abilities=user,manage
 
 #user name=julie password=13fe720f98d63de9d25ad4aaf595dcf9 roles=user
 user name=julie password=13fe720f98d63de9d25ad4aaf595dcf9 roles=user
-user name=joshua password=13fe720f98d63de9d25ad4aaf595dcf9 roles=administrator,purchase
+user name=joshua password=be9ff0562e911e00f2bbbbad1d1a40c1 roles=administrator,purchase
 user name=mary password=13fe720f98d63de9d25ad4aaf595dcf9 roles=user
 user name=peter password=13fe720f98d63de9d25ad4aaf595dcf9 roles=user

+ 1 - 1
app/goahead-5.1.0/src/cgi.c

@@ -281,7 +281,7 @@ static void writeCgiHeaders(Webs *wp, int status, ssize contentLength, char *loc
     if (contentType) {
         websWriteHeader(wp, "Content-Type", contentType);
     }
-    printf(">>>>>>>>>>>")
+    printf(">>>>>>>>>>>");
 }
 
 

+ 2 - 1
app/goahead-5.1.0/src/route.c

@@ -49,7 +49,8 @@ typedef struct PERSON
 
 void personInfoAction(Webs *wp)
 {
-    logmsg(2, "-----------------------111----------------------");
+    logmsg(2, "-----------------------111-----aaaaaaaaa-----------------", websGetVar(wp, "name", ""));
+    // console.log();
     int i; 
     Person person[2];
     person[0].name = "kangkang";

+ 5 - 1
app/goahead-5.1.0/src/web/index.html

@@ -1 +1,5 @@
-<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=/favicon.ico><title>bmcui</title><link href=/static/css/dashbord.css rel=prefetch><link href=/static/css/fan.css rel=prefetch><link href=/static/css/index.css rel=prefetch><link href=/static/css/login.css rel=prefetch><link href=/static/css/sensor_history.css rel=prefetch><link href=/static/css/set_proctrol.css rel=prefetch><link href=/static/js/dashbord.js rel=prefetch><link href=/static/js/fan.js rel=prefetch><link href=/static/js/index.js rel=prefetch><link href=/static/js/login.js rel=prefetch><link href=/static/js/sensor_history.js rel=prefetch><link href=/static/js/set_proctrol.js rel=prefetch><link href=/static/css/app.css rel=preload as=style><link href=/static/css/chunk-vendors.css rel=preload as=style><link href=/static/js/app.js rel=preload as=script><link href=/static/js/chunk-vendors.js rel=preload as=script><link href=/static/css/chunk-vendors.css rel=stylesheet><link href=/static/css/app.css rel=stylesheet></head><body><div id=app></div><script src=/static/js/chunk-vendors.js></script><script src=/static/js/app.js></script></body></html>
+<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=/favicon.ico><title>bmcui</title><link href=/static/css/dashbord.css rel=prefetch><link href=/static/css/fan.css rel=prefetch><link href=/static/css/index.css rel=prefetch><link href=/static/css/login.css rel=prefetch><link href=/static/css/sensor_history.css rel=prefetch><link href=/static/css/set_proctrol.css rel=prefetch><link href=/static/js/dashbord.js rel=prefetch><link href=/static/js/fan.js rel=prefetch><link href=/static/js/index.js rel=prefetch><link href=/static/js/login.js rel=prefetch><link href=/static/js/sensor_history.js rel=prefetch><link href=/static/js/set_proctrol.js rel=prefetch><link href=/static/css/app.css rel=preload as=style><link href=/static/css/chunk-vendors.css rel=preload as=style><link href=/static/js/app.js rel=preload as=script><link href=/static/js/chunk-vendors.js rel=preload as=script><link href=/static/css/chunk-vendors.css rel=stylesheet><link href=/static/css/app.css rel=stylesheet></head><body>
+	<div id=app></div><script src=/static/js/chunk-vendors.js></script><script src=/static/js/app.js></script>
+	<p>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</p>
+</body>
+	</html>

+ 24 - 2
gd32450i-eval.initramfs

@@ -132,8 +132,30 @@ file /etc/goahead/route.txt ${INSTALL_ROOT}/projects/${SAMPLE}/app/goahead-5.1.0
 
 file /var/www/goahead/favicon.ico ${INSTALL_ROOT}/projects/${SAMPLE}/app/goahead-5.1.0/src/web/favicon.ico 755 0 0
 file /var/www/goahead/index.html ${INSTALL_ROOT}/projects/${SAMPLE}/app/goahead-5.1.0/src/web/index.html 755 0 0
-file /var/www/goahead/login.html ${INSTALL_ROOT}/projects/${SAMPLE}/app/goahead-5.1.0/src/web/login.html 755 0 0
 file /var/www/goahead/static/css/app.css ${INSTALL_ROOT}/projects/${SAMPLE}/app/goahead-5.1.0/src/web/static/css/app.css 755 0 0
-file /var/www/goahead/static/img/logo.82b9c7a5.png ${INSTALL_ROOT}/projects/${SAMPLE}/app/goahead-5.1.0/src/web/static/img/logo.82b9c7a5.png 755 0 0
+file /var/www/goahead/static/css/chunk-vendors.css ${INSTALL_ROOT}/projects/${SAMPLE}/app/goahead-5.1.0/src/web/static/css/chunk-vendors.css 755 0 0
+file /var/www/goahead/static/css/dashbord.css ${INSTALL_ROOT}/projects/${SAMPLE}/app/goahead-5.1.0/src/web/static/css/dashbord.css 755 0 0
+file /var/www/goahead/static/css/fan.css ${INSTALL_ROOT}/projects/${SAMPLE}/app/goahead-5.1.0/src/web/static/css/fan.css 755 0 0
+file /var/www/goahead/static/css/index.css ${INSTALL_ROOT}/projects/${SAMPLE}/app/goahead-5.1.0/src/web/static/css/index.css 755 0 0
+file /var/www/goahead/static/css/login.css ${INSTALL_ROOT}/projects/${SAMPLE}/app/goahead-5.1.0/src/web/static/css/login.css 755 0 0
+file /var/www/goahead/static/css/sensor_history.css ${INSTALL_ROOT}/projects/${SAMPLE}/app/goahead-5.1.0/src/web/static/css/sensor_history.css 755 0 0
+file /var/www/goahead/static/css/set_proctrol.css ${INSTALL_ROOT}/projects/${SAMPLE}/app/goahead-5.1.0/src/web/static/css/set_proctrol.css 755 0 0
+file /var/www/goahead/static/fonts/ionicons.143146fa.woff2 ${INSTALL_ROOT}/projects/${SAMPLE}/app/goahead-5.1.0/src/web/static/fonts/ionicons.143146fa.woff2 755 0 0
+file /var/www/goahead/static/fonts/ionicons.99ac3308.woff ${INSTALL_ROOT}/projects/${SAMPLE}/app/goahead-5.1.0/src/web/static/fonts/ionicons.99ac3308.woff 755 0 0
+file /var/www/goahead/static/fonts/ionicons.d535a25a.ttf ${INSTALL_ROOT}/projects/${SAMPLE}/app/goahead-5.1.0/src/web/static/fonts/ionicons.d535a25a.ttf 755 0 0
+file /var/www/goahead/static/img/bg1.9f8ed6c0.png ${INSTALL_ROOT}/projects/${SAMPLE}/app/goahead-5.1.0/src/web/static/img/bg1.9f8ed6c0.png 755 0 0
+file /var/www/goahead/static/img/ionicons.a2c4a261.svg ${INSTALL_ROOT}/projects/${SAMPLE}/app/goahead-5.1.0/src/web/static/img/ionicons.a2c4a261.svg 755 0 0
+file /var/www/goahead/static/img/logo.762a400a.png ${INSTALL_ROOT}/projects/${SAMPLE}/app/goahead-5.1.0/src/web/static/img/logo.762a400a.png 755 0 0
 file /var/www/goahead/static/js/app.js ${INSTALL_ROOT}/projects/${SAMPLE}/app/goahead-5.1.0/src/web/static/js/app.js 755 0 0
 file /var/www/goahead/static/js/chunk-vendors.js ${INSTALL_ROOT}/projects/${SAMPLE}/app/goahead-5.1.0/src/web/static/js/chunk-vendors.js 755 0 0
+file /var/www/goahead/static/js/dashbord.js ${INSTALL_ROOT}/projects/${SAMPLE}/app/goahead-5.1.0/src/web/static/js/dashbord.js 755 0 0
+file /var/www/goahead/static/js/fan.js ${INSTALL_ROOT}/projects/${SAMPLE}/app/goahead-5.1.0/src/web/static/js/fan.js 755 0 0
+file /var/www/goahead/static/js/index.js ${INSTALL_ROOT}/projects/${SAMPLE}/app/goahead-5.1.0/src/web/static/js/index.js 755 0 0
+file /var/www/goahead/static/js/login.js ${INSTALL_ROOT}/projects/${SAMPLE}/app/goahead-5.1.0/src/web/static/js/login.js 755 0 0
+file /var/www/goahead/static/js/sensor_history.js ${INSTALL_ROOT}/projects/${SAMPLE}/app/goahead-5.1.0/src/web/static/js/sensor_history.js 755 0 0
+file /var/www/goahead/static/js/set_proctrol.js ${INSTALL_ROOT}/projects/${SAMPLE}/app/goahead-5.1.0/src/web/static/js/set_proctrol.js 755 0 0
+
+
+
+
+