• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Hosting-new.com

Hébergement web, cloud et solutions personnalisées

  • Home
  • About

Hébergement CPanel sur SSD, offre Cloud

Un hébergement professionnel sur serveur Xeon Gold et SSD

through

Lady Bird celebrity Saoirse Ronan happens to be cosying up to ballet dancer Calum Lowden after fulfilling through buddies

October 26, 2020 by Admin Leave a Comment

Linux Cpanel shared hosting: 600 GB disk space, 6 TB bandwidth, free domain, unlimited databases and ftp accounts, web hosting cheap and pro at Hostony

Lady Bird celebrity Saoirse Ronan happens to be cosying up to ballet dancer Calum Lowden after fulfilling through buddies

A supply states: ‘There had been no mistaking the spark among them’

SHE may not have walked away using the actress gong that is best, but at the least EE Baftas nominee SAOIRSE RONAN left with a grin on her face.

I’m able to expose the skilled actor that is irish who’s also up for an Oscar for Lady Bird — consoled herself by cosying as much as her new love interest, acclaimed ballet dancer CALUM LOWDEN.

Sources say the set have already been growing near for many months after fulfilling through shared buddies.

An insider stated: “Saoirse didn’t win on the but couldn’t have looked happier night.

“She headed through the honors to your dinner that is official Grosvenor home on Park Lane and connected with Calum once again. They appeared to be things ‘re going great among them.”

As being an increasing celebrity associated with Royal Swedish Ballet, it should are making a change that is nice Calum to get himself propping up the club in place of practising in the barre.

My supply included: “It’s early days and they’ve got been keeping things low-key, but there clearly was no mistaking the spark among them.”

Calum had attended the honors during the Royal Albert Hall together with his star cousin JACK LOWDEN.

These people were pictured larking around regarding the red carpeting before using their seats just a couple rows far from visitors of honour WILLS and KATE.

Saoirse the most respected young actresses in business, with three Oscar nominations, four Bafta nominations and a Golden Globes win under her gear.

Yet she reckons she’s rubbish regarding guys.

On ELLEN DE GENERES’ US chat show 30 days ago, she insisted she had never handled a serious relationship, describing: “I don’t learn asian brides how to date.

“I don’t date. I’m maybe perhaps not in to the whole, ‘Let’s get out for dinner’.

“we don’t even comprehend just how to speak about it.”

It looks like she’s a learner that is fast.

CONTINUE READING TO GET MORE OF DAN WOOTTON’S BIZARRE COLUMN. Jen keeps a statutory law profile

JENNIFER LAWRENCE kept a profile that is low the state supper and after-party circuit in order to avoid her ex NICHOLAS HOULT.

She ended up being particularly missing as A-listers gathered at nearby Grosvenor home resort while Nicholas went to the dinner before partying until 4am at Chiltern Firehouse.

The couple dated for five years and split in 2014.

Jen additionally solved accusations she ended up being rude to JOANNA LUMLEY for saying her introduction had been “a bit much”.

She told RONAN KEATING on Magic radio: “i possibly couldn’t have just walked out you, Joanna’ after she was like, ‘biggest movie star in the world’ and gone ‘Thank.

“It might have been like, ‘So you agree?’” She has a place.

Linux Cpanel shared hosting: 600 GB disk space, 6 TB bandwidth, free domain, unlimited databases and ftp accounts, web hosting cheap and pro at Hostony

RISING celebrity champion DANIEL KALUUYA stated of Uber: “Yo, I get that Prius everywhere. I’m perhaps maybe not also Uber Lux, I’m Uber X.

“It is easier to get from the to B. I’m a Londoner, I’m developed, we don’t wish to be at the flipping coach stop.”

NAOMI CAMPBELL wasn’t likely to allow the Baftas upstage her during London Fashion Week – her dramatic white feathered Dior Couture cape and gown ensured all eyes had been on her behalf.

She had been celebrating with boyfriend SKEPTA, KATE MOSS and a lot of Bafta movie movie stars at Vogue and Tiffany’s film and fashion celebration at Annabel’s in Mayfair.

LILY JAMES popped in then dashed down into the Chiltern Firehouse to satisfy boyfriend MATT SMITH, who was simply dressed straight straight down in a hoodie.

