Koozali.org: home of the SME Server

Mojolicious

Offline ReetP

  • *
  • 3,722
  • +5/-0
Mojolicious
« on: January 17, 2018, 11:59:30 AM »
I have posted on the devinfo list but thought I'd add something here.

I have been messing with mojolicious. There has been a lot of chat about trying to build a new server manager with it, but that would need an entire framework designed and built and is well beyond me.

So I was curious about it and my aim was to try and produce a simple panel which could integrate with the existing server manager to allow me to easily change my ipsec stuff as it has lots of config items and is tricky on the CLI and easy to make typos for important settings.

I have no idea whether I can successfully do this. However, I can see the potential of Mojo.

I have opened a git repo here if anyone is interested in playing - either make a PR or mail me your username and I can add you as a collaborator:

https://github.com/reetp/mojotests

Essentially create an ibay, make sure it allows executable content, drop the file into the cgi-bin dir and make sure the perms are set as follows:

Code: [Select]
chown root:www *.cgi;chmod 0750 *.cgi;chmod u+s *.cgi
(I am not 100% sure if that is tight enough, but it will at least run!)

Install mojo:

yum install perl-Mojolicious --enablerepo=fws

You can clone the file into the cgi-bin dir like this:

Code: [Select]
git clone https://github.com/reetp/mojotests .
The code has a hard coded link to a css file which you may want to modify.

It has a dropdown that you can select and then submit which returns you back to the original page. I am not sure yet how to capture the selected items..... I'll figure that today I hope :-)

Something that the documentation didn't easily explain here http://mojolicious.org/perldoc/Mojolicious/Plugin/TagHelper was how to get the form to actually react.

I realised you had to wrap the template tags with <form> tags which it doesn't mention !

I had this code form the docs:

Code: [Select]
<%= select_field 'networks' => [ @{ stash('stuff') }], id=> 'dropdown' %>

But it actually needed wrapping like this:

Code: [Select]
<form name="networks" action="./readtest1.cgi/agent" method="POST">
<%= select_field 'networks' => [ @{ stash('stuff') }], id=> 'dropdown' %>
<input type="submit" value="Submit">
</form>

That applies to all the helper tags....

Once I had figured that we were off to the races.

Please have a play and let me know how you get on !

...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline TerryF

  • grumpy old man
  • *
  • 1,821
  • +6/-0
Re: Mojolicious
« Reply #1 on: January 25, 2018, 11:45:08 PM »
Just a little bit of action beginning, and I do mean a beginning, first steps, BUT, if more of you get involved it has the potential to be a revolution.

Join in - https://lists.contribs.org/pipermail/devinfo/2018-January/date.html
--
qui scribit bis legit

Offline ReetP

  • *
  • 3,722
  • +5/-0
Re: Mojolicious
« Reply #2 on: January 26, 2018, 12:11:06 AM »
The dev posts are long. In short I took the following bootstrap/jquery template that Tony Keane (RIP mate) built as a quick demo:

https://home.reetspetit.net/testbay/server-manager/main.html

(Note nothing works.... it is just a framework)

And recreated the same thing plus a few simple form elements with perl-mojo:

https://home.reetspetit.net/testbay/cgi-bin/template.cgi

(The form bits do return values as proof of concept)

The basics were surprisingly easy. I built it in about 4 days of spare time having known nothing of mojo.

I spelled out my thoughts on the dev list but there is a limit to my coding.

One key point is how to modify some core elements so you get an effective API that ANY app could call with no perl knowledge. For an exprerenced dev it is probably trivial, but I am not that person.

I can probably do a certain amount but it needs greater minds than mine.

Any ideas or assistance appreciated.
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline mab974

  • *
  • 84
  • +1/-0
Re: Mojolicious
« Reply #3 on: June 13, 2019, 03:23:47 PM »
Hi,

I come back to a somewhat old subject that seems abandoned. I find it hard to accept that this interesting idea is disappearing.
I am resuming work on smeserver-manager2 based on mojolicious and I would like to share it.
I made a local build. I can build it on the buildsys server if that’s desirable.

I have reproduced the current manager behavior using a classic mojolicious application structure (without updates [actions] for now). A structure that must be enriched and improved, of course.

Your reactions are welcome as always.

