Commit graph

1143 commits

Author SHA1 Message Date
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
fr33domlover
e2ac053d2b No CSRF token check for Dvara routes, they do it for themselves when needed 2020-09-01 14:11:47 +00:00
fr33domlover
7415175bea Fix pattern matching missing case 2020-08-31 09:19:34 +00:00
fr33domlover
201736427e Client: Add form to submit a patch via Offer activity 2020-08-17 13:30:43 +00:00
fr33domlover
7812fa6e8f Client: Add form for submitting a patch to a repo 2020-08-17 13:01:29 +00:00
fr33domlover
32adee0a75 Don't accept Darcs MRs with more than one patch bundle file 2020-08-17 09:01:14 +00:00
fr33domlover
cb11ea6447 DB: Add media type field to 'Patch' entity
This patch (haha) also adds a VCS field to the AP representation of repos
2020-08-14 21:16:33 +00:00
fr33domlover
b16c9505af S2S & C2S: Switch from single-patch MR version to multi-patch bundle support 2020-08-13 10:26:20 +00:00
fr33domlover
da01fcf451 S2S: Fix bug: in *UndoF, when unresolving ticket, ticketStatus wasn't updated 2020-08-06 13:18:38 +00:00
fr33domlover
be3cf50283 C2S: Fix bug: undoC: When deleting TicketResolve, ticketStatus wasn't updated 2020-08-06 07:14:06 +00:00
fr33domlover
9f34106a87 Client: Add forms for resolving and unresolving a ticket/MR 2020-08-05 20:41:33 +00:00
fr33domlover
5a0c46ad5c GET ticket handlers: Provide 'resolvedBy', set to the Resolve activity's ID URI 2020-08-05 12:43:04 +00:00
fr33domlover
de5d24edca When grabbing ticket/patch from DB, grab the TicketResolve* record too 2020-08-05 11:04:00 +00:00
fr33domlover
7a74dcc55e Web.ActivityPub: Allow to specify 'resolved' and 'resolvedBy' for 'Ticket' 2020-08-05 10:11:16 +00:00
fr33domlover
9317e514b2 S2S unresolve, C2S resolve & unresolve, use C2S in the UI buttons 2020-08-05 08:28:58 +00:00
fr33domlover
7f106023b0 S2S: Implement inbox handlers for Resolve activity 2020-07-28 09:35:27 +00:00
fr33domlover
58c0719370 Web.ActivityPub: Add a Resolve activity 2020-07-23 14:27:11 +00:00
fr33domlover
1bd7995bb5 DB: Fix migration 173 for future instances to avoid the RemoteCollection bug 2020-07-23 13:38:46 +00:00
fr33domlover
ac9c79c761 DB: RemoteCollection was referring to itself accidentally, add migration to fix 2020-07-23 13:33:54 +00:00
fr33domlover
b050c9225d Web.ActivityPub: Add 'currentVersion' property to 'Patch' type 2020-07-23 10:47:35 +00:00
fr33domlover
c1f0722c21 C2S: createTicketC: Allow to submit MRs i.e. Ticket with a Patch attached 2020-07-22 13:00:48 +00:00
fr33domlover
fd8405e741 S2S: repoCreateTicketF: Store a Patch record in DB, to have a local copy 2020-07-21 10:03:51 +00:00
fr33domlover
029fce58a4 S2S: Repos now accept remotely hosted patches via Create/Ticket 2020-07-21 09:39:36 +00:00
fr33domlover
f286f35a87 S2S: Add repo patch support to checkCreateTicket 2020-07-19 12:48:39 +00:00
fr33domlover
f7c0807775 C2S: offerTicketC: Support offering a patch to a repo 2020-07-16 11:30:22 +00:00
fr33domlover
3e7e885300 S2S: Implement patch submission via repoOfferTicketF 2020-07-16 08:22:13 +00:00
fr33domlover
6d4d77255f S2S: Prepare Offer/Ticket parsing code for handling a remote patch/MR 2020-07-15 13:00:58 +00:00
fr33domlover
c78becaf5e S2S: projectCreateTicketF: Refactor to use new utils 2020-07-15 11:20:11 +00:00
fr33domlover
e46bcac559 S2S: sharerCreateTicketF: Tweak to use the new utils 2020-07-15 10:14:41 +00:00
fr33domlover
1a8ecb5995 S2S: Refactor projectOfferTicketF to use the new utils 2020-07-15 09:58:59 +00:00
fr33domlover
58e88d1e1b Upgrade sharerOfferTicketF to new utils 2020-07-15 08:00:08 +00:00
fr33domlover
75c0bc0939 Web.ActivityPub: Ticket attachment's Offer object can be either URI or a Patch
This will allow to use this representation for Offer and Create activities.
When creating a new MR, the inner Offer's 'object' is a 'Patch' object. When
serving an existing hosted MR, the inner Offer's 'object' is just a URI
pointing to the patch.
2020-07-14 11:25:37 +00:00
fr33domlover
6d80b1e4f1 Web.ActivityPub: In MR, the 'object' of the 'Offer' is a 'Patch' URI
Instead of an 'OrderedCollection' of the versions
2020-07-14 11:10:43 +00:00
fr33domlover
216aaa72ee Web.ActivityPub: Add PatchLocal type similar to TicketLocal 2020-07-14 09:56:13 +00:00
fr33domlover
fa3348513a For latest-version patches, provide a 'previousVersions' list 2020-07-14 08:50:57 +00:00
fr33domlover
a06d273107 C2S: Implement offerDepC, allowing to create ticket dependencies 2020-07-13 13:43:20 +00:00
fr33domlover
90086f1329 In audience parsing, provide version without bcc & list hosts for inbox fwding 2020-07-12 11:17:12 +00:00
fr33domlover
2a6bba89d5 C2S: Reimplement offerTicketC using the new tools 2020-07-07 07:26:51 +00:00
fr33domlover
511c3c60db C2S: In yesod authorization check, support OAuth2 as login method 2020-07-06 08:01:02 +00:00
fr33domlover
d392a37707 Rename InboxR to InboxDebugR, much clearer that way 2020-07-02 13:34:38 +00:00
fr33domlover
5d25aba239 C2S: Implement real C2S access via outbox POSTing and OAuth2 2020-07-02 13:21:59 +00:00
fr33domlover
a0325da028 S2S: Implement projectOfferDepF and repoOfferDepF 2020-06-22 11:29:30 +00:00
fr33domlover
5cf105fafb Move checkDepAndTarget from Vervis.Federation.Ticket to Vervis.Ticket
I'm moving it there because it's going to be used in C2S too, in offerDepC.
2020-06-21 12:31:11 +00:00
fr33domlover
4fc50f0870 Move hostIsLocal from Vervis.ActivityPub to Yesod.ActivityPub 2020-06-21 12:29:37 +00:00
fr33domlover
2cddadd679 sharerOfferDepF: If parent is remote and child is mine, record TicketDepOffer 2020-06-21 09:06:02 +00:00
fr33domlover
bc4248d7ca S2S: Handle remote dep in sharerAcceptF
If sharer receives Accept on an Offer/Dep where the sharer hosts the child
ticket, it records a RemoteTicketDependency and runs inbox forwarding to ticket
followers. But this relies on a TicketDependencyOffer record already existing.
I'll take care of that in the next patches.