He requires an expressed term with Naomi’s stylist.

CELIA IMRIE fell so in love with swanky members’ club Chiltern Firehouse after downing a few cups of bubbly here with pals.

She had been spotted asking staff to sign her as much as the haunt in London’s Marylebone while exiting at 1am.

Nevertheless moves like Jagger

MICK JAGGER had been the celebrity attraction at one of several after-parties.

THE ROLLING STONES frontman lapped up the eye of eight stunning ladies at London’s Chiltern Firehouse during the early hours of Monday.

And therefore designed ALEXA CHUNG couldn’t obtain a appearance in.

A partygoer said: “Mick ended up being in the middle of models and invested the majority of the in conversation with LILY JAMES night.

“Alexa arrived up to attempt to join the team but she ended up being ignored. She seemed actually ashamed. She attempted to stay nearby but she wasn’t getting extremely far.”

Most readily useful Actor winner GARY OLDMAN has also been here, dancing with Jagger-style techniques along with his trophy to the hours that are early.

The partygoer included: “At one point he had been also making use of his gong being a dumbbell.”

If he keeps on his winning streak, their biceps will explode.

Joanna had been a fab host

JOANNA LUMLEY did a job that is incredible her very first Baftas.

Plus it wasn’t unnoted by STEPHEN FRY, whom offered the ceremony 12 times, as he viewed yesterday.

We don’t think she required Stephen’s assistance, as Joanna won praise from fans and a-listers on her behalf delivery of hilarious gags including her pre-show skit featuring HUGH GIVE.

She is a fixture to any extent further.

Piping hot Billie

BILLIE PIPER will have turned minds in this outfit in the Baftas.

She avoided any KATE MIDDLETON-style sneers by using the light red dress to the Vogue London Fashion Week celebration on Sunday.

She had been accompanied by Stranger Things’ CHARLIE HEATON and in addition ROBERT PATTINSON. Three Billboards winner FRANCES McDORMAND did make it n’t.

No one would dare make an effort to alter her reasoning.

Web Hosting Geeks’ Blog

Linux Cpanel shared hosting: 600 GB disk space, 6 TB bandwidth, free domain, unlimited databases and ftp accounts, web hosting cheap and pro at Hostony

Filed Under: Web Hosting Tagged With: After, ballet, Bird, buddies, Calum, celebrity, cosying, Dancer, fulfilling, happens, Lady, Lowden, Ronan, Saoirse, through

A Web based system to push your SVN code through development, staging and production environments

January 11, 2020 by Admin Leave a Comment

Note the files in this post are now on GitHub

Hello there!

In development, having a seamlessly integrated process where you can propagate your code through whatever QA, testing and development policy you have is invaluable and a definite time saver.

We work with SVN as well as GIT code repository systems and have developed a web based system to “Export” or “Push” the code through development, staging and production environments as such.

I have already talked about sanitizing your code during the commit process, to ensure commit messages are standard and there are no PHP fatal errors, so now I will be showcasing you a simple web based system for propagating your code through development, staging and production servers.

This system should be on a secure web accessible page on each server. For the sake of argument , I’ll call each server the following :

dev.server.com — development server

staging.server.com — staging server

www.server.com — production server

We will be using PHP for the web based interface, and we will assume that you will be password protecting access to this page via htpasswd, as well as forcing SSL. I am also assuming that within your SVN repository, you have multiple “sites” that you will be individually pushing or exporting (svn export). Once you have the secure, password protected page (lets call it https://dev.server.com/svn) , the following PHP page will be the main index :

svnupdate.php

 "Site A",
"url" => "http://site-a.server.com",
"path" => "/usr/local/www/site-a.server.com",
"source" => "svn://svn.server.com/repository/branches/site-a",
"login" => "svnlogin",
"base" => "1.00",
"notes" => "Standard build for Site A"
);

"name" => "Site B",
"url" => "http://site-b.server.com",
"path" => "/usr/local/www/site-b.server.com",
"source" => "svn://svn.server.com/repository/branches/site-b",
"login" => "svnlogin",
"base" => "1.00",
"notes" => "Standard build for Site B"
);

?>





        SVN Update Page





Server: Development Server Staging Server Production Server

View Development Export Log

