Commit graph

1163 commits

Author SHA1 Message Date
Pere Lev
840b13eff1
UI: Tweak the footer repo/commit display 2023-11-21 10:55:38 +02:00
Pere Lev
22c7b88a79
Remove federation check from PublishResolveR 2023-11-13 14:15:13 +02:00
Pere Lev
34386bcf52
S2S: Deck: Resolve: Use the full OCAP-authorization algorithm
deckResolve now supports Resolve requests that use extension-Grants. It
iterates the verifies the Grant-chain using the process described in the
ForgeFed specification.
2023-11-12 17:43:11 +02:00
Pere Lev
1a3a46b6b2
Implement OCAP "Verifying an invocation" process from ForgeFed spec
Vervis currently supports only direct grants. The new process supports
delegation chains as well. This commit just implements the new process
as a new function, without yet using it anywhere. The next commits will
plug it into Deck actor handlers.
2023-11-07 10:51:42 +02:00
Pere Lev
b420c982c0
UI: Add page for publishing a Resolve with custom ticket and OCAP URIs 2023-11-05 20:41:24 +02:00
Pere Lev
91ed2c82b5
UI: Add reopen-this-ticket button to ticket page 2023-11-05 17:50:55 +02:00
Pere Lev
ebe676d94b
Client: Port/implement pseudo-client for unresolve-a-ticket 2023-11-05 17:41:16 +02:00
Pere Lev
3a95e6d302
C2S: Implement trivial Undo handler, remove old undoC code 2023-11-05 16:27:38 +02:00
Pere Lev
cbd81d1d0b
C2S, UI: Deck ticket closing button on ticket page
Ticket closing can now be done via the new C2S, and the "Close ticket"
button on TicketR page is back, and uses that new C2S.

S2S, C2S and pseudo-client are implemented for both Deck and Loom, but
the actual button and POST handler are provided here only for Deck. Will
add ones for Loom soon, as needed.
2023-11-05 16:13:09 +02:00
Pere Lev
222ba823c1
S2S: Person: Trivial Resolve handler 2023-11-05 12:52:16 +02:00
Pere Lev
35eb4917a1
S2S: Port Deck's & Loom's Resolve handlers from the old system 2023-11-05 12:40:19 +02:00
Pere Lev
cb693184f8
UI: Use the actor system for opening a ticket, and remove offerTicketC 2023-11-05 11:31:36 +02:00
Pere Lev
be569ab26d
C2S: Implement Offer{ticket/MR} handler 2023-11-03 14:55:34 +02:00
Pere Lev
a06003c361
S2S: Loom: Port Offer{MR} handler from old federation code
This is to allow getting rid of the old C2S offerTicketC and write a C2S
Offer handler in the new actor system.