sharerAcceptF and sharerRejectF now use the insertToInbox from
Vervis.Federation.Util instead of their own copies of it, which were identical
anyway. Perhaps gradually all the inbox insertion in all S2S handlers will
switch to using that function.
2020-06-21 08:02:05 +00:00
fr33domlover
a2468c52fd Prepare for ticket dependency federation
To be honest, this is a huge patch that changes tons of stuff and probably
should have been broken up into small changes. But I already had the codebase
not building, so... just did all of this at once :P

Basically this patch does the following:

- DB migrations for ticket dependency related tables, e.g. allowing a remote
  author and a remote child
- Allowing S2S handlers to provide an async continued processing function,
  which is executed and the result then added to the debug page
- Most UI and functionality related to ticket deps is disabled, new
  implementation being added gradually via ActivityPub
- Improvements to AP tools, e.g. allow to specify multiple hosts for approved
  forwarding when sending out an activity, and allow to specify audience of
  software-authored activities using a convenient human-friendly structure
- Implementation of S2S sharerOfferDepF which creates a dependency under a
  sharer-hosted ticket/patch and sends back an Accept
2020-06-18 10:38:04 +00:00
fr33domlover
854d35fd9b C2S: Support following a sharer-patch and repo-patch 2020-05-28 07:48:39 +00:00
fr33domlover
3fb529325d S2S: Support commenting on sharer-patch and repo-patch 2020-05-27 14:07:02 +00:00
fr33domlover
cf946e0326 S2S: Support unfollowing sharer-patch and repo-patch
- Sharer-patch was already working due to the shared DB tabled
- Repo-patch support added
- Fixed a bug in following project-tickets: It allowed to follow a
  sharer-ticket by sending the Follow to the project. Now, the project allows
  to follow only the project-tickets, and refuses to handle a sharer-ticket.
2020-05-27 11:59:53 +00:00
fr33domlover
c7b6ad643b S2S: Support following sharer-patch and repo-patch
Also fixed a bug in which trying to follow a ticket with nonexistent
ltkhid/talkhid would result with 404 as if the actor inbox is nonexistent. Now,
there's a friendly message reported.
2020-05-27 11:39:19 +00:00
fr33domlover
06a051d2e5 Support addressing, delivery and forwarding for sharer-patches and repo-patches 2020-05-27 10:38:28 +00:00
fr33domlover
d9c00cba1f Add repo-hosted patch routes and GET handlers 2020-05-26 14:51:11 +00:00
fr33domlover
e29233a59f Rename RepoPatchR to RepoCommitR, we'll use the old name for merge requests 2020-05-26 08:54:21 +00:00
fr33domlover
ad8c0ce8b4 Return sorted PatchId list from the get*Patch functions 2020-05-26 08:41:02 +00:00
fr33domlover
e68a659221 Support forwarding activities from repo actors 2020-05-25 13:36:34 +00:00
fr33domlover
17e59af1c4 AP: In getSharerPatchR, provide the list of patch versions, latest first 2020-05-25 12:39:25 +00:00
fr33domlover
c63479470e Add patch version route and GET handler, serving a specific patch file 2020-05-25 09:40:48 +00:00
fr33domlover
55c87b8a54 AP: Recognize "CryptographicKey" as a type of http sig keys
The examples in the security vocabulary's spec use "Key" but the JSON-LD
context doesn't define that term. From now on, just in case, recognizing both
"Key" and "CryptographicKey" as indication that the object is a key.

