Project

General

Profile

Todo #5575

Todo #5568: Convert Package PHP GUI Files to Bootstrap

Convert the pfSense package HAProxy-devel (net/pfSense-pkg-haproxy-devel) to Bootstrap

Added by Jim Pingle over 3 years ago. Updated over 3 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
haproxy
Target version:
Start date:
12/03/2015
Due date:
% Done:

100%

Estimated time:

Description

Convert the pfSense package HAProxy-devel (net/pfSense-pkg-haproxy-devel) to Bootstrap

History

#1 Updated by Pi Ba over 3 years ago

FYI, I'm making some progress on this mostly local a.t.m. writing here so it wont be that two people start doing the same work..

#2 Updated by wolf noble over 3 years ago

Eager to try this out. Let me know if I can help

#3 Updated by Pi Ba over 3 years ago

First bootstrapped version of haproxy-devel 0.36 should be available in a few days..
Pullrequest is send, https://github.com/pfsense/FreeBSD-ports/pull/41

If you could test it once available please let me know if anything is not working as expected. Will be checking some stuff here to, but most "should" be functional, and mostly bootstrapped.

#4 Updated by Jim Pingle over 3 years ago

I merged the pull request, rebuild should happen automatically shortly.

#5 Updated by wolf noble over 3 years ago

Sqee!

I'll wire up my config to this today and see how it plays out! Thanks a bunch!

#6 Updated by Pi Ba over 3 years ago

@Jim P, are you sure the build properly got started or perhaps there was some error? 3 hours after commit the package binary does not seem updated. (p.s. what is expected build time after a commit?)

#7 Updated by Jeremy Porter over 3 years ago

Build errored:
install -m 0644 /usr/ports/net/pfSense-pkg-haproxy-devel/files/usr/local/www/javascript/haproxy_geturl.js /wrkdirs/usr/ports/net/pfSense-pkg-haproxy-devel/work/stage/usr/local/www/javascript
install: /usr/ports/net/pfSense-pkg-haproxy-devel/files/usr/local/www/javascript/haproxy_geturl.js: No such file or directory
  • Error code 71

Not sure what that means, normally builds are done in a few minutes (5-10m) when things are working.

#8 Updated by Pi Ba over 3 years ago

ok thanks, seems i missed those file references, i changed the javascript folder, but forgot to update this file again after some troubles with tortoisegit..
New pullrequest https://github.com/pfsense/FreeBSD-ports/pull/42 send to fix that, should i bump version to 0.37 also? Or will 0.36 automatically try to build again?

#9 Updated by wolf noble over 3 years ago

Should the'View more information' link for this package presented on pkg_mgr_installed.php point to https://doc.pfsense.org/index.php/Haproxy_package ?
that page seems out of date. Not sure if there's a more relevant location

#10 Updated by wolf noble over 3 years ago

Settings made to the 'Global Advanced pass thru' textarea box in haproxy_global.php are at least DISPLAYED without linebreaks.
I'm uncertain as of this moment if they're saved in the config file properly or not. working through importing the rest of my config

#11 Updated by Pi Ba over 3 years ago

Thanks for these comments.

The linebreaks in the 'Global Advanced pass thru' seem to be caused by the css added by setNoWrap() on "Chrome Versie 47.0.2526.106 m" it does 'seem' to work properly with the current white-space:nowrap; but this will need to be changed in the pfSense form classes to white-space:pre;, the Chrome implementation has a bug for that though, chromium does not. Ive asked for that to be changed. https://redmine.pfsense.org/issues/5725

As for the information link ill change that to my wiki page.. https://github.com/PiBa-NL/pfsense-haproxy-package-doc/wiki

If youve found any other issues please let me know.

#12 Updated by wolf noble over 3 years ago

The init script /usr/local/etc/rc.d/haproxy.sh breaks, as the ENDOFF terminator gets greedy. Change the terminators to be unique between haproxy_start and haproxy_check.

also, /usr/local/etc/rc.d/haproxy references the wrong path to haproxy.conf... currently it seems to reside at /var/etc/haproxy/haproxy.cfg, not /usr/local/etc/haproxy.conf like the script expects.