$ value) { ?>
Site Source UN/PW Base Revision Export Pending Updates Notes
View

If you carefully look at the above code, you will see that this page will be dependent on 3 external scripts, which I will describe below. The page itself generates a list of whatever sites you want to include in the push process, within a PHP based Array. The array details important info per site such as the name, svn location, location of the files on the server as well as whatever other notes and additional info you want to provide.

Each time a site is “exported” by clicking the export button, it calls an external script called svnupdate_process.php. This executes the SVN EXPORT command, as well as logging which user requested the action into a simple text based log file. The user is determined by the authentication user that is accessing the page. The htpassword credentials you will be providing to your users should be set per-user so that it can be easier to determine who pushed the code and whatnot.

The other two external scripts are one that will view the log file in an iframe on the same page, as well as a script to extrapolate the pending commits that are in the queue since the LAST code push / svn export. That is really useful, as you can imagine.

Script to view the export log

This script, log.php is used to dump the contents of the log.txt export log file. Very simple

log.php





        Untitled



Development Export Log:
display(); ?>

Simple, right? The log.php code includes a functions.inc.php file, used for writing and reading the log.txt file. The above code depends on it, as well as the svnupdate_process.php code (described below), in order to log each time someone hits the export code button

functions.inc.php

filename = "log.txt";
                $  this->Username = $  _SERVER['PHP_AUTH_USER'];
                $  this->logfile = $  this->filename;
        }

        function write($  data) { // write to logfile
                $  handle = fopen($  this->logfile, "a+");
                $  date = date("Y-m-d H:i:s");
                $  IP = getenv('REMOTE_ADDR');
                $  data = "[$  date] {$  this->Username}:{$  IP} - " . $  data . "n";
                $  return = fwrite($  handle, $  data);
                fclose($  handle);
        }

        function display() { // display logfile
                $  handle = fopen($  this->logfile, "a+");
                while(!feof($  handle)) { // Pull lines into array
                        $  lines[] = fgets($  handle, 1024);
                }
                $  count = count($  lines);
                $  count = $  count - 2;
                for($  i=$  count;$  i>=0;$  i--) {
                        echo $  lines[$  i] . "
"; } fclose($ handle); } } ?>

The code of the svn export process is handled by the following script below. Again its self explanatory. PHP executes a shell command to export the svn code based on the array variables defined in the very first script. Make sure all the variables match up to whats in svn and the location of the files, and even execute a test run of the command manually with the variables. If there are problems, you can modify the command to pipe the output to a log file for further analysis. Additionally you may need to alter the permissions of the apache user so that the command can be properly run. Avoid setting the apache user to have a shell (big no-no) ,but maybe a nologin shell or something along those lines. Its completely up to you , but be very careful about the choices you make to get it to run properly.

svnupdate_process.php

Update/Status Window

&1"; if($ _POST['submitbutton'] == "Export") { $ output = shell_exec("umask 022;".$ command); } echo "
$  output

";
$ logtext = "Exported to {$ _POST['site']}";
$ logfile->write($ logtext);
eaccelerator_clear();
}

?>

Finally the last script will be the script that parses the SVN log output with a date/time range from the last time the export button was pushed, until the current date and time. This will load the output in the same iframe log window on the svn page so the user can see what pending commits are in the code since the last time it was exported. Invaluable information, right?

Note that this has a function to filter out additional illegal characters to avoid cross site scripting injections. This code should be completely 100% restricted from outside public use, however it might be worth it to put this function in the svnupdate_process.php script as well. Can’t be too careful. I thought I’d include it here for you to use.

viewcommit.php

',"'",'"',')','('), array('<',':','|','&','>',''','"',')','('), $  input_str );
        $  return_str = str_ireplace( '%3Cscript', '', $  return_str );
        return $  return_str;
        }

        $  xss_path=xss_cleaner($  _GET['path']);
        $  xss_svn=xss_cleaner($  _GET['svn']);
        $  xss_name=xss_cleaner($  _GET['name']);

        echo "Viewing Pending Updates For : ". $  xss_name . "";
        echo "
"; $ command = "/usr/bin/svn --username svnuser --password 'svnpassword' --config-dir /tmp log " . $ xss_svn . " -r {"`grep "" . $ xss_path . "" log.txt | tail -n 1 | awk -F " " '{printf "%s %s", $ 1,$ 2}' | sed -e 's/[//g' -e 's/]//g'`"}:{"`date "+%Y-%m-%d %H:%M:%S"`"}"; $ output = shell_exec("umask 022;".$ command); echo "
$  output

