303 Commits

Author SHA1 Message Date
Daniel Holmgren
6f780bf670
Remove scenes (#483)
* wip

* wip

* remove getAssertions & fix up notifs test

* remove did param on updateProfile
2023-01-26 15:38:45 -06:00
devin ivy
73de6d8668
Add some reporting mocks to dev-env (#491) 2023-01-26 13:09:08 -05:00
devin ivy
b686b3baff
Create PDS with ServerConfig rather than ServerConfigValues (#435)
Create pds with ServerConfig rather than ServerConfigValues
2022-12-21 13:32:10 -05:00
Daniel Holmgren
f0ee51f151
App context (#424)
* introducing appcontext & pds class

* revamp rest of server + auth

* revamp tests

* add to dev-env

* fix api test

* add start method to pds

* hook up terminator before

* PLC AppContext (#425)

* convert plc server to app context

* add start method to plc

* hooke up terminator on server setup

* fix test

* cleanup & pr feedback

* fix up one more test
2022-12-16 11:23:36 -06:00
Paul Frazee
79c3f31f9e
Add 'avatar' to the outputs of views (#392)
* Add sharp to the dev-env deps

* Add 'avatar' to the outputs of views
2022-12-08 11:40:19 -06:00
Daniel Holmgren
d0b7497a08
File uploads & profile image support (#383)
* Setup interface for image processing

* Implement getInfo() on SharpImageProcessor

* Reorganize pds image processing code

* Implement initial resize() on SharpImageProcessor

* Test sharp image processor, apply a couple fixes

* Tidy

* wip

* improve repo processing & add blbos

* more blob processing

* work into routes & config

* testing out w profiles

* Implement initial pds image uri builder/signer/verifier

* pr fixup & tests

* streaming

* better streaming interface

* s3 interface

* fix s3 prefixes

* readable streams as xrpc inputs

* more tests + cleaning up apis

* tests for failed references

* Initial implementation of image processing server

* Update node types for node v18

* fix clone issue

* add getStream to blobstore

* fixing up tests & dev-env

* get img info on upload

* integrating img processing

* hex for img uri & fixing build errors

* improve streams

* hook up uris to getProfile

* pr feedback on tmp

* test on getprofile

* testing avatars

* fix snapshot after hmac changed

* quick cleanup

Co-authored-by: Devin Ivy <devinivy@gmail.com>
2022-12-07 18:08:29 -06:00
Paul Frazee
d7b4697b2d
Add terms-of-service and privacy-policy links (#386)
* Add privacy-policy and terms-of-service to getAccountsConfig

* Add privacy policy and tos urls to dev environment
2022-12-06 13:05:05 -06:00
Daniel Holmgren
c207947bd5
Stagable blockstore (#351)
* stagable blockstore + remove mutable repo

* pds wip

* nearly there

* bugfix

* assertion ordering

* del old code

* save staged if no callback

* removing level

* pr fixup
2022-11-17 09:51:36 -06:00
devin ivy
13aead171c
Support shallow builds and sourcemaps (#352)
* Enable all modules to be built shallowly, externalizing their deps

* Setup shallow builds to modify package.json main

* Hoist update-main-to-dist to separate call, fix lex-cli and plc shallow builds

* Generate sourcemaps during build

* Tidy

* Hoist new build deps up to root
2022-11-15 19:24:58 -05:00
devin ivy
8ab87ff1f7
Standard actor declarations in app.bsky (#338)
* Include scene trends in feeds

* Tidy

* Tidy

* Sweep app.bsky schemas for standard actor declarations, remove reference from com.atproto

* Replace declarationCid on follow, assertion, confirmation records

* Sweep pds for standard app.bsky actor declarations

* Fix dev-env

* Tidy after merge
2022-11-10 15:46:16 -05:00
Paul Frazee
e1150465ab
Add 'member' to getProfile state output, and add some dev-env mock data (#332)
* Add a scene to the dev-env mock data

* Add 'member' to myState output of getProfile

* Await db writes in dev env mock data

Co-authored-by: devin ivy <devinivy@gmail.com>

Co-authored-by: devin ivy <devinivy@gmail.com>
2022-11-09 14:09:16 -06:00
devin ivy
b117ae4568
Move from likes to votes (#319)
* Model votes in lexicon, remove likes

* Model votes in db, setup notifs, fix schema

* Update pds logic, move likes to votes

* Codegen

* Update tests for votes

* Test vote filter by direction

* Fix dev-env
2022-11-08 11:02:41 -05:00
devin ivy
d6a189f59a
Healthchecks for PDS and PLC (#309)
* Add plc healthcheck, unify plc server interface with pds

* Add pds healthcheck

* Make plc test util file consistent with other packages

* Fix types in dev-env

* Type fixes

* Tidy

* Rename healthcheck routes, place pds's under /xrpc
2022-11-04 16:26:56 -04:00
Paul Frazee
e61127111a
Split lexicons into more specific namespaces (#306)
* Segment lexicons into more specific namespaces and tighten up some naming conventions

* Update API to use new lexicons

* Update pds and dev-env to use new lexicons
2022-11-04 12:59:00 -05:00
Daniel Holmgren
7fdbb4dbb5
Username -> Handle (#303)
* schemas

* db

* atproto xrpc

* bsky xrpc

* got er done
2022-11-03 11:35:21 -05:00
Paul Frazee
c986066e4c
Update XRPC procedures to use request body by default (#297)
* Update lexicons of xprc procedures to avoid using query params when possible

* Update code generated by lex-cli to reduce param counts

* Update all API usages to new signatures

* Fix readme

* Remove params from postNotifiactionsSeen lexicon schema
2022-11-02 16:37:58 -05:00
Daniel Holmgren
2fb128d94f
Account declaration & invites (#289)
* schemas

* database & buffing up schemas

* declaration on createAccount, + fixing up test client

* fix up dev-env

* schema comments

* nsid for declaration actorType

* declaration description

* oops token schema slipped in

* declaration -> declarationCid

* missed a couple of db things
2022-11-01 18:15:52 -05:00
devin ivy
51dd5665a1
Session refresh token for PDS (#286)
* Update lexicons for auth refresh token

* Implement pds refresh tokens

* Test pds auth sessions

* Fix dev-env

* Tidy

* Ignore invalid revoked and expired tokens during deleteSession
2022-10-31 20:41:51 -04:00
Daniel Holmgren
ac8569496c
Name Resolution (#278)
* user-did table

* yay fixed it

* resolve available domains from db

* serverDid + tests

* check for invalid domains

* mv available domain check to constructor

* oops reverse check
2022-10-28 18:06:17 -05:00
Daniel Holmgren
9879f673ad
SQL Blockstore (#276)
* setting up sql-blockstore

* drop table migration

* unblock sqlite tx

* correct binary types

* lol woops

* block encoding utilities

* no longer store raw record in record table

* fix dev-env

* pr feedback

* tx check
2022-10-27 13:26:17 -05:00
devin ivy
4a65804db5
Miscellaneous dep and build fixes (#272)
Misc dep and build fixes
2022-10-26 14:19:14 -04:00
Daniel Holmgren
d6fd69d3a3
Rename pds (#266)
* clean up old todos

* some more cleanup

* rename server -> pds
2022-10-25 15:52:46 -05:00
Daniel Holmgren
7e6019fbda
PDS cleanup (#265)
* clean up old todos

* some more cleanup

* remove server did for now
2022-10-25 15:36:44 -05:00
Daniel Holmgren
29463093c1
Recovery key (#263)
* clean up old todos

* recovery key in server cfg & allow user provided key

* tests & rename

* testing did creation

* recoveryKey in dev-env

* require recovery key
2022-10-25 15:25:44 -05:00
devin ivy
26b554fee2
Setup PDS server with migrations (#254)
* Setup PDS with kysely migrations

* Nix KyselyWithDialect from PLC, found it didn't work as intended in PDS

* Fix down migration in PDS

* Fix update profile on postgres

* Support postgres and migrations in PDS bin

* Lint
2022-10-24 15:27:30 -04:00
devin ivy
000507e491
Setup PLC server with postgres and migrations (#249)
* Setup PLC with postgres

* Setup PLC with kysely migrations

* Add note to PLC migrations file
2022-10-21 09:47:18 -04:00
Paul Frazee
feca3622c1
Rename ADX -> ATP (#244)
* Rename ADX to ATP

* Remove old docs (now in atproto website repo)

* Update readme

* Update README.md

Co-authored-by: devin ivy <devinivy@gmail.com>

* A couple of @ -> AT

Co-authored-by: devin ivy <devinivy@gmail.com>
2022-10-18 12:21:59 -05:00
Daniel Holmgren
60a537a6e4
MIT license (#241)
mit license errything
2022-10-17 13:20:06 -05:00
Daniel Holmgren
7a9d773e7e
Postbuild typecheck (#235)
* typecheck postbuild

* rm space

Co-authored-by: devin ivy <devinivy@gmail.com>

Co-authored-by: devin ivy <devinivy@gmail.com>
2022-10-12 20:03:43 -05:00
Daniel Holmgren
bfaf3a86f9
Handling updates (#231)
* disabled udpates

* remove update tests

* update schemas

* crud operations

* working cids into db layer

* crud working

* views tests working & updated snapshots

* rm tests for likes on reposts

* fix up repo tests

* quick pr feedback

* recordKey -> rkey & nameOrDid -> user

* reference records by uri & cid obj

* fix dev-env
2022-10-12 18:36:40 -05:00
devin ivy
0b6bf87b66
Run PDS using postgres (#233)
* Setup dockerization of postgres db

* Fix typo

* Setup postgres dialect config in pds, fix migrations for pg

* Convert home and author feed to work on pg

* Convert pds follow views to work on pg

* Convert pds liked-by and notifications views to work on pg

* Unify bigint handling between sqlite and pg

* Convert pds account, crud, and profile, reposts, thread views to work on pg

* Ensure a more complete reset of containers/volumes in with-test-db.sh, set libpq env vars

* Add readme for dockerized postgres

* Fix build issues
2022-10-12 16:43:19 -04:00
Paul Frazee
45ddf23c58
Fixes to dev env (#234) 2022-10-12 15:07:31 -05:00
Paul Frazee
90cdb99bdd
Update NSID semantics to final (#232)
* Improve lex-cli to remove files that no longer exist

* Update lex-cli to use new ns

* Rename lexicons: todo.adx to com.atproto, todo.social to app.bsky

* Improve lex-cli md generator
2022-10-12 14:32:18 -05:00
Daniel Holmgren
7f2dfb8d50
Switch TypeORM to Kysely (#229)
* kysely interfaces

* migrated record plugins

* db types + notifications

* index record emthods on db

* Convert author feed to kysely

* rest of db index

* Convert home feed to kysely

* Remove references to sqlite3 package

* Convert liked by view to kysely

* create tables

* Convert notif count view to kysely

* move scrypt to own file

* Fix typo

* Convert notifs view to kysely

* Convert post thread to kysely

* Convert profile view to kysely

* accounts tests passing!

* Convert reposted by view to kysely

* Convert followers view to kysely

* Convert follows view to kysely

* Convert notifs last seen to kysely

* Tidy

* Re-enable social methods

* Minor tidy of author and home feed queries

* Tidying and minor fixes for pds view queries

* fix up crud, disabled PUTs for now

* Fix profile view, use nulls in table interfaces

* Fix pds follow/follower views, remove special db date logic

* Fix pds notification count view

* Fix pds feed views, reposted by join

* Remove typeorm from server

Co-authored-by: Devin Ivy <devinivy@gmail.com>
2022-10-11 13:39:11 -05:00
Paul Frazee
72add11740
Fix the external better-sqlite3 path in dev-env build (#230) 2022-10-10 19:05:50 -05:00
devin ivy
ef69a725f0
Fix PLC server usage in dev-env (#228)
Fix PLC server usage in dev-env, ensure better-sqlite3 bindings are external
2022-10-10 18:58:24 -05:00
devin ivy
5a9c0e9058
Fix dev-env build, account for server's hbs templates (#218)
* Fix dev-env build, account for server's hbs templates

* Remove out-of-date comments
2022-10-06 16:02:17 -04:00
devin ivy
59f18ac707
Forgot password methods (#216)
* Schemas and scaffolding for reset password methods

* Initial handler for todo.adx.requestAccountPasswordReset

* Initial handler for todo.adx.resetAccountPassword

* Implement server mailer

* Configure server for mailer and testing w/ mailer

* Test happy path of pass reset, fix reset bug

* Update lex to fix types bug for requestAccountPasswordReset

* Fix handlebars reference to config getters

* Test some negative password reset flows

* Minor cleanup to pass reset

* Tidy handlebars file with prettier, supporting double-quotes for html

* Fix esbuild of server for mailer templates, fix test issue

* Misc tidying for password reset

* Misc tidying for password reset
2022-10-06 14:24:26 -04:00
Daniel Holmgren
7233ce070f
Cleanup (#210)
* messing around w pino

* rework locals & add pino-http

* subsystem logging off env vars

* remove auth tokens from logs

* lots of logging

* re-enable tests

* update enabled check

* fix subsystem logging

* some quick cleanup
2022-10-05 17:55:08 -05:00
Daniel Holmgren
6bb82894e3
Add PLC server to dev-env (#197) 2022-09-28 19:30:33 -05:00
Daniel Holmgren
670c419c18
Plc auth lib integration (#195)
* parsing dids to something we understand

* revamping did-sdk with did-resolver

* testing

* fixing some thigns & finishing tests

* fix type error & remove old test

* wip

* create did on server & add email

* check username available & store email

* better test utils

* remove did:test

* allow authstore to sign for controlled dids

* plc ucan integration wip

* wip

* finished auth lib refactor

* integrating to repo & server

* couple fix ups

* couple more fixups

* disable dev-env test

* comments
2022-09-28 17:52:18 -05:00
Daniel Holmgren
ee68e6977b
Pds Did integration (#190)
* parsing dids to something we understand

* revamping did-sdk with did-resolver

* testing

* fixing some thigns & finishing tests

* fix type error & remove old test

* wip

* create did on server & add email

* check username available & store email

* better test utils

* remove did:test

* allow authstore to sign for controlled dids
2022-09-28 17:36:53 -05:00
Paul Frazee
31bd54e69c
More client integration updates (#192)
* Update dev-env to use new authorization system

* Add did and name to createSession response body

* Handle not found in getProfile api

* Stop putting a timestamp in the generated code, ffs

* Add todo.adx.getAccountsConfig

* Remove timestamps from schema codegen
2022-09-27 12:32:17 -05:00
Paul Frazee
dcba744dab
Various fixes related to integration with client software (#188)
* Refactor xrpc to use native fetch and be able to replace it (for react native)

* Factor out uri package

* Fixes to getPostThread

* Manually construct indexedAt and receivedAt timestamps to ensure theyre properly encoded
2022-09-23 11:33:26 -05:00
Paul Frazee
3a4e4c0759
Dev env tooling, server package restructuring, add did:test and *.test rules (#186)
* Add ServerConfig class

* Update todo.adx.resolveName spec to make name param optional

* Add .test username and did:test behaviors

* Document name/did resolution and the .test/did:test behaviors

* Move did:test registry into server config to share across servers in the dev env

* Rework the server package structure to make it easier to include as a library

* Fix dev-env build issues

* Give better error when repo API is called on an invalid DID

* Add mock data environment to dev-env
2022-09-22 13:34:46 -05:00
Paul Frazee
1425b0cd4f
New XRPC-based Server and API implementations (#180)
* Add xrpc-cli package; implement 'new' and 'gen-md' commands

* Add gen-ts-obj to xrpc-cli

* Add gen-api command to xrpc-cli

* Add gen-server to xrpc-cli

* Update codegen from xrpc-cli to run prettier and include a banner comment

* Use 'void' instead of 'undefined' for return type

* Skip invalid schemas when generating code

* Rewrite schemas package to use new simplified schema

* Output type definitions in nested folders

* Add record schema code-generation

* Change xrcp client call() signature to be easier to use

* Update client codegen to match new xrpc call signature

* Fixes and improvements to generated record APIs

* Update generated api to use per-service instances

* Add xrpc-cli readme

* (WIP) Rewrite server to use xrpc

* Add missing references to server/tsconfig.json

* Replace api implementation with xrpc generated client

* Add /schemas folder with todo.adx

* Add /schemas/todo.social

* Update api package to include todo.social xrpc and adx schemas

* Update server package to include todo.social xrpc and adx schemas

* Fix some schema definitions

* (WIP) Work toward xrpc update of server

* Update auth package to use nsids for collections

* Update repo package to use nsids for collections

* Update AdxUri to use nsid collection IDs

* Bring server CRUD tests to passing state

* Move API to simpler xrpc call signature

* Apply fixes and improvements to record apis

* Update to new generated api with per-service instances

* Rename the todo.social.* view methods

* Rewrite the views system to use xrpc

* Remove paths accidentally added to tsconfig

* Remove microblog package

* Add simple API readme

* todo about deduping ucan prfs

* increase postThread default depth to fix failing test. & fix USE_TEST_SERVER config

Co-authored-by: dholms <dtholmgren@gmail.com>
2022-09-20 17:39:05 -05:00
dholms
275c3df202 lock uint8arrays at 3.0.0 2022-09-13 15:16:57 -05:00
Paul Frazee
6283330c3c
Deprecate did:ion, replace did:key implementation, bring dev-env to a working state (#172)
* Remove 'key manager' service from dev-env

* Remove did:web service from dev-env

* Update dev-env to use new server api

* Replace node-fetch with axios

* Remove did:ion from did-sdk

* Disable did:key implementation in did-sdk and remove difficult upstream deps

* Fix dev-env build

* Fixes to dev-env and add user() env function

* Switch to a purely js-function REPL in the dev-env to simplify
2022-09-13 15:01:09 -05:00
Paul Frazee
8344867113
Remove deprecated packages: Auth-Lobby, Awake, Example-App, WS-Relay (#168)
* Remove deprecated packages: Auth-Lobby, Awake, Example-App, WS-Relay

* couple missed references & removed awake & application redirect code from @adxp/auth

Co-authored-by: dholms <dtholmgren@gmail.com>
2022-09-13 10:56:53 -05:00
Paul Frazee
cd431c58c8
Add some readmes (#169) 2022-09-13 10:54:56 -05:00