typicode / katon Goto Github PK
View Code? Open in Web Editor NEW(use hotel instead)
Home Page: https://github.com/typicode/hotel
License: MIT License
(use hotel instead)
Home Page: https://github.com/typicode/hotel
License: MIT License
I tried to add an app in a directory named "iD", with a capital D. Katon told me the app was available at http://iD.ka/. Hostnames are case-insensitive so my browser turned that into http://id.ka/, which produced a page saying "Can't find server, check that it has been added to katon using katon list".
After I installed Katon, all my MAMP PRO hosts like local.example.com
simply doesn't work anymore! My /etc/hosts file looks fine, any ideas what might be causing it?!
Everything was working great until I tried katon reload
, although I'm not positive that's what caused it. I am using katon 0.9.1 and added my server using: katon add 'rails server --port $PORT'
I'm unable to access my 'proj.ka' site and when running katon log
I see:
[katon] Starting admin on port: 31030 using command: rails server --port 31030
bin/rails:6: warning: already initialized constant APP_PATH
/Users/jason/proj/bin/rails:6: warning: previous definition of APP_PATH was here
Error: Command '--port' not recognized
Usage: rails COMMAND [ARGS]
So maybe katon isn't running rails server --port 31030
directly? Since that command works fine in the terminal.
I'm using rails 4.1.7 and rbenv 0.4.0 if that matters.
I installed it:
$ sudo katon install
Installing katon
Done
Typing katon status
says that it's not installed: (trying this twice produces the same result
$ katon status
Checking that katon daemon is loaded...
OK
Checking .ka domain...
KO try `sudo katon install`
I tried installing it again:
$ sudo katon install
Installing katon
katon.firewall: Already loaded
Done
Any tips on how to debug this? Katon 0.6.5, Node 0.10.32, OSX 10.9.5.
Katon status says I need to install pow even though it's installed. Running the install steps for the boilerplate express server works but my app returns:
An error has occurred: {"code":"ECONNREFUSED","errno":"ECONNREFUSED","syscall":"connect"}
Katon.log still shows the correct debug info I'd usually get in the command line.
*** Installing Pow 0.4.1...
*** Installing local configuration files...
*** Starting the Pow server...
*** Performing self-test...
*** Installed
For troubleshooting instructions, please see the Pow wiki:
https://github.com/37signals/pow/wiki/Troubleshooting
To uninstall Pow, `curl get.pow.cx/uninstall.sh | sh`
> katon status
Pow not installed, try katon install-pow
Katon daemon started
> katon restart
Katon daemon was successfully stopped
Katon daemon was successfully started
> katon status
Pow not installed, try katon install-pow
Katon daemon started
I use NVM to vendor my node binaries on my dev machine. It seems that katon doesn't handle that at the moment. Is this something that could be supported first-class by the project? If not, do you have any ideas about how I can get the two to play together nicely? I tried creating a nodemon.json
file in my project and point at the NVM node executable path directly, but that file seems to be getting largely ignored, based on what I can see being output in katon.log
.
When I open localhost:4000 I get the following error. I saw this when I tried to start the deamon manually, but I guess it is the same. The problem is that localhost:4000 is quite common to use.
undefined:43
__out.push(__sanitize(this.app.cwd));
^
TypeError: Cannot read property 'cwd' of undefined
at Object.eval (:43:37)
at Object.eval (:55:8)
at eval (:57:6)
at Function.eco.render (/usr/local/lib/node_modules/katon/node_modules/eco/lib/index.js:26:25)
at module.exports (/usr/local/lib/node_modules/katon/lib/render.js:11:16)
at ProxyServer. (/usr/local/lib/node_modules/katon/lib/daemon/proxy/index.js:59:26)
at ProxyServer.emit (/usr/local/lib/node_modules/katon/node_modules/http-proxy/node_modules/eventemitter3/index.js:79:10)
at ClientRequest.proxyError (/usr/local/lib/node_modules/katon/node_modules/http-proxy/lib/http-proxy/passes/web-incoming.js:127:16)
at ClientRequest.EventEmitter.emit (events.js:117:20)
at Socket.socketErrorListener (http.js:1547:9)
at Socket.EventEmitter.emit (events.js:95:17)
at net.js:440:14
at process._tickCallback (node.js:419:13)
Just starting out with katon. Seems promising.
I have a LinemanJS project. The build/start-server command is lineman run
and is configured as the npm-start script.
katon.log:
[katon] Start /Users/user/.katon/coordinator on port 4001
[katon] Starting `lineman run`
execvp(): No such file or directory
Re-linked via katon link 'lineman clean run'
and .katon is created successfully. However, I get the same error in katon.log:
[katon] Start /Users/user/.katon/coordinator on port 4001
[katon] Detected .katon
[katon] Starting `lineman clean run`
execvp(): No such file or directory
Thoughts? Lineman is installed globally (via npm install -g lineman
).
$ which lineman
/usr/local/share/npm/bin/lineman
My Apache configuration on Yosemite starts Apache automatically when my computer boots up. I had been wrestling with Katon and it would work one minute but not another. I remembered that Apache was running. Once I stopped Apache, Katon seemed to run like a champ.
Wondering if anyone else can confirm the issue. Just thought I'd give some insight since there may be a lot os OS X users whose Apache could be causing some issues. It may be good to put "Stop Apache" in set up instructions if this is indeed an issue.
Hello,
I installed everything as described, executing "katon link" outputs "Application is now available at mysite.dev", but all I see is a blank page.
Any ideas? Is this a Pow problem?
Also, it says the app is available at that URL but I don't see any log coming into terminal (link when using nodemon app.js). Does Katon output logs to the Terminal ?
Thanks
Hi all, really like katon and docker (for different reasons). However it occured me that it would be cool to have a plugin for katon that can pipe requests to a docker container. So this is not an issue more of a discussion as to:
Below is a nodejs
script which I copy'n'paste
within each project. Then I create a katon host with:
$ katon add 'node proxy.js -p $PORT' app-name
Script:
// @todo needs to OS agnostic (only works on macs)
// @todo throw exceptions when prerequisites are not there e.g. docker!?
var shell = require('shelljs'),
argv = require('minimist')(process.argv.slice(2)),
httpProxy = require('http-proxy'),
proxy
;
createProxy();
function createProxy() {
if(proxy) {
proxy.close();
}
var dockerIp = shell.exec('boot2docker ip 2>/dev/null', {silent: true}).output;
dockerIp = dockerIp.match(/(\d+\.){3}\d+/g)[0];
// NOTE: the app-name in the regex, docker container for a given project needs to be named exactly to match
var containerPort = shell.exec('$(boot2docker shellinit) && docker ps', {silent: true}).output
.match(/(\d+)->\d+\/[a-z]{3}\s+app-name/)[1];
var target = 'http://' + dockerIp + ':' + containerPort;
console.log('proxy to', target);
proxy = httpProxy.createProxyServer({target: target}).listen(argv.p).on('error', function(e) {
if(e.code === 'ECONNREFUSED') {
createProxy();
return
}
console.log('Unknown proxy error: ', e);
throw e;
});
}
The code above works surprisingly well, even when I restart the container, but could be a lot better "out of the box"
Fresh install on new machine.
Katon says it installed and started OK. But status fails, as does trying to hit an app created with katon add
.
It appears to be listening on the correct ports, and returning a faux DNS entry but not talking to the server?
➜ name_generator curl http://katon-status-test.ka
curl: (7) Failed connect to katon-status-test.ka:80; Connection refused
➜ name_generator curl http://katon-status-test.ka:31000
<!DOCTYPE html>
<html>
<head>
<title>Katon</title>
<style>
➜ ~ netstat -an |grep 31000
tcp4 0 0 *.31000 *.* LISTEN
➜ ~ netstat -an |grep 13375
udp4 0 0 *.13375 *.*
The /etc/resolver/ka
entry looks corrupted (the '%' shows up in reverse color text on my terminal) but even removing the oddness with vim didn't help:
➜ ~ cat /etc/resolver/ka
# Katon
nameserver 127.0.0.1
port 13375%
Here's how I did everything:
➜ ~ node -v
v0.10.31
➜ ~ sudo katon install
Installing katon
Done
➜ ~ katon start
Starting katon daemon
Done
➜ ~ katon status
Checking that katon daemon is loaded...
OK
Checking .ka domain...
KO try `sudo katon install`
➜ name_generator katon add 'harp server --port $PORT'
Application is now availaible at http://name-generator.ka/
➜ .katon cat daemon.log
15 Sep 16:21:47 - [daemon] Start
15 Sep 16:21:47 - [daemon] Loading procs
15 Sep 16:21:47 - [procs ] Add name-generator
15 Sep 16:21:47 - [daemon] Starting DNS server on port 13375
15 Sep 16:21:47 - [daemon] Starting katon server on port 31000
15 Sep 16:21:47 - [daemon] DNS server started
15 Sep 16:21:47 - [daemon] Katon server started
15 Sep 16:22:02 - [dns ] Received request for name-generator.ka
15 Sep 16:22:02 - [dns ] Received request for name-generator.ka
15 Sep 16:23:14 - [dns ] Received request for katon-status-test.ka
15 Sep 16:23:14 - [dns ] Received request for katon-status-test.ka
I'm on Mac OS 10.9.4.
Any further debug help appreciated.
Would be more fun.
Hi, I just don't seem to be able to get this to work. I always get KO try sudo katon install
when running katon status
I'm not sure what info would be useful. I'm pretty much fully up to date on a Mac OSX... Yosemite, npm node all latest version
Right now katon seems to assume it can just increment up through ports starting at 4001...
The issue I have is that meteor runs it's own copy of the app on port + 1, so running a meteor app takes port 4001 and port 4002. This means the next app can't start on 4002.
Can we change katon to detect if a port is in use before it tries to use it? If one is taken, just increment up until it finds an open port?
Are you goring to support windows? What is the main problem with that?
I want to ask about this scenario: I have already existing webserver at localhost:3000. I start it manually from command line. I don't want to change this. Is there a way to simply create a .ka domain for that webserver and server it's requests exactly as they are from the new .ka domain? The webserver serves dynamic, generated content. To say it the other way I don't want Katon to launch the process(es) or watch filesystem.
It would be a really nice simplification if katon would allow cli command like:
katon link foofoo.ka localhost:3000
katon link barbar.ka localhost:3001
No process starting, no folders, no watching etc.
In my express app I set the port with:
app.set('port', process.env.PORT || 3000);
and i run katon link and the log shows:
PORT=4001 /usr/local/share/npm/lib/node_modules/katon/lib/daemon/../../node_modules/.bin/nodemon app.js15 Feb 12:10:17 - �[33m[nodemon] v1.0.14�[39m
15 Feb 12:10:17 - �[33m[nodemon] to restart at any time, enter `rs`�[39m
15 Feb 12:10:17 - �[33m[nodemon] watching: *.*�[39m
15 Feb 12:10:17 - �[32m[nodemon] starting `node app.js`�[39m
Express server listening on port 4001
but when I go to the specified url I get:
Proxy Error
Couldn't proxy request to localhost:4000.
Error: connect ECONNREFUSED
so then I change the app to:
app.set('port', 4000);
And refresh my browser and everything starts working...
Am I supposed to "hard code" the port like that? Or am I doing something wrong?
Just a heads up, Katon is not working in OSX 10.10. Here's some additional info I found over in a pow issue - basecamp/pow#452.
Dont parse files in ~/.katon/hosts
that aren't JSON files.
I'm curious as to whether you think having katon pause
and katon resume
would be valuable options. the objective here would be turning a server "off" (potentially saving resources) w/o losing it's configuration, as you would with katon rm
.
I'm new to the project, so there may be architectural reasons this doesn't make sense - but I'm willing to contribute this if you thought it was worthwhile.
Alternative I can add .katon
and katon.log
in the global .gitignore
, but it will be nice if there is a way for katon to not pollute the repos.
i can get to the to the app using localhost:{port}, but going to it via the .ka domain results in the “can’t connect, possible reasons: ...”.
[katon] Starting societysouth.dev on port: 31004 using command: php -S localhost:31004
halp :)
Logging should be moved to ~/.katon/logs/APP_NAME.log
. Currently the logging clutters up the working directory also makes it difficult to run 2 katon applications from the same directory.
Having an issue using katon with rvm. Using the following:
rvm use ruby-2.0.0-p576 && katon add 'bundle exec unicorn -p 9999'
Getting the following:
/Users/omarvelous/.rvm/rubies/ruby-2.0.0-p576/lib/ruby/gems/2.0.0/gems/bundler-1.7.3/lib/bundler/spec_set.rb:92:in `block in materialize': Could not find rake-10.3.2 in any of the sources (Bundler::GemNotFound)
It seems to be looking in the wrong spot for the gems? Not sure what's going on. Any guidance?
Omar
It's easy enough to use tunnels but it would be awesome if everything inside of katon automatically worked over https.
similar to touch tmp/restart.txt
in pow, or powder restart
in powder.
Yeah sopport tu linux?
When running a symfony2 site over the php built in web server after about 10 requests I get the following error
Warning: Unknown: failed to open stream: Too many open files in Unknown on line 0
When I do a lsof -p
on the php process i get a 500+ similar to -
php 2353 $USER 368u IPv4 0xd28da1814874ee0b 0t0 TCP localhost:58215->localhost:etlservicemgr (CLOSED)
php 2353 $USER 369u IPv4 0xd28da18142565fab 0t0 TCP localhost:58239->localhost:etlservicemgr (CLOSED)
php 2353 $USER 370u IPv4 0xd28da18141a5353b 0t0 TCP localhost:58259->localhost:etlservicemgr (CLOSED)
php 2353 $USER 371u IPv4 0xd28da18141a51acb 0t0 TCP localhost:58261->localhost:etlservicemgr (CLOSED)
Defiantly an issue to how katon is running the php process as it doesn't seem to happen when I run the php server from the command line.
xip.io isn't working when I ping app.ka.192.168.178.88.xip.io
it returns my IP but when I load it in the browser nothing.
Accessing by IP 192.168.178.88 from even my local computer doesn't work.
I assume this an firewall issue. Any thoughts?
I would like to see Katon follow the XDG base dir spec.
If I understand katon correctly, the files placed under $HOME/.katon are runtime-related files? They ought to be placed in $XDG_RUNTIME_DIR/katon
.
For a smooth transition, we could use the $XDG_RUNTIME_DIR
only if it exists and fall back to $HOME/.katon
. This would leave XDG support as purely opt-in.
Would be great if katon could optionally automatically stop a daemon if it hasn't been accessed in a while (perhaps some user-configurable duration).
Specify individual apps from command line, ie: katon start app
This would be helpful if you have a lot of apps, especially if you're using something like vagrant.
This has happened randomly 3 times now, where Katon will just fail to work. Usually I do a npm uninstall and re-install and it's all good and dandy. However the last time, I just started it up, and it started working again.
This is the error that re-occures in the daemon.log
3 Oct 09:37:56 - �[31m[daemon] �[39mStart
3 Oct 09:37:56 - �[31m[daemon] �[39mLoading procs
3 Oct 09:37:56 - �[36m[procs ] �[39mAdd �[90mrealty�[39m
3 Oct 09:37:56 - �[36m[procs ] �[39mAdd �[90mroommates�[39m
3 Oct 09:37:56 - �[36m[procs ] �[39mAdd �[90mtruck�[39m
3 Oct 09:37:56 - �[31m[daemon] �[39mStarting DNS server on port 13375
3 Oct 09:37:56 - �[31m[daemon] �[39mStarting katon server on port 31000
3 Oct 09:37:56 - �[31m[daemon] �[39mDNS server started
3 Oct 09:37:56 - �[31m[daemon] �[39mKaton server started
/usr/local/lib/node_modules/katon/node_modules/native-dns/lib/platform.js:166
throw err;
^
Error: ENOENT, open '/etc/resolv.conf'
I have one app with three sub-domains (www
, static
and admin
).
I got it to work by creating symbolic links in ~/.katon
, so I have three links to the same directory, which also means it first up three servers. Not the worst thing in the world, but have to wait longer for app to reload.
Would it be feasible for Katon to recognize all three link lead to the same app, and share one server between all three?
katon add 'cd site/; gulp;'
This isn't working and outputs:
[katon] Starting basicmodal on port: 31002 using command: cd site/ [object Object] gulp [object Object]
Maybe it's not supported or a bug, but whatever the reason is, it might be good to show an error.
Thanks for the great tool!
My site is located in a folder named etc/
. This is actually not the name I want to use for the domain (etc.ka). It would be great if I could add the folder with a custom name:
katon add 'nodemon' --name myapp
katon add 'nodemon' -n myapp
A common scenario for me is to have a module with both a "main" file and a "start" script. The main file is for consumption by external modules and doesn't listen on a port at all. The start script does listen, and typically runs a server for in-browser tests, manual debugging, or examples. The current behavior of "main" having precedence over "start" doesn't work in this scenario, so I'm wondering if it can be reversed, or if there are scenarios where the current precedence makes more sense.
It would be really nice to have an option to use https instead of http when using katon open
. Maybe even force ssl, redirect to https. Also, it was really awesome to discover that ssl was even setup for katon 🙌, maybe add a section for "ssl" or "https" to the docs? That was first thing I searched for.
If anyone else is interested in this, I just manually edited the following file in my global node modules directory - https://github.com/typicode/katon/blob/master/src/cli/commands/open.js#L9
Should bind to 127.0.0.1 or ::1 rather than 0.0.0.0 or ::, so that the resultant katon page is only accessible to the machine it's running on. This affects ports 31000 and 30900 which katon serves from.
Would be nice to go to katon.ka/log/myappname
to see the logs. (bonus for an in-browser tail -f
implementation!)
This would be great to be linked from index.ka
as well.
Currently katon starts apps when katon starts up. I would rather only start apps when they are requested by DNS to keep the running app cost down. This mimics pow and would be ideal for me as I have 30+ apps I would put in place.
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.