Giter Site home page Giter Site logo

menyanorke / cozy-proxy Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cozy/cozy-proxy

0.0 0.0 0.0 9.07 MB

This repository was part of CozyV2 which has been deprecated - Cozy authentication and routing layer

Home Page: https://blog.cozycloud.cc/post/2016/11/21/On-the-road-to-Cozy-version-3

License: GNU Affero General Public License v3.0

JavaScript 19.71% CoffeeScript 68.91% CSS 7.84% HTML 3.54%

cozy-proxy's Introduction

Cozy Proxy

Cozy Proxy redirects requests properly to the right application of the Cozy platform depending on given path. It also handles authentication to the Cozy for users and devices.

Install

We assume here that the Cozy platform is correctly installed on your server.

Type this command to install the proxy module:

$ cozy-monitor install proxy

Contribution

You can contribute to the Cozy Proxy in many ways:

  • Pick up an issue and solve it.
  • Translate it in a new language.
  • Improve the session management.

Listen on https

It is recommended to run Cozy Proxy behind a reverse proxy like nginx. The reverse proxy does the SSL/TLS stuff in that case. But if you want to run Cozy Proxy with no reverse proxy (low memory server for example), you can set the following env variables:

USE_SSL=true
SSL_CRT_PATH=/path/to/server.crt  # /etc/cozy/server.crt by default
SSL_KEY_PATH=/path/to/server.key  # /etc/cozy/server.key by default

To use this when the whole Cozy stack is running, you can add this variables into the Controller configuration file, /etc/cozy/controller.json, as explained into the documentation. Just add the following lines into this file:

"env": {
  "proxy": {
    "PORT": 443,
    "USE_SSL": true,
    "SSL_CRT_PATH": "/path/to/server.crt",
    "SSL_KEY_PATH": "/path/to/server.key"
  }
}

Troubleshooting

The Cozy proxy has a default timeout of 120 seconds. If an application doesn't anwser in 120 seconds, the Proxy will close the connection. If your server is slow, you may want to increase this timeout. Just edit server.js inside the build directory of your proxy (usually /usr/local/cozy/apps/proxy/node_modules/cozy-proxy/build/server) and add server.timeout = 0 juste after return americano.start(options, function(err, app, server) {.

Hack

To be hacked, the Cozy Proxy dev environment requires that a CouchDB instance and a Cozy Data System instance are running. Then you can start the Cozy Proxy this way:

$ git clone https://github.com/cozy/cozy-proxy.git
$ cd cozy-proxy
$ npm install
$ npm run watch

To hack cozy-proxy using the cozy vagrant

  • Forward cozy-home application port from the virtual machine: config.vm.network :forwarded_port, guest: 9103, host: 9103 in file Vagrantfile (if the virtual machine is already up, you can apply this change with vagrant reload)
  • On your computer, go to your cozy-proxy folder cd your-cozy-proxy-folder
  • Run npm install
  • Once install is done, launch cozy-proxy PORT=9555 HOST="0.0.0.0" npm run watch (You may use another port)
  • You can now access the hacked proxy on http://localhost:9555 with your navigator

Tests

Build Status

To run tests, type the following command into the Cozy Proxy folder:

$ npm run test

Note: a running data-system is required for the tests.

Contribute with Transifex

Transifex can be used the same way as git. It can push or pull translations. The config file in the .tx repository configure the way Transifex is working : it will get the json files from the locales repository. If you want to learn more about how to use this tool, I'll invite you to check this tutorial.

License

Cozy Proxy is developed by Cozy Cloud and distributed under the AGPL v3 license.

What is Cozy?

Cozy Logo

Cozy is a platform that brings all your web services in the same private space. With it, your web apps and your devices can share data easily, providing you with a new experience. You can install Cozy on your own hardware where no one profiles you.

Community

You can reach the Cozy Community by:

  • Chatting with us on IRC #cozycloud on irc.freenode.net
  • Posting on our Forum
  • Posting issues on the Github repos
  • Mentioning us on Twitter

cozy-proxy's People

Contributors

frankrousseau avatar m4dz avatar poupotte avatar gregorylegarec avatar aenario avatar nono avatar jsilvestre avatar clochix avatar felix-lambert avatar kelukelu avatar kloadut avatar babolivier avatar paultranvan avatar misstick avatar cylwin avatar kosssi avatar goldoraf avatar obigroup avatar alpha14 avatar bnjbvr avatar gooz avatar jankeromnes avatar f6fvy avatar nnodot avatar

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.