]> git.aero2k.de Git - sirius.git/commitdiff
README updates
authorJoe Rickerby <joerick@mac.com>
Thu, 25 Apr 2019 15:21:53 +0000 (16:21 +0100)
committerJoe Rickerby <joerick@mac.com>
Thu, 25 Apr 2019 15:21:53 +0000 (16:21 +0100)
README.md
sirius/web/templates/about.html

index 0ee4e0bbc67b5b3d0b0bcf065a0899515651050a..b5fafed79b967bc0644cc701df1c819f62e3c44b 100644 (file)
--- a/README.md
+++ b/README.md
-# nord-sirius - An alternative backend for your Little Printer
+# nord-sirius 
 
 ![CloudBerg Little Printer](https://i.vimeocdn.com/video/222115839_1280x720.jpg)
 
-This repository is a fork of [genmon/sirius](https://github.com/genmon/sirius).
+This repository is a fork of [genmon/sirius](https://github.com/genmon/sirius), developed and maintained by [Nord Projects](https://nordprojects.co).
 
 Want to try it out? We have an instance running at http://littleprinter.nordprojects.co which all are welcome to use!
 
-### Interesting links
+# How to use
 
-Before everything else, you might want to understant how to update your CloudBerg Little Printer to use it with Sirius. It seems that before you just had to give your CloudBerg Bridge MAC address and someone pushed the update on your device. Now, it appears that the only option to update your CloudBerg Bridge to use it with Sirius is to root your device. The following links might help you :
+Want to get your Little Printer online?
 
-  * [Updating the Bridge](https://github.com/genmon/sirius/wiki/Updating-the-Bridge)
-  * [Rooting Your BERG Cloud Bridge](http://pipt.github.io/2013/04/15/rooting-berg-cloud-bridge.html)
-  * [Getting Little Printer online](http://joerick.me/hardware/2017/03/09/little-printer)
-  * [Installing Sirius on Mac / Linux / Raspberry Pi](https://gist.github.com/hako/f8944cfa7b8fb8115f6d)
+- Hack the Berg Cloud bridge. Follow our [step-by-step guide](https://docs.google.com/document/d/1JT1f2ClVdAnjrnby92V9ONBnN05EFQGYpLG5ijl5KRI/edit?usp=sharing) here.
+    - If you've already got a hacked bridge using the alpha.littleprinter.com
+      backend, use the guide above but start at step 6.
 
-### Installation
+- Once it's paired with this server, you can use Device Keys with our iOS app,
+[Little Printers](https://itunes.apple.com/us/app/little-printers/id1393105914?ls=1&mt=8),
+which is also [open source](https://github.com/nordprojects/littleprinters-ios-app)!
 
-Install and run Sirius on Debian:
+### Using the device key API
 
-```
-apt install python python-pip libpq-dev postgresql phantomjs libfreetype6-dev fontconfig libgstreamer1.0-dev python-dev wget libjpeg-dev zlib1g-dev
-git clone https://github.com/genmon/sirius
-cd sirius
-
-pip install -r requirements.txt
-
-wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2
-tar jxf phantomjs-2.1.1-linux-x86_64.tar.bz2
-sudo mv phantomjs-2.1.1-linux-x86_64/bin/phantomjs /usr/local/bin/phantomjs
-
-./manage.py db upgrade head
-
-~/.local/bin/gunicorn -k flask_sockets.worker manage:app -b 0.0.0.0:5002 -w 1
-```
-or use Docker Compose, just type:
-
-```
-docker-compose up
-```
+Use Device Keys to print through an API. Create a device key from the web
+interface, and go to that URL to view API documentation.
 
-*With PhantomJS 1.9.8 I can't print pictures but version 2.1.1 seems to fix the problem*.
+# Developing Sirius
 
-Navigate browser to http://127.0.0.1:5002/
+## Running on Heroku
 
-You should configure your BergCloud Bridge to point to your Sirius instance.
+We run an instance of this server on Heroku, at [littleprinter.nordprojects.co](https://littleprinter.nordprojects.co). You are welcome to use our instance!
 
-If you want, you can create a systemd service, feel free to update this skeleton to fit your needs:
+If you want to run it yourself, this app will run on Heroku, but you need a
+static IP address due to the way the Berg Bridge connects. We have a droplet 
+at Digital Ocean running nginx to forward the HTTPS connection on to Heroku.
 
-```
-[Unit]
-Description=Sirius, webapp for Little Printer
-
-[Service]
-WorkingDirectory=/home/berg/sirius
-ExecStart=/home/berg/.local/bin/gunicorn -k flask_sockets.worker manage:app -b 0.0.0.0:5002 -w 1
-User=berg
-
-[Install]
-WantedBy=multi-user.target
-```
-
-### Using the external API
-
-If you want to print messages from your application, you can use the external API.
-
-
-#### With curl
-
-```bash
-curl \
-  --data '{"message": "<h1>hello</h1>", "face": "noface"}' \
-  http://127.0.0.1:5000/ext_api/v1/printer/1/print_html?api_key=<key>
-```
-
-#### With Processing
-
-You'll need an external library named unirest and its dependencies.
-You can download it directly from my server : [unirest-java-1.4.10.jar](https://cloud.deuxfleurs.fr/f/685c77efbd/?raw=1)
-Or, if you prefer, you can compile it from the source by following this [guide](http://blog.mashape.com/installing-unirest-java-with-the-maven-assembly-plugin/).
-
-Once you have the `unirest-java-1.4.10.jar` (or another version):
-
-  1. Create a folder named `code` inside your sketchbook folder, next to your Processing files (use File explorer on Windows, Finder on Mac OS, etc.)
-  2. Put `unirest-java-1.4.10.jar` in this folder
-
-Now restart processing and add the following in your project:
-
-```processing
-import com.mashape.unirest.http.*;
-import com.mashape.unirest.http.exceptions.UnirestException;
-
-boolean little_print(String face, String message, String endpoint, String api_key) {
-  try {
-    com.mashape.unirest.http.HttpResponse<String> request = Unirest.post(endpoint+"?api_key="+api_key)
-      .body("{\"message\": \"" + message.replace("\"", "\\\"") +"\", \"face\": \"" + face.replace("\"", "\\\"") + "\"}")
-      .asString();
-
-    println(request.getBody());
-    return true;
-  } catch (Exception e) {
-    println(e);
-    return false;
-  }
-}
-
-```
-
-Each time you want to use your little printer to print something, you should write something like this (don't forget to put your API key and update the URL):
-
-```processing
-little_print("noface", "<h1 style=\"margin-top: 100px\"> PROOOOCESSING </h1>", "http://127.0.0.1:5000/ext_api/v1/printer/1/print_html", "xxxxxxxxx");
-```
+It should also be possible to run in Docker, dokku, or directly with gunicorn,
+but we don't use it that way :).
 
 ### Environment variables
 
@@ -121,15 +44,10 @@ The server can be configured with the following variables:
 TWITTER_CONSUMER_KEY=...
 TWITTER_CONSUMER_SECRET=...
 FLASK_CONFIG=...
+DATABASE_URL=...
 ```
 
-For dokku this means using e.g.:
-
-```
-dokku config:set sirius FLASK_CONFIG=heroku
-dokku config:set sirius TWITTER_CONSUMER_KEY=DdrpQ1uqKuQouwbCsC6OMA4oF
-dokku config:set sirius TWITTER_CONSUMER_SECRET=S8XGuhptJ8QIJVmSuIk7k8wv3ULUfMiCh9x1b19PmKSsBh1VDM
-```
+These can be set in the `.env` file in your checkout.
 
 ### Creating fake printers and friends
 
index ac8f4a1413f0dc11d439d8718fb95b134aefd09f..e66ded5408207858f0f733f1bd55cfbea6427562 100644 (file)
@@ -17,7 +17,7 @@
                        <li>Send messages via our Print Key API</li>
                </ul>
 
-               <p>To use your Little Printer with this backend, you'll need to root your bridge, and install a software update. Check out <a href="http://joerick.me/posts/2017/03/09/little-printer/">information about the process</a> or keep an eye on <a href="https://github.com/genmon/sirius/issues/8">this thread</a>.</p>
+               <p>To use your Little Printer with this backend, you'll need to root your bridge, and install a software update. Check out <a href="http://joerick.me/posts/2017/03/09/little-printer/">information about the process</a> or check out a <a href="https://docs.google.com/document/d/1JT1f2ClVdAnjrnby92V9ONBnN05EFQGYpLG5ijl5KRI/edit?usp=sharing">step-by-step guide here</a>.</p>
 
                <p>All the code is open source, check it on <a href="https://github.com/nordprojects/sirius">GitHub</a>. This backend is forked from the <a href="http://github.com/genmon/sirius">sirius project</a>, and most of the code originated there. Thanks to Matt Webb, Tom Hunger, Quentin Dufour, who did the lion's share of the work to get this thing working!</p>