Git Product home page Git Product logo

dukex / adoteumpedido Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 2.0 1.3 MB

O Adote um Pedido veio contornar um obstáculo ao acesso à informação no Brasil: aqui, ao contrário do que acontece em outros países, não é possível solicitar informações dos órgãos públicos de forma anônima.

Home Page: http://www.adoteumpedido.info

Ruby 70.75% JavaScript 0.10% CoffeeScript 0.46% CSS 5.56% HTML 23.13%

adoteumpedido's Introduction

Adoteumpedido

Code Climate Build Status Dependency Status

O Adote um Pedido veio contornar um obstáculo ao acesso à informação no Brasil: aqui, ao contrário do que acontece em outros países, não é possível solicitar informações dos órgãos públicos de forma anônima.

Install

$ bundle install
$ cp config/database.yml{.example,}
$ rake db:create db:migrate

On development enviroment you can create fake data running:

$ rake db:bootstrap

Import Authorities From Alaveteli

First we need download the Authorities and save csv in db/data/all-authorities.csv

$ curl 'http://queremossaber.org.br/body/all-authorities.csv' -o db/data/all-authorities.csv

Send it to production server and, on production server, run:

$ rake db:import_authorities_from_alaveteli

Hide User?

on App

On app level, the config/initializers/hide_ip.rb file hide user IP, the request log will like that

Started GET "/assets/application.js?body=1" for ###.##.##.###

Why not disable log? I tried it, sent the log to /dev/null, that was a bad idea! the app logs are important to debug app

on Web Server

We need only disable web server log, please see the your web server manual, on nginx, for example, the access_log var can be off

Using heroku

The Heroku has your log acess, to use heroku we need create a small proxy, you can use amazon for it. Given my app address is adoteumpedido.herokuapp.com, we configure the nginx on amazon with that config:

http {
  upstream adoteumpedido{
    server adoteumpedido.herokuapp.com:80; # adoteumpedido instance
  }

  server {
    listen       80;
    server_name  adoteumpedido.info; # adoteumpedido address
    error_log off;
    access_log off;

    location ~ / {
      index  index.html index.htm;
      proxy_set_header X-Real-IP 111.111.11.11;
      proxy_set_header X-Forwarded-For 111.111.11.111;
      proxy_set_header Host $http_host;
      proxy_redirect off;
      proxy_max_temp_file_size 0;
      proxy_pass http://adoteumpedido;
    }
  }
}
```

Feel free to updated it, I put only the basic config to proxy

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.