1
0
mirror of https://github.com/laravel/valet.git synced 2026-02-04 08:10:07 +01:00

#691 Surround with quotes all paths which might contain blank spaces.

This commit is contained in:
Sahib J. Leo
2018-12-26 15:10:51 -06:00
committed by Matt Stauffer
parent d75810239a
commit 001058414b
7 changed files with 29 additions and 29 deletions

View File

@@ -273,7 +273,7 @@ function createCa()
));
$this->cli->runAsUser(sprintf(
'openssl req -new -newkey rsa:2048 -days 730 -nodes -x509 -subj "/C=/ST=/O=%s/localityName=/commonName=%s/organizationalUnitName=Developers/emailAddress=%s/" -keyout %s -out %s',
'openssl req -new -newkey rsa:2048 -days 730 -nodes -x509 -subj "/C=/ST=/O=%s/localityName=/commonName=%s/organizationalUnitName=Developers/emailAddress=%s/" -keyout "%s" -out "%s"',
$oName, $cName, 'rootcertificate@laravel.valet', $caKeyPath, $caPemPath
));
$this->trustCa($caPemPath);
@@ -305,7 +305,7 @@ function createCertificate($url)
}
$this->cli->runAsUser(sprintf(
'openssl x509 -req -sha256 -days 730 -CA %s -CAkey %s%s -in %s -out %s -extensions v3_req -extfile %s',
'openssl x509 -req -sha256 -days 730 -CA "%s" -CAkey "%s"%s -in "%s" -out "%s" -extensions v3_req -extfile "%s"',
$caPemPath, $caKeyPath, $caSrlParam, $csrPath, $crtPath, $confPath
));
@@ -320,7 +320,7 @@ function createCertificate($url)
*/
function createPrivateKey($keyPath)
{
$this->cli->runAsUser(sprintf('openssl genrsa -out %s 2048', $keyPath));
$this->cli->runAsUser(sprintf('openssl genrsa -out "%s" 2048', $keyPath));
}
/**
@@ -332,7 +332,7 @@ function createPrivateKey($keyPath)
function createSigningRequest($url, $keyPath, $csrPath, $confPath)
{
$this->cli->runAsUser(sprintf(
'openssl req -new -key %s -out %s -subj "/C=/ST=/O=/localityName=/commonName=%s/organizationalUnitName=/emailAddress=%s%s/" -config %s',
'openssl req -new -key "%s" -out "%s" -subj "/C=/ST=/O=/localityName=/commonName=%s/organizationalUnitName=/emailAddress=%s%s/" -config "%s"',
$keyPath, $csrPath, $url, $url, '@laravel.valet', $confPath
));
}

View File

@@ -31,7 +31,7 @@ function symlinkToUsersBin()
{
$this->cli->quietlyAsUser('rm '.$this->valetBin);
$this->cli->runAsUser('ln -s '.realpath(__DIR__.'/../../valet').' '.$this->valetBin);
$this->cli->runAsUser('ln -s "'.realpath(__DIR__.'/../../valet').'" '.$this->valetBin);
}
/**

View File

@@ -1,4 +1,4 @@
user VALET_USER staff;
user "VALET_USER" staff;
worker_processes auto;
events {
@@ -37,7 +37,7 @@ http {
text/plain
text/x-component;
include VALET_HOME_PATH/Nginx/*;
include "VALET_HOME_PATH/Nginx/*";
include servers/*;
include valet/valet.conf;
}

View File

@@ -17,24 +17,24 @@ server {
try_files $uri $uri/;
}
ssl_certificate VALET_CERT;
ssl_certificate_key VALET_KEY;
ssl_certificate "VALET_CERT";
ssl_certificate_key "VALET_KEY";
location / {
rewrite ^ VALET_SERVER_PATH last;
rewrite ^ "VALET_SERVER_PATH" last;
}
access_log off;
error_log VALET_HOME_PATH/Log/nginx-error.log;
error_log "VALET_HOME_PATH/Log/nginx-error.log";
error_page 404 VALET_SERVER_PATH;
error_page 404 "VALET_SERVER_PATH";
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:VALET_HOME_PATH/valet.sock;
fastcgi_index VALET_SERVER_PATH;
fastcgi_pass "unix:VALET_HOME_PATH/valet.sock";
fastcgi_index "VALET_SERVER_PATH";
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME VALET_SERVER_PATH;
fastcgi_param SCRIPT_FILENAME "VALET_SERVER_PATH";
}
location ~ /\.ht {
@@ -56,20 +56,20 @@ server {
}
location / {
rewrite ^ VALET_SERVER_PATH last;
rewrite ^ "VALET_SERVER_PATH" last;
}
access_log off;
error_log VALET_HOME_PATH/Log/nginx-error.log;
error_log "VALET_HOME_PATH/Log/nginx-error.log";
error_page 404 VALET_SERVER_PATH;
error_page 404 "VALET_SERVER_PATH";
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:VALET_HOME_PATH/valet.sock;
fastcgi_index VALET_SERVER_PATH;
fastcgi_pass "unix:VALET_HOME_PATH/valet.sock";
fastcgi_index "VALET_SERVER_PATH";
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME VALET_SERVER_PATH;
fastcgi_param SCRIPT_FILENAME "VALET_SERVER_PATH";
}
location ~ /\.ht {

View File

@@ -11,20 +11,20 @@ server {
}
location / {
rewrite ^ VALET_SERVER_PATH last;
rewrite ^ "VALET_SERVER_PATH" last;
}
access_log off;
error_log VALET_HOME_PATH/Log/nginx-error.log;
error_log "VALET_HOME_PATH/Log/nginx-error.log";
error_page 404 VALET_SERVER_PATH;
error_page 404 "VALET_SERVER_PATH";
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:VALET_HOME_PATH/valet.sock;
fastcgi_index VALET_SERVER_PATH;
fastcgi_pass "unix:VALET_HOME_PATH/valet.sock";
fastcgi_index "VALET_SERVER_PATH";
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME VALET_SERVER_PATH;
fastcgi_param SCRIPT_FILENAME "VALET_SERVER_PATH";
}
location ~ /\.ht {

View File

@@ -31,7 +31,7 @@ public function test_install_nginx_configuration_places_nginx_base_configuration
$files->shouldReceive('putAsUser')->andReturnUsing(function ($path, $contents) {
$this->assertSame('/usr/local/etc/nginx/nginx.conf', $path);
$this->assertContains('include '.VALET_HOME_PATH.'/Nginx/*', $contents);
$this->assertContains('include "'.VALET_HOME_PATH.'/Nginx/*"', $contents);
})->once();
swap(Filesystem::class, $files);

2
valet
View File

@@ -52,7 +52,7 @@ then
# Fetch Ngrok URL In Background...
bash "$DIR/cli/scripts/fetch-share-url.sh" &
sudo -u $(logname) "$DIR/bin/ngrok" http "$HOST.$TLD:$PORT" -host-header=rewrite ${*:2}
sudo -u "$(logname)" "$DIR/bin/ngrok" http "$HOST.$TLD:$PORT" -host-header=rewrite ${*:2}
exit
# Finally, for every other command we will just proxy into the PHP tool