even after fixing those, however, haproxy didn't seem to get started by the scripts on the master carp node.

manually starting haproxy with /usr/local/sbin/haproxy -f /var/etc/haproxy/haproxy.cfg on the master did seem to get things going.

Clicking on 'restart' in status_services.php on haproxy  resulted in the following log on the master system.log:
Jan 11 03:33:00 underthing php-fpm[67513]: /haproxy_global.php: Beginning HAProxy XMLRPC sync to https://X.X.X.2:443.
Jan 11 03:33:05 underthing php-fpm[67513]: /haproxy_global.php: HAProxy XMLRPC sync successfully completed with https://X.X.X.2:443.
Jan 11 03:33:05 underthing php-fpm[67513]: /haproxy_global.php: HAProxy XMLRPC reload data https://X.X.X.2:443.
Jan 11 03:33:09 underthing php-fpm[67513]: /haproxy_global.php: HAProxy XMLRPC reload data success with https://X.X.X.2:443 (exec_php).
Jan 11 03:33:09 underthing php-fpm[67513]: /haproxy_global.php: Beginning HAProxy XMLRPC sync to https://X.X.X.2:443.
Jan 11 03:33:12 underthing php-fpm[67513]: /haproxy_global.php: HAProxy XMLRPC sync successfully completed with https://X.X.X.2:443.
Jan 11 03:33:12 underthing php-fpm[67513]: /haproxy_global.php: HAProxy XMLRPC reload data https://X.X.X.2:443.
Jan 11 03:33:16 underthing php-fpm[67513]: /haproxy_global.php: HAProxy XMLRPC reload data success with https://X.X.X.2:443 (exec_php).
Jan 11 03:33:16 underthing php-fpm[67513]: /haproxy_global.php: Checked cron job for /usr/local/etc/rc.d/haproxy.sh onecheck, no change needed
Jan 11 03:33:16 underthing php-fpm[67513]: /haproxy_global.php: Stopping haproxy on CARP backup.
Jan 11 03:33:30 underthing php-fpm[69400]: /status_services.php: The command '/usr/local/etc/rc.d/haproxy.sh stop' returned exit code '1', the output was 'Stopping haproxy. Waiting for PIDS: 83927. Stopping haproxy. No matching processes were found'
Jan 11 03:33:30 underthing php-cgi: config.inc: Beginning HAProxy XMLRPC sync to https://X.X.X.2:443.
Jan 11 03:33:34 underthing php-cgi: config.inc: HAProxy XMLRPC sync successfully completed with https://X.X.X.2:443.
Jan 11 03:33:34 underthing php-cgi: config.inc: HAProxy XMLRPC reload data https://X.X.X.2:443.
Jan 11 03:33:37 underthing php-cgi: config.inc: HAProxy XMLRPC reload data success with https://X.X.X.2:443 (exec_php).
Jan 11 03:33:37 underthing php-cgi: config.inc: Checked cron job for /usr/local/etc/rc.d/haproxy.sh onecheck, no change needed

and haproxy was no longer running. Manually starting it again seemed to work.

I'll look into this more tomorrow. Gotta go to bed now tho.

#13 Updated by Pi Ba over 3 years ago

Looks like the 'space' character behind the first ENDOFF terminater made it go wrong..
After removing that it seems to work properly. Other than that Haproxy is always started by haproxy.inc which uses the correct path for the config file.
Nonetheless it needs to fixed, will do that soon.

#14 Updated by Pi Ba over 3 years ago

carp check also needs some changes.. will fix that to..

#15 Updated by wolf noble over 3 years ago

When you click 'apply changes' on a carp setup, it can often take some time for the changes to propagate.

system log after hitting apply:

