Skip to content

Commit

Permalink
Merge branch 'stable'
Browse files Browse the repository at this point in the history
* stable:
  0.9.8.28-rc1
  (docs) updating changelog/release notes
  (chocolatey-archiveGH-577) use default credentials if available.
  (maint) add kickstarter message
  (chocolatey-archiveGH-558) quote path on batch fallback
  (chocolatey-archiveGH-571) Use process id instead of name
  (chocolatey-archiveGH-600) Give maintainer heads up about moderation
  (chocolatey-archiveGH-599) Restrict calls to choco.org to https

Conflicts:
	readme.markdown
  • Loading branch information
ferventcoder committed Nov 2, 2014
2 parents 742bd69 + c9e1af6 commit e076d62
Show file tree
Hide file tree
Showing 16 changed files with 87 additions and 47 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ BUG FIXES:
* Fix - Shim argument parsing needs fixed for quoting - [ShimGen #1](https://github.com/chocolatey/shimgen/issues/1)
* Fix - Forcing x86 does not use 32bit checksum - [#535](https://github.com/chocolatey/chocolatey/issues/535)
* Fix - Powershell v2 fails to download SSLv3 files - [#531](https://github.com/chocolatey/chocolatey/issues/531)
* Get-ChocolateyUnzip fails due to Wait-Process exception - [#571](https://github.com/chocolatey/chocolatey/issues/571)

IMPROVEMENTS:

* Use default credentials for internet if available - [#577](https://github.com/chocolatey/chocolatey/issues/577)
* Add moderation message on push - [#600](https://github.com/chocolatey/chocolatey/issues/600)
* Restrict all calls to chocolatey.org to HTTPS - [#599](https://github.com/chocolatey/chocolatey/issues/599)
* Batch fallback should quote path for spaces - [#558](https://github.com/chocolatey/chocolatey/issues/558)

##[0.9.8.27](https://github.com/chocolatey/chocolatey/issues?labels=v0.9.8.27&page=1&state=closed) (July 13, 2014)

Expand Down
10 changes: 5 additions & 5 deletions chocolateyInstall/InstallChocolatey.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ==============================================================================
#
# Fervent Coder Copyright 2011 - Released under the Apache 2.0 License
# Fervent Coder Copyright 2011 - Present - Released under the Apache 2.0 License
#
# Copyright 2007-2008 The Apache Software Foundation.
#
Expand All @@ -17,9 +17,9 @@
# ==============================================================================

# variables
#$url = "http://chocolatey.org/packages/chocolatey/DownloadPackage"
$url = "http://chocolatey.org/api/v2/package/chocolatey/"
#$url = "http://chocolatey.org/api/v1/package/chocolatey"
#$url = "https://chocolatey.org/packages/chocolatey/DownloadPackage"
$url = "https://chocolatey.org/api/v2/package/chocolatey/"
#$url = "https://chocolatey.org/api/v1/package/chocolatey"
$chocTempDir = Join-Path $env:TEMP "chocolatey"
$tempDir = Join-Path $chocTempDir "chocInstall"
if (![System.IO.Directory]::Exists($tempDir)) {[System.IO.Directory]::CreateDirectory($tempDir)}
Expand Down Expand Up @@ -47,7 +47,7 @@ $chocInstallPS1 = Join-Path $toolsFolder "chocolateyInstall.ps1"
write-host 'Ensuring chocolatey commands are on the path'
$chocInstallVariableName = "ChocolateyInstall"
$nuGetPath = [Environment]::GetEnvironmentVariable($chocInstallVariableName, [System.EnvironmentVariableTarget]::User)
$nugetExePath = 'C:\NuGet\bin'
$nugetExePath = 'C:\ProgramData\Chocolatey\bin'
if ($nuGetPath -ne $null) {
$nugetExePath = Join-Path $nuGetPath 'bin'
}
Expand Down
13 changes: 10 additions & 3 deletions nuget/chocolatey.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<metadata>
<id>chocolatey</id>
<title>Chocolatey</title>
<version>0.9.8.28-alpha3</version>
<version>0.9.8.28-rc1</version>
<authors>Rob Reynolds, The Chocolatey Team</authors>
<owners>Rob Reynolds</owners>
<summary>Chocolatey is your machine level NuGet repository. Think apt-get for Windows (executables/application packages), not library packages.</summary>
Expand Down Expand Up @@ -42,12 +42,19 @@ Humor related to playing off of tiki gods. We like humor. Don't take life so ser
See all - https://github.com/chocolatey/chocolatey/blob/master/CHANGELOG.md

## 0.9.8.28:

### BUG FIXES:

* Fix - Shim argument parsing needs fixed for quoting - https://github.com/chocolatey/shimgen/issues/1
* Fix - Forcing x86 does not use 32bit checksum - https://github.com/chocolatey/chocolatey/issues/535
* Fix - Powershell v2 fails to download SSLv3 files - https://github.com/chocolatey/chocolatey/issues/531
* Get-ChocolateyUnzip fails due to Wait-Process exception - https://github.com/chocolatey/chocolatey/issues/571

### IMPROVEMENTS:

* Use default credentials for internet if available - https://github.com/chocolatey/chocolatey/issues/577
* Add moderation message on push - https://github.com/chocolatey/chocolatey/issues/600
* Restrict all calls to chocolatey.org to HTTPS - https://github.com/chocolatey/chocolatey/issues/599
* Batch fallback should quote path for spaces - https://github.com/chocolatey/chocolatey/issues/558

## 0.9.8.27:
### BUG FIXES:
Expand Down Expand Up @@ -128,7 +135,7 @@ See all - https://github.com/chocolatey/chocolatey/blob/master/CHANGELOG.md
* Update to Nuget.exe 2.8.2 - https://github.com/chocolatey/chocolatey/issues/379

</releaseNotes>
<projectUrl>http://chocolatey.org</projectUrl>
<projectUrl>https://chocolatey.org</projectUrl>
<licenseUrl>http://www.apache.org/licenses/LICENSE-2.0</licenseUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<copyright>RealDimensions Software, LLC - 2011-Present</copyright>
Expand Down
2 changes: 1 addition & 1 deletion readme.markdown
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Support making Chocolatey better! [Kickstarter - The Chocolatey Experience](https://www.kickstarter.com/projects/ferventcoder/chocolatey-the-alternative-windows-store-like-yum)

Chocolatey NuGet (like apt-get, but for Windows) [![](http://img.shields.io/gittip/Chocolatey.svg)](https://www.gittip.com/Chocolatey/) [![](http://img.shields.io/chocolatey/dt/chocolatey.svg)](http://chocolatey.org/packages/chocolatey) [![](http://img.shields.io/chocolatey/v/chocolatey.svg)](http://chocolatey.org/packages/chocolatey) [![Build status](https://ci.appveyor.com/api/projects/status/jj9h1tobakhpbiwx/branch/master)](https://ci.appveyor.com/project/ferventcoder/chocolatey/branch/master) [![](http://img.shields.io/teamcity/codebetter/bt802.svg)](http://teamcity.codebetter.com/viewType.html?buildTypeId=bt802)
Chocolatey NuGet (like apt-get, but for Windows) [![](http://img.shields.io/gittip/Chocolatey.svg)](https://www.gittip.com/Chocolatey/) [![](http://img.shields.io/chocolatey/dt/chocolatey.svg)](https://chocolatey.org/packages/chocolatey) [![](http://img.shields.io/chocolatey/v/chocolatey.svg)](https://chocolatey.org/packages/chocolatey) [![Build status](https://ci.appveyor.com/api/projects/status/jj9h1tobakhpbiwx/branch/master)](https://ci.appveyor.com/project/ferventcoder/chocolatey/branch/master) [![](http://img.shields.io/teamcity/codebetter/bt802.svg)](http://teamcity.codebetter.com/viewType.html?buildTypeId=bt802)
=======
![Chocolatey Logo](https://github.com/chocolatey/chocolatey/raw/master/docs/logo/chocolateyicon.gif "Chocolatey")

Expand Down
1 change: 1 addition & 0 deletions src/chocolatey.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<useNuGetForSources>false</useNuGetForSources>
<checksumFiles>true</checksumFiles>
<virusCheck>false</virusCheck>
<ksMessage>true</ksMessage>
<sources>
<source id="chocolatey" value="https://chocolatey.org/api/v2/" />
</sources>
Expand Down
43 changes: 15 additions & 28 deletions src/chocolatey.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ $currentThread.CurrentCulture = $culture;
$currentThread.CurrentUICulture = $culture;

#Let's get Chocolatey!
$chocVer = '0.9.8.28-alpha3'
$chocVer = '0.9.8.28-rc1'
$nugetChocolateyPath = (Split-Path -parent $MyInvocation.MyCommand.Definition)
$nugetPath = (Split-Path -Parent $nugetChocolateyPath)
$nugetExePath = Join-Path $nuGetPath 'bin'
Expand Down Expand Up @@ -122,37 +122,10 @@ The default install location has been changed to '$newChocoPath'.
"@ | Write-Host -ForegroundColor $Warning -BackgroundColor Black
}

# Win2003/XP do not support SNI
if ([Environment]::OSVersion.Version -lt (new-object 'Version' 6,0)){
$originalSource = $source
Write-Debug 'This version of Windows does not support SNI, so configuring chocolatey to use Http automatically'
$chocoHttpExists = $false
$chocoHttpId = 'chocolateyHttp'
$sources = Chocolatey-Sources 'list'
Write-Debug 'Checking sources to see if chocolatey http is configured'
foreach ($sourceConfig in $sources) {
if ($sourceConfig.ID -eq "$chocoHttpId") {
Write-Debug 'ChocolateyHttp found'
$chocoHttpExists = $true
break
}
}

if (!$chocoHttpExists) {
Write-Debug 'Removing https version of chocolatey and re-adding as http'
Chocolatey-Sources 'disable' 'chocolatey'
Chocolatey-Sources 'add' "$chocoHttpId" 'http://chocolatey.org/api/v2/'
}

#this command fixes a small change somewhere that messes up the original source specified
$source = $originalSource
}

# bump installarguments back to quotes
$installArguments = $installArguments.Replace("'","""")
$packageParameters = $packageParameters.Replace("'","""")


#main entry point
Append-Log

Expand Down Expand Up @@ -219,6 +192,20 @@ if ($badPackages -ne '') {
Write-Host "Command `'$command`' failed (sometimes this indicates a partial failure). Additional info/packages: $badpackages" -BackgroundColor $ErrorColor -ForegroundColor White
}

if ((Get-ConfigValue 'ksMessage') -ne 'false') {
@"
Did you know we are rewriting Chocolatey? The new
version is much more stable and secure.
Find out more and support the future of Chocolatey
at https://bit.ly/chocolateykickstarter
Disable this message by changing ksMessage to false in chocolatey.config.
"@ | Write-Host -ForegroundColor $Warning -BackgroundColor Black

}

if ($chocolateyErrored) {
Write-Debug "Exiting with non-zero exit code."
exit 1
Expand Down
6 changes: 5 additions & 1 deletion src/functions/Chocolatey-InstallAll.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@ param(

Write-Debug "Running 'Chocolatey-InstallAll' with source:`'$source`'";

if ($source -eq '' -or $source -eq 'https://go.microsoft.com/fwlink/?LinkID=230477' -or $source -eq 'http://chocolatey.org/api/v2/') {
if ($source -eq '' -or $source -eq 'https://go.microsoft.com/fwlink/?LinkID=230477' -or $source -eq 'https://chocolatey.org/api/v2/') {
write-host 'Source must be specified and cannot be nuget.org/chocolatey.org'
return
}

if ($source.StartsWith('http')) {
$webClient = New-Object System.Net.WebClient
$defaultCreds = [System.Net.CredentialCache]::DefaultCredentials
if ($defaultCreds -ne $null) {
$webClient.Credentials = $defaultCreds
}

if (!$source.EndsWith('/')) { $source = $source + '/' }
$feedUrl = $source + 'Packages/'
Expand Down
2 changes: 1 addition & 1 deletion src/functions/Chocolatey-Pack.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ param(

$process = Start-Process $nugetExe -ArgumentList $packageArgs -NoNewWindow -Wait -RedirectStandardOutput $logFile -RedirectStandardError $errorLogFile -PassThru
# this is here for specific cases in Posh v3 where -Wait is not honored
try { if (!($process.HasExited)) { Wait-Process $process } } catch { }
try { if (!($process.HasExited)) { Wait-Process -Id $process.Id } } catch { }

$nugetOutput = Get-Content $logFile -Encoding Ascii
foreach ($line in $nugetOutput) {
Expand Down
21 changes: 18 additions & 3 deletions src/functions/Chocolatey-Push.ps1
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
function Chocolatey-Push {
param(
[string] $packageName,
[string] $source = 'http://chocolatey.org/'
[string] $source = 'https://chocolatey.org/'
)
Write-Debug "Running 'Chocolatey-Push' for $packageName with source:`'$source`'";

$srcArgs = "-source $source"
if ($source -like '') {
$srcArgs = '-source http://chocolatey.org/'
$srcArgs = '-source https://chocolatey.org/'
Write-Debug "Setting source to `'$srcArgs`'"
}

Expand All @@ -19,7 +19,7 @@ param(

$process = Start-Process $nugetExe -ArgumentList $packageArgs -NoNewWindow -Wait -RedirectStandardOutput $logFile -RedirectStandardError $errorLogFile -PassThru
# this is here for specific cases in Posh v3 where -Wait is not honored
try { if (!($process.HasExited)) { Wait-Process $process } } catch { }
try { if (!($process.HasExited)) { Wait-Process -Id $process.Id } } catch { }

$nugetOutput = Get-Content $logFile -Encoding Ascii
foreach ($line in $nugetOutput) {
Expand All @@ -29,4 +29,19 @@ param(
if ($process.ExitCode -ne 0) {
throw $errors
}

if ($source -like '' -or $source -like 'https://chocolatey.org/') {
@"
Your package may be subject to moderation. A moderator will review the
package prior to acceptance. You should have received an email. If you
don't hear back from moderators within one business day, please reply
to the email and ask for status or use contact site admins on the
package page to contact moderators.
Please ensure your registered email address is correct and emails from
chocolateywebadmin at googlegroups dot com are not being sent to your
spam/junk folder.
"@ | Write-Host -ForegroundColor $Warning -BackgroundColor Black

}
}
2 changes: 1 addition & 1 deletion src/functions/Chocolatey-Python.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ param(
Write-Host "Opening minimized PowerShell window and calling `'cmd.exe $packageArgs`'. If progress is taking a long time, please check that window. It also may not be 100% silent..." -ForegroundColor $Warning -BackgroundColor Black
$process = Start-Process -FilePath "$($env:windir)\System32\WindowsPowerShell\v1.0\powershell.exe" -ArgumentList "-NoProfile -ExecutionPolicy unrestricted -Command `"cmd.exe $packageArgs | Tee-Object -FilePath `'$chocoInstallLog`'`"" -Wait -WindowStyle Minimized -PassThru
# this is here for specific cases in Posh v3 where -Wait is not honored
try { if (!($process.HasExited)) { Wait-Process $process } } catch { }
try { if (!($process.HasExited)) { Wait-Process -Id $process.Id } } catch { }

Create-InstallLogIfNotExists $chocoInstallLog
$installOutput = Get-Content $chocoInstallLog -Encoding Ascii
Expand Down
2 changes: 1 addition & 1 deletion src/functions/Generate-BinFile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ start """" ""$path"" %*" | Out-File $packageBatchFileName -encoding ASCII

"@echo off
SET DIR=%~dp0%
cmd /c ""$path %*""
cmd /c """"$path"" %*""
exit /b %ERRORLEVEL%" | Out-File $packageBatchFileName -encoding ASCII

$sw = New-Object IO.StreamWriter "$packageBashFileName"
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/functions/Get-CheckSumValid.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ param(
Write-Debug "Calling command [`'$checksumExe`' -c$checksum `"$file`"] to retrieve checksum"
$process = Start-Process "$checksumExe" -ArgumentList " -c=`"$checksum`" -t=`"$checksumType`" -f=`"$file`"" -Wait -WindowStyle Hidden -PassThru
# this is here for specific cases in Posh v3 where -Wait is not honored
try { if (!($process.HasExited)) { Wait-Process $process } } catch { }
try { if (!($process.HasExited)) { Wait-Process -Id $process.Id } } catch { }

Write-Debug "`'$checksumExe`' exited with $($process.ExitCode)"

Expand Down
2 changes: 1 addition & 1 deletion src/helpers/functions/Get-ChocolateyUnzip.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ param(
param($7zip, $destination, $fileFullPath, [ref]$exitCodeRef)
$process = Start-Process $7zip -ArgumentList "x -o`"$destination`" -y `"$fileFullPath`"" -Wait -WindowStyle Hidden -PassThru
# this is here for specific cases in Posh v3 where -Wait is not honored
try { if (!($process.HasExited)) { Wait-Process $process } } catch { }
try { if (!($process.HasExited)) { Wait-Process -Id $process.Id } } catch { }

$exitCodeRef.Value = $process.ExitCode
}
Expand Down
9 changes: 9 additions & 0 deletions src/helpers/functions/Get-WebFile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,17 @@ param(
Write-Debug "Running 'Get-WebFile' for $fileName with url:`'$url`', userAgent: `'$userAgent`' ";
#if ($url -eq '' return)
$req = [System.Net.HttpWebRequest]::Create($url);
$defaultCreds = [System.Net.CredentialCache]::DefaultCredentials
if ($defaultCreds -ne $null) {
$req.Credentials = $defaultCreds
}

# check if a proxy is required
$webclient = new-object System.Net.WebClient
if ($defaultCreds -ne $null) {
$webClient.Credentials = $defaultCreds
}

if (!$webclient.Proxy.IsBypassed($url))
{
$creds = [net.CredentialCache]::DefaultCredentials
Expand Down
9 changes: 9 additions & 0 deletions src/helpers/functions/Get-WebHeaders.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,18 @@ param(
if ($url -eq '') { return }

$request = [System.Net.HttpWebRequest]::Create($url);
$defaultCreds = [System.Net.CredentialCache]::DefaultCredentials
if ($defaultCreds -ne $null) {
$request.Credentials = $defaultCreds
}

#$request.Method = "HEAD"
# check if a proxy is required
$client = New-Object System.Net.WebClient
if ($defaultCreds -ne $null) {
$client.Credentials = $defaultCreds
}

if (!$client.Proxy.IsBypassed($url))
{
$creds = [Net.CredentialCache]::DefaultCredentials
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/Get-ConfigValue.tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Describe "Get-ConfigValue" {
<?xml version="1.0"?>
<chocolatey>
<sources>
<source id="chocolatey" value="http://chocolatey.org/api/v2/" />
<source id="chocolatey" value="https://chocolatey.org/api/v2/" />
<source id="nuget" value="https://go.microsoft.com/fwlink/?LinkID=230477" />
</sources>
</chocolatey>
Expand Down

0 comments on commit e076d62

Please sign in to comment.