smeserver-manager-0.1.0-4 available at http://repos.misouk.com/Sme_Server/7/x86_64/smeserver-manager-0.1.0-4.el7.sme.x86_64.rpm

for a  sme10 test server of course  :-)

Please note that :
  • perl-mojolicious-Plugin-I18N is required (from Epel)
  • an expand-template of /etc/httpd/admin-conf/httpd.conf is required too
  • and the classic  signal-event post-upgrade; signal-event --reboot

Offline ReetP

  • *
  • 3,722
  • +5/-0
Re: Mojolicious
« Reply #4 on: June 13, 2019, 03:44:03 PM »
Not abandoned but I do not have enough time, or enough skill to progress it.

Did you not use the AdminLTE bootstrap theme as I originally did?

You can still see it here:

https://home.reetspetit.net/testbay/smeserver-manager/old/main.html

It makes theming MUCH easier and gives it a much more modern look and feel - more 2019 instead of 1999.

I did all the hard work for that a long time ago - well actually Tony Keane did the hard work before he died.

Yes, it probably needs bootstap etc updating, and would need some more work on the layout, but you get the basic idea.

I can send you over the core code for what I did if you want.
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline TerryF

  • grumpy old man
  • *
  • 1,821
  • +6/-0
Re: Mojolicious
« Reply #5 on: June 13, 2019, 04:46:02 PM »
Your reactions are welcome as always.
for a  sme10 test server of course  :-)

I'll play :-)

Please oh please have a chat with John, we need some progress...good job...
--
qui scribit bis legit

Offline ReetP

  • *
  • 3,722
  • +5/-0
Re: Mojolicious
« Reply #6 on: June 13, 2019, 07:38:55 PM »
Note also JPP had already seup a rough "server-manager 2"

Have a look in cvs if you haven't already.

Note also my discussions regarding issues converting over some modules to make a lose 'API' that was easily accessible.

Yes, you can just try and 'recreate' the SM but this was always a chance to bring it into the 21st century as well.

By all means talk to me. Here, dev list, and best on rocket chat.
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline mab974

  • *
  • 84
  • +1/-0
Re: Mojolicious
« Reply #7 on: June 14, 2019, 09:29:39 PM »
happy to see your quick reactions.

Note also JPP had already setup a rough "server-manager 2"

I started there... but did not find all the patches.

Note also my discussions regarding issues converting over some modules to make a lose 'API' that was easily accessible.

I admit I got a little lost in that long e-mail exchange, a year later.


Did you not use the AdminLTE bootstrap theme as I originally did?

I’m just trying to define an architecture for now and yes I am interested in the work you have produced and that of stefano too.

For sure there are many possibilities and there will no doubt be difficulties of choice.

Offline brianr

  • *
  • 988
  • +2/-0
Re: Mojolicious
« Reply #8 on: June 16, 2019, 08:44:03 PM »
Hi,

I come back to a somewhat old subject that seems abandoned. I find it hard to accept that this interesting idea is disappearing.
I am resuming work on smeserver-manager2 based on mojolicious and I would like to share it.
I made a local build. I can build it on the buildsys server if that’s desirable.

I have reproduced the current manager behavior using a classic mojolicious application structure (without updates [actions] for now). A structure that must be enriched and improved, of course.

Your reactions are welcome as always.

smeserver-manager-0.1.0-4 available at http://repos.misouk.com/Sme_Server/7/x86_64/smeserver-manager-0.1.0-4.el7.sme.x86_64.rpm

for a  sme10 test server of course  :-)

Please note that :
  • perl-mojolicious-Plugin-I18N is required (from Epel)
  • an expand-template of /etc/httpd/admin-conf/httpd.conf is required too
  • and the classic  signal-event post-upgrade; signal-event --reboot

I am trying to install this, but getting this:

Error: Package: smeserver-manager-0.1.0-4.el7.sme.x86_64 (/smeserver-manager-0.1.0-4.el7.sme.x86_64)
           Requires: perl-Mojolicious-Plugin-I18N >= 1.6.2
           Available: perl-Mojolicious-Plugin-I18N-1.6-2.el7.noarch (epel)
               perl-Mojolicious-Plugin-I18N = 1.6-2.el7
Brian j Read
(retired, for a second time, still got 2 installations though)
The instrument I am playing is my favourite Melodeon.
.........

Offline mab974

  • *
  • 84
  • +1/-0