Jan 12 04:34:31 underthing check_reload_status: Syncing firewall
Jan 12 04:34:32 underthing php-fpm[17445]: /rc.filter_synchronize: Beginning XMLRPC sync to https://198.18.100.2:443.
Jan 12 04:34:33 underthing php-fpm[18883]: /haproxy_pools.php: Beginning HAProxy XMLRPC sync to https://198.18.100.2:443.
Jan 12 04:34:39 underthing php-fpm[17445]: /rc.filter_synchronize: XMLRPC sync successfully completed with https://198.18.100.2:443.
Jan 12 04:34:43 underthing php-fpm[18883]: /haproxy_pools.php: HAProxy XMLRPC sync successfully completed with https://198.18.100.2:443.
Jan 12 04:34:43 underthing php-fpm[18883]: /haproxy_pools.php: HAProxy XMLRPC reload data https://198.18.100.2:443.
Jan 12 04:34:47 underthing php-fpm[17445]: /rc.filter_synchronize: Filter sync successfully completed with https://198.18.100.2:443.
Jan 12 04:34:50 underthing php-fpm[18883]: /haproxy_pools.php: HAProxy XMLRPC reload data success with https://198.18.100.2:443 (exec_php).
Jan 12 04:34:50 underthing php-fpm[18883]: /haproxy_pools.php: Beginning HAProxy XMLRPC sync to https://198.18.100.2:443.
Jan 12 04:34:55 underthing php-fpm[18883]: /haproxy_pools.php: HAProxy XMLRPC sync successfully completed with https://198.18.100.2:443.
Jan 12 04:34:55 underthing php-fpm[18883]: /haproxy_pools.php: HAProxy XMLRPC reload data https://198.18.100.2:443.
Jan 12 04:34:58 underthing php-fpm[18883]: /haproxy_pools.php: HAProxy XMLRPC reload data success with https://198.18.100.2:443 (exec_php).
Jan 12 04:34:58 underthing php-fpm[18883]: /haproxy_pools.php: Checked cron job for /usr/local/etc/rc.d/haproxy.sh onecheck, no change needed
Jan 12 04:34:58 underthing php-fpm[18883]: /haproxy_pools.php: Stopping haproxy on CARP backup.

That's almost 30 seconds the user sits with a slowly progressing red status bar.
Is there an easy way to provide a little more feedback of events occurring behind the scenes in the UI?

#16 Updated by wolf noble over 3 years ago

I entered a custom HTTP string in the Http check version textarea of the Health Checking section of the Edit HAProxy Backend Server pool panel on the backend tab; served from haproxy_pool_edit.php

The notes underneath the textara box say to use the following syntax in the textare: "HTTP/1.1 Host:\ www"

However the quotes seem to be escaped, or at least displayed escaped, upon subsequent views to the backend in question

#17 Updated by Pi Ba over 3 years ago

The quote's are not supposed to be part of the text put into the field.. Maybe i should just remove them completely. I ment to just quote a piece of text "like this" but putting it also on a separate line i see why it starts being confusing. Also some \r\n text is 'missing' from there.

HTTP/1.1\r\nHost:\ www

#18 Updated by Pi Ba over 3 years ago

As for the xmlrpcsync, ill try and see if can make that happen 'asynchronously'. So the user does not need to wait for it to finish..

#19 Updated by Pi Ba over 3 years ago

@Wolf Noble, if you've got some time, please take another look at the current 0.39 package, it should have all points above fixed.

#20 Updated by Jim Pingle over 3 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

This one looks ok from a Bootstrap point of view. PiBa is going to sync it over on top of the main haproxy package at which point the other one can be marked resolved as well.

#21 Updated by Jim Pingle over 3 years ago

  • Assignee set to Jim Pingle

#22 Updated by wolf noble over 3 years ago

Hi there,

from any of the main tabbed haproxy pages IE /haproxy/haproxy_global.php
the 'restart service' link in the upper right sends the user to

/haproxy/status_services.php?mode=restartservice&service=HAProxy

which results in a 404.

/status_services.php?mode=restartservice&service=HAProxy

seems to be the url that we want?

#23 Updated by Jim Pingle over 3 years ago

Bring that up on the forum or a new ticket, it's not related to the Bootstrap conversion, but other work done on the package.

#24 Updated by Pi Ba over 3 years ago

Pullrequest is 'pending' for that one.. https://github.com/pfsense/pfsense/pull/2499

Also available in: Atom PDF