zPlus, thanks for finding this bug!
2020-05-25 09:37:15 +00:00
fr33domlover
417fcd3e94 S2S: If sharer inbox handler fails, return and log the error message 2020-05-24 13:53:31 +00:00
fr33domlover
d56a7411fc Refactor sharer-ticket and sharer-patch GET handler code to reuse similar parts 2020-05-24 13:31:58 +00:00
fr33domlover
02c42029d2 Add GET routes and handlers for sharer-hosted patches 2020-05-24 09:17:49 +00:00
fr33domlover
bb6785de75 DB: Generalize TicketProjectLocal into TicketContextLocal
This is the first step preparing for patches and merge requests.

The work-item aspect of MRs will reuse the Ticket related tables, except MRs
will live under repos. So, the context of tickets will no longer be just
projects, but will also be repos.

So, TicketProjectLocal turns into TicketContextLocal, and there are 2 new
tables that refer to it: TicketProjectLocal and TicketRepoLocal. Tickets will
have the former, MRs will have the latter.
2020-05-18 10:28:43 +00:00
fr33domlover
77e576ccb2 Startup: Sort the repo-tree-from-filesystem, it's not sorted by default 2020-05-14 12:33:51 +00:00
fr33domlover
2063c7313b Startup: If repo dir check fails, print both versions of repo tree 2020-05-14 12:11:31 +00:00
fr33domlover
cac4edc8eb getProjectTicketsR: In AS2, list remote tickets too 2020-05-14 11:13:04 +00:00
fr33domlover
d29ba23bfb In getProjectTicket, return TUP alongside TAL to prove it exists 2020-05-14 09:09:57 +00:00
fr33domlover
036c60171b In getSharerTicket, support remote project 2020-05-14 08:59:34 +00:00
fr33domlover
003adcbf7b Comment out more uses of ticket team collection 2020-05-14 08:58:37 +00:00
fr33domlover
a5348245f6 Comment out some usage of ticket team collection for addressing
Removed its usage in pseudo-client when publishing a comment, and removed it
from inbox forwarding when handling a remote comment.

Very possibly, the ticket team collection will be entirely removed. For now
leaving it there as-is. Just not using it for addressing in activities.
2020-05-13 14:00:38 +00:00
fr33domlover
a548dc8c5b S2S: sharerCreateNoteF: If ctx is sharer-ticket of another user, store to inbox 2020-05-13 13:49:22 +00:00
fr33domlover
f296dc173c C2S: In followC, return friendly message if already following the target object 2020-05-13 13:29:39 +00:00
fr33domlover
43cd1a95f3 S2S: sharerCreateNoteF caches note and does inbox fwd if sharer is ticket owner 2020-05-13 13:06:28 +00:00
fr33domlover
c91908941b S2S: sharerCreateNoteF & projectCreateNoteF can handle sharer-hosted tickets 2020-05-11 18:59:29 +00:00
fr33domlover
edaa3c49b2 C2S: Rewrite createNoteC based on createTicketC 2020-05-01 17:48:01 +00:00
fr33domlover
23056b3b3c DB: Attach a RemoteDiscussion to each RemoteTicket, for caching comments 2020-04-14 18:24:19 +00:00
fr33domlover
6c8b9664a2 When HTTP-fetching actors, remember their 'followers' as a LocalURI
The implementation felt quite weird, had to add an extra field to Fetched and
to VerifKeyDetail. Should probably figure out the whole mess in that code, have
something clean there. Easily add fields. Easily and safely re-fetch an actor
or key.
2020-04-11 14:58:38 +00:00
fr33domlover
7dc0ba2bf1 Fix error message for HTTP inbox forwarding 2020-04-11 14:03:54 +00:00
fr33domlover
04fc94cedb S2S: Write Create/Ticket project inbox handler: list ticket & do inbox fwding 2020-04-11 13:57:43 +00:00
fr33domlover
40a5b336a4 S2S: In Undo handler for sharer inbox, support unfollowing sharer tickets 2020-04-10 10:47:43 +00:00
fr33domlover
e406b08f44 S2S: In Follow handler for sharer inbox, support following of sharer tickets 2020-04-10 10:34:22 +00:00
fr33domlover
f4ab99f7bb C2S: In Follow handler, support following sharer-hosted tickets 2020-04-09 20:04:21 +00:00
fr33domlover
90bac5c34e Support sharer-hosted tickets in AP local dispatch and delivery 2020-04-09 17:39:36 +00:00
fr33domlover
ef4a8f4015 Write S2S Create/Ticket handler for sharer inbox 2020-04-09 12:21:17 +00:00
fr33domlover
f18c15f038 Rename the TicketR routes to ProjectTicketR for clarity
Now it's much clearer when looking at the code, that these routes are about
project-hosted tickets, and it's easier to see where the author-hosted
equivalents are missing.
2020-04-09 07:36:01 +00:00
fr33domlover
4a362632be Update S2S Accept handler to handle Accept on a Create/Ticket 2020-04-08 17:02:04 +00:00
fr33domlover
318f182245 Add OAuth2 subsite 2020-03-28 14:28:24 +00:00
fr33domlover
ac477ab739 Add OAuth2 tables to database, and run their migrations 2020-03-28 14:18:00 +00:00
fr33domlover
8f3ac50963 Verify TUP existence (when relevant) in all project-hosted ticket routes 2020-02-24 15:36:43 +00:00
fr33domlover
bf4a0e4c95 getTicketsR: Deduce ticket URL correctly for HTML output too 2020-02-23 15:41:08 +00:00
fr33domlover
ca0c7124c1 In C2S Offer{Ticket} on local project, insert a TicketUnderProject record 2020-02-23 15:38:22 +00:00
fr33domlover
f6903364f4 getTicketsR: Deduce ticket URLs correctly for JSON output 2020-02-23 13:22:32 +00:00
fr33domlover
a00c45a444 Implement C2S Create{Ticket}, available in PublishR and in postTicketsR
IMPORTANT: Since a lot of ticket code still doesn't use TicketUnderProject,
creating tickets now appears to be failing. Usage of this patch as is, is at
your own risk ^_^ the next patches will update the ticket handlers to fix this
problem.
2020-02-22 19:45:27 +00:00
fr33domlover
e0300ba0fa Write recipient filtering utility function 2020-02-19 10:59:38 +00:00
fr33domlover
a53fbcf1c0 Vervis.ActivityPub: Implement general-purpose full local delivery
Delivery of an activity into local inboxes is being done using custom local
functions. Each C2S or S2S handler has its own specific variant for this.

As part of the ongoing refactoring and evolution of the federation code, I
implemented a general-purpose local delivery function: It takes a
LocalRecipientSet and simply delivers to everyone, no handler-specific
assumptions or limitations.

To limit the recipient set according to handler specific rules, just
filter/adapt/edit it before passing to the delivery function.

The function isn't exported yet, but the existing 'deliverLocal' that delivers
only to actors and to author's followers is now implemented via the new
general-purpose function. I hope that's a step towards doing all the local
delivery using this one function, simplifying the complicated federation
code.
2020-02-18 13:34:34 +00:00
fr33domlover
adc107bb4c Web.ActivityPub: Add createTarget field
I'll use this for C2S to allow client to state who the tracker actor is. It's
still possible to do without it, by HTTP GETing the ticket's context and
checking whether we got an actor, or a non-actor with ticketsTrackedBy. Tbh I'm
adding createTarget simply because it's easier for coding, no need for a custom
variant of actor fetching :P
2020-02-18 13:26:28 +00:00
fr33domlover
257a811a8b Remove some unused imports from Vervis.Foundation 2020-02-18 13:25:26 +00:00
fr33domlover
1a650a783f Web.ActivityPub: Move ticketContext from TicketLocal to Ticket
This allows the context to be specified even when replies/followers/deps/etc.
aren't. This is needed for Create-ing a Ticket. Also, it allows a ticket's
context to be on a different host than where it's hosted, which is also needed
for the Create flow.
2020-02-11 14:14:52 +00:00
fr33domlover
6d25d7ec2c Web.ActivityPub: Allow Create object to be a Ticket 2020-02-10 14:51:32 +00:00
fr33domlover
0de98a9cdd Implement sharer ticket JSON view, including discussion, followers, deps etc. 2020-02-10 14:10:01 +00:00
fr33domlover
00e0f7c14f DB: Switch RemoteMessage to use RemoteObject 2020-02-10 14:07:00 +00:00
fr33domlover
c03dacdb11 In getTicketR, if author is local, make sure a TicketUnderProject exists 2020-02-08 15:42:55 +00:00
fr33domlover
32173fe0c0 Add tickets-under-sharer route, just plain JSON view 2020-02-08 15:24:36 +00:00
fr33domlover
5e9dd3555d DB: Add and populate TicketUnderProject table
A row in this table will be required for local-project-local-author tickets
hosted under the project, and non-existence of a row will be required for such
tickets hosted by the author. So I'll need to CAREFULLY update all the ticket
route handler code and all the ticket related AP code. The latter includes C2S
and S2S for tickets, ticket deps, ticket discussion... everything that is under
tickets.
2020-02-08 11:49:30 +00:00
fr33domlover
7612b4e01e DB: Switch RemoteDiscussion to use RemoteObject instead of instance+ident 2020-02-08 10:55:19 +00:00
fr33domlover
fb9e2dd4dd DB: In TAL and TAR, rename 'offer' to 'open'
That's because with the Create flow added, the activity that reports a ticket
can be either Create or Offer, maybe later Announce too.

The old TAL unique name mentioned in the migration has what may look like a
typo, "Locale" instead of "Local". That's because I made a typo in migration
115, and now needed to specify the typoed name I used then. I verified in dev
DB and on dev.angeley.es DB that the typo is reflected in the PostgreSQL
database side and fixed by the new migrations.
2020-02-08 09:35:35 +00:00
fr33domlover
6fa0a9cb46 Fix bug in DB query in getTicketsR 2020-02-08 08:55:28 +00:00
fr33domlover
6e2445a31f DB: Remove unnecessary fkey from TicketAuthorRemote to Ticket
Since it points to TicketProjectLocal which in turn points to Ticket.
2020-02-07 23:05:42 +00:00
fr33domlover
5b57039447 DB: Point from TicketAuthorRemote to TicketProjectLocal 2020-02-07 19:42:02 +00:00
fr33domlover
ea7d806233 DB: Remove 'project' and 'accept' from Ticket, use TicketProjectLocal instead 2020-02-06 17:25:09 +00:00
fr33domlover
7809512117 DB: Add TicketProjectLocal table, pointing to Ticket but not in use yet 2020-02-06 04:18:19 +00:00
fr33domlover
813869755a DB: Remove foreign key from TicketAuthorLocal to Ticket, not needed anymore
Since TicketAuthorLocal now points to LocalTicket, which in turn points to
Ticket.
2020-02-06 03:41:16 +00:00
fr33domlover
fd704e231f DB: Add foreign key from TicketAuthorLocal to LocalTicket
Right now it's in addition to the Ticket one. The next patch will remove the
Ticket old, so TicketAuthorLocal will point only to the LocalTicket.
2020-02-06 03:17:00 +00:00
fr33domlover
443ff6daa1 Switch ticket routes to use the KeyHashid of LocalTicket instead of Ticket 2020-02-06 00:52:15 +00:00
fr33domlover
cd5180a1d5 DB: Remove did and fsid from Ticket, get them from LocalTicket
Everywhere Ticket is found, a matching LocalTicket is now expected to be found
too. Ticket doesn't point at LocalTicket because there will be remote cached
tickets too. Also, ticket URLs are going to switch the khid from Ticket to
LocalTicket (much like it's already the case for MessageR).
2020-02-05 14:09:12 +00:00
fr33domlover
deeac7e760 DB: Add LocalTicket table
This is a step preparing for the Create flow for tickets. Each Ticket now gets
a matching LocalTicket that points to it. But otherwise the LocalTicket isn't
in use yet.
2020-02-05 12:08:39 +00:00
fr33domlover
1a5654f8ae Stop assigning ticket numbers, allow them to be NULL 2020-02-03 15:44:16 +00:00
fr33domlover
c5996bd226 Re-enable UI for removing ticket deps 2020-02-03 15:10:13 +00:00
fr33domlover
1cb3812ef5 Remove ticket numbers from UI and from URLs, use KeyHashid instead 2020-02-03 14:53:12 +00:00
fr33domlover
fc0f694289 When comparing repo dir to DB, compare the VCS type of each repo as well 2020-01-18 11:49:07 +00:00
fr33domlover
54ea66878f Compare repos dir and repos in DB when launching Vervis 2020-01-18 11:00:08 +00:00
fr33domlover
59d08782ba Don't html-escape ticket title, it's already escaped 2020-01-17 21:52:29 +00:00
fr33domlover
f4a5866dec Very basic support for ticket label colors
- WorkflowField now has a color, it's a simple `Maybe Int` for now. Valid
  values are only 1-4
- That color is used for displaying ticket class params a.k.a labels in ticket
  list view
- Ticket list now also serves a paged OrderedCollection

I tried to use a single SQL query to grab the tickets along with their labels,
but couldn't figure out a way to aggregate tuples/rows into an array (it seems
only single values are supported in Esqueleto). Instead of doing manual SQL or
adding Esqueleto functions, I just switched from 1 query to O(n) queries: Each
ticket has its own query selecting its labels. I guess it's slower, but also,
ticket list is paged now with fixed page size so it's really O(1) ^_^
2020-01-16 10:29:47 +00:00
fr33domlover
031a4c0930 Display ticket class params AKA labels in ticket list view 2020-01-11 17:28:53 +00:00
fr33domlover
d01bc5bad7 Implement ticket class params 2020-01-05 14:33:10 +00:00
fr33domlover
8fc5e4b3c1 DB: Rename entity WorkflowFieldEnum to WorkflowEnum 2020-01-05 12:04:17 +00:00
fr33domlover
b78a0fa116 Allow to create and set ticket params of enum type, fixes #111 2020-01-04 10:49:44 +00:00
fr33domlover
64cf836b47 UI: When selecting ticket dep, display the list sorted by ticket number 2020-01-03 18:42:29 +00:00
fr33domlover
878e8f4056 In /browse, add repo-less project table, so that all projects are listed 2019-12-28 18:04:05 +00:00
fr33domlover
d8fabbdfc5 Display project/repo sharer nav, and project nav in repo page 2019-12-28 16:34:44 +00:00
fr33domlover
7654655bcf In repo source page(s), display the project it belongs to 2019-12-27 20:44:14 +00:00
Jason Harrer
955f7444f6 Discussion Tree View Improvements 2019-12-08 14:47:38 +00:00
fr33domlover
73cfaf7ceb UI: In ticket view, display filter as 3 checkboxes, default is open tickets 2019-11-07 10:46:25 +00:00
fr33domlover
0031801a74 Fix SQL error when selecting ticket summaries 2019-11-07 10:45:44 +00:00
fr33domlover
7a96d904f3 Use orderedItems in OrderedCollection 2019-11-06 20:46:21 +00:00
fr33domlover
f8dd72d052 DB: Use RemoteObject in UnfetchedRemoteActor, RemoteActor, RemoteCollection 2019-11-06 19:47:50 +00:00
fr33domlover
acb86ab621 DB: Add RemoteObject entity and use it in RemoteActivity instead of iid+lu 2019-11-05 04:08:36 +00:00
fr33domlover
027b0012a5 AP: When parsing a Follow, let "hide" not be specified, treat as false 2019-11-03 13:43:59 +00:00
fr33domlover
deba50f835 UI: Display all messages in defaultLayout, not just one 2019-11-03 13:20:48 +00:00
fr33domlover
4dcd6eb1b2 UI: Some tweaks, following ikomi's suggestions, thank you ikomi :) 2019-10-31 11:29:00 +00:00
fr33domlover
b95e9a8006 Weird initial (but complete) display of Darcs patches 2019-10-31 10:11:13 +00:00
fr33domlover
e9f17ff220 UI: Change RepoPatchR breadcrumb parent from RepoR to RepoHeadChangesR 2019-10-31 10:10:17 +00:00
fr33domlover
bdc48f4ca2 When parsing a Darcs repo's patch file, fail with error detail in the message
I'm not sure this will improve much, because the error messages come from
attoparsec, but at least the message text won't be constant, which was the
previous situation.
2019-10-23 09:31:37 +00:00
fr33domlover
ff73433bc1 UI: Change the default page parent from Nothing to Just HomeR
That way, it's a bit easier to navigate from a weird "PAGE TITLE HERE" page to
the homepage. Breadcrumbs still need work though.
2019-10-22 11:00:35 +00:00
fr33domlover
b23741f1fe S2S: Store relevant Push activities in recipient's inbox
Before, Push activities were being ignored by all inboxes. I just forgot to add
code to handle them. Now, person inboxes accept them if they're about a
relevant repo (i.e. a repo of which the user is a remote follower; remote
collaboration would be relevant too, but it's not implemented yet).
2019-10-22 10:28:35 +00:00
fr33domlover
0673ed0bb4 DB: Remove the "manual" fields from follow records
Follows used to be added automatically, without a Follow activity sent by the
client. They aren't added automatically anymore, so there's no need for those
"manual" boolean fields.
2019-10-22 10:25:33 +00:00
fr33domlover
a700dc4208 Make the hook config file path include the instance host
Before this patch, if you ran more than 1 instance as the same OS user, they'd
use the same config file path and overwrite it and cause post hooks to have
errors due to wrong config being used.
2019-10-20 09:19:49 +00:00
fr33domlover
552e2b3001 UI: Remove link to FEDERATION.md
It's getting outdated and with demo instructions you don't need that file
anyway. Removing it to reduce visual clutter in the UI.
2019-10-19 09:49:09 +00:00
fr33domlover
96c6904b46 When parsing actor, allow missing sshKey, treat it the same as [] 2019-10-19 09:38:05 +00:00
fr33domlover
bc379a864f Provide 'following' collections and link in page header 2019-10-19 08:15:48 +00:00
fr33domlover
e0d7612908 Display SSH key example as a placeholder, not a default value (thanks zPlus!) 2019-10-19 06:35:28 +00:00
fr33domlover
339c2253f9 If Git repo is empty (no branches), don't 404, just show basic repo page 2019-10-19 06:01:14 +00:00
fr33domlover
0be7f05d31 If an actor doesn't have SSH keys, don't list an "sshKey":[] property 2019-10-19 04:16:09 +00:00
fr33domlover
1c56f63e86 Default actor name display is now its URL, not the string "(?)" 2019-10-19 04:10:33 +00:00
fr33domlover
c2cd32f020 When creating a repo, redirect to the page of the new repo 2019-10-19 02:43:24 +00:00
fr33domlover
b030320964 C2S: Process the HTML forms in postPublishR, not postSharerOutboxR 2019-10-19 02:41:36 +00:00
fr33domlover
af9f207b78 S2S: In repo inbox POST, don't check for CSFR token 2019-10-19 00:13:48 +00:00
fr33domlover
9f063fb349 Fix missing logs of fixRunningDeliveries 2019-10-18 23:51:55 +00:00
fr33domlover
d5063eaef9 S2S: FIx bug in parsing Follow object 2019-10-18 23:45:13 +00:00
fr33domlover
1e8dd71f23 Fix handling of forwarded activities from local repos 2019-10-18 23:20:48 +00:00
fr33domlover
271bc3dbd0 UI: List projectless repos and "Create New" link in personal overview page 2019-10-17 11:45:06 +00:00
fr33domlover
02337c39e1 UI: Take SSH public key in 1 field, then split into key type and content 2019-10-17 09:57:46 +00:00
fr33domlover
a419db5b5b Publish AS2 representation of SSH keys and list SSH keys in actor documents 2019-10-17 08:37:48 +00:00
fr33domlover
0be7fa05f8 In Push activity summary, list the titles of the pushed commits 2019-10-13 19:19:24 +00:00
fr33domlover
6c81a46a02 List repo in Push recipients, it was accidentally not listed 2019-10-12 19:38:29 +00:00
fr33domlover
16cde4b4c2 Fix typo in context property name for Commit objects 2019-10-10 16:48:57 +00:00
fr33domlover
59ce05694e In darcs post-apply hook, send a Push object to Vervis 2019-10-10 16:41:34 +00:00
fr33domlover
6cb86ebbf1 Install darcs post-apply hooks in darcs repos, no-op hook for now
In Darcs, any command can have a post hook (and a pre hook), and the hook
command can be set using a command-line option to the darcs command that you
run. So, in the Vervis SSH server, if we add a --posthook option when running
`darcs apply` to apply remotely received patches, we get a chance to process
the patch data much like in the git post-receive hook.

The setup this patch creates is similar to the git one: It writes a
_darcs/prefs/defaults file to all Darcs repos, and that defaults file sets the
posthook line for `darcs apply`. The posthook line simply executes the actual
hook program written in Haskell.

The current hook program is a one-liner that prints a line to stdout, so every
time you `darcs push` you can tell the hook got executed. The next step is to
implement the actual hook logic, by reading patch data from the environment
variable in which Darcs puts it.
2019-10-07 14:05:52 +00:00
fr33domlover
c529722b5a Implement S2S unfollowing using Undo{Follow} 2019-10-05 16:22:27 +00:00
fr33domlover
bbe6f159d0 Implement C2S unfollowing, using Undo{Follow} 2019-10-05 14:10:29 +00:00
fr33domlover
6a4975a52c Add "Follow" button to person, repo, project and ticket pages 2019-10-02 08:07:26 +00:00
fr33domlover
c91599b989 When successfully submitting a ticket comment, submit Follow activity too 2019-09-30 09:00:44 +00:00
fr33domlover
77678fc8f6 Move postTicketsR to Vervis.Handler.Client & submit Follow activity on success 2019-09-30 08:00:05 +00:00
fr33domlover
72cba96958 Move reply authoring code from Vervis.Handler.Discussion to Vervis.Client 2019-09-30 06:27:42 +00:00
fr33domlover
5a7700ffe4 Implement remote following, disable automatic following
This patch contains migrations that require that there are no follow records.
If you have any, the migration will (hopefully) fail and you'll need to
manually delete any follow records you have. In the next patch I'll try to add
automatic following on the pseudo-client side by running both e.g. createNoteC
and followC in the same POST request handler.
2019-09-25 10:43:05 +00:00
fr33domlover
1673851db0 In S2S Follow, projects allow following their tickets 2019-09-16 16:01:43 +00:00
fr33domlover
612dfa1fce Implement S2S Follow for sharers, projects and repos 2019-09-16 15:18:18 +00:00
fr33domlover
525a722439 Implement C2S Follow activity and add form on /publish page 2019-09-11 08:12:20 +00:00
fr33domlover
3a68a3e7e6 Don't list non-public follows in follower collections 2019-09-09 01:20:02 +00:00
fr33domlover
544ebae3fd Specify visibility in Follow records 2019-09-09 00:33:36 +00:00
fr33domlover
68e8b094a0 Handle post-receive hook, publish a Push activity 2019-09-09 00:27:45 +00:00
fr33domlover
3c01f4136c Mechanism for reporting git pushes to Vervis via post-receive hooks
Here's how it works:

- When Vervis starts, it writes a config file and it writes post-receive hooks
  into all the repos it manages
- When a git push is accepted, git runs the post-receive hook, which is a
  trivial shell script that executes the actual Haskell program implementing
  the hook logic
- The Haskell hook program generates a Push JSON object and HTTP POSTs it to
  Vervis running on localhost
- Vervis currently responds with an error, the next step is to implement the
  actual publishing of ForgeFed Push activities
2019-09-05 12:02:42 +00:00
fr33domlover
29354ff1ed Provide darcs log in ActivityPub format 2019-09-02 02:41:50 +00:00
fr33domlover
6ffc2c9872 Provide git log in ActivityPub format
Currently it's a paged Collection where the items are merely URIs. This could
be changed to have actual Commit objects as items; for that we need to examine
the whole thing with the LogEntry type and the Patch type and have an
AP-friendly log item representation, but without commit diffs.
2019-09-01 14:19:14 +00:00
fr33domlover
7b26d5d918 Use 'context' for Commit's repo, instead of 'repository' 2019-08-28 16:20:19 +00:00
fr33domlover
d4d45c6fe7 AP representation of git repo branches & preparation for Push activities 2019-08-28 15:31:40 +00:00
fr33domlover
2c18660a3b Provide AP representation of commits, and support committer field 2019-08-06 13:23:11 +00:00
fr33domlover
072039f5d8 On "See JSON" pages, display a link back to "regular HTML" version of the page 2019-07-23 18:17:15 +00:00
fr33domlover
655a2ebe18 Provide AP Collection representations for ticket deps/rdeps pages 2019-07-23 18:15:51 +00:00
fr33domlover
8fc5c80dd6 New Network.FedURI with separate URI modes for dev and for fediverse
FedURIs, until now, have been requiring HTTPS, and no port number, and DNS
internet domain names. This works just fine on the forge fediverse, but it
makes local dev builds much less useful.

This patch introduces URI types that have a type tag specifying one of 2 modes:

- `Dev`: Works with URIs like `http://localhost:3000/s/fr33`
- `Fed`: Works with URIs like `https://dev.community/s/fr33`

This should allow even to run multiple federating instances for development,
without needing TLS or reverse proxies or editing the hosts files or anything
like that.
2019-07-23 13:59:48 +00:00
fr33domlover
84765e2b94 Represent a ticket dep using a dedicated TicketDependency AP type 2019-07-11 22:18:30 +00:00
fr33domlover
65edc77747 Specify deps and rdeps in Ticket as URIs of Collections 2019-07-11 15:53:55 +00:00
fr33domlover
81a05a950f Implement getTicketDepR, not used anywhere else yet
This patch also disables the ability to specify deps when creating a ticket,
because those deps won't be in the ticket object anymore. Instead of coding a
workaround and getting complications later, I just disabled that thing. It
wasn't really being used by anyone anyway.
2019-07-11 15:14:16 +00:00
fr33domlover
828e015c54 Rename TicketDepR to TicketDepOldR; we're going to use TicketDepR in a new way 2019-07-08 15:54:41 +00:00
fr33domlover
d2e64d2920 Fix outbox item pretty display, it was highlighted but not pretty-encoded 2019-06-30 16:53:53 +00:00
fr33domlover
deedc961c5 If highlight backend not set for pretty JSON, assume Skylighting
Highlighter2 doesn't work for JSON anyway (not sure why yet).
2019-06-30 14:38:23 +00:00
fr33domlover
31d7e9eac7 Display times and link to activity in inbox, outbox and notifications 2019-06-30 14:04:28 +00:00
fr33domlover
dc631a98c5 Fix typo in Create Note summary text formatting 2019-06-30 11:20:43 +00:00
fr33domlover
a09585f074 Specify noteSource when inserting C2S ticket comment 2019-06-30 02:52:40 +00:00
fr33domlover
4b045118f9 Address project followers when posting ticket comment in regular UI 2019-06-30 02:23:58 +00:00
fr33domlover
d8da1f2abf Display summary and pretty JSON for notifications and for outboxes 2019-06-30 01:41:54 +00:00
fr33domlover
2109974709 Publish project outbox URL in project AP JSON 2019-06-30 01:18:52 +00:00
fr33domlover
add8a3a23b Display pretty JSON on user page 2019-06-30 01:17:47 +00:00
fr33domlover
2376cbd479 When receiving Offer in inbox, expect ticket's 'published' NOT to be set 2019-06-29 23:32:34 +00:00
fr33domlover
d73c3928a0 In inbox display, show summary when available, otherwise show highlighted JSON 2019-06-29 23:16:52 +00:00
fr33domlover
f7b7a417eb Highlight JSON with Skylighting by default, Highligher2 isn't working on it 2019-06-29 23:15:41 +00:00
fr33domlover
90cb4fcd88 Data.Aeson.Encode.Pretty.ToEncoding: Use encodePrettyToTextBuilder as base
aeson-pretty implements by formatting using a text Builder, and the ByteString
is encoded from that. So instead of decoding the ByteString to produce Text or
Builder, use the Builder as the starting point, to match how aeson-pretty works
and save computation and weird backwards-decoding stuff.
2019-06-29 22:39:42 +00:00
fr33domlover
183e9a7754 Encode pretty JSON using encodePretty, highlighting doesn't do formatting! 2019-06-29 22:38:42 +00:00
fr33domlover
685b7ec2bc Add option to render pretty AP JSON using Skylighting
highligher2 doesn't have a JSON syntax and the JS lexer seems to be failing,
not sure exactly why yet. To have an alternative, I'm adding a Skylighting
option.
2019-06-29 20:31:01 +00:00
fr33domlover
590e3928a5 Vervis.Migration: Replace fromJust in migration #109 with informative error 2019-06-29 17:18:48 +00:00
fr33domlover
6d72d676e7 Switch OutboxItem's Activity from plain BL to an upgraded PersistJSONObject 2019-06-29 03:19:00 +00:00
fr33domlover
e10b4d452a Treat outbox items in DB as bytestrings to avoid depending on JSON parsing 2019-06-28 23:15:08 +00:00
fr33domlover
e5f9b34ad2 Unset ticket closer PersonId for tickets that aren't closed 2019-06-27 12:19:37 +00:00
fr33domlover
63689aef1a Fix SQL query that selects ticket summary data, was making getTicketsR fail 2019-06-27 11:47:23 +00:00
fr33domlover
9f3e45c113 When Accepting an Offer{Ticket}, automatically add author as ticket follower 2019-06-26 01:37:29 +00:00
fr33domlover
07f76d2a6f Publish Accept activity when creating a new ticket from the Offer 2019-06-26 01:12:11 +00:00
fr33domlover
0a4c2ad817 Add a new-ticket form to /publish page, and handle in sharer outbox 2019-06-23 12:39:44 +00:00
fr33domlover
4be444f5ab Bring back postTicketsR, now implemented using offerTicketC 2019-06-23 10:00:11 +00:00
fr33domlover
55fdb5437c Write C2S Offer{Ticket} handler, not used in any route handlers yet
This patch doesn't just add the handler code, it also does lots of refactoring
and moves around pieces of code that are used in multiple places. There is
still lots of refactoring to make though. In this patch I tried to make minimal
changes to the existing Note handler to avoid breaking it. In later patches
I'll do some more serious refactoring, hopefully resulting with less mess in
the code.
2019-06-22 18:03:20 +00:00
fr33domlover
d6b999eaf3 C2S: Handle recipient grouping in dedicated Vervis.API.Recipient module 2019-06-20 23:22:25 +00:00
fr33domlover
7c30ee2d52 Switch activityId from LocalURI to Maybe LocalURI, for C2S posting without ID 2019-06-19 08:53:31 +00:00