Re: Mojolicious
« Reply #9 on: June 16, 2019, 09:17:58 PM »
Install the plugin first :
Code: [Select]
yum install perl-Mojolicious-Plugin-I18N  --enablerepo=epel

Offline brianr

  • *
  • 988
  • +2/-0
Re: Mojolicious
« Reply #10 on: June 17, 2019, 07:32:33 AM »
Install the plugin first :
Code: [Select]
yum install perl-Mojolicious-Plugin-I18N  --enablerepo=epel

It still fails, note the difference between the dependency name and the name of the module (1.6-2 vs 1.6.2)

Code: [Select]
[root@sme10 ~]# yum install perl-Mojolicious-Plugin-I18N  --enablerepo=epel
Loaded plugins: fastestmirror, post-transaction-actions, priorities, smeserver
Loading mirror speeds from cached hostfile
 * base: mirror.netweaver.uk
 * epel: anorien.csc.warwick.ac.uk
 * smeaddons: mirror.pialasse.com
 * smeextras: mirror.pialasse.com
 * smeos: mirror.pialasse.com
 * smeupdates: mirror.pialasse.com
 * updates: mirror.econdc.com
epel                                                                                    | 5.3 kB  00:00:00     
323 packages excluded due to repository priority protections
Resolving Dependencies
--> Running transaction check
---> Package perl-Mojolicious-Plugin-I18N.noarch 0:1.6-2.el7 will be installed
--> Processing Dependency: perl(Mojolicious) >= 5 for package: perl-Mojolicious-Plugin-I18N-1.6-2.el7.noarch
--> Processing Dependency: perl(Mojo::Base) for package: perl-Mojolicious-Plugin-I18N-1.6-2.el7.noarch
--> Processing Dependency: perl(Mojo::URL) for package: perl-Mojolicious-Plugin-I18N-1.6-2.el7.noarch
--> Processing Dependency: perl(Mojolicious::Plugin) for package: perl-Mojolicious-Plugin-I18N-1.6-2.el7.noarch
--> Running transaction check
---> Package perl-Mojolicious.noarch 0:7.94-2.el7 will be installed
--> Processing Dependency: perl(JSON::PP) for package: perl-Mojolicious-7.94-2.el7.noarch
--> Running transaction check
---> Package perl-JSON-PP.noarch 0:2.27202-2.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===============================================================================================================
 Package                                  Arch               Version                    Repository        Size
===============================================================================================================
Installing:
 perl-Mojolicious-Plugin-I18N             noarch             1.6-2.el7                  epel              13 k
Installing for dependencies:
 perl-JSON-PP                             noarch             2.27202-2.el7              base              55 k
 perl-Mojolicious                         noarch             7.94-2.el7                 epel             1.0 M

Transaction Summary
===============================================================================================================
Install  1 Package (+2 Dependent packages)

Total download size: 1.1 M
Installed size: 2.1 M
Is this ok [y/d/N]: y
Downloading packages:
(1/3): perl-JSON-PP-2.27202-2.el7.noarch.rpm                                            |  55 kB  00:00:00     
(2/3): perl-Mojolicious-Plugin-I18N-1.6-2.el7.noarch.rpm                                |  13 kB  00:00:00     
(3/3): perl-Mojolicious-7.94-2.el7.noarch.rpm                                           | 1.0 MB  00:00:00     
---------------------------------------------------------------------------------------------------------------
Total                                                                          1.4 MB/s | 1.1 MB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
  Installing : perl-JSON-PP-2.27202-2.el7.noarch                                                           1/3
  Installing : perl-Mojolicious-7.94-2.el7.noarch                                                          2/3
  Installing : perl-Mojolicious-Plugin-I18N-1.6-2.el7.noarch                                               3/3
  Verifying  : perl-JSON-PP-2.27202-2.el7.noarch                                                           1/3
  Verifying  : perl-Mojolicious-Plugin-I18N-1.6-2.el7.noarch                                               2/3
  Verifying  : perl-Mojolicious-7.94-2.el7.noarch                                                          3/3

Installed:
  perl-Mojolicious-Plugin-I18N.noarch 0:1.6-2.el7                                                             

Dependency Installed:
  perl-JSON-PP.noarch 0:2.27202-2.el7                   perl-Mojolicious.noarch 0:7.94-2.el7                 