And that is to allow ticket opening and closing to work, so that it can
use delegated OCAPs too, as a first demo of delegated OCAPs in action.
2023-11-03 14:18:41 +02:00
Pere Lev
909ba94b49
S2S: Person: Implement trivial Offer handler 2023-11-03 11:08:35 +02:00
Pere Lev
1694d77705
S2S: Deck: Port the Offer{Ticket} handler from the old code 2023-11-03 10:56:25 +02:00
Pere Lev
7edb7a9760
Fix some little bugs in component implementation 2023-11-02 23:14:29 +02:00
Pere Lev
df6ece2889
UI: Deck: 'Approve' button for accepting invites-to-projects 2023-11-02 22:27:54 +02:00
Pere Lev
47f993d63f
Client: Project UI for adding a component 2023-11-02 18:03:28 +02:00
Pere Lev
fe6f95d497
UI: Deck: Projects list page 2023-11-02 14:48:22 +02:00
Pere Lev
acc1d13c63
UI: Project: Component list HTML version 2023-11-02 12:35:35 +02:00
Pere Lev
5d52db9377
C2S: Implement Accept handler (without any filters) 2023-10-23 19:39:58 +03:00
Pere Lev
14ef892032
C2S: Implement Add handler, for adding a component to a project 2023-10-23 19:11:51 +03:00
Pere Lev
477793688f
C2S: Invite: Support component mode 2023-10-23 18:26:44 +03:00
Pere Lev
21aa4e7c49
S2S: projectAccept: When adding a Collab, delegate access-to-my-components 2023-10-23 15:21:12 +03:00
Pere Lev
fa43a49b16
S2S: Person Grant handler: Handle component-mode Grants too 2023-09-09 17:01:18 +03:00
Pere Lev
4ac73a9515
S2S: Implement component delegator-Grant handler 2023-09-09 16:41:12 +03:00
Pere Lev
9a78c83233
S2S: Deck Accept handler: Implement component mode 2023-09-01 19:50:48 +03:00
Pere Lev
e8970c1f4a
S2S: Deck Invite handler: Implement component mode 2023-08-14 15:24:08 +03:00
Pere Lev
521eed8bb2
S2S: Deck Add handler 2023-08-02 15:13:54 +03:00
Pere Lev
06e5ab9e90
S2S: Project Grant handler 2023-07-17 20:57:19 +03:00
Pere Lev
a083b0d866
S2S: Update Project-Accept handler to handle Components 2023-07-12 16:50:29 +03:00
Pere Lev
aec2235fdc
S2S: Project Add handler: Rearrange code in preparation for Component mode
Also add Component mode details into the behavior comment (but haven't
yet implemented the newly described Component-mode behavior)
2023-06-29 20:56:03 +03:00
Pere Lev
2920deb900
S2S: Copy topicAccept code into projectAccept and reorganize the comment
This is in preparation to implementing Component mode
2023-06-29 14:48:55 +03:00
Pere Lev
afb83b7761
Add a ProjectCollabLiveR route for use as Grant revocation URI 2023-06-28 22:24:01 +03:00
Pere Lev
4a2f97d9dd
S2S: Upgrade the Project Invite handler to handle components 2023-06-28 21:34:19 +03:00
Pere Lev
5e87dd99d3
DB: Make the Accept unique per CollabFulfillsInvite 2023-06-28 14:18:45 +03:00
Pere Lev
afc45257b4
S2S: topicInvite, projectInvite: If approved, send an Accept 2023-06-28 14:10:09 +03:00
Pere Lev
b45aa78d7b
Copy topicInvite impl into projectInvite instead of reusing topicInvite
That's because projectInvite is about to get changes and can't use
topicInvite anymore; that's probably suitable only for components
2023-06-28 10:44:13 +03:00
Pere Lev
043667ed76
S2S, C2S, Client: Update parseRemove to support project+component 2023-06-28 10:22:53 +03:00
Pere Lev
710bfc27c0
C2S: When HTTP GETing an Invite/Remove topic, compare with collabs URI
Until now the code GETs the collabs URI to find the resource, but it
didn't make sure the URI was really the collabs URI specified by the
resource. This commit adds the check.
2023-06-28 09:38:53 +03:00
Pere Lev
1093d4e67d
Vocab: Support project/component in parseInvite, update handlers 2023-06-28 02:23:46 +03:00
Pere Lev
c98d8d1cc0
Vocab & UI: Repo, Deck and Loom now serve their collabs URI 2023-06-28 01:09:35 +03:00
Pere Lev
b2657589dd
Switch Invite/Join/Remove to use resource collabs URI
Until now, the resource object itself would be specified. This no longer
works, because it's unclear whether we're adding/removing a collaborator
or a component.

