Hello!
On Wed, Sep 10, 2014 at 12:37 PM, Michal Cichra wrote:
> In the end it wasn’t just about ENV. But also shared dictionaries. I’m not
> sure if propagating them all is desired.
>
One design goal is make "resty" more like the "lua" and "luajit"
command-line utilities. Making all environments visible by default
makes sense to me :)
And yeah, shared dicts also need a new command-line option to add in,
for example,
resty --shdict dogs=10m --shdict cats=20m hello.lua
The goal here is to abstracting nginx's configuration language away for "resty".
>
> Do you think it would be possible to add a flag to resty command to include
> a file to generated nginx configuration?
>
It's surely technically possible but I prefer not. Because it can
easily break things when we add more stuff to resty's boilerplate
nginx.conf (eventually we may have no nginx.conf at all).
>
> I had to require them and initialise as globals. Thats is probably not
> expected behaviour.
>
Why not putting such special initialization code in your main .lua file?
> The NGINX_PATH is required for me on OSX, because name of the binary
> installed by homebrew is `openresty`.
>
We can support both executable names though I'm not the maintainer of
the homebrew setup.
> Because nginx can’t include files from outside of it’s prefix relatively,
> I’m copying my required config files to the temp folder with the generated
> config.
This is definitely a hack and we should avoid it in the first place :)
> And last, but not least is die when it can’t exec (for example missing
> openresty) which would return exit code 0 before.
>
Yeah, we can fix this.
BTW, driving automated testing for OpenResty apps and libraries is not
among the design goals of the the "resty" utility. In contrast, my
Test::Nginx::Socket test framework was created specifically for this
purpose and has been extensively used by myself:
http://search.cpan.org/perldoc?Test%3A%3ANginx%3A%3ASocket
Anyway, I don't want to limit the users' choices. Just FYI :)
Regards,
-agentzh