weex/noswot
1
0
Fork
You've already forked noswot
1
A web of trust made from nostr follows and reports
Python 76%
HTML 23.8%
Dockerfile 0.2%
2023年12月06日 20:06:00 +00:00
config add SCORES_DIR to settings 2023年10月21日 20:20:29 +00:00
env-configs flask website included 2023年10月03日 10:51:47 -07:00
nostr setup celery to get missing profiles 2023年10月17日 03:57:09 +00:00
static add favicons 2023年11月09日 14:07:36 -08:00
templates wrong variable name in template 2023年11月26日 21:40:42 +00:00
tmp split out functions into models and views 2023年10月11日 20:20:43 +00:00
weboftrust reference wot-server 2023年11月09日 19:43:26 +00:00
.gitignore Streamline setup with docker compose ( #9 ) 2023年11月11日 20:26:31 +00:00
db.py fix interface server has gone away 2023年10月16日 00:11:16 +00:00
dedup.py determine and use preferred relay 2023年10月26日 04:55:01 +00:00
docker-compose.yml default_broker_uri ( #10 ) 2023年11月11日 20:40:27 +00:00
Dockerfile Streamline setup with docker compose ( #9 ) 2023年11月11日 20:26:31 +00:00
fill_in_profiles.py Streamline setup with docker compose ( #9 ) 2023年11月11日 20:26:31 +00:00
flaskdemo.ini uswgi setup 2023年10月25日 19:48:08 +00:00
follows.py unused imports 2023年10月19日 19:02:14 +00:00
hoover.py remove commented code 2023年10月19日 19:03:37 +00:00
lib.py add home text, npub2hex, fix pleb button 2023年11月08日 23:04:31 +00:00
LICENSE.txt make license easier to open on windows 2023年11月11日 17:59:01 +00:00
lnd_rest.py flask website included 2023年10月03日 10:51:47 -07:00
main.py remove nostr.wine since paid only 2023年12月06日 20:06:00 +00:00
Makefile Streamline setup with docker compose ( #9 ) 2023年11月11日 20:26:31 +00:00
models.py Streamline setup with docker compose ( #9 ) 2023年11月11日 20:26:31 +00:00
npub_name_mapping.py resolve known names in notes on profile page 2023年11月01日 18:23:29 +00:00
overlap.py tab completion 2023年10月16日 00:12:17 +00:00
preferred_relay.py determine and use preferred relay 2023年10月26日 04:55:01 +00:00
process_profiles.py use correct key for contact ( #18 ) 2023年11月20日 19:54:00 +00:00
query.py extract profile (kind 0) data into db 2023年10月03日 15:35:53 -07:00
README.md Streamline setup with docker compose ( #9 ) 2023年11月11日 20:26:31 +00:00
requirements.txt remove relay seen counts 2023年11月08日 23:24:11 +00:00
runner.py default_broker_uri ( #10 ) 2023年11月11日 20:40:27 +00:00
schema.sql determine and use preferred relay 2023年10月26日 04:55:01 +00:00
score.py settings are in config 2023年10月21日 20:24:05 +00:00
update_contacts.py run once for hourly cron 2023年10月19日 19:07:12 +00:00
views.py remove relay seen counts 2023年11月08日 23:24:11 +00:00
wsgi.py uswgi setup 2023年10月25日 19:48:08 +00:00

noswot

A web of trust made from nostr follows and reports

Welcome to noswot. The vision here is to see what becomes possible when we can trust strangers on the internet.

Hypothesis: A web of trust algorithm that is comprehensive, and can run entirely client-side, will enable a range and volume of activity that the world has never seen.

This trial tests the algorithm in a database web application that gathers follows and reports, then calculates trust scorings from every known perspective every 24-48 hours.

You can participate in the trial by using the tool at noswot.org

If you have any questions or don't see what you're looking for please make an issue or mention David Sterry on nostr.

Requirements

  • Python 3.9+
  • MariaDB or MySQL
  • RabbitMQ: sudo apt-get install rabbitmq-server

Installation

  • pip3 install -r requirements.txt
  • Copy config/default_settings.py to config/settings.py and fill in parameters
  • Create a database in mariadb then mariadb -u dbuser -p {dbname} < schema.sql

Cron Scripts

  • hoover.py - downloads and saves the day's worth of notes, contact lists, and reports
  • process_profiles.py - parses out profile fields into profile table
  • update_contacts.py - saves follows to contact table, creating a follow log along the way
  • score.py - calculate trust scores
  • npub_name_mapping.py - generates nn.js for front-end to replace known npubs with names
  • preferred_relay.py - populates profile with each user's most commonly used relay and many more...

Celery Scripts

  • runner.py - main celery process
  • fill_in_profiles.py - sends profile grabber tasks to celery queue

Development

  • Run python3 hoover.py to pull in recent nostr data Then process profiles and contacts with:
  • time python process_profiles.py | sort | uniq -c to get a count of errors
  • python update_contacts.py
  • To collect missing profiles referred to in contact lists run celery: celery -A runner worker --loglevel=DEBUG
  • Then fire off profile grabbing tasks: python fill_in_profiles.py

After running hoover, profiles, contacts, and score you can run python main.py to start the Flask server.

Docker Compose

To run the project with docker-compose, you can use the following commands:

docker compose up -d

Open a shell in the web container to run the python scripts for example:

docker compose exec web ash
python hoover.py

Contributing

This project uses C4 (Collective Code Construction Contract) process for contributions.