";
}
else {
echo "No queries passed!";
}

?>

Lets break down the SVN log command, so you know whats going on. I’m grabbing the SVN site array variables when the “view log” link is clicked on the svn page. I am also parsing the export log text file to get the last entry for the particular site in question, grabbing the date and time.

I am then getting the current date and time to complete the date/time range in the svn log query. The finished query should look something like this :

svn --username svnuser --password 'svnpassword' --config-dir /tmp log svn://svn.server.com -r {"2013-01-01 12:01:00"}:{"2013-02-01 12:01:00"}

Note the files in this post are now on GitHub

The post A Web based system to push your SVN code through development, staging and production environments appeared first on Managed WordPress Hosting | Managed VPS Hosting | Stack Star.

Managed WordPress Hosting | Managed VPS Hosting | Stack Star

Filed Under: Web Hosting Tagged With: Based, Code, Development, Environments, production, Push, staging, System, through

A Web based system to push your SVN code through development, staging and production environments

October 25, 2019 by Admin Leave a Comment

Note the files in this post are now on GitHub

Hello there!

In development, having a seamlessly integrated process where you can propagate your code through whatever QA, testing and development policy you have is invaluable and a definite time saver.

We work with SVN as well as GIT code repository systems and have developed a web based system to “Export” or “Push” the code through development, staging and production environments as such.

I have already talked about sanitizing your code during the commit process, to ensure commit messages are standard and there are no PHP fatal errors, so now I will be showcasing you a simple web based system for propagating your code through development, staging and production servers.

This system should be on a secure web accessible page on each server. For the sake of argument , I’ll call each server the following :

dev.server.com — development server

staging.server.com — staging server

www.server.com — production server

We will be using PHP for the web based interface, and we will assume that you will be password protecting access to this page via htpasswd, as well as forcing SSL. I am also assuming that within your SVN repository, you have multiple “sites” that you will be individually pushing or exporting (svn export). Once you have the secure, password protected page (lets call it https://dev.server.com/svn) , the following PHP page will be the main index :

svnupdate.php

 "Site A",
"url" => "http://site-a.server.com",
"path" => "/usr/local/www/site-a.server.com",
"source" => "svn://svn.server.com/repository/branches/site-a",
"login" => "svnlogin",
"base" => "1.00",
"notes" => "Standard build for Site A"
);

"name" => "Site B",
"url" => "http://site-b.server.com",
"path" => "/usr/local/www/site-b.server.com",
"source" => "svn://svn.server.com/repository/branches/site-b",
"login" => "svnlogin",
"base" => "1.00",
"notes" => "Standard build for Site B"
);

?>





        SVN Update Page





Server: Development Server Staging Server Production Server

View Development Export Log

