pier-oliviert / irrigation Goto Github PK
View Code? Open in Web Editor NEWGo web server for controlling your sprinklers with your Raspberry Pi.
Home Page: http://pothibo.com/2013/05/control-your-sprinklers-on-your-raspberry-pi
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
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
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.
Right now, initdb is used to initialize the db. What should actually happen is that you initialize the whole program. This way, it would initialize the database, move the html/css/js files in the specific place.
Should be able to put the scheduling on hold for an amount of time.
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.
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
Should move to another driver or another database if I can't find an alternative that works on go 1.1.
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)
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.
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.
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. :-)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.