Project homepage Mailing List  Warmcat.com  API Docs  Github Mirror 
    npro  
 Modern all-safe Rust Network Protocol library supporting h1, h2, h3, ws, wt sans-IO and with socket IO + tls
git clone https://npro.rs/repo/npro
 
root / READMEs / README-gitolite-hook.md
Author[]Andy Green <andy@warmcat.com> 2025-10-01 08:22 UTC
Committer[]Andy Green <andy@warmcat.com> 2025-10-01 18:16 UTC
Tree06e777184e0051e1a3034b333c06eb274c8b4654   Raw Patch
 
notification: add sec
notification: add sec
diff --git a/assets/coverity.svg b/assets/coverity.svg new file mode 100644 index 0000000..21aabcf --- /dev/null +++ b/assets/coverity.svg @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + width="19.873205mm" + height="19.870104mm" + viewBox="0 0 19.873205 19.870104" + version="1.1" + id="svg1" + xml:space="preserve" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg"><defs + id="defs1" /><g + id="layer1" + transform="translate(-91.619212,-178.89038)"><path + id="path4" + style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-dasharray:none;stroke-opacity:1" + d="m 99.711226,178.89037 0.01809,0.005 c -4.694239,0.88598 -8.100157,5.01668 -8.110099,9.83661 -8.7e-5,3.97837 2.329924,7.58065 5.938655,9.18135 l -3.674711,-10.06657 -0.0956,-0.48111 0.529683,0.786 2.055689,3.96255 2.453597,-6.03426 0.963765,-2.45101 0.630965,-1.85001 0.22738,-0.80151 0.0605,-0.43976 -5.2e-4,-0.4036 -0.14469,-0.45216 -0.28216,-0.43822 -0.27078,-0.26717 -0.278015,-0.0811 z m 5.511294,0.5178 -0.004,0.002 0.017,0.005 c -0.005,-0.002 -0.009,-0.005 -0.0134,-0.007 z m 0.0134,0.007 c 0.002,9.3e-4 0.004,0.002 0.007,0.003 l 5.2e-4,-0.001 z m 0.007,0.003 -0.7121,1.28726 -6.699332,17.32401 c 1.183542,0.48297 2.448222,0.73123 3.724842,0.73122 5.48761,-1.9e-4 9.93614,-4.48991 9.93634,-10.02833 h -9.93686 l 9.93686,-5.2e-4 c -1.5e-4,-4.22357 -2.58773,-7.83578 -6.24975,-9.31364 z m -7.411432,18.61127 c -0.09151,-0.0372 -0.182476,-0.0758 -0.272852,-0.11576 l 0.153996,0.0734 z" /></g></svg> diff --git a/assets/locked.svg b/assets/locked.svg new file mode 100644 index 0000000..222aec9 --- /dev/null +++ b/assets/locked.svg @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + width="27.739134mm" + height="35.710579mm" + viewBox="0 0 27.739134 35.710579" + version="1.1" + id="svg1" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg"> + <defs + id="defs1" /> + <g + id="layer1" + transform="translate(-126.91223,-84.261528)"> + <path + id="path1-5" + style="fill:#000000;stroke:none;stroke-width:4.68965;stroke-linecap:round;stroke-dasharray:none;stroke-opacity:1" + d="m 140.94127,84.261523 a 10.840562,10.840562 0 0 0 -10.84068,10.840682 10.840562,10.840562 0 0 0 10.84068,10.840685 10.840562,10.840562 0 0 0 10.13013,-6.979938 v -5.17e-4 l -3.56723,-3.036507 a 6.7406063,6.7406063 0 0 1 -6.57014,5.233792 6.7406063,6.7406063 0 0 1 -6.74119,-6.740677 6.7406063,6.7406063 0 0 1 6.74119,-6.741191 6.7406063,6.7406063 0 0 1 2.65721,0.54622 l 2.16937,-2.831868 a 10.840562,10.840562 0 0 0 -4.81934,-1.130681 z" /> + <rect + style="fill:#000000;stroke-width:0.810001;stroke-linecap:round" + id="rect1-3" + width="27.739132" + height="27.739132" + x="126.91223" + y="92.232971" + ry="8.130435" /> + <circle + style="fill:#ffffff;stroke:none;stroke-width:2.90999;stroke-linecap:round;stroke-dasharray:none;stroke-opacity:1" + id="path2-6" + cx="141.10063" + cy="105.94312" + r="3.0289855" /> + <rect + style="fill:#ffffff;stroke:none;stroke-width:2.90999;stroke-linecap:round;stroke-dasharray:none;stroke-opacity:1" + id="rect2-2" + width="2.3913045" + height="9.565218" + x="139.82527" + y="106.74023" + ry="1.1956522" /> + </g> +</svg> diff --git a/assets/sai.css b/assets/sai.css index 3165758..9132e3c 100644 --- a/assets/sai.css +++ b/assets/sai.css @@ -231,7 +231,7 @@ div.nailed { div.undernailed { position:relative; top: 0px; - margin-left: 180px; + margin-left: 8px; } diff --git a/assets/sai.js b/assets/sai.js index cd314b2..9910f50 100644 --- a/assets/sai.js +++ b/assets/sai.js @@ -850,8 +850,10 @@ function sai_event_summary_render(o, now_ut, reset_all_icon) s += "<td><table class=\"nomar\">" + "<tr><td class=\"nomar\" colspan=2>" + - "<span class=\"e1\">" + san(e.repo_name) + - "</span></td></tr><tr><td class=\"nomar\" colspan=2><span class=\"e2\">"; + "<span class=\"e1\">" + san(e.repo_name); + if (e.sec) + s += " <img class=\"bico\" src=\"/sai/locked.svg\">"; + s += "</span></td></tr><tr><td class=\"nomar\" colspan=2><span class=\"e2\">"; if (e.ref.substr(0, 11) === "refs/heads/") { s += "<img class=\"branch\">" + diff --git a/assets/x86_64.svg b/assets/x86_64.svg new file mode 100644 index 0000000..39eaa23 --- /dev/null +++ b/assets/x86_64.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 3.816 3.816" height="14.423" width="14.423" xmlns:v="https://vecta.io/nano"><circle cx="1.908" cy="1.908" r="1.908" opacity=".12" fill="#f9f9f9"/><path d="M1.285 1.4l-.607.59v1.15H1.92l.528-.572-1.155.018zM.735.784h2.327v2.36l-.594-.594V1.382H1.296z" paint-order="markers fill stroke" fill="#099b39"/></svg> diff --git a/src/common/include/private.h b/src/common/include/private.h index ae8d062..2f08956 100644 --- a/src/common/include/private.h +++ b/src/common/include/private.h @@ -123,7 +123,7 @@ typedef struct { char art_down_nonce[33]; char uuid[65]; char builder_name[96]; - char cpack[128]; + char cpack[512]; char script[4096]; char branches[256]; @@ -281,6 +281,7 @@ typedef struct sai_event { uint64_t last_updated; sai_event_state_t state; int uid; + int sec; } sai_event_t; typedef struct { @@ -582,7 +583,7 @@ extern const lws_struct_map_t lsm_schema_sq3_map_artifact[1], lsm_schema_map_ta[1], lsm_schema_map_plat_simple[1], - lsm_event[10], + lsm_event[11], lsm_task[29], lsm_log[7], lsm_artifact[8], diff --git a/src/common/struct-metadata.c b/src/common/struct-metadata.c index 9ad8618..0579b61 100644 --- a/src/common/struct-metadata.c +++ b/src/common/struct-metadata.c @@ -143,6 +143,7 @@ const lws_struct_map_t lsm_event[] = { LSM_UNSIGNED (sai_event_t, created, "created"), LSM_UNSIGNED (sai_event_t, state, "state"), LSM_UNSIGNED (sai_event_t, last_updated, "last_updated"), + LSM_UNSIGNED (sai_event_t, sec, "sec"), }; const lws_struct_map_t lsm_schema_json_map_event[] = { diff --git a/src/power/p-comms.c b/src/power/p-comms.c index b6523ba..cf5633a 100644 --- a/src/power/p-comms.c +++ b/src/power/p-comms.c @@ -163,7 +163,9 @@ saip_m_rx(void *userobj, const uint8_t *buf, size_t len, int flags) saip_server_plat_t *sp = lws_container_of(px, saip_server_plat_t, list); sp->needed = 0; } lws_end_foreach_dll(px); - + + fprintf(stderr, "|||||||||||||||||||||||||||||||| Server says needed: '%.*s'\n", (int)len, buf); + while (p < end) { n = 0; while (p < end && *p != ',') diff --git a/src/server/s-notification.c b/src/server/s-notification.c index cd473d6..04ffcc5 100644 --- a/src/server/s-notification.c +++ b/src/server/s-notification.c @@ -41,6 +41,7 @@ static const char * const paths[] = { "nonce", "saifile_len", "saifile", + "sec", }; enum enum_paths { @@ -53,6 +54,7 @@ enum enum_paths { LEJPN_NONCE, LEJPN_SAIFILE_LEN, LEJPN_SAIFILE, + LEJPN_SEC, }; /* @@ -687,10 +689,10 @@ next_plat: ; if (!(reason & LEJP_FLAG_CB_IS_VALUE) || !ctx->path_match) return 0; -// if (reason != LEJPCB_VAL_STR_END) -// return 0; - - /* only the end part of the string, where we know the length */ + /* + * Some of these will be long strings, accept all the string parts + * and accumilate them + */ switch (ctx->path_match - 1) { case LEJPNSAIF_SCHEMA: @@ -737,7 +739,10 @@ next_plat: ; break; case LEJPNSAIF_CONFIGURATIONS_CPACK: - lws_strncpy(sn->t.cpack, ctx->buf, sizeof(sn->t.cpack)); + n = strlen(sn->t.cpack); + if (n < sizeof(sn->t.cpack) - 2) + lws_strnncpy(sn->t.cpack + n, ctx->buf, ctx->npos, + sizeof(sn->t.cpack) - n); break; case LEJPNSAIF_CONFIGURATIONS_BRANCHES: @@ -830,6 +835,10 @@ sai_notification_lejp_cb(struct lejp_ctx *ctx, char reason) lws_strncpy(sn->e.ref, ctx->buf, sizeof(sn->e.ref)); break; + case LEJPN_SEC: + sn->e.sec = 1; + break; + case LEJPN_HASH: lws_strncpy(sn->e.hash, ctx->buf, sizeof(sn->e.hash)); break; diff --git a/src/server/s-task.c b/src/server/s-task.c index 7aa06be..88dfada 100644 --- a/src/server/s-task.c +++ b/src/server/s-task.c @@ -567,6 +567,8 @@ sais_find_or_add_pending_plat(struct vhd *vhd, const char *name) } lws_end_foreach_dll(p); + // lwsl_notice("%s: ->->->->-> adding %s\n", __func__, name); + /* platform name is new, make an entry in the ac */ sp = lwsac_use_zero(&vhd->ac_plats, sizeof(sais_plat_t) + strlen(name) + 1, 512); diff --git a/src/server/s-ws-builder.c b/src/server/s-ws-builder.c index c02b6d3..7c73c38 100644 --- a/src/server/s-ws-builder.c +++ b/src/server/s-ws-builder.c @@ -707,11 +707,11 @@ bail: case SAIM_WSSCH_BUILDER_LOADREPORT: { - sai_load_report_t *lr = (sai_load_report_t *)pss->a.dest; +// sai_load_report_t *lr = (sai_load_report_t *)pss->a.dest; - lwsl_notice("%s: @@@@@@@@@@@@@@@@@@ loadreport from %s: ram %uk, disk %uk\n", - __func__, lr->builder_name, lr->reserved_ram_kib, - lr->reserved_disk_kib); +// lwsl_notice("%s: @@@@@@@@@@@@@@@@@@ loadreport from %s: ram %uk, disk %uk\n", +// __func__, lr->builder_name, lr->reserved_ram_kib, +// lr->reserved_disk_kib); ssize_t wr = write(2, buf, bl); if (wr != (ssize_t)bl) diff --git a/src/web/CMakeLists.txt b/src/web/CMakeLists.txt index b132dfb..5035616 100644 --- a/src/web/CMakeLists.txt +++ b/src/web/CMakeLists.txt @@ -75,6 +75,8 @@ if (requirements) ../../assets/delete.png ../../assets/passed.svg ../../assets/failed.svg + ../../assets/locked.svg + ../../assets/coverity.svg ../../assets/sai.css ../../assets/sai.js ../../assets/sai.svg @@ -98,6 +100,7 @@ if (requirements) ../../assets/arch-riscv64.svg ../../assets/arch-risc-v.svg ../../assets/arch-x86_64-amd.svg + ../../assets/x86_64.svg ../../assets/arch-x86_64-intel-i3.svg ../../assets/arch-x86_64-intel.svg ../../assets/arch-xl6-esp32.svg diff --git a/src/web/w-websrv.c b/src/web/w-websrv.c index 8161887..d6abdc5 100644 --- a/src/web/w-websrv.c +++ b/src/web/w-websrv.c @@ -224,8 +224,8 @@ saiw_lp_rx(void *userobj, const uint8_t *buf, size_t len, int flags) break; case SAIS_WS_WEBSRV_RX_LOADREPORT: - lwsl_notice("%s: ^^^^^^^^^^^^^^ SAIS_WS_WEBSRV_RX_LOADREPORT forwarding to browser\n", __func__); - lwsl_hexdump_notice(buf, len); + // lwsl_notice("%s: ^^^^^^^^^^^^^^ SAIS_WS_WEBSRV_RX_LOADREPORT forwarding to browser\n", __func__); + // lwsl_hexdump_notice(buf, len); saiw_ws_broadcast_raw(vhd, buf, len - (unsigned int)n, 0, lws_write_ws_flags(LWS_WRITE_TEXT, flags & LWSSS_FLAG_SOM, flags & LWSSS_FLAG_EOM)); break; diff --git a/src/web/w-ws-browser.c b/src/web/w-ws-browser.c index cbccfa3..35e6c25 100644 --- a/src/web/w-ws-browser.c +++ b/src/web/w-ws-browser.c @@ -208,7 +208,7 @@ static int saiw_pss_schedule_eventinfo(struct pss *pss, const char *event_uuid) { saiw_scheduled_t *sch = saiw_alloc_sched(pss, WSS_PREPARE_OVERVIEW); - char qu[80], esc[66], esc2[96]; + char qu[180], esc[66], esc2[96]; int n; if (!sch) @@ -328,6 +328,8 @@ saiw_pss_schedule_taskinfo(struct pss *pss, const char *task_uuid, int logsub) lws_sql_purify(esc2, pss->specific_project, sizeof(esc2)); m += lws_snprintf(qu + m, sizeof(qu) - (unsigned int)m, " and repo_name='%s'", esc2); } + if (!pss->authorized) + m += lws_snprintf(qu + m, sizeof(qu) - (unsigned int)m, " and sec=0"); if (pss->specific_ref[0] && pss->specificity != SAIM_SPECIFIC_TASK) { lws_sql_purify(esc2, pss->specific_ref, sizeof(esc2)); @@ -875,6 +877,9 @@ again: lws_sql_purify(esc, pss->specific_project, sizeof(esc) - 1); lws_snprintf(filt, sizeof(filt), " and repo_name=\"%s\"", esc); } + if (!pss->authorized) + lws_snprintf(filt + strlen(filt), sizeof(filt) - strlen(filt), " and sec=0"); + pss->wants_event_updates = 1; if (!sch->ov_db_done && lws_struct_sq3_deserialize(vhd->pdb, filt[0] ? filt : NULL, "created ", @@ -915,6 +920,9 @@ again: * additional controls clientside. The events the controls * cause if used are separately checked for coming from an * authorized pss when they are received. + * + * If you're not authorized, you're only going to see events + * that have sec=0. Otherwise you can see all events. */ if (pss->specificity) @@ -1262,6 +1270,9 @@ b_finish: lws_snprintf(filt, sizeof(filt), " and (task_uuid == '%s')", sch->one_task->uuid); + // if (!pss->authorized) + // lws_snprintf(filt + strlen(filt), sizeof(filt) - strlen(filt), " and sec=0"); + // lwsl_debug("%s: ---------------- %s\n", __func__, filt); if (lws_struct_sq3_deserialize(pdb, filt, NULL,
Page fetched 0s ago, creation time: 8ms (vhost etag hits: 0%, cache hits: 0%)