$ value) { ?>
Site Source UN/PW Base Revision Export Pending Updates Notes
View

If you carefully look at the above code, you will see that this page will be dependent on 3 external scripts, which I will describe below. The page itself generates a list of whatever sites you want to include in the push process, within a PHP based Array. The array details important info per site such as the name, svn location, location of the files on the server as well as whatever other notes and additional info you want to provide.

Each time a site is “exported” by clicking the export button, it calls an external script called svnupdate_process.php. This executes the SVN EXPORT command, as well as logging which user requested the action into a simple text based log file. The user is determined by the authentication user that is accessing the page. The htpassword credentials you will be providing to your users should be set per-user so that it can be easier to determine who pushed the code and whatnot.

The other two external scripts are one that will view the log file in an iframe on the same page, as well as a script to extrapolate the pending commits that are in the queue since the LAST code push / svn export. That is really useful, as you can imagine.

Script to view the export log

This script, log.php is used to dump the contents of the log.txt export log file. Very simple

log.php





        Untitled



Development Export Log:
display(); ?>

Simple, right? The log.php code includes a functions.inc.php file, used for writing and reading the log.txt file. The above code depends on it, as well as the svnupdate_process.php code (described below), in order to log each time someone hits the export code button

functions.inc.php

filename = "log.txt";
                $  this->Username = $  _SERVER['PHP_AUTH_USER'];
                $  this->logfile = $  this->filename;
        }

        function write($  data) { // write to logfile
                $  handle = fopen($  this->logfile, "a+");
                $  date = date("Y-m-d H:i:s");
                $  IP = getenv('REMOTE_ADDR');
                $  data = "[$  date] {$  this->Username}:{$  IP} - " . $  data . "n";
                $  return = fwrite($  handle, $  data);
                fclose($  handle);
        }

        function display() { // display logfile
                $  handle = fopen($  this->logfile, "a+");
                while(!feof($  handle)) { // Pull lines into array
                        $  lines[] = fgets($  handle, 1024);
                }
                $  count = count($  lines);
                $  count = $  count - 2;
                for($  i=$  count;$  i>=0;$  i--) {
                        echo $  lines[$  i] . "
"; } fclose($ handle); } } ?>

The code of the svn export process is handled by the following script below. Again its self explanatory. PHP executes a shell command to export the svn code based on the array variables defined in the very first script. Make sure all the variables match up to whats in svn and the location of the files, and even execute a test run of the command manually with the variables. If there are problems, you can modify the command to pipe the output to a log file for further analysis. Additionally you may need to alter the permissions of the apache user so that the command can be properly run. Avoid setting the apache user to have a shell (big no-no) ,but maybe a nologin shell or something along those lines. Its completely up to you , but be very careful about the choices you make to get it to run properly.

svnupdate_process.php

Update/Status Window

&1"; if($ _POST['submitbutton'] == "Export") { $ output = shell_exec("umask 022;".$ command); } echo "
$  output

";
$ logtext = "Exported to {$ _POST['site']}";
$ logfile->write($ logtext);
eaccelerator_clear();
}

?>

Finally the last script will be the script that parses the SVN log output with a date/time range from the last time the export button was pushed, until the current date and time. This will load the output in the same iframe log window on the svn page so the user can see what pending commits are in the code since the last time it was exported. Invaluable information, right?

Note that this has a function to filter out additional illegal characters to avoid cross site scripting injections. This code should be completely 100% restricted from outside public use, however it might be worth it to put this function in the svnupdate_process.php script as well. Can’t be too careful. I thought I’d include it here for you to use.

viewcommit.php

',"'",'"',')','('), array('<',':','|','&','>',''','"',')','('), $  input_str );
        $  return_str = str_ireplace( '%3Cscript', '', $  return_str );
        return $  return_str;
        }

        $  xss_path=xss_cleaner($  _GET['path']);
        $  xss_svn=xss_cleaner($  _GET['svn']);
        $  xss_name=xss_cleaner($  _GET['name']);

        echo "Viewing Pending Updates For : ". $  xss_name . "";
        echo "
"; $ command = "/usr/bin/svn --username svnuser --password 'svnpassword' --config-dir /tmp log " . $ xss_svn . " -r {"`grep "" . $ xss_path . "" log.txt | tail -n 1 | awk -F " " '{printf "%s %s", $ 1,$ 2}' | sed -e 's/[//g' -e 's/]//g'`"}:{"`date "+%Y-%m-%d %H:%M:%S"`"}"; $ output = shell_exec("umask 022;".$ command); echo "
$  output

";
}
else {
echo "No queries passed!";
}

?>

Lets break down the SVN log command, so you know whats going on. I’m grabbing the SVN site array variables when the “view log” link is clicked on the svn page. I am also parsing the export log text file to get the last entry for the particular site in question, grabbing the date and time.

I am then getting the current date and time to complete the date/time range in the svn log query. The finished query should look something like this :

svn --username svnuser --password 'svnpassword' --config-dir /tmp log svn://svn.server.com -r {"2013-01-01 12:01:00"}:{"2013-02-01 12:01:00"}

Note the files in this post are now on GitHub

The post A Web based system to push your SVN code through development, staging and production environments appeared first on Managed WordPress Hosting | Managed VPS Hosting | Stack Star.

Managed WordPress Hosting | Managed VPS Hosting | Stack Star

Filed Under: Web Hosting Tagged With: Based, Code, Development, Environments, production, Push, staging, System, through

A Web based system to push your SVN code through development, staging and production environments

February 24, 2017 by Admin Leave a Comment

