Giter Club home page Giter Club logo

trellis-app's Introduction

Trellis Application

NOTE: this project has been migrated into the Trellis/Rosid repository.

Requirements

The location of Kafka and Zookeeper will be defined in the ./etc/config.yml file.

Running Trellis

Unpack a zip or tar distribution. In that directory, modify ./etc/config.yml to match the desired values for your system.

To run trellis directly from within a console, issue this command:

$ ./bin/trellis-app server ./etc/config.yml

Note: When running trellis, please be sure to also have an active asynchronous processor.

Installation

To install Trellis as a systemd service on linux, follow the steps below. systemd is used by linux distributions such as CentOS/RHEL 7+ and Ubuntu 15+.

  1. Move the unpacked Trellis directory to a location such as /opt/trellis. If you choose a different location, please update the ./etc/trellis.service script.

  2. Edit the ./etc/environment file as desired (optional).

  3. Edit the ./etc/config.yml file as desired (optional).

  4. Create a trellis user:

$ sudo useradd -r trellis -s /sbin/nologin
  1. Create data directories. A different location can be used, but then please update the ./etc/config.yml file.
$ sudo mkdir /var/lib/trellis
$ sudo chown trellis.trellis /var/lib/trellis
  1. Install the systemd file:
$ sudo ln -s /opt/trellis/etc/trellis.service /etc/systemd/system/trellis.service
  1. Reload systemd to see the changes
$ sudo systemctl daemon-reload
  1. Start the trellis service
$ sudo systemctl start trellis

To check that trellis is running, check the URL: http://localhost:8080

Application health checks are available at http://localhost:8081/healthcheck

Building Trellis

  1. Run ./gradlew clean install to build the application or download one of the releases.
  2. Unpack the appropriate distribution in ./build/distributions
  3. Start the application according to the steps above

Configuration

The web application wrapper (Dropwizard.io) makes many configuration options available. Any of the configuration options defined by Dropwizard can be part of your application's configuration file.

Trellis defines its own configuration options, including:

partitions:
    - id: partition-name
      binaries:
        path: /path/to/binaries
      resources:
        path: /path/to/resources
      baseUrl: http://localhost:8080/
Name Default Description
id (none) The unique identifier for a partition
binaries / path (none) The path for storing binaries
resources / path (none) The path for storing resources
baseUrl (none) A defined baseUrl for resources in this partition. If not defined, the Host request header will be used
namespaces:
    file: /path/to/namespaces.json
Name Default Description
file (none) The path to a JSON file defining namespace prefixes
zookeeper:
    ensembleServers: localhost:2181
Name Default Description
ensembleServers (none) The location of the zookeeper ensemble servers (comma separated)
kafka:
    bootstrapServers: localhost:9092
Name Default Description
bootstrapServers (none) The location of the kafka servers (comma separated)
auth:
    webac:
        enabled: true
    anon:
        enabled: true
    jwt:
        enabled: true
        base64Encoded: false
        key: secret
    basic:
        enabled: true
        usersFile: /path/to/users.auth
Name Default Description
webac / enabled true Whether WebAC authorization is enabled
anon / enabled false Whether anonymous authentication is enabled
jwt / enabled true Whether jwt authentication is enabled
jwt / base64Encoded false Whether the key is base64 encoded
jwt / key (none) The signing key for JWT tokens
basic / enabled true Whether basic authentication is enabled
basic / usersFile (none) The path to a file where user credentials are stored
cors:
    enabled: true
    allowOrigin:
        - "*"
    allowMethods:
        - "GET"
        - "POST"
        - "PATCH"
    allowHeaders:
        - "Content-Type"
        - "Link"
    exposeHeaders:
        - "Link"
        - "Location"
    maxAge: 180
    allowCredentials: true
Name Default Description
enabled false Whether CORS is enabled
allowOrigin "*" A list of allowed origins
allowMethods "PUT", "DELETE", "PATCH", "GET", "HEAD", "OPTIONS", "POST" A list of allowed methods
allowHeaders "Content-Type", "Link", "Accept", "Accept-Datetime", "Prefer", "Want-Digest", "Slug", "Digest" A list of allowed request headers
exposeHeaders "Content-Type", "Link", "Memento-Datetime", "Preference-Applied", "Location", "Accept-Patch", "Accept-Post", "Digest", "Accept-Ranges", "ETag", "Vary" A list of allowed response headers
maxAge 180 The maximum age (in seconds) of pre-flight messages
allowCredentials true Whether the actual request can be made with credentials
async: false
Name Default Description
async false Set this to true if resource caches should be generated by an async processor; otherwise they will be generated synchronously. Note: setting this to true will make write operations faster for clients, but the availability of the updated content will appear to lag (because it is generated asynchronously).
cacheMaxAge: 86400
Name Default Description
cacheMaxAge 86400 The value of the Cache-Control: max-age= response header

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.