Coder Social home page Coder Social logo

pier-oliviert / irrigation Goto Github PK

View Code? Open in Web Editor NEW
28.0 4.0 8.0 2.88 MB

Go web server for controlling your sprinklers with your Raspberry Pi.

Home Page: http://pothibo.com/2013/05/control-your-sprinklers-on-your-raspberry-pi

Ruby 55.01% CoffeeScript 14.21% CSS 6.70% Go 20.70% JavaScript 3.39%

irrigation's Introduction

README

This README would normally document whatever steps are necessary to get the application up and running.

Things you may want to cover:

  • Ruby version

  • System dependencies

  • Configuration

  • Database creation

  • Database initialization

  • How to run the test suite

  • Services (job queues, cache servers, search engines, etc.)

  • Deployment instructions

Please feel free to use a different markup language if you do not plan to run rake doc:app.

irrigation's People

Contributors

pier-oliviert avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

irrigation's Issues

Make the Go scheduler a standalone app

I really like the Go scheduler, it should become a standalone application that lives in rails_project/bin.

The Binary would connect to rails_project/db/sqlite.db and start it's runloop to check for active schedules every minutes. This means that the connection between the rails app and the scheduler would be implicit, via the database.

Use SQlite

I'd prefer using SQlite to handle the database side of things. It's easier to maintain (only a file, works out of the box)

Rain delay

Should be able to put the scheduling on hold for an amount of time.

Ruby on rails frontend

Go is great to handle low level stuff like the GPIO but is crap at handling web pages and assets. The whole frontend should use rails instead.

User protected website

Readonly version accessible to guests but every action on the site should be protected by user session.

This would make it possible to finally have irrigation accessible outside of NAT

Application should be initialized as root

When starting the app, it should elevate it's privilege to root. So the GPIO can be activated, once the activation process is complete, it should reduce its privilege to userspace and launch the webserver

Make configuration easier and universal

Configuration file should allow you to set system specific path as well as server settings.

Given the following example

valves: [14, 15, 18, 23, 24, 4, 17, 22]
port: 7777
path: "/srv/http/irrigation"

Path would be created with

$ sudo irrigation -initialize

Path would be use to save the database, serve HTML, CSS, JS. This will make it easier for someone to customize the visual while keeping everything tidied up.

A check should be made every time the server is launched to make sure the path contains the expected file structure. If not, an explicit error message should be given to the use so they know what's happening.

Not go-gettable

I should be able to simply run

go get github.com/pothibo/irrigation

to download and build your package. But I get this in a clean $GOPATH:

[andrew@Liger ~] go get github.com/pothibo/irrigation
package github.com/pothibo/irrigation
        imports github.com/globocom/config
        imports github.com/howeyc/fsnotify
        imports launchpad.net/~niemeyer/goyaml/beta
        imports github.com/gorilla/pat
        imports github.com/gorilla/context
        imports github.com/gorilla/mux
        imports irrigation/db: unrecognized import path "irrigation/db"
package github.com/pothibo/irrigation
        imports github.com/globocom/config
        imports github.com/howeyc/fsnotify
        imports launchpad.net/~niemeyer/goyaml/beta
        imports github.com/gorilla/pat
        imports github.com/gorilla/context
        imports github.com/gorilla/mux
        imports irrigation/helpers: unrecognized import path "irrigation/helpers"
package github.com/pothibo/irrigation
        imports github.com/globocom/config
        imports github.com/howeyc/fsnotify
        imports launchpad.net/~niemeyer/goyaml/beta
        imports github.com/gorilla/pat
        imports github.com/gorilla/context
        imports github.com/gorilla/mux
        imports irrigation/models: unrecognized import path "irrigation/models"
package github.com/pothibo/irrigation
        imports github.com/globocom/config
        imports github.com/howeyc/fsnotify
        imports launchpad.net/~niemeyer/goyaml/beta
        imports github.com/gorilla/pat
        imports github.com/gorilla/context
        imports github.com/gorilla/mux                                                                    
        imports irrigation/scheduler: unrecognized import path "irrigation/scheduler" 

Even if I follow your instructions I get build errors looking for gopi:

[andrew@Liger gotmp] cd src/github.com/pothibo/irrigation/
[andrew@Liger irrigation] go get ./...
package irrigation/db: unrecognized import path "irrigation/db"
package irrigation/helpers: unrecognized import path "irrigation/helpers"
package irrigation/models: unrecognized import path "irrigation/models"
package irrigation/scheduler: unrecognized import path "irrigation/scheduler"
package github.com/coopernurse/gorp
        imports github.com/mattn/go-sqlite3
        imports gopi: unrecognized import path "gopi"

Is there any reason why are you aren't qualifying your import paths? e.g., instead of irrigation/db, you'd use github.com/pothibo/irrigation/db. If you fully qualified all your import paths. You should do this for other packages too, like github.com/pothibo/gopi instead of just gopi.

If you do that, then people will be able to just run go get github.com/pothibo/irrigation and things will work. :-)

Login

Have a "sort" of 2-step authentification.

Goal is to be easy and secure-enough. Here's an idea.

Authentication screen requires email only. Email checks against DB to see if it's a white listed email.

Once white-listed, send an email to that address with a one-time use token.

That token should be expired within 5 minutes if not used.

Device should be stored for an amount of time. Maybe do like google account and have token listed so you can revoke them.

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.