Note the files in this post are now on GitHub

Hello there!

In development, having a seamlessly integrated process where you can propagate your code through whatever QA, testing and development policy you have is invaluable and a definite time saver.

We work with SVN as well as GIT code repository systems and have developed a web based system to “Export” or “Push” the code through development, staging and production environments as such.

I have already talked about sanitizing your code during the commit process, to ensure commit messages are standard and there are no PHP fatal errors, so now I will be showcasing you a simple web based system for propagating your code through development, staging and production servers.

This system should be on a secure web accessible page on each server. For the sake of argument , I’ll call each server the following :

dev.server.com — development server

staging.server.com — staging server

www.server.com — production server

We will be using PHP for the web based interface, and we will assume that you will be password protecting access to this page via htpasswd, as well as forcing SSL. I am also assuming that within your SVN repository, you have multiple “sites” that you will be individually pushing or exporting (svn export). Once you have the secure, password protected page (lets call it https://dev.server.com/svn) , the following PHP page will be the main index :

svnupdate.php

<?

$  sites[] = array(
"name" => "Site A",
"url" => "http://site-a.server.com",
"path" => "/usr/local/www/site-a.server.com",
"source" => "svn://svn.server.com/repository/branches/site-a",
"login" => "svnlogin",
"base" => "1.00",
"notes" => "Standard build for Site A"
);

"name" => "Site B",
"url" => "http://site-b.server.com",
"path" => "/usr/local/www/site-b.server.com",
"source" => "svn://svn.server.com/repository/branches/site-b",
"login" => "svnlogin",
"base" => "1.00",
"notes" => "Standard build for Site B"
);

?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
        <title>SVN Update Page</title>

<style>
body {
        background-color:#eeeeee;
}

.tdheader {
        background-color:#0f2c66;
        color:#FFFFFF;
        font-weight: bold;
}

.tdheader2 {
        background-color:#000000;
        color:#FFFFFF;
        font-weight: bold;
}

.tdrow {
        background-color:#ffffff;
        color:#000000;
        font-weight: normal;
}

a:link,a:active,a:visited {
        color:#0f2c66;
}

a:hover {
        color:#6A9CD3;
}
.menuon {
        background-color:#6699cc;
        color:white;
        font-weight: bold;
}

.menuoff {
        background-color:white;
        color:black;
        font-weight: bold;
}

table {
        border-style: solid;
        border-width: 1px;
        border-color: #000000;
}

</style>
<script type="text/javascript">
function confirmexport(text) {
        if (confirm(text)) {
                document.getElementById('framecont').style.display = '';
                document.getElementById("processframe").contentWindow.document.body.innerHTML = "<div align='center'>Exporting...</div>";
                return true;
        } else return false;
}
function viewframe() {
        document.getElementById('framecont').style.display = '';
}
function closeframe() {
        document.getElementById('framecont').style.display = 'none';
}

</script>
</head>
<body>
<table width="750px" cellpadding="2" cellspacing="1" bgcolor="#000000" border="0">
<tr>
<td class="tdheader2">Server: </td>
<td class="menuon" align="center">Development Server</td>
<td class="menuoff" align="center"><a href="https://staging.server.com/svn/svnupdate.php">Staging Server</a></td>
<td class="menuoff" align="center"><a href="https://www.server.com/svn/svnupdate.php">Production Server</a></td>
</tr>
</table>

<hr size="1" noshade="noshade" />
<a href="log.php" target="processframe" onclick="closeframe();viewframe()">View Development Export Log</a> 
<br><br>
<table cellpadding="2" width="1000px" cellspacing="1" bgcolor="#000000" border="0">
<tr class="tdheader">
<td>Site</td>
<td>Source</td>
<td>UN/PW</td>
<td>Base</td>
<td>Revision</td>
<td>Export</td>
<td>Pending Updates</td>
<td>Notes</td>
</tr>

