HowNetWorks / uriteller

A service for monitoring whether chat apps etc. leak URLs
MIT License
56 stars 3 forks source link
javascript kubernetes privacy
URI:teller

CircleCI

NOTE: The hosted site, https:/​/uriteller.io, is no longer active. As a replacement check out Canarytokens and RequestBin.

URI:teller is a service for monitoring how chat apps, social network sites and such fetch their link previews. See the companion blog post talking about the original motivation and further uses.

The code in this repository is built for the Google Cloud Platform. See Prerequisites for more info about that.

Technical Name-dropping

URI:teller uses Google's Cloud Datastore as the database and Cloud Pub/Sub for passing work between services. Stackdriver Debugger, Trace and Error Reporting work if their respective APIs are enabled. The frontend service sends analytics to Google Analytics whent the GA_TRACKING_ID environment variable is set.

The code is written in ES2015 plus some extensions, such as modules and .vue component files. Babel then compiles the source to JavaScript that Node.js and browsers can handle. For styling: SASS.

Vue allows reusing the same view code for both server-side and in-browser rendering.

Express (with its Helmet on) powers the server side code.

On the browser Bootstrap 4 makes things look nice. Webpack 2 crumples the code, styles and other assets into an easily distributable bundle.

CircleCI runs the build process on every repository push. CircleCI also deploys the site whenever the production branch gets an update.

Prerequisites

Google Cloud Platform

This project is made to be hosted in the Google Cloud Platform (namely in the Google App Engine Node.js flexible environment), so you need an account: https://cloud.google.com/

Install and initialize Google Cloud SDK: https://cloud.google.com/sdk/docs/

Create a new project from the Google Cloud Platform Console or use an already existing one. Set your project's id PROJECT_ID as default with:

$ gcloud config set project <PROJECT_ID>

App Dependencies

Install Node.js dependencies. The following command line examples use yarn but npm works just as well.

$ yarn

Development

Client

Watch and rebuild client side assets on changes:

$ yarn dev

Server

If you want to run the server components you can use the Application Default Credentials - note that you need to get these only once for your environment:

$ gcloud auth application-default login

Run app.js in port 8080:

$ GCLOUD_PROJECT=<PROJECT_ID> APP_BASE_URL=http://localhost:8080/ yarn start

Run worker.js instead:

$ GCLOUD_PROJECT=<PROJECT_ID> SCRIPT=worker.js yarn start