From now on, adding a collaborator is done by pointing to the resource's
'collaborators' URI, not to the resource itself
2023-06-28 00:30:35 +03:00
Pere Lev
034194f2aa
DB & Vocab: Specify role in Add, store it in Component & Stem 2023-06-27 22:56:52 +03:00
Pere Lev
1fd46b0590
UI & Vocab: Project components list & link from collabs JSON to project 2023-06-27 21:07:21 +03:00
Pere Lev
6ae079a310
S2S: Project Add handler 2023-06-27 17:55:59 +03:00
Pere Lev
89185164b8
DB: Store the 'type' of remote actors 2023-06-27 13:27:51 +03:00
Pere Lev
224025b9b6
DB: Entities for project-component system 2023-06-27 03:20:30 +03:00
Pere Lev
64aae37b4f
UI: Minimal HTML page for Project 2023-06-26 23:50:33 +03:00
Pere Lev
232a0cd4df
S2S: Implement project handlers, based on the Deck ones 2023-06-26 23:26:53 +03:00
Pere Lev
224c290b04
S2S: Project creation and following 2023-06-26 23:12:40 +03:00
Pere Lev
9d6bbfdf92
C2S: Project creation 2023-06-26 23:01:41 +03:00
Pere Lev
372fd35f2c
Project routes, handlers and creation UI 2023-06-26 22:02:54 +03:00
Pere Lev
3db602e3bd
DB entity for Project 2023-06-26 17:26:20 +03:00
Pere Lev
050e8d09bc
Vocabulary for Project 2023-06-26 17:25:56 +03:00
Pere Lev
cc87b6e17d
Port deck creation to the new actor system 2023-06-19 18:44:12 +03:00
Pere Lev
0bd2ca8d5d
DB: Allow actors to mark they've just been created by someone
This will be used for sending that someone a grant with Admin access
2023-06-19 11:38:25 +03:00
Pere Lev
6e8cedadd1
Client: Fix bug: Invite target isn't addressed 2023-06-19 10:38:22 +03:00
Pere Lev
581838e550
Support the 6 ForgeFed roles + launch repo/deck/loom actor upon creation 2023-06-17 21:35:00 +03:00
Pere Lev
c8c2106eab
UI: In deck collaborator list, have a Remove button for each 2023-06-17 01:27:28 +03:00
Pere Lev
58518811e3
UI for publishing a Remove 2023-06-17 00:39:02 +03:00
Pere Lev
9673887479
C2S Remove handler 2023-06-17 00:28:35 +03:00
Pere Lev
7b64ab56b1
S2S Remove handlers for Person and Deck 2023-06-16 23:42:50 +03:00
Pere Lev
928ad8f9a9
UI in deck collaborators list, for adding a new collaborator 2023-06-16 20:12:40 +03:00
Pere Lev
aaa92d8141
UI for publishing an Invite 2023-06-16 17:39:11 +03:00
Pere Lev
ffb5dadac7
Link C2S handler with ClientMsg Person actor handler & port inviteC 2023-06-16 17:15:15 +03:00
Pere Lev
a683185918
Actor system: Add support for C2S actor methods 2023-06-15 20:23:50 +03:00
Pere Lev
d33f272ede
Switch to converged handlers than handle both local and remote activities
I was writing a topicLocalInvite handler when I realized how cumbersome
it's becoming, to have separate handlers for local activities. While it
allows me to pick custom specific message names and parameters (which is
why I took that approach in the first place), it causes a lot of
duplication and complexity (because I have to write the remote-activity
handlers anyway; adding local ones doesn't reduce complexity).

So this commit switches the entire system to communicate only using
AP/FF activities, including between local actors.
2023-06-15 15:44:43 +03:00
Pere Lev
d5d6b0af61
On app start, launch only verified Persons 2023-06-10 10:56:02 +03:00
Pere Lev
a41356c261
Upon account verification, launch the Person actor 2023-06-10 10:51:01 +03:00
Pere Lev
59e99f405a
Deck: Port Join handler 2023-06-09 09:40:10 +03:00
Pere Lev
85f77fcac4
Deck: Port Invite handler 2023-06-08 15:38:09 +03:00
Pere Lev
9955a3c0ad
Deck: Port/write Accept, Reject, Follow, Undo 2023-06-07 10:15:30 +03:00
Pere Lev
d467626049
Person: Implement (trivial) Revoke handler 2023-06-05 12:38:08 +03:00
Pere Lev
b4ebd08c5a
Person: Port Undo{Follow} handler 2023-06-05 11:34:58 +03:00
Pere Lev
552ef760e6
Person: Port Reject{Follow} handler 2023-06-05 10:03:20 +03:00
Pere Lev
9b0622cd7a
Person: Port the Accept{Follow} handler 2023-06-05 09:43:28 +03:00
Pere Lev
b759b87d0f
Person: Implement (the quite trivial) Join handler 2023-05-30 22:21:51 +03:00
Pere Lev
4d8e5de8b8
Person: Port Invite and Follow handlers to new system 2023-05-30 22:02:11 +03:00
Pere Lev
cc135692c0
Web.ActivityPub: Add Grant 'allows' & 'delegates' fields 2023-05-30 14:34:37 +03:00
Pere Lev
621275e257
Verify integrity proof on remote activities coming into local inboxes
Limitations:

- Only jcs-eddsa-2022 is supported for now, can add more easily if
  needed
- Not verifying forwarded local activities, only remotely-authored ones
- Fetching key and actor with HTTP without using the DB cache, because
  the current cache system is deprecated and I haven't yet created the
  new one
2023-05-30 12:51:41 +03:00
Pere Lev
e8e587af26
Generate FEP-8b32 authenticity proofs when delivering activities
Limitations:

- Verification of proofs not implemeneted yet, just generation.
  Verification probably coming in the next commit.
- Only jcs-eddsa-2022 is supported. Can add more cryptosuites once
  they're updated for the requirements of the VC Data Integrity spec.
- Bug: The proofs aren't stored in the DB versions of outgoing activities, i.e.
  HTTP GETing an activity won't include the proof. Probably not urgent
  to fix. Ideally, change the whole PersistJSONObject/Envelope/etc.
  thing to allow to serialize the activity exactly once.
2023-05-30 09:48:21 +03:00
Pere Lev
ba02d62eb5
Web.ActivityPub: Add Grant startTime and endTime 2023-05-29 10:47:41 +03:00
Pere Lev
a22aeb85d0
Web.ActivityPub: Add grantResult field, with optional duration 2023-05-29 09:50:17 +03:00
Pere Lev
906b5e8f44
Update docs for darcs->git switch, and switch from darcs-rev to gitrev 2023-05-25 13:55:56 +03:00
fr33domlover
6786e2e0e1 Implement theater-based remote delivery and port personGrant 2023-05-24 22:17:14 +00:00
fr33domlover
c9db823c8c Implement actor-model system and start moving Person actor to it
This patch makes Vervis temporarily unusable, because all actors' inbox POST
handlers use the new system, but the actual federation handler code hasn't been
ported. The next patches will port all the S2S activities supported so far, as
well as C2S.
2023-04-29 10:40:44 +00:00
fr33domlover
72796a6bdc UI, S2S: Implement Join flow in S2S + deck devs page now lists join requests 2022-11-14 15:11:25 +00:00
fr33domlover
e4d7156cbc S2S: Implement repoUndoF, loomUndoF, personUndoF 2022-10-31 14:13:18 +00:00
fr33domlover
9b158c13cd S2S: Implement deckUndoF 2022-10-27 16:27:58 +00:00
fr33domlover
934c69daae UI, S2S: Re-implement and re-enable Push activity
- When pushing to a repo, a Push activity is now automatically published
- The 'actor' is now the repo, and 'attributedTo' specifies the person who
  pushed
- No need for 'context' in the Push anymore, since it's always the 'actor'
- 'target' now specifies the branch as a Branch object rather than URI (since
  Vervis doesn't keep AS2 objects for branches anymore)
- I deleted 'pushCommitsC' (from Vervis.API) because the code for preparing and
  pushing an activity is so simple with the new delivery API, doesn't need a
  dedicated pushCommitsC function
- The generated Push activity does generate an HTML summary, unlike all other
  generated activities (in which I removed the summary generating code); I'm
  still unsure whether to bring back those summaries (extra code to write, for
  a problematic feature that may become useless when the new UI comes)
2022-10-26 10:47:38 +00:00
fr33domlover
340d1eacb1 S2S: loomFollowF & repoFollowF 2022-10-26 05:25:44 +00:00
fr33domlover
ee3548a940 S2S: Re-implement and re-enable deckFollowF 2022-10-25 19:02:07 +00:00
fr33domlover
648204ef80 S2S: Implement loomResolveF, allowing to close MR without Applying 2022-10-25 18:49:19 +00:00
fr33domlover
756c2952f2 S2S: Re-implement and re-enable personFollowF 2022-10-25 18:02:06 +00:00
fr33domlover
f76e80c028 S2S: Re-implement and re-enable deckResolveF 2022-10-25 16:12:48 +00:00
fr33domlover
8f8354ea5e C2S: Re-implement and enable resolveC, followC, undoC 2022-10-25 04:54:56 +00:00
fr33domlover
fa7f765e2e DB: Remote Ticket.status field 2022-10-20 15:41:47 +00:00
fr33domlover
fdf6a83c40 DB, UI: Prepare DB schema for Join flow + display deck collaborators & invites 2022-10-20 12:53:54 +00:00
fr33domlover
eb342b47ed DB: Move new entity declarations to a new module Vervis.Migration.Entities 2022-10-19 09:06:38 +00:00
fr33domlover
6407aaf897 DB: Avoid bulk-selecting specific-actor records
When looking up a specfic actor record for a given ActorId, you're pretty much
guaranteed to find the actor if it exists, because there's 1 function in the
codebase that handles this. Whenever a new actor type is added, which is a rare
event, that function gets updated.

But when mass-selecting actors using Esqueleto? Then, you need to LeftOuterJoin
by yourself on each actor type. This is both ugly and error prone, because all
those places in the codebase need to be updated when adding an actor type. The
only downside is that it means O(n) DB queries instead of O(1).

Perhaps there's some elegant way to "add" the specific-actor Joins to a given
Esqueleto query. Something to do some other time, as an optimization, if the
need arises.
2022-10-18 16:05:33 +00:00
fr33domlover
118b787416 UI: New ticket/MR creation form + deck/loom navigation links 2022-10-17 15:08:00 +00:00
fr33domlover
d8c65930ca UI, DB: Switch ticket filter to use TicketResolve instead of TicketStatus 2022-10-16 23:44:16 +00:00
fr33domlover
7ddb79d78d DB: If no workflow exists, add a dummy one 2022-10-16 23:42:41 +00:00
fr33domlover
e638ff4117 UI: In ticket/MR pages, display when and by whom the ticket was resolved 2022-10-16 22:25:21 +00:00
fr33domlover
58ca5e998e UI: Redirect DeckR to DeckTicketsR 2022-10-16 22:24:41 +00:00
fr33domlover
b99d864429 UI, Web: Re-enable ticket/MR replies view and commenting forms/buttons 2022-10-16 20:34:00 +00:00
fr33domlover
d5e913d97a S2S: Implement loomCreateNoteF 2022-10-16 12:24:41 +00:00
fr33domlover
2e7f9ef5e6 S2S: Re-enable deckCreateNoteF 2022-10-16 12:14:30 +00:00
fr33domlover
71bceec18b C2S, S2S: Re-enable createNoteC and personCreateNoteF 2022-10-16 11:26:24 +00:00
fr33domlover
8424c76de7 Link to per-actor keys from actor documents
Per-actor keys are now fully supported in Vervis! Caveats:

- The HTTP Signature keys produced by Vervis are Ed25519 keys; software that
  expects only RSA keys will fail here
- Like instance keys, per-actor keys are currently served in separate
  documents, not embedded in the actor document; so software that expects
  embedded keys will fail here
2022-10-12 18:01:52 +00:00
fr33domlover
32c87e3839 Improve the AP async HTTP delivery API and per-actor key support
New iteration of the ActivityPub delivery implementation and interface.
Advantages over previous interface:

* When sending a ByteString body, the sender is explicitly passed as a
  parameter instead of JSON-parsing it out of the ByteString
* Clear 3 operations provided: Send, Resend and Forward
* Support for per-actor keys
* Actor-type-specific functions (e.g. deliverRemoteDB_D) removed
* Only the most high-level API is exposed to Activity handler code, making
  handler code more concise and clear

Also added in this patch:

* Foundation for per-actor key support
* 1 key per actor allowed in DB
* Disabled C2S and S2S handlers now un-exported for clarity
* Audience and capability parsing automatically done for all C2S handlers
* Audience and activity composition automatically done for Vervis.Client
  builder functions

Caveats:

* Actor documents still don't link to their per-actor keys; that should be the
  last piece to complete per-actor key support
* No moderation and anti-spam tools yet
* Delivery API doesn't yet have good integration of persistence layer, e.g.
  activity is separately encoded into bytestring for DB and for HTTP; this will
  be improved in the next iteration
* Periodic delivery now done in 3 separate steps, running sequentially; it
  simplifies the code, but may be changed for efficiency/robustness in the next
  iterations
* Periodic delivery collects per-actor keys in a
  1-DB-transaction-for-each-delivery fashion, rather than grabbing them in the
  big Esqueleto query (or keeping the signed output in the DB; this isn't done
  currently to allow for smooth actor key renewal)
* No support yet in the API for delivery where the actor key has already been
  fetched, rather than doing a DB transaction to grab it; such support would be
  just an optimization, so it's low-priority, but will be added in later
  iterations
2022-10-12 16:50:11 +00:00
fr33domlover
0cc1e20f85 UX: Don't redirect to referer after login
It causes first login after verification to redirect to registration page,
which is weird, and the default Yesod falue is False, so, switching back to
False
2022-09-28 14:10:20 +00:00
fr33domlover
861d7636bc UX: Don't require login for verifying email address 2022-09-28 14:09:10 +00:00
fr33domlover
0d1de1278b UI: Add settings option to change main UI color 2022-09-28 06:03:43 +00:00
fr33domlover
84b70aa7b3 UI: If MR is applied, don't do the canApply check and display "RESOLVED" 2022-09-27 18:11:13 +00:00
fr33domlover
088d166d13 Fix infinite loop in getBundleR 2022-09-27 18:08:59 +00:00
fr33domlover
c5b85d11a9 UI: Since getLoomR doesn't have UI, redirect to LoomClothsR 2022-09-27 10:52:31 +00:00
fr33domlover
587ae5e8cc Fix query error in getTicketSummaries 2022-09-27 10:49:32 +00:00
fr33domlover
ceb0d951c1 UI: Personal overview: List your repos, decks, looms 2022-09-27 08:04:55 +00:00
fr33domlover
323de5b114 UI, Doc: Update Vervis repo links, because the route structure changed 2022-09-27 04:49:17 +00:00
fr33domlover
ee26ef7b82 UI: Actor outbox view: Render URI from route instead of parsing JSON for @id 2022-09-26 14:20:21 +00:00
fr33domlover
7429345cc0 If an outbox item is missing an @id, display whole activity in error message 2022-09-26 13:52:01 +00:00
fr33domlover
a96fcb8835 PostReceiveR hook handler: Don't raise error, otherwise VCS push fails 2022-09-26 13:31:24 +00:00
fr33domlover
482e2e806e DB: Migration: When switching repos dir to new layout, remove old sharer dirs 2022-09-26 13:27:16 +00:00
fr33domlover
6b0783a10b DB: Migration: Fix error in mig 447, accidentally creation CollabTopicLocal
Repo/Loom/Deck created one in their migrations, but CollabTopicAccept isn't
itself a topic, it's just a helper, so it needs to *find* the relevant
CollabTopicLocal rather than create a new one.
2022-09-26 13:12:44 +00:00
fr33domlover
cc9facdf5a UI: Tweak and re-enable UI for uploading personal SSH keys 2022-09-26 12:51:06 +00:00
fr33domlover
206d140b95 DB: Migration: Check for surprisingly named foreign constraints, fail if found
Because finding them may be a sign of undetected error in the migration plan,
so it's best to stop and find it
2022-09-26 12:48:21 +00:00
fr33domlover
1d2a251c13 DB: Fix typo in DB migration 2022-09-26 06:55:23 +00:00
fr33domlover
6d0eab24d1 UI: Define nav breadcrumbs for all routes 2022-09-26 06:54:16 +00:00
fr33domlover
ab105cb604 Crypto: PersistField instance for ActorKey, preparing to support per-actor keys
Like the KeyFile instance, it stores just the secret key, in a plain
ByteString, and generates the public key from it when decoding from the DB
2022-09-25 12:29:53 +00:00
fr33domlover
f10655f2c1 Client, UI: "Apply" button for local MRs & PublishMergeR form for remote MRs 2022-09-24 21:15:40 +00:00
fr33domlover
ba6f22b94b S2S: Implement loomApplyF (remote person asking to apply bundle on local loom) 2022-09-24 15:46:02 +00:00
fr33domlover
be95f15b21 C2S: Implement applyC (apply a patch/MR to a repo/branch)
Both Git and Darcs are supported

- Darcs implementation applies right on the bare repo, I haven't tested to make
  sure it works right (federated MR demo is going to be only for Git)
- Git implementation clones to temporary repo, runs `git am` on it to apply,
  then pushes to the real bare repo (because `git am` doesn't work on bare
  repos; I haven't tested yet to see how it handles conflicts; cloning and
  pushing should be efficient since the refs are just hardlinked rather than
  copied)
2022-09-24 09:04:10 +00:00
fr33domlover
b5adfce971 S2S: loomOfferTicketF, open MR sent by remote author 2022-09-23 15:59:21 +00:00
fr33domlover
ef8e1c1108 S2S: deckOfferTicketF (i.e. local deck receives ticket from remote author) 2022-09-23 15:58:54 +00:00
fr33domlover
0d922b0e5a Client, UI: Git merge request submission form 2022-09-23 05:20:39 +00:00
fr33domlover
9cb90c58c0 DB: Remember whether a Bundle came from person input or auto-generated 2022-09-22 17:23:33 +00:00
fr33domlover
de51fb9ab5 C2S: offerTicketC: If origin provided but not bundle, generate patches from git
For now it's implemented only for Git:

If tracker is a local loom, and a (local or remote) origin repo is specified,
but no patches are provided, then generate them ourselves!

* Clone the (local) target repo
* Add the (local or remote) origin repo as a git remote
* Make sure target branch is an ancestor of the origin branch
* Generate patches for the commits that origin adds on top of target
* Insert them into our DB
2022-09-22 17:12:37 +00:00
fr33domlover
2e7c5f767c Add 'cloneUri' to AP.Repo, publish in getRepoR, grab in offerTicketC
In offerTicketC it can be used for fetching commits from the remote origin
repo, by knowing its clone URI

Only HTTP clone URIs are supported for now, because it's enough for finishing
the federated MR implementation. Apparently user@host:path isn't a valid URI
and I'll later add a parser for that
2022-09-22 06:02:14 +00:00
fr33domlover
e7ab9e701c C2S: offerTicketC: Add VCS-type and patch-type consistency checks 2022-09-21 17:45:38 +00:00
fr33domlover
23b5343ec2 C2S: Enable offerTicketC for person inbox post handler 2022-09-21 14:22:36 +00:00
fr33domlover
de2e29d505 C2S: offerTicketC re-enabled and supporting looms and remote origin repo
What's missing:

- Match patch VCS, origin repo VCS and target repo VCS
- Hook into postPersonInboxR
- If only origin is provided, generate patches / otherwise somehow remember the
  commits proposed
2022-09-21 12:50:26 +00:00
fr33domlover
0b10056cc3 UI: getClothR: If a Bundle exists in DB, display list of its patches 2022-09-19 12:02:48 +00:00
fr33domlover
ffe68390e5 UI: getBundleR: Display list of old versions and list of patches 2022-09-19 11:40:08 +00:00
fr33domlover
dae8554a12 UI: getPatchR: Display diff-syntax-highlighted patch content file 2022-09-19 11:00:47 +00:00
fr33domlover
5673340bd1 UI: Display origin and target repos in getClothR HTML 2022-09-18 17:37:25 +00:00
fr33domlover
9906231d04 DB, Web: Allow origin repo for Cloths, mention in getClothR JSON 2022-09-18 15:55:42 +00:00
fr33domlover
9deba96cf2 UI: Serve HTML in getClothR, copied from getTicketR 2022-09-18 07:44:00 +00:00
fr33domlover
1e2b3d2006 UI: HTML version for getLoomClothsR, copied from getDeckTicketsR 2022-09-17 19:17:11 +00:00
fr33domlover
1db56ced39 UI: Re-enable ticket page, some pieces still missing, mostly buttons 2022-09-17 17:42:04 +00:00
fr33domlover
e69d775f3f UI: Fix and re-enable deck ticket list view 2022-09-17 10:14:27 +00:00
fr33domlover
c495d78d05 C2S, UI: Loom creation and Repo linking to a Loom
RepoSourceR, for a repo that doesn't have a loom, lists looms that want to
serve that repo with buttons for bidirectionally linking the repo to a loom

Once linked, the repo navbar has a Patches/MRs link pointing to the LoomClothsR
of the linked Loom
2022-09-17 08:31:22 +00:00
fr33domlover
1c8c6d9d24 UI: In RepoSourceR page, mention SSH clone address 2022-09-16 14:04:24 +00:00
fr33domlover
40f741e504 UI: Fix and re-enable getRepoSourceR (repo content file/dir browsing) 2022-09-16 13:47:10 +00:00
fr33domlover
b66bab4295 UI: Fix and re-enable getRepoCommitsR (i.e. repo history view) 2022-09-16 12:46:52 +00:00
fr33domlover
91cdbf51ab UI: Fix and re-enable getRepoCommitR 2022-09-16 11:41:58 +00:00
fr33domlover
e78f043f49 C2S & UI: Allow creation of a new Repo 2022-09-16 10:34:44 +00:00
fr33domlover
8ec98e2a59 S2S: Invite->Accept->Grant (for Repo, Deck, Loom and Person, not for Group)
Person inbox handler:
    - Invite: Parse and insert to inbox
    - Grant: Parse and insert to inbox

Repo/Deck/Loom inbox handler:
    - Invite: Parse and remember as Collab record in DB for later
    - Accept: Send a Grant (and remember it in DB)

Along with inviteC and acceptC, the Invite->Accept->Grant flow is now fully
federated, yay!

What's missing is UI for actually using it. Coming soon.
2022-09-08 12:00:14 +00:00
fr33domlover
00a39475eb S2S: Prepare inbox handler for Group as well 2022-09-06 17:41:09 +00:00
fr33domlover
9dddc7d846 S2S: Prepare inbox handlers for Repo, Deck and Loom 2022-09-06 10:52:14 +00:00
fr33domlover
cdcf3a3326 Control.Applicative.Local: Rename parameter to avoid confusing name shadowing 2022-09-05 16:27:21 +00:00
fr33domlover
5a6ae76b76 Add missing signature to function in Vervis.RemoteActorStore
There are many more missing, but... just felt like fixing a warning :)
2022-09-05 16:25:59 +00:00
fr33domlover
ac867e56f2 S2S: Switch from Grant->Accept->Enable to Invite->Accept->Grant
Giving access now starts with an Invite activity, followed by Accept from the
Invite's recipient. Finally, the resource sends a Grant, which is the actual
OCap.
2022-09-05 16:19:52 +00:00
fr33domlover
0d96ee0775 DB: Add CollabTopicLocalReceive and CollabRecipLocalReceive tables
I was going to link the matching Accept tables to them, but then switched to
the Invite-Accept-Grant model and going to implement it in the next patches. So
I'm committing these new tables just in case I decide to revert to the current
model.
2022-09-01 17:44:43 +00:00
fr33domlover
4269385e15 DB: Add received::UTCTime field to InboxItem
To record *when* an activity, local or remote, was inserted into the specific
inbox. I'm surprised I haven't been keeping that data until now :P
2022-09-01 11:21:31 +00:00
fr33domlover
dd0bdaa742 S2S: Implement preparation and generic steps in person inbox post handler
The steps are:

- Parse activity ID and match with the authenticated sender
- For local activity (we got via forwarding), find in DB
- For remote activity, cache in DB
- Insert activity to recipient's inbox

What's not there yet is the actual logic of handling specific activities.
2022-08-31 13:01:04 +00:00
fr33domlover
b0576f9bf6 DB: Separate tables for CollabTopicLocalAccept and CollabTopicRemoteAccept
Previously there was just CollabTopicAccept, which worked only for local topics
but pretended to apply to both, due to directly pointing to Collab, thus
possible to insert rows even if there's a CollabTopicRemote.

The new situation is a new CollabTopicLocal table to which the local topic
things point, thus keeping the local and remote data separate and difficult to
confuse.
2022-08-30 08:28:44 +00:00
fr33domlover
9e6eb9bec6 Support delivery to Group followers collection 2022-08-29 21:41:13 +00:00
fr33domlover
b7eb7a17d2 C2S: Implement acceptC, allowing people to accept Grants given to them 2022-08-29 20:56:30 +00:00
fr33domlover
e8ed2d5f24 Remove accidental trailing space 2022-08-29 20:55:02 +00:00
fr33domlover
d741d0e918 C2S: grantC: Insert Collab records for Grants with remote topics too 2022-08-28 13:51:43 +00:00
fr33domlover
06c520f6aa C2S: Implement grantC and enable in person outbox handler 2022-08-22 16:59:22 +00:00
fr33domlover
158ad789ec C2S: In automatic Grant upon Deck creation, insert CollabTopicAccept record
Since that table being added, a Collab without a CollabTopicAccept is
considered an open proposal/invitation waiting for completion. So inserting the
CollabTopicAccept is now required for making the Grant valid and active.
2022-08-21 18:15:44 +00:00
fr33domlover
10645bf02b DB: Add Collab tables for recording Recip's and Topic's Accept activities 2022-08-21 18:10:03 +00:00
fr33domlover
0bd7568ca5 ActivityPub: Move 'fulfills' property from Grant type to Activity type 2022-08-16 14:55:21 +00:00
fr33domlover
26ec6527e2 Client, UI: Form for creating a new Deck 2022-08-16 13:17:26 +00:00
fr33domlover
a12409548f C2S: Enable creation of new decks, with automatic Grant and Follow 2022-08-15 20:21:10 +00:00
fr33domlover
87bb369120 ActivityPub: Add a PatchTracker actor type 2022-08-15 18:22:46 +00:00
fr33domlover
2e72684fd5 Switch to new actor layout
This is such a huge patch, it's probably impossible to tell what it does by
looking at the code. One thing is clear: It changes *everything* :P so here's
an overview:

- There are now 5 types of actors, each having its own top-level route
- So projects, repos, etc. are no longer "under" sharers
- Actor routes are now based on their KeyHashid, there are no "idents" anymore,
  i.e. URLs look random and don't contain user or repo names
- No sharers anymore; people and groups are distinct entities not sharing a
  common namespace or anything like that
- Project has been renamed to Deck and it simply means a ticket tracker; repos
  are no longer "under" projects
- In addition to Person, Group, Repo and Deck, there's a new actor type Loom,
  which is a patch tracker; i.e. Repo actors don't manage MRs anymore
- All C2S and S2S is temporarily disabled, because huge changes to the whole
  code are required and I'll do them gradually in the next patches
- Since form-based actions are implemented using C2S, they're disabled as well,
  so Vervis is now essentially read-only
- Some views have been temporarily removed, e.g. repo history and commit view
- A huge set of DB migrations has been added to adapt the DB to these changes;
  I haven't tested them yet on a read DB so there may be errors there; I'll fix
  them in the next patches if I find any (probably going to test on the main
  instance where Vervis itself is hosted...)
- Some modules got tech upgrades, e.g. LocalActor became a higher-kinded type
  and a similar pattern is probably relevant for several other types
- There's an 'Actor' entity in the DB schema now, and all 5 actor types use it
  for common things like inbox and outbox
- Although inbox and outbox are used only by Actor, so essentially could be
  removed, I haven't removed them; that's because I wonder if at some point
  users can have a tree of inboxes much like in email; I don't have an excuse
  for Outbox, but anyway, leaving them as is for now
- Workflows, roles and collaborators are partially removed/unused until I
  figure out a sane federated way to provide these features
- Since repo routes don't contain a "sharer" anymore, SSH URIs are now simpler,
  they already look like user@host/repo regardless of who "controls" that repo
2022-08-15 13:57:42 +00:00
fr33domlover
91b2d36a19 Move models and routes files from config/ to new th/ dir 2022-07-25 18:40:36 +00:00
fr33domlover
066285d3a3 Move robots.txt and favicon from config/ to new embed/ dir 2022-07-25 17:40:19 +00:00
fr33domlover
b3cd7ca28f C2S: Implement ticket tracker creation
* Publish a Create activity and respond with a Grant activity
* postProjectsR reuses that code
* No automatic following at the moment
* Workflow and role specified in new project form are ignored for now
* Can't create tracker under a group yet, just under the user
2022-07-25 17:15:22 +00:00
fr33domlover
3cda2205c5 Web.ActivityPub: Remove fake extContext, the URI doesn't work anymore anyway 2022-07-25 09:10:24 +00:00
fr33domlover
e2591734d3 Web.ActivityPub: Update representation of actor and project
Ugh, that module is such a horrible mess... I hope to turn it soon into
something sane. Is there some generic non-clumsy way restructure the AP
parser/encoder API?

For now, making these ugly changes to support the represenation of
Create {TicketTracker}, which I'm about to implement.
2022-07-24 16:52:28 +00:00
fr33domlover
88b8027572 DB: Move project inbox, outbox & followers into a new Actor table 2022-07-19 12:12:49 +00:00
fr33domlover
86b35e9b56 Style: Replace yesod favicon with Vervis icon made by ikomi (thanks <3) 2022-07-12 14:08:37 +00:00
fr33domlover
b18c0cb255 C2S: applyC: Implement the missing support for patching Git repos 2022-06-26 14:15:52 +00:00
fr33domlover
8186e64a26 S2S: repoApplyF: Implement the missing support for patching Git repos 2022-06-26 14:00:28 +00:00
fr33domlover
a6e4587281 Raise build-time error on incomplete patterns
I realized I never intend to leave patterns (e.g. pattern matching in a 'case'
clause) incomplete, i.e. some cases left missing. When I do that it means I
forgot, and I'd like GHC to highlight it by raising an error instead of just
warning. Vervis has lots of warnings so it's hard to detect among them.

I suppose in other kinds of software people sometimes leave incomplete patterns
intentionally / are okay with a runtime exception being thrown? In a web
application, I definitely want to handle all cases, and be in control of how
errors are handled and displayed in UI.
2022-06-26 13:54:37 +00:00
fr33domlover
842f27f515 C2S: Implement applyC, works only for Darcs right now 2022-06-25 19:59:26 +00:00
fr33domlover
61b9710e38 S2S: repoApplyF: Support local sharer-hosted proposals 2022-06-24 05:39:24 +00:00
fr33domlover
02734d02f2 S2S: repoApplyF: Support local repo-hosted proposals 2022-06-24 05:02:54 +00:00
fr33domlover
c3ff3c40eb S2S: repoApplyF, for now only on remotely hosted patches 2022-06-23 09:09:02 +00:00
fr33domlover
bc7806b100 In migration code, rename Apply to Run to avoid confusion with Apply activity 2022-06-22 07:45:35 +00:00
fr33domlover
1e759698c1 Web.ActivityPub: Add capability URI field to Activity type 2022-06-22 07:39:38 +00:00
fr33domlover
bfa9774f83 DB: Switch to more flexible collaborator model 2022-06-22 06:19:37 +00:00
fr33domlover
bf2e172f6e C2S: addBundleC for adding a new patch bundle version to a Ticket 2020-09-13 12:48:03 +00:00
fr33domlover
1b304994d0 S2S: Add 'Add' activity, adds a new version of the patch bundle to a Ticket 2020-09-10 10:57:02 +00:00