<?
if($  sites) {
foreach($  sites as $  key => $  value) {
?>
<form method="post" action="svnupdate_process.php" target="processframe">
<tr class="tdrow">
<td><a href="<?=$  value['url']?>" target="_blank"><?=$  value['name']?></a></td>
<td><?=preg_replace("/svn://svn.server.com//","",$  value['source'])?><input type="hidden" name="source" value="<?=$  value['source']?>"></td>
<td><?=$  value['login']?></td>
<td><?=$  value['base']?></td>
<td><input type="text" name="revision" size="5"></td>
<td><input type="hidden" name="site" value="<?=$  value['path']?>">
<input type="submit" name="submitbutton" value="Export" onClick="javascript:return confirmexport('This will overwrite the current files on development. Are you sure?');">
</td>
<td width="150px"><center><a href="viewcommit.php?name=<?=$  value['name']?>&path=<?=$  value['path']?>&svn=<?=$  value['source']?>" target="processframe" onclick="closeframe();viewframe()">View</a></center></td>
<td><?=$  value['notes']?></td>
</tr>
</form>
<? } ?>
<? } ?>
</table>
<br><div id='framecont' style="text-align: left; display: none">
<iframe name="processframe" id="processframe" width="1000px" height="300px" align="left" scrolling="yes" frameborder="0">
                </iframe>
</div>
</body>
</html>

If you carefully look at the above code, you will see that this page will be dependent on 3 external scripts, which I will describe below. The page itself generates a list of whatever sites you want to include in the push process, within a PHP based Array. The array details important info per site such as the name, svn location, location of the files on the server as well as whatever other notes and additional info you want to provide.

Each time a site is “exported” by clicking the export button, it calls an external script called svnupdate_process.php. This executes the SVN EXPORT command, as well as logging which user requested the action into a simple text based log file. The user is determined by the authentication user that is accessing the page. The htpassword credentials you will be providing to your users should be set per-user so that it can be easier to determine who pushed the code and whatnot.

The other two external scripts are one that will view the log file in an iframe on the same page, as well as a script to extrapolate the pending commits that are in the queue since the LAST code push / svn export. That is really useful, as you can imagine.

Script to view the export log

This script, log.php is used to dump the contents of the log.txt export log file. Very simple

log.php

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
        <title>Untitled</title>
</head>

<body>
<b>Development Export Log:</b><hr>
<?
include("./functions.inc.php");
$  logfile = new logfile();
$  logfile->display();
?>
</body>
</html>

Simple, right? The log.php code includes a functions.inc.php file, used for writing and reading the log.txt file. The above code depends on it, as well as the svnupdate_process.php code (described below), in order to log each time someone hits the export code button

functions.inc.php

<?
class logfile {
        function logfile() {
                $  this->filename = "log.txt";
                $  this->Username = $  _SERVER['PHP_AUTH_USER'];
                $  this->logfile = $  this->filename;
        }

        function write($  data) { // write to logfile
                $  handle = fopen($  this->logfile, "a+");
                $  date = date("Y-m-d H:i:s");
                $  IP = getenv('REMOTE_ADDR');
                $  data = "[$  date] {$  this->Username}:{$  IP} - " . $  data . "n";
                $  return = fwrite($  handle, $  data);
                fclose($  handle);
        }

        function display() { // display logfile
                $  handle = fopen($  this->logfile, "a+");
                while(!feof($  handle)) { // Pull lines into array
                        $  lines[] = fgets($  handle, 1024);
                }
                $  count = count($  lines);
                $  count = $  count - 2;
                for($  i=$  count;$  i>=0;$  i--) {
                        echo $  lines[$  i] . "<br>";
                }
                fclose($  handle);
        }
}
?>

The code of the svn export process is handled by the following script below. Again its self explanatory. PHP executes a shell command to export the svn code based on the array variables defined in the very first script. Make sure all the variables match up to whats in svn and the location of the files, and even execute a test run of the command manually with the variables. If there are problems, you can modify the command to pipe the output to a log file for further analysis. Additionally you may need to alter the permissions of the apache user so that the command can be properly run. Avoid setting the apache user to have a shell (big no-no) ,but maybe a nologin shell or something along those lines. Its completely up to you , but be very careful about the choices you make to get it to run properly.

svnupdate_process.php

<b>Update/Status Window</b>
<hr>


<?
include("./functions.inc.php");
$  logfile = new logfile();

