aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorAsbjørn Sloth Tønnesen <ast@fiberby.net>2019-09-06 13:43:35 +0000
committerAsbjørn Sloth Tønnesen <ast@fiberby.net>2019-09-06 13:56:47 +0000
commit6b7297545b71fda63aff0a74e680660e8c22222b (patch)
tree44fe479e65b52d7404a402fd7f9c2f1ad3a88e6f /README.md
parent55acfbfb3bb76454a462fc3ae72de251871e8c41 (diff)
downloadpeeringdb-simplesync-6b7297545b71fda63aff0a74e680660e8c22222b.tar.gz
peeringdb-simplesync-6b7297545b71fda63aff0a74e680660e8c22222b.tar.xz
peeringdb-simplesync-6b7297545b71fda63aff0a74e680660e8c22222b.zip
initial commit
Signed-off-by: Asbjørn Sloth Tønnesen <ast@fiberby.net>
Diffstat (limited to 'README.md')
-rw-r--r--README.md60
1 files changed, 60 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..814d561
--- /dev/null
+++ b/README.md
@@ -0,0 +1,60 @@
+peeringdb-simplesync - Minimalistic PeeringDB synchronization tool
+==================================================================
+
+A simple tool for keeping a local PostgreSQL database up-to-date with PeeringDB.
+
+Requirements
+------------
+
+* PostgreSQL 9.5+
+* Python 3.6+
+* psycopg2 2.7+
+* python-requests 2+
+
+
+Installation
+-----
+
+```sh
+sudo apt install git python3 python3-requests python3-psycopg2
+
+git clone https://git.2e8.dk/peeringdb-simplesync
+cd peeringdb-simplesync
+
+cp config.py.sample config.py
+editor config.py # change credentials
+
+createdb pdbtest
+psql pdbtest < schema.sql
+```
+
+Usage
+-----
+
+```sh
+./sync.py # initial sync takes about 10 minutes
+```
+
+Then try the following query with `psql pdbtest`:
+
+```sql
+SELECT
+ asn,
+ data->>'irr_as_set',
+ (data->>'info_prefixes4')::int pfx4,
+ (data->>'info_prefixes6')::int pfx6
+FROM peeringdb.net ORDER BY asn;
+```
+
+Note: if you add an `info_prefixes4` column to the schema,
+then it will automatically be used, just like the `asn` column.
+
+Known issues
+------------
+
+* Objects are not deleted when they are deleted from PeeringDB.
+
+Disclaimer
+----------
+
+This tool is not affiliated with PeeringDB.