
serge
Members-
Posts
695 -
Joined
-
Last visited
-
Days Won
6
Everything posted by serge
-
I manage thousand of domains, and I would say, I tested OVH before doing this business and in my opinions OVH is very very bad for domains, at API or even from their interface you can not really do bulk update, and their desktop application bad.
-
Thank You! Just testing it, very nice! only thing, I found my logo very big in my HTML invoice, when ok in PDF invoice, please, see attachements
-
I also experienced this reported bug before. All of this is coming because 2 differents documents type (unpaid invoice and paid invoice) are sharing at some point same sequential numbering in a single column "id_value" at Table "invoices" in database. 1/ Proforma (unpaid invoice or quote by the way) Are not really sequential number by now in Blesta because it's re-use old previous number that was existing before (before the switch at payment "date_closed"), so at different time, you can send to different customers , proforma using an old used sequence number "id_value" that was again released. So, it's a traceability & commercial issue. All proforma should be related to an unique content/proposal. 2/Paid invoice should have their very own sequential numbering, created from the payment date (this sequential number column is now missing in Blesta, this new column could be "id_paid") What accountability request in EU (but not only there), is Paid invoice number are sequential and without numbering interruption (missing number between paid invoices), and the more easy is just to base the number sequence on the payment date, and not like now from proforma sequence, because not all proforma will be paid... ----------- Unpaid vs paid are 2 separate "documents" type for the sequencing number UNPAID: sequencing is based on creation of the document itself ("date_billed" in table "invoices"), it's ever "id_value", but it's should be persistent (never be changed when invoice is closed) PAID: sequencing number should be based on payment date more exactly "date_closed" in Table "invoices", so it will be more suitable to have a new column "id_paid" in Table "invoices" In place of: like Blesta is working now by only sharing "id_value" for both type (unpaid & paid). So my proposal to solve the issue, will be easy to implement as it's do not change a lot the way Blesta work and for old data, it's will be easy to create the missing paid invoice sequencial "id_paid" number with an Blesta upgrade & SQL query, as "date_closed" is ever know in the database. I past here bellow more detail I given in this post: http://www.blesta.com/forums/index.php?/topic/3306-pro-forma-invoices-numbering-are-not-sequential/page-3
-
Send Notify Email About General Blesta's Cron Task Locked Or Stalled
serge replied to serge's topic in Contribute
Thxs, I updated my above instruction at step 2/ , in case you are not using UTC time at your Blesta admin area & menu: /settings/company/general/localization/ There could be an improvement for later, in the condition the blesta cron is found "not ok", & after send the warning email, we could add some cleaning or check in the Blesta tables "log_cron" & "cron_task_runs", and followed by one webcron request, as it's seem the Blesta webcron or a manual cron request from blesta interface is able to restart "locked/frozen" cron process, if some "cleaning have been done before in the db or if the 6 hours from Blesta cron script have expired, I would prefer my script do also the cleaning VS waiting 6 hours. -
I do not have shared server, so I can not say at 100% are you able to edit crontab or add cron on a shared server? have you console access? try this to edit crontab in console: crontab -u YOUR-USER -e Or more simple, just use your control panel menu to add a new cron. As said above I can not say at 100% for shared server, I do not have, so I can not try Be aware that by design webcron will not be working with solo, it's made for internally initiated cron VS cron run from URL (webcron) and basically to create solo from an other way than command line (console), just copy file content here: http://timkay.com/solo/solo create solo file without file extension, and make this file executable, and place this file at any place you want (level above of public_html are better for security , and adapt cronjob line with your given path to solo file
-
Just posted in the contribute section, : http://www.blesta.com/forums/index.php?/topic/4073-send-notify-email-about-general-blestas-cron-task-locked-or-stalled/
-
Attached to this post, a poor man's cron script to check "health" of Blesta cron Basically it's check in Blesta log being in Blesta database & table log_cron what is the max of end_date when `run_id` ='0' run_id` ='0 in table log_cron is matching to such Blesta cron output: "Attempting to run all tasks for ? XXX-COMPANY ? XXX-COMPANY.. All tasks have been completed." so this cron script definite an acceptable last cron end_date ($Accepted_last_end_date) from time now, it's (timeNow -30mins) but you can change it as explained in bellow instruction, so if Blesta end_date in table log_cron was older(inferior) than this $Accepted_last_end_date, you will receive an email (by smtp), and no more email will be sent until Blesta cron back to normal (this to prevent you to received a lot of warning email in your email box....) ------------------- Require Pear & Pear Mail -( ever installed by default on most servers). in console, check if pear is there, type: pear version install on debian: --------------------- apt-get install php-pearl pear install mail pear install Net_SMTP pear install Auth_SASL pear install mail_mime ---------------- optional, require php cli (php5-cli) , for testing & see echo messages. --------------- Decompress zip archive and place "check_blesta_cron" dir at one level above of your public_html dir , example, if you have path: /home/YOUR-USER/public_html place "check_blesta_cron" dir here: /home/YOUR-USER/ -------------- Be aware that putting "check_blesta_cron" dir inside "public_html" is NOT SECURE. If you want to do it, for doing WEB CRON, create a directory protected by password. -------------- 1/ "open_custom_blesta_db_connection.php" file & at top from line 5 to 8: fill your Blesta database connection details 2/ "CRON_check_blesta_cron.php" : - make time zone definited at line 7 be same as time zone chosen in Blesta admin area & menu: /settings/company/general/localization/ - check/fill from line 103 to 115 , with your email address & smtp parameters - for TESTING if the sending of email work, read test instruction at line 64 3/ run "CRON_check_blesta_cron.php" : 3a/ - if you have console (command line access) use php CLI in console, to run test, type: cd /PATH-TO/check_blesta_cron/ php CRON_check_blesta_cron.php 4/ For create a recurrent run (cronjob) 4a/ - use crontab & in console, type (if your user is not root just change root to your-user): crontab -u root -e Next ad this line in crontab: */15 * * * * php /PATH-TO/check_blesta_cron/CRON_check_blesta_cron.php OR 4b/ create the cron job using your server control panel menu N.B.: Depending of your OS, use: */15 * * * * php /PATH-TO/CRON_check_blesta_cron.php OR */15 * * * * /usr/bin/php /PATH-TO/CRON_check_blesta_cron.php ----------------------------------- So the this cron will be runing every 15mins & will check that last Blesta's cron was not more old that 30mins from date-time-now. Please, read line 10 in CRON_check_blesta_cron.php if you want modify this value. When you are ready to use this script in PRODUCTION, Please read instruction at line 66 in CRON_check_blesta_cron.php file HAPPY CRON! check_blesta_cron.zip
-
The contradiction is here, some people want some Blesta's tasks are done immediately, when in my opinion it's more effective at process control & management to operate by batch list, most system having a lot of tasks work this way to operate safely (Blesta ever do this way), and never-mind if batch frequency is short. All domain name registry are doing process by batch list & short job frequency...are you waiting 5 mins for your Registrar, register your domains, will you accept that? So just make shorter the Blesta cron frequency & Blesta's cron interval can do the job. It will not really consume more resources if there is no task to do, and even if Blesta has its own locking mechanism to prevent race conditions, just in case, I added a deadly simple layer of protection in front for preventing to do not run more than one instance of Blesta's cron: See my last post here: http://www.blesta.com/forums/index.php?/topic/2990-email-not-being-sent-on-invoice-creation/page-2
-
in my understanding, this do the job: in Blesta admin area, at package "Browse", you can tick "Cancel at end of term"
-
1. send notify via email about cron task locked or stalled (staff member can try to fix the problem, if present, asap); I just created a poor man's script that's work fine for that, I will be posting it tomorrow in the contribution forum section.
-
Thxs to Tyson about explanation on Cron task Lock in Blesta. Just to share, as my concern was to have a safe 2 mins cron frequency, (my above previous script & lock was not good) I finally found more deadly easy solution using solo, and that work fine on blesta cron: http://timkay.com/solo/ Naturally this beats working with lock/PID files, because an open port is directly tied to a running process, and chances of inconsistency and having to detect and cleanup orphaned PID files, are zero. and regarding 2mins cron frequency VS 5mins recommended by default, I'm not a believers it will consume a lot of resources, if we should avoid using php resources, we should be also afraid when customers load website pages as powered all by php. Solo, need you have Perl installed on your server to create the solo file from console (if you do not have console access ? see my below post): ----------------------------------------------------------------------------------------------------- curl -q http://timkay.com/solo/solo -o /usr/local/bin/solo \ && chmod a+x $_ CREATE THE CRONJOB: ------------------------------- open crontab as root in console(if your user is not root just change root to your-user): ------------------------------------------------------------------------------------------- crontab -u root -e Next ad this line in crontab: -------------------------------- */2 * * * * /usr/local/bin/solo -port=5001 php /PATH-TO-BLESTA/index.php cron OR Create the cron job using your server control panel menu N.B.: Depending of your OS, use: */2 * * * * /usr/local/bin/solo -port=5001 php /PATH-TO-BLESTA/index.php cron OR */2 * * * * /usr/local/bin/solo -port=5001 /usr/bin/php /PATH-TO-BLESTA/index.php cron N.B.: ---- As root you can use any available port above 1023. The maximum allowed port number is 65535, but use only one port by cron. In above case, cron frequency is 2 mins. Next, -------- Check in Database Table cron_task_runs table, take note of what are the task_id you want to speed the cron interval. In my case it was task_id : 4, 5, 18 as I want new ordered service when paid, be fast activated And open Table task_id in database, and edit row where task_id & company_id you want to speed interval, & update interval, In my case I have updated all above task_id to interval 2 . (2mins) -------------------------- Ref.: http://kvz.io/blog/2012/12/31/lock-your-cronjobs/ The Flow Can it open your port ? so it's will be starting Blesta cron script Can't open your port?Never mind, Blesta cron script is probably still running, will try again next time Naturally this beats working with lock/PID files, because an open port is directly tied to a running process, and chances of inconsistency and having to detect and cleanup orphaned PID files, are zero. ------------------------
-
I tried above solutions for change payment gateway label, Only things that work for me is to edit in database Table "gateways" & update "name" column for given gateway
-
licensecart was saying this here I understand we should prevent simultaneous instance of cron, I had to think at this on a custom scrip I done and was not related to Blesta, as I wanted my cron be running every 2 mins, and the way I found to prevent bad effect you was saying was my script start by to create a temporary file in "/var/run/" but it could be in place in current dir path , an this file temporary file having a lock extension, and will be auto-deleted when cron is ended, so when starting running the code check if there is no .lock file.: <?php // START Make sure NOT run more than one instance of this script/file // Reference: http://fr2.php.net/getmypid // create .lock file in this directory: /var/run/YOUR-FILE.lock define('LOCK_FILE', "/var/run/" . basename($argv[0], ".php") . ".lock"); if (!tryLock()) die("Already running.\n"); // quit script if ever runing (locked) # remove the lock when runing the exit function later register_shutdown_function('unlink', LOCK_FILE); # if not locked continue below // HERE YOUR CRON TASKS TO DO sleep(1); // quit this script (with unlock this file as declared above) exit(0); // this function is used very above but declared here, and as exit is just before, it will never be executed "alone" after function tryLock() { # If lock file exists, check if stale. If exists and is not stale, return TRUE # Else, create lock file and return FALSE. if (@symlink("/proc/" . getmypid(), LOCK_FILE) !== FALSE) # the @ in front of 'symlink' is to suppress the NOTICE you get if the LOCK_FILE exists return true; # link already exists # check if it's stale if (is_link(LOCK_FILE) && !is_dir(LOCK_FILE)) { unlink(LOCK_FILE); # try to lock again return tryLock(); } return false; } ?> I would like to get feedback on this idea to apply on Blesta, because I found sending invoice or activate service every 5 mins is in my opinion to long for the world we are living. Example registering a domain name, in my opinion can not wait 5 mins, if it's was me as customers I will found bad a Registry taking 5 mins to register a domain.
-
the portal plugin was not enabled for this company. SOLVED
-
This page loadfine but Blesta add /404 at the end of url: http://hello.netpublica.com/ is there a way to prevent Blesta to add /404 at the end of url I ever tried Blesta route but certainly with a wrong syntax
-
the advantage I found by creation of one package by each domain extension, is each domain extension can use a different registrar module, & can have different price. So if later you change registrar or price, that's just more flexible
-
[Blesta 3.2-3.5.1] How To Make Static Pages By Modifying Portal Plugin
serge replied to Rodrigo's topic in Contribute
The solution for that work with multi-company is : else { if ($this->company_id == "YOUR-COMPANY-ID") { switch($uri) { case 'page-x': SEE CONTENT HERE FROM ABOVE RODRIGO TUTORIAL case 'page-y': SEE CONTENT HERE FROM ABOVE RODRIGO TUTORIAL } } if ($this->company_id == "YOUR-OTHER-COMPANY-ID") { switch($uri) { case 'page-y1': SEE CONTENT HERE FROM ABOVE RODRIGO TUTORIAL case 'page-y2': SEE CONTENT HERE FROM ABOVE RODRIGO TUTORIAL } } } -
there is different way, I found for my case more flexible to create one single package by domain extension.
-
have you transactions history for auto-activated service? Maybe try to over-writte all blesta files (& payment gateway) with new, a file is maybe altered
-
thxs for this idea but I really need to check again my service table in db tomorrow. Today (2015/02/01) I saw service was well suspended at J+1 as expected, but I found strange, it's display such info in client area: Renew Date:Feb 06, 2015 ------ Next Invoice: Feb 02, 2015 ----------- The next invoice date is OK, but Renew Date have for me zero logic for a 1 day long service, ordered/activated one day before. if a service is sell for a duration inferior of "Invoice Days Before Renewal", like I did: package/service duration sell: 1 day Invoice Days Before Renewal: 5 day I think in Blesta, it miss a conditional formula for if "package/service duration" is inferior to "Invoice Days Before Renewal" to use in place "package/service duration sell" as the "Invoice Days Before Renewal:"