Complete!
[root@sme10 ~]# yum localinstall ./smeserver-manager-0.1.0-4.el7.sme.x86_64.rpm
Loaded plugins: fastestmirror, post-transaction-actions, priorities, smeserver
Examining ./smeserver-manager-0.1.0-4.el7.sme.x86_64.rpm: smeserver-manager-0.1.0-4.el7.sme.x86_64
Marking ./smeserver-manager-0.1.0-4.el7.sme.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package smeserver-manager.x86_64 0:0.1.0-4.el7.sme will be installed
--> Processing Dependency: perl-Mojolicious-Plugin-I18N >= 1.6.2 for package: smeserver-manager-0.1.0-4.el7.sme.x86_64
Loading mirror speeds from cached hostfile
 * base: mirror.freethought-internet.co.uk
 * smeaddons: mirror.pialasse.com
 * smeextras: mirror.pialasse.com
 * smeos: mirror.pialasse.com
 * smeupdates: mirror.pialasse.com
 * updates: mirror.econdc.com
--> Finished Dependency Resolution
Error: Package: smeserver-manager-0.1.0-4.el7.sme.x86_64 (/smeserver-manager-0.1.0-4.el7.sme.x86_64)
           Requires: perl-Mojolicious-Plugin-I18N >= 1.6.2
           Installed: perl-Mojolicious-Plugin-I18N-1.6-2.el7.noarch (@epel)
               perl-Mojolicious-Plugin-I18N = 1.6-2.el7
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest
[root@
Brian j Read
(retired, for a second time, still got 2 installations though)
The instrument I am playing is my favourite Melodeon.
.........

Offline mab974

  • *
  • 84
  • +1/-0
Re: Mojolicious
« Reply #11 on: June 17, 2019, 08:49:53 AM »
you’re right. I’m looking at it today.

Offline mab974

  • *
  • 84
  • +1/-0
Re: Mojolicious
« Reply #12 on: June 17, 2019, 12:08:22 PM »
new release : http://repos.misouk.com/Sme_Server/7/x86_64/smeserver-manager-0.1.0-5.el7.sme.x86_64.rpm

  • perl-mojolicious-Plugin-I18N is required (from Epel)
  • no more need to manually expand /etc/httpd/admin-conf/httpd.conf
  • signal-event post-upgrade; signal-event --reboot
  • access with "https://your_server/server-manager2"
  • only modules in Miscellaneous  and online-manual have changed

Offline brianr

  • *
  • 988
  • +2/-0
Re: Mojolicious
« Reply #13 on: June 17, 2019, 01:07:51 PM »
Ok, that installed fine.

However it is not letting me login using the admin/root password.

I'v'e checked the password is correct using the text based server manager from the text config.
Brian j Read
(retired, for a second time, still got 2 installations though)
The instrument I am playing is my favourite Melodeon.
.........

Offline mab974

  • *
  • 84
  • +1/-0
Re: Mojolicious
« Reply #14 on: June 17, 2019, 04:27:42 PM »
Strange, it is the same login that server-manager.

I have verified on my test server in text and normal mode, manager and manager2 : all is ok !!

I suppose that you are testing with admin username and password....

Do you have some informations in log files ?

Offline janet

  • ****
  • 4,812
  • +0/-0
Re: Mojolicious
« Reply #15 on: June 18, 2019, 02:35:53 AM »
brianr

I have vague recollections of a similar ssue in the past that had something to do with multiple instances running, was it httpd-admin ?
Have a look with
htop
or
ps -aux

Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline brianr

  • *
  • 988
  • +2/-0
Re: Mojolicious
« Reply #16 on: June 18, 2019, 10:16:54 AM »
brianr

I have vague recollections of a similar ssue in the past that had something to do with multiple instances running, was it httpd-admin ?
Have a look with
htop
or
ps -aux

Still happening, tried reboot. Looked at ps -aux and can only see one runsrv httpd-admin.  Nothing in the logs.  However it also won't allow me to login using the "old" server manager, except as above using the text version from the config screens.

However I also remember some sort of problem involving cookies, so I fired up Chrome instead of Firefox and I can now get in.

Brian j Read
(retired, for a second time, still got 2 installations though)
The instrument I am playing is my favourite Melodeon.
.........

Offline ReetP

  • *
  • 3,722
  • +5/-0
Re: Mojolicious
« Reply #17 on: June 18, 2019, 10:56:01 AM »
I have reproduced the current manager behavior using a classic mojolicious application structure (without updates [actions] for now). A structure that must be enriched and improved, of course.

Ok, for those playing please note there is a MASSIVE difference between what I did and the work here.

My approach was to use Mojo as a simple templating system. A passive, drop in replacement for Formmagick.

Mabs approach is completely the reverse.

He is using Mojo as an entire application. It effectively runs as a stand alone server. That may well be where you are struggling with testing.

Personally I do not believe this is a good approach.

It is complex.
No one else round here currently has the skills to work on it.
It means the entire server-manager needs rebuilding including, every single contrib
It is another 'application' to maintain

The approach I took was different.

It was effectively JUST a drop in replacement for Formmagick. Yes, it does need work on some backend code, but even an idiot like me is capable of doing lot of it.

It has the benefit that when the backend code is tidied (removing Formmagick code from the perl files in /usr/share/perl5/vendor_perl and moving it to /etc/e-smith/web) you could use something else as your templating system.

Now, I fully admit I am not really a great judge of this due to my poor coding skills, and I had been asking if my approach was wrong, but no one ever replied.

I have written to mab to try and explain this in more depth but realised it might be worth pointing out the difference in approaches and where you may be struggling (another reason I stuck with simple templates rather than an 'application' - less to break)

Also, the approach is substantially different enough it should have a completely different rpm as there may be conflicts with my original code/rpms
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline brianr

  • *
  • 988
  • +2/-0
Re: Mojolicious
« Reply #18 on: June 18, 2019, 12:01:16 PM »
Ok ,so I spent about an hour on this and can see how the system hangs together, something I never really managed with the current formagick system.

My personal preference would be something NOT based on perl (ducks behind parapet), but I can see that makes no sense in the context of all the other code in smeserver which IS based on perl and could/should not be replaced on the if not broken don't fix it principle.

I think the general feeling is that the smeserver based on formmagick IS broken and needs a replacemenmt.

I suspect that whatever system we adopt to replace the current one will require some investment in learning and then some grunt work translating the current panels to the next format.

If you look at

etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/templates/starterwebsite.html.ep

And compare it with

/etc/e-smith/web/functions/starterwebsite

You might be able to see that the structure is similar although the syntax is quite different.

My own opinion....YMMV

Brian j Read
(retired, for a second time, still got 2 installations though)
The instrument I am playing is my favourite Melodeon.
.........

Offline ReetP

  • *
  • 3,722
  • +5/-0
Re: Mojolicious
« Reply #19 on: June 18, 2019, 01:40:16 PM »
Ok ,so I spent about an hour on this and can see how the system hangs together, something I never really managed with the current formagick system.

Yes, I understand the fundamentals of mabs code. I'll cover the 'but' in a bit.

It isn't difficult to understand fundamentally how serevr-manager currently works. If I can work it out, anyone can!! It was just never worth investing any further time in it.

Before bandying about what may or may not be a great idea, you really need to get your head round how it DOES work now in the first place.

You can go on your server and look at this easily.

In a perfect world you just have a set of Formmagick template files in:
/etc/e-smith/web/functions

They use functions that are in the files in:
/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel

If you have the wbl package it is a simple and very neat way of demonstrating this.

The file web/function/wbl is a formmagick template that calls some routines in FormMagick/Panel/wbl.pm

So in an ideal you could just rip out the FM template, add a new form of template system and call the original routines. Simples.

However, the issue is that some developers decided to use FM formatting in the pm files, which makes removing FM as a whole more bothersome, but not impossible. Even I can do some of it. It is just some time.

The old adage of separating form from content. The perl routines stay in the pm files, and templating code goes in 'function' files.

Quote
I think the general feeling is that the smeserver based on formmagick IS broken and needs a replacement.

No, it isn't that it is broken. It is because FormMagick is way old, unsupported, and not easy to learn and use. It therefore needs replacing.

Quote
My personal preference would be something NOT based on perl (ducks behind parapet), but I can see that makes no sense in the context of all the other code in smeserver which IS based on perl and could/should not be replaced on the if not broken don't fix it principle.

I am nor a perl evangelist - I can barely code quite frankly. But it is actually pointless because the whole backend relies on Perl. You would have to rip out the entire SME templating system (which is what it is after all) and rebuild it from the ground up.

HOWEVER, if you read what I have previously said, if we were really smart, I believe we can create new templates (just using Mojolicious as a templating system) which can output code as html, OR as JSON.

And if you can do that, you have the basics of an API, which can then be queried by whatever language you like. And you don't need to know anything about the perl behind it

Think:

server panel <- html -> mojo template <-> perl routine

PHP/python <- API/JSON -> mojo template <-> perl routine

The difference is in the query type.

if (type=html){
sub get_somedata()
output_somehtml
}

if (type=json){
sub (get_somedata($query)
output_somejson
}

/server-manager/wbl?type=json&query=get_dnsblist

Get the idea?

Quote
I suspect that whatever system we adopt to replace the current one will require some investment in learning and then some grunt work translating the current panels to the next format.

Yup - there will be an investment of time and effort somewhere.

The method I have suggested, assuming it is correct, will probably be easier and quicker. Especially if someone knowledgeable gave me a hand. So far I had zero assistance beyond answers to a couple of technical questions, despite requests for people to test and help.

Quote
If you look at
etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/templates/starterwebsite.html.ep

And compare it with
/etc/e-smith/web/functions/starterwebsite

You might be able to see that the structure is similar although the syntax is quite different.

Well, yes and no.

If you looked at my original templates, you would be able to see exactly the same thing.

But I DIDN'T need an entire new running application to do it. And it is simple enough that *I* can do it.

The system that mab has proposed is clever, but much more complicated. It is effectively a complete application, not just some templating. And possibly overkill. I won't be able to write anything for it as it is way over my head and the point was to try and lower the bar to entry, not raise it.

You have to consider who is going to maintain it, whose is going to convert existing contribs, and who is going to be able to write new ones?

We are not swimming in developers here.........

...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline TerryF

  • grumpy old man
  • *
  • 1,821
  • +6/-0
Re: Mojolicious
« Reply #20 on: June 19, 2019, 12:46:50 AM »
Over my head on many levels, but do subscribe whenever possible to the KISS principle :-)
--
qui scribit bis legit

Offline mab974

  • *
  • 84
  • +1/-0
Re: Mojolicious
« Reply #21 on: June 19, 2019, 08:58:10 AM »
First of all, the proposal I am putting forward is just one element that I bring to the table.
I don’t have any a-priori I just want things to move for SME.

It is far from being achieved, and I have deliberately limited it, for the sake of time, to a sufficiently meaningful set.
Added to that I’m not a Perl developer...

It is not based on server mode and is not the most common solution among existing applications. Besides, the problem of performance could be posed. But one can assume that the number of admin per server is never very high.

In short Perl or not? Mojolicious as solution? For what part?

And if the most reasonable way (playable!) given the means was the cohabitation of FormMagick and Mojolicious for existing modules, a progressive conversion and a new form for the new modules and an immediate contribution of an API (which I don’t fully understand for the moment).

Anyway, this transition to Mojolicious would obviously require time and efforts, probably more in tests and debugging than in transcription.

I have written to mab to try and explain this in more depth .

i have not received it yet !?

You have to consider who is going to maintain it, whose is going to convert existing contribs, and who is going to be able to write new ones?

this is the whole future of SME.... Who maintains the existing one? Maintain this or that....

Ps: Sorry if my ideas are not always well expressed. Dual translation is a difficult task and can lead to misunderstandings which are obviously incidental.

Offline TerryF

  • grumpy old man
  • *
  • 1,821
  • +6/-0
Re: Mojolicious
« Reply #22 on: June 19, 2019, 09:18:09 AM »
Mate you are to be applauded, you are one of the very few who has jumped in .. JPP is also more than well worth a chat. Just now he is maxed out so may have to wait a short time..

Either way please stay with it, look at what John has been up to, we need the help.
--
qui scribit bis legit

Offline ReetP

  • *
  • 3,722
  • +5/-0
Re: Mojolicious
« Reply #23 on: June 20, 2019, 02:29:11 PM »
i have not received it yet !?

Sent to mab974 at your gmail address. I think there may be more than one.

Check your Junk?
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline mab974

  • *
  • 84
  • +1/-0
Re: Mojolicious
« Reply #24 on: June 21, 2019, 06:57:44 AM »
Sent to mab974 at your gmail address. I think there may be more than one.

Check your Junk?

yes, all your mails in spam actually. "Rocket" looks a bit aggressive  :smile:

thanks

Offline ReetP

  • *
  • 3,722
  • +5/-0
Re: Mojolicious
« Reply #25 on: June 21, 2019, 11:20:38 AM »
yes, all your mails in spam actually. "Rocket" looks a bit aggressive  :smile:

Rocket is great !!!!

We don't bite..... ;-)

A good place to practice your English, and Jean Philippe is French.....

Anyone who wants an account to come and chat is welcome. Just ask me.
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline TerryF

  • grumpy old man
  • *
  • 1,821
  • +6/-0
Re: Mojolicious
« Reply #26 on: June 21, 2019, 01:18:03 PM »
Its safe mab :-) just us old farts
--
qui scribit bis legit

