diff --git a/README.md b/README.md index 6098e84..f8c9a28 100644 --- a/README.md +++ b/README.md @@ -1,52 +1,74 @@ -#ToxMe source +## I no longer run this service. + +https://blog.fefe.de/?ts=a3695410 and this is why we can't have nice things. + +Due to recent uninformed and stupid decisions by people who should uphold and protect the law and order, and because I have no need of such drama in my life, I'm no longer maintaining this service. + +You can find me on toktok IRC if you are interested in having the torch passed to you, but I'll only accept trustworthy individuals I've known to be active in the community/dev team. + +So long. + + +~~## You can contact the maintainer of the toxme.io directly.~~ + +~~I can be found on freenode IRC, channel #tox , or you can add me from tox by adding toxmeio@toxme.io .~~ + +~~I can assist you with removing or changing your user account on toxme.io in the event that you forget your toxme.io-generated password.~~ + +~~However, please note that you need to be able to prove the account in question is yours. This means that you need to have access to your old toxid.~~ + +~~I am not a tech support for tox issues. If you have an issue with tox, raise a ticket on github or ask someone on the IRC.~~ + +# ToxMe source ToxMe is a speedy and feature-packed Tox name resolution server. -##Installing: +## Installing: Quick notes before we get started, ToxMe's source is not required to access and use it in a client. Additionally, it's being written in OS X and ran on Ubuntu, so please correct any odd quirks I might accidentally include. -###OS X +### OS X Install homebrew from http://brew.sh ```bash brew install libsodium python3 git libffi -git clone https://github.com/subliun/toxme +git clone https://github.com/LittleVulpix/toxme pip install -r misc/requirements.txt ``` And you should be ready! -###Ubuntu -Note: we use Ubuntu 14.04 +### Ubuntu +Note: we use Ubuntu 14.04, but newer releases should work too. ```bash -apt-get install python3 python3-pip libffi-dev build-essential wget git sqlite -wget -P /tmp/ https://download.libsodium.org/libsodium/releases/libsodium-1.0.3.tar.gz -cd /tmp/ -tar -xvf libsodium-1.0.3.tar.gz -cd libsodium* +apt-get install python3 python3-pip libffi-dev build-essential wget git sqlite libtool autotools-dev automake checkinstall check git yasm +git clone https://github.com/jedisct1/libsodium.git +cd libsodium +git checkout tags/1.0.3 +./autogen.sh ./configure --prefix=/usr -make -j4 && make install -cd .. && rm -rf libsodium* +make check +sudo make install cd ~ -git clone https://github.com/subliun/toxme -pip install -r misc/requirements.txt +git clone https://github.com/LittleVulpix/toxme +cd toxme +pip3 install -r misc/requirements.txt ``` ### Optional: #### postgres support: -#####OS X +##### OS X ```brew install postgresql``` -#####Ubuntu +##### Ubuntu ```apt-get install libpq-dev``` -#####All +##### All ( For Ubuntu, use pip3 instead of pip ) ```pip install psycopg2``` -##Getting started: +## Getting started: For most testing and development work you'll need both a config.json and a sqlite3 database. @@ -56,11 +78,13 @@ A database can be generated locally by running ```sqlite3 -init misc/structure.s Now just run python3 src/main.py and it should start automatically! -##Tips: +## Tips: If you're testing it locally make sure secure_mode in config.json is marked off (0) otherwise you'll be required to reverse proxy it and use an SSL cert -##Documentation: +## Documentation: - [API reference](/doc/api.md) - [config options](/doc/config.md) - [PyToxMe](https://github.com/ToxMe/PyToxMe) + +~~ diff --git a/doc/config.md b/doc/config.md index 9cf8764..f7aea8a 100644 --- a/doc/config.md +++ b/doc/config.md @@ -1,61 +1,61 @@ -#Config options refrence +# Config options refrence config.json is a json based set of options evaluated by main.py that set various properties and options in the sever. -###Database URL +### Database URL ```"database_url": "sqlite:///tox.db"``` A SQL alchemy style connector to the database to use. This can be sqlite, postgres, mssql, etc. -###Registration domain +### Registration domain ```"registration_domain": "localhost"``` The domain appended by ToxMe to the end of records (user@localhost for http://localhost/u/user). -###Server port +### Server port ```"server_port": 8080``` The port ToxMe listens on for http. -###Server address +### Server address ```"server_addr": "127.0.0.1"``` The IP ToxMe listens on. `127.0.0.1` prevents outside connections while `0.0.0.0` allows all. -###PID File +### PID File ```"pid_file": "pidfile.dl"``` Where ToxMe places it's own PID. Useful for daemons. -###Is proxied +### Is proxied ```"is_proxied": 1``` Tells ToxMe to resolve a connecting clients IP from a reverse proxies headers. -###suid +### suid ```"suid": "toxme"``` The user ToxMe runs as, please ensure it exists. -###Sandboxing +### Sandboxing ```"sandbox": 1``` Removes API limits for testing. -###Template +### Template ```"templates" : "tox"``` The template to use for the web interface. -###Find friends +### Find friends ```"findfriends_enabled" : 1``` Enables friend discovery features. -###Number of workers +### Number of workers ```"number_of_workers": 2``` -Number of processes to use. \ No newline at end of file +Number of processes to use. diff --git a/src/database.py b/src/database.py index 396916c..51fb087 100644 --- a/src/database.py +++ b/src/database.py @@ -250,6 +250,8 @@ def search_users(self, name, length, num): def delete_pk(self, pk): sess = self.gs() + ex = sess.query(User).filter_by(public_key=pk).first() + self.presence_cache[ex.name] = -1 sess.query(User).filter_by(public_key=pk).delete() sess.commit() sess.close() diff --git a/src/main.py b/src/main.py index fcd88ee..c394bc2 100755 --- a/src/main.py +++ b/src/main.py @@ -719,7 +719,7 @@ def post(self): return elif action == "Delete": self.settings["local_store"].delete_pk(rec.public_key) - self.redirect("/friends/0") + self.redirect("/") return bio = self.get_body_argument("bio", "") or rec.bio @@ -747,7 +747,7 @@ def post(self): return if self.update_db_entry(rec.public_key, name, pkey, bio, check, privacy, pin): - self.redirect("/friends/0") + self.redirect("/") return class AddKeyWeb(APIHandler): @@ -859,17 +859,19 @@ def main(): LOGGER.info("Record sign key: {0}".format(crypto_core.verify_key)) templates_dir = "../templates/" + cfg["templates"] + robots_path=os.path.join(os.path.dirname(__file__), "../static") handlers = [ ("/api", _make_handler_for_api_method), ("/pk", PublicKey), (r"/barcode/(.+)\.svg$", CreateQR), (r"/u/(.+)?$", LookupAndOpenUser), - (r"^/$", LookupAndOpenUser) + (r"^/$", LookupAndOpenUser), + (r"/add_ui", AddKeyWeb), + (r"/edit_ui", EditKeyWeb), + (r'/robots.txt', tornado.web.StaticFileHandler, {'path': robots_path}) ] if cfg["findfriends_enabled"]: handlers.append((r"/friends/([0-9]+)$", FindFriends)) - handlers.append((r"/add_ui", AddKeyWeb)) - handlers.append((r"/edit_ui", EditKeyWeb)) app = tornado.web.Application( handlers, template_path=os.path.join(os.path.dirname(__file__), templates_dir), diff --git a/static/favicon.ico b/static/favicon.ico new file mode 100644 index 0000000..e8db42e Binary files /dev/null and b/static/favicon.ico differ diff --git a/static/robots.txt b/static/robots.txt new file mode 100644 index 0000000..e223f09 --- /dev/null +++ b/static/robots.txt @@ -0,0 +1,3 @@ +User-agent: * +Allow: /$ +Disallow: / diff --git a/templates/tox/add_ui.html b/templates/tox/add_ui.html index b9f94f2..9bccaed 100644 --- a/templates/tox/add_ui.html +++ b/templates/tox/add_ui.html @@ -5,7 +5,7 @@ Tox ID Service - + @@ -47,8 +47,8 @@ diff --git a/templates/tox/addkeyweb_success.html b/templates/tox/addkeyweb_success.html index c1fff36..d42689d 100644 --- a/templates/tox/addkeyweb_success.html +++ b/templates/tox/addkeyweb_success.html @@ -20,8 +20,8 @@ diff --git a/templates/tox/api_error_pretty.html b/templates/tox/api_error_pretty.html index 4aeab2a..e429748 100644 --- a/templates/tox/api_error_pretty.html +++ b/templates/tox/api_error_pretty.html @@ -20,8 +20,8 @@ diff --git a/templates/tox/edit_ui.html b/templates/tox/edit_ui.html index a7cf098..970cf6e 100644 --- a/templates/tox/edit_ui.html +++ b/templates/tox/edit_ui.html @@ -5,7 +5,7 @@ Tox ID Service - + @@ -51,8 +51,8 @@ diff --git a/templates/tox/fourohfour.html b/templates/tox/fourohfour.html index dd4f6d7..3c7b720 100644 --- a/templates/tox/fourohfour.html +++ b/templates/tox/fourohfour.html @@ -24,8 +24,8 @@ diff --git a/templates/tox/lookup_home.html b/templates/tox/lookup_home.html index 6c033f0..90de3c7 100644 --- a/templates/tox/lookup_home.html +++ b/templates/tox/lookup_home.html @@ -3,9 +3,10 @@ + Tox ID Service - + @@ -25,7 +26,7 @@ -

