Commit graph

55 commits

Author SHA1 Message Date
Pere Lev
66ecaa88e7
DB: Fix per-actor SQLite DB creation 2024-03-14 21:56:21 +02:00
Pere Lev
6e55659410
Fix bug in HTTP delivery actor storage, delivery wasn't working 2024-03-14 16:34:09 +02:00
Pere Lev
df6ece2889
UI: Deck: 'Approve' button for accepting invites-to-projects 2023-11-02 22:27:54 +02:00
fr33domlover
6786e2e0e1 Implement theater-based remote delivery and port personGrant 2023-05-24 22:17:14 +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
06c520f6aa C2S: Implement grantC and enable in person outbox handler 2022-08-22 16:59:22 +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
edaa3c49b2 C2S: Rewrite createNoteC based on createTicketC 2020-05-01 17:48:01 +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
4b20ed23b6 Stop using Vervis.Import and NoImplicitPrelude, switch to plain regular imports 2019-06-15 08:24:08 +00:00
fr33domlover
9a306e762c Unfinished updated outbox handler 2019-04-11 13:44:44 +00:00
fr33domlover
85c6354291 Switch jsonb support from persistent-postgresql to a custom module
The custom module provides a parametric wrapper, allowing any specific
FromJSON/ToJSON instance to be used. It's a standalone module though, and not a
wrapper of persistent-postgresql, because persistent-postgresql uses aeson
Value and it prevents using toEncoding to get from the value directly to a
string.
2019-03-23 15:29:50 +00:00
fr33domlover
ad3a20d783 Receive remote comments on local ticket discussion 2019-03-21 22:57:15 +00:00
fr33domlover
2a39378468 HTTP Signature verification: RSA-SHA256 and PEM/ASN1 support
Before, things worked like this:

* Only signatures of Ed25519 keys could be verified
* Key encoding placed the plain binary Ed25519 key in the PEM, instead of the
  key's ASN1 encoding

With this patch it now works like this:

* Ed25519 signatures are supported as before
* RSA keys are now supported too, assuming RSA-SHA256 signatures
* Both Ed25519 and RSA keys are encoded and decoded using actual PEM with ASN1
2019-03-10 23:15:42 +00:00
fr33domlover
fdbe46741b When POSTing an activity, protect remote actor DB insertion with withHostLock 2019-03-09 17:12:43 +00:00
fr33domlover
8ac559d064 New datatype FedURI for @id URIs
Using a dedicated type allows to record in the type the guarantees that we
provide, such as scheme being HTTPS and authority being present. Allows to
replace ugly `fromJust` and such with direct field access.
2019-02-07 23:08:28 +00:00
fr33domlover
b0b2aa83c5 Store remote actor keys in the DB, reuse them instead of GETing every time 2019-02-03 13:58:14 +00:00
fr33domlover
250701712a Move most of the DB graph modules to a separate persistent-graph library 2019-01-26 22:20:19 +00:00
fr33domlover
33338a73cc Upgrade to GHC 8.4 and LTS 12 2018-12-05 03:41:19 +00:00
fr33domlover
8eca3fa647 Upgrade to GHC 8 and LTS 10.10 2018-05-16 00:02:54 +00:00
fr33domlover
829fd72fef Use my new persistent-migration library, to which I moved the related modules 2018-02-26 14:23:02 +00:00
fr33domlover
3b4bd2a5e8 I made upgrades to the DB migration system in Funbot, apply them here too 2018-02-25 11:14:07 +00:00
fr33domlover
cd1f7af46e Migration: Safe IsString instances for Field, Entity, Unique 2016-09-01 17:37:20 +00:00
fr33domlover
e027789fbd Migration: When escaping names, forgot to surround then with "s 2016-09-01 17:36:39 +00:00
fr33domlover
bff41673c4 Migration: Specify default value when adding non-null column 2016-09-01 16:30:39 +00:00
fr33domlover
2640ecb8d1 Schema backend becomes associated datatype 2016-08-29 13:19:57 +00:00
fr33domlover
400c29289d Persistent schema backend, and PostgreSQL impl 2016-08-20 17:41:16 +00:00
fr33domlover
7d6ef47e05 DB actions for selecting nodes and edges of single graph 2016-08-03 21:26:39 +00:00
fr33domlover
6220c78f74 Extra persistent graph classes & instances for ticket graph 2016-08-03 19:32:33 +00:00
fr33domlover
52f91cb98a PersistEntityGraph specifies type of single graph selector 2016-08-02 15:44:45 +00:00
fr33domlover
51c99a1dfe SQL: Don't list starting nodes in graph reachable set 2016-08-02 11:58:49 +00:00
fr33domlover
521871c476 Refactor undirected edge SQL to remove repeated filter 2016-08-02 09:29:56 +00:00
fr33domlover
9cfaabc035 SQL: Define the undirected edge table once, use everywhere 2016-07-30 11:29:23 +00:00
fr33domlover
c111f66d7d SQL: Move some DBNames to common util module 2016-07-30 09:32:53 +00:00
fr33domlover
0904abd7e6 SQL: Use single recursive CTE reference in undirected traversal
At least in PostgreSQL, at most one reference is allowed. My undirected
recursion code used a UNION of two recursive steps, one for each
direction. That is invalid, so instead I define a CTE that's a union of
the edges and their reverse, and do a single recursion step on that CTE
instead of on the edge table itself.
2016-07-30 07:28:46 +00:00
fr33domlover
de384d0427 Persistent graph: Cyclic: Remove start temp table, not needed anymore 2016-07-29 23:27:26 +00:00
fr33domlover
9ca7ab3a57 SQL: Remove some =ANY(?) from trr code, left there by mistake 2016-07-29 23:03:01 +00:00
fr33domlover
dad1ed2e1f SQL: IN (1, 2, 3) instead of invalid ANY('[1, 2, 3]')
I thought SQL arrays were common and PersistList corresponded to SQL
array values. But that isn't the case. PersistList seems to be
serialized as a JSON list, and `filterClause` uses IN, not ANY. So I'm
doing the same thing here and using IN.