Offline ReetP

  • *
  • 3,722
  • +5/-0
Re: Mojolicious
« Reply #27 on: June 21, 2019, 03:18:50 PM »
Its safe mab :-) just us old farts

:rofl:
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline mab974

  • *
  • 84
  • +1/-0
Re: Mojolicious
« Reply #28 on: June 24, 2019, 07:46:30 PM »
Hi,

In fact, there is not a lot of differences between the two approaches. The use of Mojolicious is the same, the difference is the scope.

The use:
Routes, Templates, Controllers (or not) and existing routines ( +/- adapted).

The "complete" structure is just a "familiar" way to store the different files cleanly : lib (Controllers), conf, public, templates and so on... Particularly when the modules number is growing.

I’m not sure we can avoid "Controllers" at least to separate modules and main program.
Other things have to be adapted to SME : conf, log, ...

The scope:
Maybe I was wrong about the scope of the project. I was convinced of a new version of server-manager and the progressive replacement of FormMagick.

Perhaps I am too optimistic and the ambitions should be lowered. But I think we need to aim for the SME9 EOL (11/2020) and give us an interesting target. It’s doable.



Offline TerryF

  • grumpy old man
  • *
  • 1,821
  • +6/-0
Re: Mojolicious
« Reply #29 on: June 24, 2019, 09:26:55 PM »
As they said in the movie, "build it and they will come", with you in it to the hilt, anything I can do just a shout away..
--
qui scribit bis legit

