Re: [Mojolicious] DATA templates

2020-02-22 Thread Илья
To be honest, perl documentation doesn't shed any light on case where __END__ and __DATA__ tokens coexists in one file. But I'm sure that it is not mojolicious problem, but perl behaviour in that case. On 22.02.2020 18:40, Mike Lieman wrote: >The two control characters ^D and ^Z, and the tokens

Re: [Mojolicious] Mojolicious::Plugin::Config and Test::Mojo

2020-04-21 Thread Илья
I do it that way (pretty ugly, i know), but agree, it's annoying and I'll be much happier if Mojolicious::Plugin::Config will do deep merge my $t = Test::Mojo->new('App'); my $config = $t->app->config; ... do something with config; undef $t; $t = Test::Mojo->new('App', $config); ... do test

[Mojolicious] Minion::Backend::Redis

2017-12-31 Thread Илья Рассадин
Hi! I recently started to work on my own implementation for Minion::Backend::Redis. During code reading of Mojo::Backend::Pg, some questions were born in my mind and I wrote email directly to Sebastian. Than's how I found out about Dan Book's Redis backend https://github.com/Grinnz/Minion-Back

Re: [Mojolicious] Minion::Backend::Redis

2018-01-04 Thread Илья Рассадин
script with the modification to use Redis here: https://github.com/Grinnz/Minion-Backend-Redis/blob/master/examples/minion_bench.pl -Dan On Sun, Dec 31, 2017 at 7:08 AM, Илья Рассадин <mailto:elcaml...@gmail.com>> wrote: Hi! I recently started to work on my own implementation for

Re: [Mojolicious] SQL::Abstract::Pg

2018-02-03 Thread Илья Рассадин
I think, the case is not about inserting bulk data from one table to another. For example, we can buffer minion jobs via enqueue and insert them to minion_jobs all at once in the end of request. That feature also is very valuable for highload project if you want to store some kind of logs in t

Re: [Mojolicious] Mojo::Base get all attributes names

2018-02-06 Thread Илья Рассадин
To be fare, Mouse can do it as well. And Moo too (but not with support of Moose Meta Object Protocol). понедельник, 5 февраля 2018 г., 21:13:19 UTC+3 пользователь Charlie Brady написал: > > > On Mon, 5 Feb 2018, Dan Book wrote: > > > Introspection capabilities are a feature of Moose. > > Moose

[Mojolicious] Re: Excessive stop/start hypnotoad workers

2018-02-06 Thread Илья Рассадин
Looks like this is behaviour of a gracefull_timeout attribute of Mojo::Server::Hypnotoad >From the docs https://metacpan.org/pod/Mojo::Server::Hypnotoad#graceful_timeout Maximum amount of time in seconds stopping a worker gracefully may take before being forced, defaults to the value of "gracef

[Mojolicious] Migrations are always run inside transaction

2018-02-07 Thread Илья Рассадин
Hi! On my new project I finally started using Mojo::Pg::Migrations but ran into a problem. All migrations are wrapped within transactions. But some schema changes, such as enum type modifications can not be run inside transactions. And code falls with message DBD::Pg::st execute failed: ER

Re: [Mojolicious] Re: Basic HTTP auth and plugin "Directory"

2018-02-16 Thread Илья Рассадин
Hi! Looks like basic_auth helper always return perl true value. You need to use check_auth mehod instead with auth helper, or use basic_auth helper directly within controller. But the most important question, why not to use apache or nginx directly to solve your problem? On 2/16/18 5:33 PM

Re: [Mojolicious] Re: trying to catch a clic on a link

2018-02-19 Thread Илья Рассадин
Do you have any server dispatching requests before Mojolicious? Nginx or Apache maybe? On 2/19/18 7:51 PM, amka1...@gmail.com wrote: app->hook(before_dispatch => sub {   my $c = shift;   print "Hi\n"; }); don't react for the links (to .../public folder). Have you please another idea ? -- You

[Mojolicious] Nginx Unit 1.0 released

2018-05-05 Thread Илья Рассадин
Hi! Recently (month ago) the stable version of nginx unit application server was released https://www.nginx.com/blog/nginx-unit-1-0-released/ Did anyone try to launch Mojolicious with nginx unit? What do you think, is it worth trying to do it? Best Regards. Ilya Rassadin. -- You rec

Re: [Mojolicious] Nordic Perl Workshop and Mojoconf in Oslo

2018-05-08 Thread Илья Рассадин
Hi! Is english main language for the conference talks? On 5/8/18 10:15 AM, Jan Henning Thorsen wrote: Nordic Perl Workshop 2018 will be held in Oslo, 6 - 7 September, 2018. The conference topic is “Perl in the cloud”, with focus on web development, and deployment methods. We are pleased to an

Re: [Mojolicious] Good namespace for personal plugin?

2018-05-08 Thread Илья Рассадин
If you sure that your modules has no value outside your projects, cpan is not right place to store them. You could use darkpan to install your local modules, centralize updates and so on. Such modules can be installed via cpanm/carton/carmel See https://metacpan.org/pod/Carton#Specifying-a-C

Re: [Mojolicious] Multiple SSL certs

2018-05-14 Thread Илья Рассадин
Hi! Using Mojolicious as a proxy instead of Nginx looks like hammering nails with screwdriver. It's possible, but hammer is much more effective tool for the job. If You can configure Nginx for this, just do it. On 5/13/18 4:24 PM, Stefan Adams wrote: I'm using Toadfarm to mount several apps

Re: [Mojolicious] List of All Optional Modules?