Don't know anyone? Find some friends here.

+

Want to test toxme? Add echobot! - tox://echobot@toxme.io

@@ -42,8 +43,8 @@ diff --git a/templates/tox/onemomentplease.html b/templates/tox/onemomentplease.html index 8c371e4..208a871 100644 --- a/templates/tox/onemomentplease.html +++ b/templates/tox/onemomentplease.html @@ -19,18 +19,18 @@ Click here to add {{record.name}}.

You can also add {{ record.name }}@{{ realm }} in your client.

- {% if record.bio %}
+ {% if record.bio %}

{{ record.bio }}

{{ record.name }}@{{ realm }} + {% end %} {% if record.pin %}

Full Tox ID: {{ record.public_key }}{{ record.pin }}{{ record.checksum }}

{% end %}
- {% end %}
@@ -42,8 +42,9 @@ diff --git a/templates/tox/public_userlist.html b/templates/tox/public_userlist.html index 94bdc1c..cc63f7f 100644 --- a/templates/tox/public_userlist.html +++ b/templates/tox/public_userlist.html @@ -24,13 +24,6 @@
{% for record in results_set %}
- {% if record.bio %} -

{{ record.bio }}

- {% else %} -

(There is only silence.)

- {% end %} -

- {{ record.name }}@{{ realm }} @@ -50,8 +43,8 @@