if($  _POST['submitbutton']) {

        if($  _POST['revision'] != "") {
                $  revision = "-r ".$  _POST['revision'];
        }

        $  command = "/usr/bin/svn export --force --username svnuser --password 'svnpassword' $  revision --config-dir /tmp ".$  _POST['source']. " " . $  _POST['site']." 2>&1";

        if($  _POST['submitbutton'] == "Export") {
                $  output = shell_exec("umask 022;".$  command);
        }

        echo "<pre>output

”;
$ logtext = “Exported to {$ _POST[‘site’]}”;
$ logfile->write($ logtext);
eaccelerator_clear();
}

?>

Finally the last script will be the script that parses the SVN log output with a date/time range from the last time the export button was pushed, until the current date and time. This will load the output in the same iframe log window on the svn page so the user can see what pending commits are in the code since the last time it was exported. Invaluable information, right?

Note that this has a function to filter out additional illegal characters to avoid cross site scripting injections. This code should be completely 100% restricted from outside public use, however it might be worth it to put this function in the svnupdate_process.php script as well. Can’t be too careful. I thought I’d include it here for you to use.

viewcommit.php

<?

        if(($  _GET['svn'] != "") && ($  _GET['path'] != "") && ($  _GET['name'] != "")) {

        // Cross Site Script  & Code Injection Sanitization
        function xss_cleaner($  input_str) {
        $  return_str = str_replace( array('<',';','|','&','>',"'",'"',')','('), array('&lt;','&#58;','&#124;','&#38;','&gt;','&apos;','&#x22;','&#x29;','&#x28;'), $  input_str );
        $  return_str = str_ireplace( '%3Cscript', '', $  return_str );
        return $  return_str;
        }

        $  xss_path=xss_cleaner($  _GET['path']);
        $  xss_svn=xss_cleaner($  _GET['svn']);
        $  xss_name=xss_cleaner($  _GET['name']);

        echo "<b>Viewing Pending Updates For : ". $  xss_name . "</b>";
        echo "<hr>";

        $  command = "/usr/bin/svn --username svnuser --password 'svnpassword' --config-dir /tmp log " . $  xss_svn . " -r {"`grep "" . $  xss_path . "" log.txt | tail -n 1 | awk -F " " '{printf "%s %s", $  1,$  2}' | sed -e 's/[//g' -e 's/]//g'`"}:{"`date "+%Y-%m-%d %H:%M:%S"`"}";

        $  output = shell_exec("umask 022;".$  command);
        echo "<pre>output

”;
}
else {
echo “No queries passed!”;
}

?>

Lets break down the SVN log command, so you know whats going on. I’m grabbing the SVN site array variables when the “view log” link is clicked on the svn page. I am also parsing the export log text file to get the last entry for the particular site in question, grabbing the date and time.

I am then getting the current date and time to complete the date/time range in the svn log query. The finished query should look something like this :

svn --username svnuser --password 'svnpassword' --config-dir /tmp log svn://svn.server.com -r {"2013-01-01 12:01:00"}:{"2013-02-01 12:01:00"}

Note the files in this post are now on GitHub

The post A Web based system to push your SVN code through development, staging and production environments appeared first on Managed WordPress Hosting | Managed VPS Hosting | Stack Star.

Managed WordPress Hosting | Managed VPS Hosting | Stack Star

Filed Under: Web Hosting Tagged With: Based, Code, Development, Environments, production, Push, staging, System, through

A Good Way To Boost Your Business Through Web Hosting

December 5, 2014 by Admin Leave a Comment

The world is moving at a very fast rate. Be it young or old, every day, we see millions of people move from one place to another, even from one country to another merely for their business purposes.
Find Articles, Free Articles Directory | Web Hosting Articles

Filed Under: Web Hosting Tagged With: Boost, Business, Good, Hosting, through

How the cloud can support your business through the festive season

November 19, 2014 by Admin Leave a Comment

For many online retailers, the festive season is the single biggest point of the year for online sales. It is the only point in the calendar when everybody is looking to buy gifts and with many flocking to online retailers … Continue reading →

(Visited 1 times, 1 visits today)

Web Hosting UK Blog | Dedicated Servers VPS Hosting Technology Updates

Filed Under: VPS / Dedicated Servers Tagged With: Business, Cloud, Festive, Season, Support, through

  • Go to page 1
  • Go to page 2
  • Go to page 3
  • Interim pages omitted …
  • Go to page 10
  • Go to Next Page »

Primary Sidebar

Made with love by Hosting-New