Giter Site home page Giter Site logo

Comments (3)

chipotle avatar chipotle commented on July 16, 2024

I'm going to need a bit of guidance on a few bits of this:

  • prerequisites for production mode rather than dev mode (i.e., start RethinkDB server separately, etc.)
  • how to use hz make-token to get the admin user admin-ing
  • basic advice about self-hosted deployment (i.e., is hz serve production ready or should they run a "real" web server and proxy to it, other general node stuff)
  • anything about Horizon Cloud and DO support that's impending

from horizon-docs.

danielmewes avatar danielmewes commented on July 16, 2024

prerequisites for production mode

  • Starting your own RethinkDB server, or setting the start-rethinkdb option explicitly
  • An SSL key/certificate pair (unless you want to run with secure=false)
  • A schema file that includes all collections, indexes and permissions, which you can install through hz set-schema
  • In fact you need to run hz set-schema once before you start the Horizon servers so that it can initialize the internal Horizon databases in RethinkDB.
  • The correct bind setting to expose Horizon publicly

how to use hz make-token to get the admin user admin-ing

We will improve this interface, but at the moment you have to do the following:

  1. Run hz make-token <project path> admin. This will print a token that is valid for one day.
  2. Start the Horizon server if you haven't done so yet
  3. In the browser, open the Horizon application. Then open the JavaScript console and run the following command:
horizon.utensils.tokenStorage.set("<the token from make-token>")

I assume here that the application defined a horizon object which is an instance of the Horizon class. If the instance has a different name, use that instead. Or if there isn't one, you have to instantiate Horizon first:

var hz = Horizon();
hz.utensils.tokenStorage.set("<the token from make-token>");
  1. The application should now be authenticated as "admin" and can perform any administrative task through the browser (e.g. modifying the users collection in order to add users to groups)

Open question: Assume that the user wants to do the administrative task(s) through a node.js script rather than through the browser. How would one require the Horizon client in a node script and set the token in there? @deontologician ideas on if/how that could work?

self-hosted deployment

I believe it's fine to run hz serve by itself. There might be some questions about rate limiting to protect against DoS attacks. There also is the question of how to log requests, and how to start the server on system startup etc. I'm not sure if we have developed any best practices for these things yet. @encryptio @mlucy might have some tips.

Horizon Cloud and DO support

Horizon cloud will soon offer extremely a very simple way for deploying Horizon apps in the cloud. DigitalOcean offers a one-click Horizon droplet, see https://www.digitalocean.com/community/tutorials/how-to-use-the-horizon-one-click-install-image

from horizon-docs.

deontologician avatar deontologician commented on July 16, 2024

We need to provide a better interface in the client for using a token to authenticate. Right now we can use the utensils thing (which is really a non-official api), but it would be nice if users could create a horizon client instance and specify the token they want to use, without forcing the client to talk to localStorage. I'll open an issue for this

from horizon-docs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.