diff --git a/.github/workflows/deploy-kernel.yml b/.github/workflows/deploy-kernel.yml index 47585e37..b2251645 100644 --- a/.github/workflows/deploy-kernel.yml +++ b/.github/workflows/deploy-kernel.yml @@ -7,7 +7,6 @@ on: required: false default: develop description: Enter the tag to deploy - default: staging jobs: build-frontend: runs-on: ubuntu-latest diff --git a/desk/app/docket.hoon b/desk/app/docket.hoon index a4596758..095e1b74 100644 --- a/desk/app/docket.hoon +++ b/desk/app/docket.hoon @@ -3,7 +3,7 @@ |% +$ card card:agent:gall +$ app-state - $: %4 + $: %5 :: local charges=(map desk charge) == @@ -65,13 +65,18 @@ ?. ?=(%3 -.old) `old :_ old(- %4) :_ ~ [%pass /reinstall %agent [our.bowl dap.bowl] %poke %reinstall-groups !>(~)] - ?> ?=(%4 -.old) + =^ cards-4 old + ?. ?=(%4 -.old) `old + :_ old(- %5) :_ ~ + =/ =cage [%kiln-suspend !>(`desk`%garden)] + [%pass /suspend %agent [our.bowl %hood] %poke cage] + ?> ?=(%5 -.old) =/ cards-tire [~(tire pass /tire) ~] =. -.state old :: inflate-cache needs to be called after the state is set :: =. +.state inflate-cache - [:(weld cards-1 cards-2 cards-3 cards-tire) this] + [:(weld cards-1 cards-2 cards-3 cards-4 cards-tire) this] :: ++ inflate-cache ^- cache @@ -87,9 +92,11 @@ state-1 state-2 state-3 + state-4 app-state == :: + +$ state-4 [%4 (map desk charge)] +$ state-3 [%3 (map desk charge)] +$ state-2 [%2 (map desk charge)] +$ state-1 [%1 (map desk charge)] @@ -250,6 +257,7 @@ [%kiln ~] `state [%charge @ *] (take-charge i.t.wire t.t.wire) [%reinstall *] `state + [%suspend ~] `state == [cards this] :: @@ -656,28 +664,40 @@ ?~ file [glob 'file without filename' err] ?~ type [glob (cat 3 'file without type: ' u.file) err] ?^ code [glob (cat 3 'strange encoding: ' u.code) err] - =/ filp (rush u.file fip) - ?~ filp [glob (cat 3 'strange filename: ' u.file) err] + =/ filp (fip u.file) :: ignore metadata files and other "junk" ::TODO consider expanding coverage :: - ?: =('.DS_Store' (rear `path`u.filp)) + ?: =('DS_Store' (rear filp)) [glob err] :: make sure to exclude the top-level dir from the path :: :_ err - %+ ~(put by glob) (slag 1 `path`u.filp) + %+ ~(put by glob) (slag 1 filp) [u.type (as-octs:mimes:html body)] :: + ++ split-at + =| fst=tape + |= [=tape char=@tD] + =. tape (flop tape) + |- + ^+ [fst fst] + ?~ tape [(flop fst) (flop tape)] + ?: =(i.tape char) + [(flop fst) (flop t.tape)] + $(tape t.tape, fst (snoc fst i.tape)) + :: ++ fip - =, de-purl:html - ;: cook - |=(pork (weld q (drop p))) - deft - |=(a=cord (rash a (more fas smeg))) - crip - (star ;~(pose (cold '%20' (just ' ')) next)) - == + |= fil=@t + ^- path + =/ [ext=tape fil=tape] (split-at (trip fil) '.') + =- (snoc - (crip ext)) + %+ turn + (scan fil (most fas (star ;~(less fas next)))) + |= t=^tape + %- crip + (en-urlt:html t) + :: :: ++ inline-js-response |= js=cord @@ -703,6 +723,8 @@ ?: =(suffix /desk/js) %- inline-js-response (rap 3 'window.desk = "' u.des '";' ~) + =? suffix !(~(has by glob) suffix) + (turn suffix |=(s=@t (crip (en-urlt:html (trip s))))) =/ requested ?: (~(has by glob) suffix) suffix /index/html diff --git a/desk/app/vitals.hoon b/desk/app/vitals.hoon index c536cfbf..8d164937 100644 --- a/desk/app/vitals.hoon +++ b/desk/app/vitals.hoon @@ -138,7 +138,7 @@ %landscape %vitals-connection-check %noun - !>(ship) + !>((some ship)) == ?: ?=(%pending -.status.u.stat) cor @@ -153,17 +153,14 @@ %landscape %vitals-connection-check %noun - !>(ship) + !>((some ship)) == :: :: public pokes :: %ship =+ !<(=ship vase) - ?< =(our ship) - ?< =(~ (find ~[our] (saxo:title our now ship))) - ?. ?=([%live *] (scry-qos:lib our now ship)) - !! + ?> ?=([%live *] (scry-qos:lib our now ship)) cor == ++ watch @@ -187,14 +184,12 @@ ?+ path [~ ~] :: [%x %sponsor ~] - ?< ?=(%czar (clan:title our)) %- some %- some :- %vitals-qos !> (scry-qos:lib our now (sein:title our now our)) :: [%x %galaxy ~] - ?< ?=(%czar (clan:title our)) %- some %- some :- %vitals-qos diff --git a/desk/desk.docket-0 b/desk/desk.docket-0 index c28faed8..d74552a3 100644 --- a/desk/desk.docket-0 +++ b/desk/desk.docket-0 @@ -1,10 +1,10 @@ :~ title+'Landscape' info+'An app launcher for Urbit.' color+0xee.5432 - glob-http+['https://bootstrap.urbit.org/glob-0v7.c3mlj.gm8sb.1cmkv.ugntt.pg185.glob' 0v7.c3mlj.gm8sb.1cmkv.ugntt.pg185] + glob-http+['https://bootstrap.urbit.org/glob-0v3.0dqi8.1csij.8dv08.lhglb.45fpk.glob' 0v3.0dqi8.1csij.8dv08.lhglb.45fpk] ::glob-ames+~zod^0v0 base+'landscape' - version+[1 20 0] + version+[1 24 0] website+'https://tlon.io' license+'MIT' == diff --git a/desk/lib/vitals.hoon b/desk/lib/vitals.hoon index d17d2ba9..8e1d916e 100644 --- a/desk/lib/vitals.hoon +++ b/desk/lib/vitals.hoon @@ -11,14 +11,16 @@ ++ scry-qos |= [=ship =time peer=ship] ^- qos:ames - %- simplify-qos - .^ ship-state:ames - %ax - (scot %p ship) - %$ - (scot %da time) - %peers - (scot %p peer) - ~ - == + :: a ship is not guaranteed by %ames to know itself, so we fake it + ?: =(ship peer) + [%live time] + :: .^(* /ax/=//=/peers/[peer]) crashes if the peer is unknown, so we + :: check the source map beforehand and fake an %unborn if we can see + :: a crash coming + =/ ames-peers=path /ax/(scot %p ship)//(scot %da time)/peers + =/ peers .^((map ^ship ?(%alien %known)) ames-peers) + ?. (~(has by peers) peer) + [%unborn time] + =/ pqos .^(ship-state:ames (snoc ames-peers (scot %p peer))) + (simplify-qos pqos) -- diff --git a/desk/sur/vitals.hoon b/desk/sur/vitals.hoon index 734a4dee..1c986697 100644 --- a/desk/sur/vitals.hoon +++ b/desk/sur/vitals.hoon @@ -41,4 +41,43 @@ $: =ship =result == +:: ++$ ship-state + $% [%idle ~] + [%poking ~] + [%http until=@da] + [%waiting until=@da] + == +:: ++$ ping + $% [%0 ships=(map ship [=rift =ship-state])] + $: %1 + ships=(set ship) + nonce=@ud + $= plan + $~ [%nat ~] + $% [%nat ~] + [%pub ip=(unit @t)] + == + == + :: + $: %2 + ships=(set ship) + nonce=@ud + $= plan + $~ [%nat ~] + $% [%nat ~] + [%pub ip=(unit @t)] + [%off ~] + [%one ~] + == + == + :: + $: %3 + mode=?(%formal %informal) + pokes=@ud + timer=(unit [=wire date=@da]) + galaxy=@p + == + == -- diff --git a/desk/sys.kelvin b/desk/sys.kelvin index 87ac69c7..d641b028 100644 --- a/desk/sys.kelvin +++ b/desk/sys.kelvin @@ -1 +1,2 @@ -[%zuse 412] \ No newline at end of file +[%zuse 412] +[%zuse 411] diff --git a/desk/ted/make-glob.hoon b/desk/ted/make-glob.hoon index b884bd2b..3e0312de 100644 --- a/desk/ted/make-glob.hoon +++ b/desk/ted/make-glob.hoon @@ -14,7 +14,12 @@ %+ turn paths |= pax=path ^- [path mime] - :- (slag (lent dir) pax) + :- + ?> ?=(^ pax) + %+ turn t.pax + |= seg=@t + ^- @t + (crip (en-urlt:html (trip seg))) =/ mar=mark (rear pax) =+ .^(vas=vase %cr (weld home pax)) =+ .^(=tube:clay %cc (weld home /[mar]/mime)) diff --git a/desk/ted/vitals/connection-check.hoon b/desk/ted/vitals/connection-check.hoon index 3705f717..52b7515a 100644 --- a/desk/ted/vitals/connection-check.hoon +++ b/desk/ted/vitals/connection-check.hoon @@ -10,12 +10,12 @@ |= arg=vase =/ m (strand ,vase) ^- form:m -=+ !<(target=ship arg) +=+ !<([~ target=ship] arg) ;< our=@p bind:m get-our:io |^ :: early exit; check if we have live path to target - ;< now=@da bind:m get-time:io ;< tqos=qos:ames bind:m (get-qos target) + ;< now=@da bind:m get-time:io ?: ?& ?=(%live -.tqos) (gth last-contact.tqos (sub now info-timeout:vitals)) == @@ -33,8 +33,9 @@ :: set pending to %trying-local ;< ~ bind:m (update-status [%trying-local ~]) :: check if we can contact our own galaxy + ;< =ping:vitals bind:m (scry:io ping:vitals ~[%gx %ping %noun]) ;< gqos=qos:ames bind:m (scry:io qos:ames ~[%gx %vitals %galaxy %vitals-qos]) - ?. ?=(%live -.gqos) + ?: !(galaxy-reachable ping gqos) (post-result [%no-our-galaxy last-contact.gqos]) :: set pending to %trying-target ;< ~ bind:m (update-status [%trying-target ~]) @@ -45,23 +46,30 @@ :: if we're a moon, check if we can contact our planet :: :: NN: failing to contact our sponsor is only a failure condition for moons, - :: since currently only moons receive additional routing help from their - :: sponsors + :: since currently only moons require the direct sponsor to be online for + :: peers to grab the moon keys :: NN: we do this after the initial target check because if we're a moon and :: our planet is down, it's useful to talk to ships that still have live :: wires (e.g. for troubleshooting); thus, by waiting to perform this :: check, we don't report %no-our-planet for every connectivity check :: when attempting to track down a live peer from whom to seek help :: - ;< sqos=qos:ames + ;< moon-sponsor-reachable=? bind:m - =/ mm (strand ,qos:ames) + =/ mm (strand ,?) ^- form:mm ?. ?=(%earl (clan:title our)) - (pure:mm [%live *@da]) - (scry:io qos:ames ~[%gx %vitals %sponsor %vitals-qos]) - ?. ?=(%live -.sqos) - (post-result [%no-our-planet last-contact.sqos]) + (pure:mm %.y) + =/ sponsor=@p (end 5 our) + ;< ~ bind:mm (update-status [%trying-sponsor sponsor]) + ;< pchek=(unit) bind:mm (check-online sponsor target-timeout:vitals) + ?: ?=([%$ %$] pchek) + (pure:mm %.y) + (pure:mm %.n) + :: + ?: !moon-sponsor-reachable + ;< pqos=qos:ames bind:m (scry:io qos:ames ~[%gx %vitals %sponsor %vitals-qos]) + (post-result [%no-our-planet last-contact.pqos]) :: early exit; if target is a galaxy, there's nothing more we can check ?: ?=(%czar (clan:title target)) (galaxy-down target) @@ -92,6 +100,30 @@ ?: u.live [%no-sponsor-hit i.sponsors] [%no-sponsor-miss i.sponsors] +:: +++ galaxy-reachable + |= [=ping:vitals =qos:ames] + ^- ? + ?- -.ping + %0 + ?=(%live -.qos) + :: + %1 + ?: ?=(%pub -.plan.ping) + %.y + ?=(%live -.qos) + :: + %2 + ?. ?=(%nat -.plan.ping) + %.y + ?=(%live -.qos) + :: + %3 + ?: ?=(%informal mode.ping) + %.y + ?=(%live -.qos) + == +:: ++ update-status |= =pending:vitals =/ m (strand ,~) @@ -103,13 +135,20 @@ !> ^- update:vitals [target now %pending pending] +:: thread version of +scry-qos in /=landscape=/lib/vitals/hoon ++ get-qos - |= =ship + |= peer=ship =/ m (strand ,qos:ames) ^- form:m - ;< state=ship-state:ames - bind:m - (scry:io ship-state:ames ~[%ax %$ %peers (scot %p ship)]) + ;< now=@da bind:m get-time:io + ?: =(our peer) + (pure:m [%live now]) + ;< peers=(map ship ?(%alien %known)) bind:m + (scry:io (map ship ?(%alien %known)) ~[%ax %$ %peers]) + ?. (~(has by peers) peer) + (pure:m [%unborn now]) + ;< state=ship-state:ames bind:m + (scry:io ship-state:ames ~[%ax %$ %peers (scot %p peer)]) (pure:m (simplify-qos:lib-vitals state)) ++ galaxy-down |= galaxy=ship diff --git a/ui/src/constants.ts b/ui/src/constants.ts index c9dfa5c9..f4865c89 100644 --- a/ui/src/constants.ts +++ b/ui/src/constants.ts @@ -187,11 +187,11 @@ export const APPS = [ { title: 'radio', description: 'an app for urbit disc jockeys', - color: '#FF0000', + color: '#FFFFFF', link: '/apps/radio', section: SECTIONS.FUN, desk: 'radio', source: '~nodmyn-dosrux', - image: 'https://0x0.st/o4--.png', + image: 'https://bwyl.nyc3.digitaloceanspaces.com/radio/radio.png', }, ]; diff --git a/ui/src/nav/notifications/useNotifications.ts b/ui/src/nav/notifications/useNotifications.ts index cc43c4b3..dde152db 100644 --- a/ui/src/nav/notifications/useNotifications.ts +++ b/ui/src/nav/notifications/useNotifications.ts @@ -50,15 +50,10 @@ export const useNotifications = (mentionsOnly = false) => { }; } - const notDmsFromGroupsDesk = (s: Skein) => - !((isDM(s.top.rope) || isClub(s.top.rope)) && isGroups(s.top.rope)); - - const unreads = skeins - .filter((s) => s.unread) - .filter((s) => notDmsFromGroupsDesk(s)); - const filteredSkeins = skeins - .filter((s) => (mentionsOnly ? isMention(s.top) : s)) - .filter((s) => notDmsFromGroupsDesk(s)); + const unreads = skeins.filter((s) => s.unread); + const filteredSkeins = skeins.filter((s) => + mentionsOnly ? isMention(s.top) : s + ); return { notifications: groupSkeinsByDate(filteredSkeins),