Commit graph

57 commits

Author SHA1 Message Date
Jonathan Zernik
ed360ff3d1
Add clightning backend support (#2205)
* Add c-lightning support

* Got subscribe paid invoices working with c-lightning

* Remove log lines

* Use a single config section for all lightning configs

* Fix itest config

* Update configuration doc with new confis
2022-05-08 12:41:44 -07:00
Jonathan Zernik
7658a4d95c
Upgrade squeaklib to v013 (#2165)
* Upgrade to squeaklib v0.13

* Allow different squeak types in server reponse

* Add core method for create resqueak.

* Add make resqueak method for squeak store

* Update db migration to include resqueak hash

* Add db method to insert and get resqueak

* Return resqueak as squeak entry in db query method

* Add RPC method for make resqueak

* Got make resqueak modal working in frontend

* Show different content for resqueak in frontend

* Show resqueaed squeak in display

* Show resqueak correctly

* Got resqueak display working on squeak card component

* Fix display for missing resqueaked squeak.

* Fix display for missing resqueaked squeak in squeak card.

* Got resqueak from squeak card working

* Fix prevent default action on resqueak unlock click

* Fix prevent default on make reply squeak in squeak card

* Got number of replies to resqueaked squeak working

* Fix click on squeak card

* Fix too many characters warning message

* Fix click on squeak card image and name and pubkey

* Rename set reply modal state function

* Fix toggle modals for resqueaked squeak

* Fix form submit action for squeak modals

* Include num resqueaks and num resqueaked resqueaks in get squeak entry db query

* Show number of resqueaks in frontend

* Fix distinct count in query for num replies and num resqueaks

* Update resqueaked squeak in slice state

* Update frontend build
2022-04-24 17:54:07 -07:00
Jonathan Zernik
61e9ed67cb
Remove websocket dependencies (#2156) 2022-04-14 00:12:43 -07:00
Jonathan Zernik
19d540849c
Upgrade squeaklib to v0.12.0 (#2108) 2022-04-03 22:46:43 -07:00
Jonathan Zernik
8bb6de88b4
Pin version of werkzeug (#2048) 2022-03-28 16:47:28 -07:00
Jonathan Zernik
8a89dbfa10
Make peer client connect with tor (#2018) 2022-03-25 23:12:43 -07:00
Jonathan Zernik
68e69e55c8
Use http for peer connection (#2002)
* Got basic web server running for peer

* Got squeak route and lookup route working

* Got secret key route working

* Got offer endpoint working

* Remove old comment

* Move peer server code to server subdir

* Create client subdir for peer client

* Return empty list for lookup when pubkeys is empty

* Add peer client and network controller class

* Remove old network code

* Remove old block subscription worker

* Remove network handler class

* Remove more old classes

* Add back twitter forwarder worker

* Remove download methods from controller

* Add websocket endpoint

* Add websocket subscribe method

* Add websocket client library

* Fetch squeaks from peer (slowly) on UI timeline load

* Fetch squeaks from peer (slowly) on UI pubkey squeaks load

* Got download squeaks working with HTTP requests

* Fixed external address method in controller

* Remove download pubkey squeak button and action

* Remove unused connection displays from peer ana peers page

* Fix 404 not found for offer endpoint

* Better handling of null cases in peer client downloader

* Simplify peer downloader

* Create subclass for range download

* Got single squeak download working

* Fix itest for get external address
2022-03-17 14:38:46 -07:00
Jonathan Zernik
3ae9b84641
Use new squeaklib with 32 byte pub key (#1970)
* Update squeaklib version

* Clear database migrations
2022-02-27 21:29:49 -08:00
Jonathan Zernik
86172929e4
Upgrade squeaklib to support secure shared key for private messages. (#1930) 2021-12-30 17:19:06 -08:00
Jonathan Zernik
058240841d
Use python venv (#1920)
* Automatically install requirements.txt in setup

* Remove extra copy of requirements.txt in dockerfile
2021-12-29 18:48:53 -08:00
Jonathan Zernik
20d651df8e
Implement unlock private squeak (#1910)
* Add method stub for unlock private squeak in controller class

* Add methods to unlock private squeak in controller

* Remove todo comments

* Add test for create and decrypt private squeak in core module

* Update handler method for make squeak to support recipient profile id

* Add itest for make private squeak and unlock content as author
2021-12-28 01:07:59 -08:00
Jonathan Zernik
51f412d75f
Update squeaklib to support private messages (#1897)
* Update squeaklib and update import from keys module

* Rename signing key variable to private key in test util

* Fix calling make squeak function

* Update db data file to v3

* Add recipient public key column to squeak table

* Got squeak entry db query working with alias for profiles table

* Add test for make squeak with recipient

* Add test case for get profile from squeak entry query

* Got outer join with recipient profile working

* Use outer join to get recipient profile for all squeak entry db queries
2021-12-27 00:56:31 -08:00
Jonathan Zernik
0ecb73fac3
Update squeaklib and use new msg type (#1894)
* Use updated squeaklib with offer msg removed

* Bump squeaklib version and use methods to check if message has offer
2021-12-25 19:47:07 -08:00
Jonathan Zernik
5198467889
Use new squeak protocol with schnorr and pubkey as identifier (#1870)
* Got all tests in core dir passing

* Got all tests in db dir passing

* Got tests for admin dir passing

* Got all unit tests passing

* Added migration for squeak table and profile table using new pubkey

* Re-start db migrations with new data-v2.db file

* Fix column type for profile public key

* Got all itests passing

* Log the public key in hex in create contact profile handle fn

* Rename rpc methods to use pubkey instead of address

* Got frontend mostly working with new profile pubkey

* Update frontend to use pubkey instead of address

* Change size of squeak profile detail item

* Update create contact profile dialog to use pubkey

* Update twitter account item to use pubkey

* Include label for pubkey in profile detail item

* Decrease size of profile detail item

* Update frontend build

* Improve logging of requests in handler
2021-12-20 09:28:38 -08:00
Jonathan Zernik
dbc6c31381
Make download async (#1725)
* Use active download class for explicit downloads

* Delete old temporary interest manager and expiringdict dependency

* Delete old comments related to temporary interest manager

* Add log line after successful download single squeak

* Add unit test for mark download complete

* Add unit test for wait for stop method of download

* Add test for download hash not interested

* Add test for get download result

* Add test for initiate download for hash download

* Add test for initiate download for interest download

* Rename interest download

* Remove commented old method

* Remove another comment from active download

* Use limit 1 for hash download

* Rename wait for complete method of download
2021-10-25 14:48:12 -07:00
Jonathan Zernik
508a4cb423
Remove libpq-dev as requirement for standard install (#1442) 2021-09-29 12:37:04 -07:00
Jonathan Zernik
d03d1c5ed6
Upgrade sqlalchemy to 1.4 (#1438) 2021-09-28 11:43:50 -07:00
Jonathan Zernik
f73226b621
Upgrade version of squeaklib to 0.7.7 (#1435) 2021-09-27 21:38:44 -07:00
Jonathan Zernik
08be7b6faf
Don't send old squeaks in subscribe response in new proto version (#1423)
* Don't send old squeaks in subscribe response in new proto version

* Remove old comment in update subscription method
2021-09-26 13:09:05 -07:00
Jonathan Zernik
1715ef1613
Upgrade squeaklib to 0.7.5 and fix broken mypy-protobuf (#1375) 2021-09-20 23:09:54 -07:00
Jonathan Zernik
7bd75bea50
Move mypy protobuf to dev requirements (#1374)
* Move mypy-protobuf to dev requirements

* Remove install_requires from setup.py and fix pinned version of sqlalchemy
2021-09-20 22:24:52 -07:00
Jonathan Zernik
6c4feb8802
Pin squeaklib and python-bitcoinlib in requirements (#1313) 2021-09-16 15:25:20 -07:00
Jonathan Zernik
3c181371e6
Pin more requirements (#1311)
* Pinned all dependencies in requirements.txt

* Remove argparse from requirements
2021-09-16 14:41:31 -07:00
Jonathan Zernik
4320c44f7c
Pin versions of mypy and protobuf with tests passing (#1310) 2021-09-16 14:14:31 -07:00
Jonathan Zernik
f587acc095
Use typedconfig with repr function (#1255)
* Use typedconfig with repr function

* Pin version of typedconfig in requirements.txt
2021-09-09 18:06:14 -07:00
Jonathan Zernik
8c8a039ba2
Use socks5 proxy for outbound connection when available (#1226)
* Use socks5 proxy for outbound connection when available

* Remove log lines in peer client for tox proxy
2021-09-08 12:13:12 -07:00
Jonathan Zernik
49ed12e84a
Use newer version of squeaklib with new inv struct (#1198)
* Use newer version of squeaklib with new inv struct

* Refactor peer message handler

* Use constants for inv types from new version of squeaklib
2021-09-05 16:19:14 -07:00
Jonathan Zernik
76ad744936
Updrage squeaklib to 0.7.1 (#1194)
* Updrage squeaklib to 0.7.1

* Add case to handle secret key msg in peer msg handler

* Add fields for custom price and use custom price to profile table

* Got itest working with new profile fields

* Use default values for profile struct constructor

* Fix db migration to use use profile columns

* Got itest passing for set use custom price

* Show custom price or default price in profile page

* Change wording of selling with price in profile page

* Got set use custom price toggle working in configure profile dialog
2021-09-05 12:30:58 -07:00
Jonathan Zernik
26fced200d
Upgrade squeaklib to version 7 (#1188)
* Use newer version of squeaklib with decryption key outside squeak object

* Remove todo comment about clearing decryption key before insert squeak in db
2021-09-04 16:58:33 -07:00
Jonathan Zernik
a0129558d4
Implement block subscription client (#1141)
* Got block subscription working in background thread

* Use separate port for hashblock zeromq subscription

* Update subscription on new block

* Enable checking for block range in interest match function

* Remove unused zmq subscriptions

* Fix squeak interest match function
2021-09-01 06:06:11 -07:00
Jonathan Zernik
512129b8ec
Implement per address rate limit (#1102)
* Add check for per address rate limit in controller

* Delete rate limiter class

* Add check for interest and rate limit to save received squeak

* Got single squeak download working using temporary interest

* Use polymorphic interest classes for temporary interest manager

* Change order of checking temporary interests before permanent interests

* Used timed dict for temporary interests

* Include check for limit in temporary interest
2021-08-29 06:36:14 -07:00
Jonathan Zernik
40ee4b70f9
Use newer version of squeaklib with fixed repr (#1035) 2021-08-22 23:46:43 -07:00
Jonathan Zernik
9023131112
Add subscribe msg (#1016)
* Added subscribe message and send after connection handshake

* Added new squeak worker

* Got itest working for subscribe squeaks peer message

* Update peer squeak subscriptions on follow profile changed.

* Remove sync squeaks worker
2021-08-22 01:46:05 -07:00
Jonathan Zernik
1243f9da30
Use new peer protocol with multiple addresses in getsqueaks msg (#969) 2021-08-18 00:26:32 -07:00
Jonathan Zernik
f652915355
Use tcp peer connection (#900)
* Got basic tcp connection working

* Got passing itest for open tcp connection

* Got most of protocol working. still need to send offer correctly

* Got offer from peer over tcp connectrion

* Got single squeak download working on tcp connection

* Remove rpc peer client

* Remove old rpc clients

* Remove old squeak client modules

* Got sharesqueaks peer message working

* Remove peer rpc server

* Remove server rpc fixtures

* Remove old itests

* Remove old sync modules

* Run worker background task to keep peers synced

* Add peer connection worker

* Add test for disconnect peer

* Remove old itest util

* Delete old peer rpc client helpers.

* Handle insert duplicate received offer

* Use more specific exception handling for duplicate offer insert
2021-07-09 21:07:46 -07:00
Jonathan Zernik
41278868bd
Create base class network sync (#639)
* itest passing with refactored peer sync

* Fix query for downloading peers

* Delete old network sync

* Revert "Delete old network sync"

This reverts commit 91d5620129.

* Delete old network sync
2021-01-13 17:41:50 -08:00
Jonathan Zernik
80d7eb1878
Update squeaklib version and use new make squeak function (#594) 2021-01-10 19:28:56 -08:00
Jonathan Zernik
a57021ab0c
Use typed config (#566)
* Use typed config

* Use typed config

* Got bitcoin connection working in main config

* Use better defaults for lnd configs

* Got test working for get network using config fixture

* Use sqk_dir_path instead of sqk_dir

* Add logging of bitcoin configs

* Don't use config option when config file doesn't exist
2021-01-05 23:39:04 -08:00
Jonathan Zernik
f263dd60dd
Create main.yml (#554)
* Create main.yml

Add the yaml file for the github action

* Update main.yml

Try build and push docker image

* Update main.yml

Fix image tag

* Update main.yml

Specify platforms in docker build action

* Upgrade pip in dockerfile

* Pin version of grpcio in requirements.txt

* Install pip requirements with only-binary

* Change grpcio version

* Remove only-binary option for pip install

* Update main.yml

cache docker layers

* Update main.yml

Push version tags to dockerhub

* Update main.yml

export and import cache to local

* Update main.yml

Fix image name
2021-01-03 21:00:49 -08:00
Jonathan Zernik
22f6b4fc3c
Add precommit hooks (#526) 2020-12-28 23:52:32 -08:00
Jonathan Zernik
0a5a54554c
Use data classes instead of namedtuples (#508)
* Build mypy files for protos in tox env

* Include mypy check in make test

* Improve building offer from remote peer download

* Remove old methods from peer task
2020-12-26 01:00:58 -08:00
Jonathan Zernik
00fc72514f
Use squeaklib with ptlc (#502)
* Rename secret_key

* More work to convert to using PTLC

* Updated most code for PTLC

* More work to use ptlc with secret key

* Got itest passing

* Remove unused import

* Use version 0.5.0 of squeaklib

* Added simple unit test for squeak controller

* Use modular addition subtraction for secret key nonce tweak

* Move util to core folder

* Store secret key as hex in database

* Store nonce as hex in db
2020-12-25 20:17:54 -08:00
Jonathan Zernik
24abdd0ee3
Add alembic (#418)
* Add alembic with init command

* Create separate models class

* Add target metadata to alembic config

* Got initial migration working

* Move migration code into separate module

* Add documentation for migrations
2020-11-08 21:23:19 -05:00
Jonathan Zernik
927299cef0
Allow frontend testing without login (#345)
* Frontend testing working in dev mode

* Make login_disabled and cors configs configurables

* Update frontend readme
2020-10-29 18:22:01 -04:00
Jonathan Zernik
79d7a45e32
Use authentication for web app (#321)
* Require authentication for web app index page

* Got template working for login page

* Got fake login working

* Add logout endpoint

* Remove old comment

* Got login working

* Remove log lines
2020-10-24 23:13:16 -04:00
Jonathan Zernik
d3d7e6e604
Add admin web server (#310)
* Add basic flask web server

* Use ubuntu as docker base image for frontend docker build

* Got web frontend server running inside sqkserver

* Got client request throught flask working

* Refactor makerequest function in frontend

* Support sending request to flask server

* Use request and reply in flask for set profile sharing method

* Handle request object in flask for get followed squeaks route

* Use flask endpoint for lnd getinfo

* Use flask endpoint for walletbalance

* Use flask for gettransactions endpoint

* Use flask endpoint for lnd methods

* Add set profile properties methods to flask

* Move request, response protobuf to handler class

* Move request, reply inside handler for get signing profiles

* Move request, reply to handler for get contact profiles

* Move request, reply to handler for get squeak profile

* Move request reply for get profile by address to handler

* Move request reply to handler for set profile attributes

* Move request reply to handler for delete profile

* Move request reply for make squeak to handler

* Move request reply to handler for get squeak display

* Move request reply to get address squeak displays

* Move request reply to handler for ancestor squeaks

* Move request reply to handler for delete squeak

* Move request reply to handler for create peer and get peer

* Move request reply to handler for peer set attributes

* Move request reply to handler for more methods

* Move request reply to handler for another method

* Move request reply to handler for more methods

* Move more request reply to handler

* Move request reply to handler for all methods

* Remove message conversion helper methods from servicer class

* Remove duplicate protobuf conversion functions

* Fix flask handling of requests

* Remove old protobuf conversion methods in comments

* Use helper method to simplify web server routes functions
2020-10-22 22:52:40 -04:00
Jonathan Zernik
86778c8fac
Use sqlalchemy for create tables (#249)
* Use sqlalchemy for create peers table

* Use sqlalchemy to create squeak table

* Add index to squeak table

* Use sqlalchemy fo create profile table

* Use sqlalchemy to create offer table

* Use sqlalchemy to create all tables

* Define tables in db class
2020-08-18 23:18:48 -07:00
Jonathan Zernik
404772372f
Add btcd credentials to sqkserver config (#81)
* Add btcd credentials and rpc cert to sqkserver configs

* Start the squeak block verifier worker thread on startup

* Btcd request still failing because of cert

* Got btcd client working

* Use valid block hash and height in itest
2020-07-18 17:19:43 -07:00
yzernik
e6d5dafce9 Update squeaklib to 0.3.3 2020-07-05 18:21:08 -07:00
Jonathan Zernik
fc50f97525
Use version 0.3.2 of squeaklib (#67) 2020-07-05 17:48:47 -07:00