2018-09-08 Thread Илья Рассадин
Hi! See https://mojolicious.org/perldoc/Mojolicious/Guides/FAQ#Why-doesnt-Mojolicious-have-any-dependencies And I was surprised that there is no cpanfile in project. Cpanfile recommends and suggests feature is a nice to way to declare such optional dependencies. On 09/09/2018 03:00, Viktor

Re: [Mojolicious] Re: List of All Optional Modules?

2018-09-09 Thread Илья Рассадин
I think, you can get the most complete list of optional deps with "mojo version" command. Output should looks like this CORE   Perl    (v5.26.1, linux)   Mojolicious (7.94, Doughnut) OPTIONAL   Cpanel::JSON::XS 4.04+  (4.06)   EV 4.0+ (4.22)   IO::Socket::Socks 0.64+ (n/a)

Re: [Mojolicious] How do you generate a "Content-Length" header in a multipart request?

2018-09-18 Thread Илья Рассадин
Hi! Please, provide a code example (with any paste service, like gist.github.com), so we can see how you  create request object and give you advice. On 18/09/2018 19:50, Steve Dondley wrote: I'm starting a new thread related to the previous one regarding making a batch api request to Google

Re: [Mojolicious] Configuration override via Test::Mojo not being used

2018-09-27 Thread Илья Рассадин
Config overriding works only for full apps #! /usr/bin/env perl use Mojo::Base-strict; use Test::More; use Test::Mojo; package Foo; use Mojo::Base'Mojolicious', -signatures; sub startup ($self) { $self->plugin(Config => {default => {jack => 'squat'}}); $self->routes->get('/')->to('main#inde

Re: [Mojolicious] Checking proxy information

2019-01-08 Thread Илья Рассадин
Hi! Mojo::UserAgent has proxy attribute. You can set it up request, catch error and if error is related to proxy, set next proxy and retry request. On 07/01/2019 12:42, Veesh Goldman wrote: I'm working on a project that requires cycling through a list of proxies. I've been trying to implemen

[Mojolicious] How to proper test minion job with Test::Mojo in smoke test

2019-01-11 Thread Илья Рассадин
Hi! I faced an issue during cover my application with tests. Prerequisites: * I'm using docker-compose to run application and tests locally. * I have main app and minion tasks. One of app's features is to deal with goods and associated images. Usually I read goods list and its metadata (includi

[Mojolicious] Re: How to proper test minion job with Test::Mojo in smoke test

2019-01-14 Thread Илья Рассадин
Hi! Solved my problem with mocking. Now model has a sub, returning Mojo::Message::Response object. And in test I mock this function to return special Response. On 11/01/2019 20:39, Илья Рассадин wrote: Hi! I faced an issue during cover my application with tests. Prerequisites: * I'm

Re: [Mojolicious] MUA::Transactor::add_generator

2019-03-12 Thread Илья Рассадин
Hi! name "add_generator" leads me to the idea, that there can be more than one aws sign generators. apply_generator or set_generator makes it clear, that there can be only one. And by the way, why don't you encapsulate generator logic inside role AWSSign role? So, code could be something l

[Mojolicious] Set correct rights to unix socket with Mojo::Server::Daemon

2019-04-26 Thread Илья Рассадин
Hi! I want to run my mojo app with hypnotoad listening on unix socket. conf file looks like this { ...     hypnotoad => {     listen  => ['http+unix://%2Ftmp%2Fmy_app.sock'],     workers => 2,     proxy => 1,     }, } And then file /tmp/my_app.sock has 755 rights (accordin

Re: [Mojolicious] Set correct rights to unix socket with Mojo::Server::Daemon

2019-05-01 Thread Илья Рассадин
Thanks for your advice. But 1) It's requirement from my devops collegue and I need to achieve it somehow. Just tell "some people think that your approach is wrong and insecure" is not a valid solution in my case. 2) Other apps (like php-fpm) allows to set up socket rights, as well as socket

Re: [Mojolicious] Mojo::SQLite && foreign keys support ?

2019-05-08 Thread Илья Рассадин
To clarify Dan's answer about state variables (mostly, for myself). If you run separate apps in the same process like these. my $app1 = Test::Mojo->new('MyApp')->app; my $app2 = Test::Mojo->new('MyApp')->app; # now $app1->sqlite and $app2->sqlite is the same state variable. You got two apps i

Re: [Mojolicious] Sharing memory amongst hypnotoad workers

2019-05-15 Thread Илья Рассадин
Hi! As you said, you can use any type of external database. If you're looking for something more simple - try Cache::FastMMap. The only way to do that without external modules (just perl core + Mojolicious) I can think of is a file, but you need to use some locking mechanism like flock. If

Re: [Mojolicious] Mojo::UserAgent installed successfully but gives while coding

2019-06-02 Thread Илья Рассадин
Hi! How did you install Mojolicious exactly? With cpanm, with git or some other way? Do you use system perl bundled with MacOSX, or do you install your own version with plenv/perlbrew? See this article for details https://www.effectiveperlprogramming.com/2015/11/apple-recommends-installing

Re: [Mojolicious] Mojo::UserAgent installed successfully but gives while coding

2019-06-02 Thread Илья Рассадин
My guess is you installed Mojolicious into perlbrew library path, but running program with system perl. For example, you have this shebang line (first line in script) #!/usr/bin/perl You need to change it to perlbrew perl. I guess, the right way to do it is line #!/usr/bin/env perl Read th

Re: [Mojolicious] Reverse Proxy

2019-09-09 Thread Илья Рассадин
Hi! Reverse proxy (such as Nginx) can proxy different requests to the different apps based on different params. For example, you have an application doing auth and application doing something only for the authorized users. So domain auth.app.com could be proxied to auth app and domain internal