Note that I'm building the list myself using Text concatenation, not
using `filterClause`, because the latter takes a filter on an existing
`PersistEntity` while my filters often apply to temporary tables.
2016-07-29 22:57:52 +00:00
fr33domlover
1c2e5f86af SQL: Use ANY() with arrays, not IN 2016-07-28 16:50:08 +00:00
fr33domlover
5c153b0294 Ticket dependency add/remove and some fixes to recursive SQL 2016-07-28 16:40:10 +00:00
fr33domlover
350f8a9521 Function trrFix for adapting intransitive DAG after edge insertion 2016-07-27 07:29:32 +00:00
fr33domlover
461283ba6e Simpler path selection in SQL transitive reduction
The transitive reduction query works by removing all the edges which
aren't the only paths between their nodes, i.e. longer paths exist. The
first step is to pick all the paths which include 2 or more edges.

The initial code did that appending in-edges to all paths, which results
with unnecessary duplicates and an INNER JOIN. Now, instead, just pick
all the paths with length of more than 3 nodes. This is hopefully not
just simpler, but also faster.
2016-07-20 11:24:01 +00:00
fr33domlover
a41f111bee Split recursive SQL query huge module into smaller modules 2016-07-20 10:08:42 +00:00
fr33domlover
8c1d4dd6f1 Transitive reduction of DAGs in SQL 2016-07-15 00:32:33 +00:00
fr33domlover
c340508385 Reachability sets of graph nodes using SQL 2016-07-14 13:48:24 +00:00
fr33domlover
24040133a1 Graph path detection using recursive SQL queries 2016-07-13 19:05:02 +00:00
fr33domlover
7a33ef16f8 PersistEntityGraph is for any graph, PersistEntityHierarchy for DAGs 2016-07-05 16:13:48 +00:00
fr33domlover
879ad873e3 DB graph cycle existence checking using recursive SQL query 2016-07-05 08:46:58 +00:00
fr33domlover
5340cf23f1 Project role inheritance and graph queries with some raw SQL 2016-06-17 20:17:39 +00:00