Offline TerryF

  • grumpy old man
  • *
  • 1,821
  • +6/-0
Re: Mojolicious
« Reply #30 on: June 25, 2019, 01:18:07 AM »
Suggestion only :-) go the simple route first, quicker, less development work? dunno with that as I am a child in the codeing stakes. 

The sooner we can run a usable system up the mast the better :-) and it might encourage others with the where for all to get involved as well..
--
qui scribit bis legit

Offline ReetP

  • *
  • 3,722
  • +5/-0
Re: Mojolicious
« Reply #31 on: June 26, 2019, 01:53:44 AM »

The scope:
Maybe I was wrong about the scope of the project. I was convinced of a new version of server-manager and the progressive replacement of FormMagick.

Replacement of FormMagick with a different templating system was the real task.

As you will find, server manager is a deep dark rabbithole. To replace more will mean ripping out and rewriting a lot of perl code.

Trying to separate parts of that and replace it with something else, be it perl or PHP or cockpit is not easy (just ask nethesis.....)

So the 'simplest' task is to focus on replacing FM. Hence my approach. It does not to be complicated, or be a running application.

Just separate the style from the content/function.

This would be a big leap forwards.

I did this as a proof of concept with some mojo templates and a rough but working bootstrap responsive UI, but no one seemed to bother looking, or just ignored it.

Once you have that out of the way you can look at a number of different dev pathways

I believed we could build an accessible API 'layer' using Mojo on top of the existing perl functions (why reinvent the wheel?).

The great thing about mojo is that it is as happy outputting html as it is json.

So then you can build any frontend, anywhere, in any language, and link it via the API.

What no one has said to me so far about my test code is 'you can't do it that way because of x y or z technical reason'.

So, all anyone has to do is convince me of a better path.

I see your 'full working version' and yes, if you were building from the ground up then that is probably the right approach.

But I think it might be overkill right now (I do not know how much is required in the way of routes/controllers etc if we JUST try and replace the templates)
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation