Coder Social home page Coder Social logo

brow's People

Contributors

bjoerge avatar kytrinyx avatar lhz avatar mrtime avatar simen avatar skogsmaskin avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

atombender

brow's Issues

brow start <someproject> doesn't start nginx

When nothing is running, then starting a single project, e.g. snitch with

$ brow start snitch

fails to start nginx.

This results in the following:

$ curl 'http://snitch.dev/api/snitch/v1/ping'
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /api/snitch/v1/ping was not found on this server.</p>
<hr>
<address>Apache/2.2.21 (Unix) DAV/2 Server at snitch.dev Port 80</address>
</body></html>

Brow watch fails during startup

This is what happens:

$ brow watch

==> /tmp/brow-checkpoint.stderr.log <==

==> /tmp/brow-connector.stderr.log <==

==> /tmp/brow-dittforslag.stderr.log <==

==> /tmp/brow-grove.stderr.log <==

==> /tmp/brow-kudu.stderr.log <==
/Users/bjoerge/.rvm/gems/ruby-1.9.2-p290/gems/guard-0.9.1/lib/guard/listener.rb:36:in `[]': can't convert Symbol into Integer (TypeError)
    from /Users/bjoerge/.rvm/gems/ruby-1.9.2-p290/gems/guard-0.9.1/lib/guard/listener.rb:36:in `select_and_init'
    from /Users/bjoerge/.rvm/gems/ruby-1.9.2-p290/gems/brow-0.0.1/lib/brow/watcher.rb:46:in `watch'
    from /Users/bjoerge/.rvm/gems/ruby-1.9.2-p290/gems/brow-0.0.1/lib/brow/watcher.rb:21:in `block in start'
    from /Users/bjoerge/.rvm/gems/ruby-1.9.2-p290/gems/brow-0.0.1/lib/brow/watcher.rb:21:in `each'
    from /Users/bjoerge/.rvm/gems/ruby-1.9.2-p290/gems/brow-0.0.1/lib/brow/watcher.rb:21:in `start'
    from /Users/bjoerge/.rvm/gems/ruby-1.9.2-p290/gems/brow-0.0.1/lib/brow/wrangler.rb:81:in `watch'
    from /Users/bjoerge/.rvm/gems/ruby-1.9.2-p290/gems/brow-0.0.1/bin/brow:74:in `watch'
    from /Users/bjoerge/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/task.rb:22:in `run'
    from /Users/bjoerge/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/invocation.rb:118:in `invoke_task'
    from /Users/bjoerge/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor.rb:263:in `dispatch'
    from /Users/bjoerge/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/base.rb:389:in `start'
    from /Users/bjoerge/.rvm/gems/ruby-1.9.2-p290/gems/brow-0.0.1/bin/brow:89:in `<top (required)>'
    from /Users/bjoerge/.rvm/gems/ruby-1.9.2-p290/bin/brow:19:in `load'
    from /Users/bjoerge/.rvm/gems/ruby-1.9.2-p290/bin/brow:19:in `<main>'

Needs to work on Ubuntu (and possibly other linuces)

Brow currently works only for OS X. These are the parts that are known to be platform specific at this point:

In hostsfile.rb line 17 dscacheutil -flushcache is used to flush the DNS-cache.

In nginx_config.rb the method locate_mime_types finds the file mime.types from the nginx bundle by looking in the folders used by popular OS X package managers (MacPorts, Homebrew)

Also some places I use backticks to call unix commands (like calling kill to signal processes) while I should have used the Process api in ruby. I also use lsof and ps to find running processes and extract data about them. This makes brow vulnerable to the specific formatting of the output from these commands on a particular system. Brow would be more robust if it used more stable api's for this, but I have not researched if that is possible. This is particularly relevant in server_process.rb.

In watcher.rb the gem guard is used to watch the file system. This should be platform independent, but might not be.

Also watcher.rb looks for the command growlnotify to display user notifications. Growl is an OS X specific application, but something similar may exist for linux?¨

Good luck!

Fails to start Origo sometimes [housekeeping branch]

# brow down
Killing nginx
Giving all unicorns a break ...
Stopping hermes, origo, vanilla, checkpoint

# brow up
Releasing master unicorns for checkpoint, hermes, origo, vanilla ...
Launching nginx.
Updating /etc/hosts
Done. Waiting for unicorn workers.
/Users/alex/.rvm/gems/ruby-1.9.3-p374@global/gems/bundler-1.2.3/lib/bundler/source.rb:801:in `rescue in load_spec_files': git://github.com/amedia/redcloth.git (at master) is not checked out. Please run `bundle install` (Bundler::GitError)
    from /Users/alex/.rvm/gems/ruby-1.9.3-p374@global/gems/bundler-1.2.3/lib/bundler/source.rb:799:in `load_spec_files'
    from /Users/alex/.rvm/gems/ruby-1.9.3-p374@global/gems/bundler-1.2.3/lib/bundler/source.rb:381:in `local_specs'
    from /Users/alex/.rvm/gems/ruby-1.9.3-p374@global/gems/bundler-1.2.3/lib/bundler/source.rb:774:in `specs'
    from /Users/alex/.rvm/gems/ruby-1.9.3-p374@global/gems/bundler-1.2.3/lib/bundler/lazy_specification.rb:53:in `__materialize__'
    from /Users/alex/.rvm/gems/ruby-1.9.3-p374@global/gems/bundler-1.2.3/lib/bundler/spec_set.rb:86:in `block in materialize'
    from /Users/alex/.rvm/gems/ruby-1.9.3-p374@global/gems/bundler-1.2.3/lib/bundler/spec_set.rb:83:in `map!'
    from /Users/alex/.rvm/gems/ruby-1.9.3-p374@global/gems/bundler-1.2.3/lib/bundler/spec_set.rb:83:in `materialize'
    from /Users/alex/.rvm/gems/ruby-1.9.3-p374@global/gems/bundler-1.2.3/lib/bundler/definition.rb:113:in `specs'
    from /Users/alex/.rvm/gems/ruby-1.9.3-p374@global/gems/bundler-1.2.3/lib/bundler/definition.rb:158:in `specs_for'
    from /Users/alex/.rvm/gems/ruby-1.9.3-p374@global/gems/bundler-1.2.3/lib/bundler/definition.rb:147:in `requested_specs'
    from /Users/alex/.rvm/gems/ruby-1.9.3-p374@global/gems/bundler-1.2.3/lib/bundler/environment.rb:23:in `requested_specs'
    from /Users/alex/.rvm/gems/ruby-1.9.3-p374@global/gems/bundler-1.2.3/lib/bundler/runtime.rb:11:in `setup'
    from /Users/alex/.rvm/gems/ruby-1.9.3-p374@global/gems/bundler-1.2.3/lib/bundler.rb:116:in `setup'
    from /Users/alex/.rvm/gems/ruby-1.9.3-p374@global/gems/bundler-1.2.3/lib/bundler/setup.rb:17:in `<top (required)>'
    from /Users/alex/.rvm/rubies/ruby-1.9.3-p374/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/alex/.rvm/rubies/ruby-1.9.3-p374/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
  + hermes
  + vanilla
  + checkpoint

Got tired of waiting for origo.
You may try again soon or check syslog for errors.

More automagick

What about a "brow update" that

  • pulls the latest git repositories in the pebbles
  • updates/install the bundles
  • and run the needed rake tasks if needed?

Force use of bash

It seems ruby is hardcoded to use 'sh'. In order to get shell_environment.rb to work as intended, try this:

bash -lc "command"

which should load .bash_profile and execute the command.

Nginx config does not work on Homebrew [housekeeping branch]

Homebrew's Nginx is not compiled with --with-http_gzip_static_module or --with-http_stub_status_module.

nginx: [emerg] unknown directive "gzip_static" in /tmp/brow/nginx/nginx.conf:29
nginx: configuration file /tmp/brow/nginx/nginx.conf test failed

and

nginx: [emerg] unknown directive "stub_status" in /tmp/brow/nginx/nginx.conf:47
nginx: configuration file /tmp/brow/nginx/nginx.conf test failed

Automatic reloading does not work

When running

 $ brow watch

Brow should watch the files of the running servers and reload them when files change. After the latest changes this stopped working. Someone should take a look and make it work again.

Regression: Default app does not work [housekeeping branch]

The old behaviour where a single app handled all non-matching requests is broken.

# echo origo >~/.brow/default
# brow down; brow up
# curl "http://indrepuls.no.dev"
<html><body><h1>503 Service Unavailable</h1>
No server is available to handle this request.
</body></html>

A default backend should have been added to HAProxy config.

Brow stopped watching repos

After the port to Ubuntu brow watch is no longer automatically restarting services. It is not clear to me why this happens. Fedir?

Support capitalized project names

Mappings in the nginx-config is naïvely based on the project folder name in the .brow-folder. The names should probably be downcased before it is passed to nginx.

Avoid alias expansion for shell commands

brow does not work if the user has an alias for one of the shell commands it uses, e.g. ps. Use full path (/bin/ps) to avoid alias expansion.

En annen måte er å kjøre "shopt -u expand_aliases" før alle kommandoer. Da vil ikke bash bruke aliaser.

Brow sets (command-line feature)

It would be nice to have some convenience tools to work with brow, for example to create a brow set, i.e. a ~/.project.brow directory unibrow? for a single app with any dependencies (other apps/pebbles).

e.g.
brow new unibrow lifeloop --path ~/code/apps/lifeloop --pebblespath ~/code/pebbles --pebbles checkpoint papertime tiramisu

which would create a ~/.lifeloop.brow dir with symlinks to lifeloop, papertime, tiramisu, and checkpoint

We'd also need brow use unibrow lifeloop which would unlink an existing .brow dir, and ln -s .lifeloop.brow .brow

"brow list" spews "ps" errors [housekeeping branch]

# brow list
  checkpoint (down)
  hermes (down)
  origo (down)
  vanilla (down)
sh: /tmp/brow/haproxy.pid: No such file or directory
ps: option requires an argument -- p
usage: ps [-AaCcEefhjlMmrSTvwXx] [-O fmt | -o fmt] [-G gid[,gid...]]
          [-g grp[,grp...]] [-u [uid,uid...]]
          [-p pid[,pid...]] [-t tty[,tty...]] [-U user[,user...]]
       ps [-L]
  nginx/haproxy (down)

Updating all pebbles at once

There would be more convenient to have some cli command which would update all pebbles within .brow directory.
So it could do:

  • git pull
  • bundle install
  • bundle update
  • bundle exec rake db:nuke RACK_ENV=development

Empty hosts file.

I founded brow failes when startin with empty hosts file. With this backtrace:

brow up
Releasing all unicorns ...
Nginx allready running, reloading config.
Updating /etc/hosts
/home/robert/.rvm/gems/ruby-1.9.2-p290@brow/gems/brow-0.0.1/lib/brow/hostsfile.rb:11:in `update': undefined method `+' for nil:NilClass (NoMethodError)
    from /home/robert/.rvm/gems/ruby-1.9.2-p290@brow/gems/brow-0.0.1/lib/brow/wrangler.rb:35:in `up'
    from /home/robert/.rvm/gems/ruby-1.9.2-p290@brow/gems/brow-0.0.1/bin/brow:16:in `up'
    from /home/robert/.rvm/gems/ruby-1.9.2-p290@brow/gems/thor-0.14.6/lib/thor/task.rb:22:in `run'
    from /home/robert/.rvm/gems/ruby-1.9.2-p290@brow/gems/thor-0.14.6/lib/thor/invocation.rb:118:in `invoke_task'
    from /home/robert/.rvm/gems/ruby-1.9.2-p290@brow/gems/thor-0.14.6/lib/thor.rb:263:in `dispatch'
    from /home/robert/.rvm/gems/ruby-1.9.2-p290@brow/gems/thor-0.14.6/lib/thor/base.rb:389:in `start'
    from /home/robert/.rvm/gems/ruby-1.9.2-p290@brow/gems/brow-0.0.1/bin/brow:89:in `<top (required)>'
    from /home/robert/.rvm/gems/ruby-1.9.2-p290@brow/bin/brow:19:in `load'
    from /home/robert/.rvm/gems/ruby-1.9.2-p290@brow/bin/brow:19:in `<main>'

start current project

It would be veeeery nice if we could say

$ brow start .

in order to start the project (and all the dependencies) of the project in the pwd.

Should create log folder unless one exists

Won't launch Nginx because config did not validate. Nginx had this to say about that:
nginx: the configuration file /tmp/brow-nginx-preflight.conf syntax is ok
nginx: [emerg] open() "/home/tom/.brow/.tiramisu.brow/tootsie/log/nginx-access.log" failed (2: No such file or directory)
nginx: configuration file /tmp/brow-nginx-preflight.conf test failed

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.