From afc540f6b7ff162a5d1141fe8d04d158619f1575 Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Wed, 15 Jul 2015 09:36:34 -0600 Subject: [PATCH 1/3] Updated changes --- dist/CHANGES.txt | 9 +++++---- middleware/redirect/redirect.go | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/dist/CHANGES.txt b/dist/CHANGES.txt index 1be7e263..b7238d25 100644 --- a/dist/CHANGES.txt +++ b/dist/CHANGES.txt @@ -1,10 +1,11 @@ CHANGES - -- errors: Error log now includes timestamp with each entry -- gzip: Default filtering is by extension (fixes bug); removed MIME type filter +0.7.3 (July 15, 2015) +- errors: Error log now shows timestamp with each entry +- gzip: Fixed; Default filtering is by extension; removed MIME type filter - import: Fixed; works inside and outside server blocks -- templates: Restricted or missing files result in proper 403 or 404 error +- redir: Query string preserved on catch-all redirects +- templates: Proper 403 or 404 errors for restricted or missing files 0.7.2 (July 1, 2015) diff --git a/middleware/redirect/redirect.go b/middleware/redirect/redirect.go index 2c5de410..56275d8b 100644 --- a/middleware/redirect/redirect.go +++ b/middleware/redirect/redirect.go @@ -23,7 +23,7 @@ type Redirect struct { func (rd Redirect) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, error) { for _, rule := range rd.Rules { if rule.From == "/" { - // Catchall redirect preserves path (TODO: Standardize/formalize this behavior) + // Catchall redirect preserves path and query string toURL, err := url.Parse(rule.To) if err != nil { return http.StatusInternalServerError, err From 95140f948f2401b95c73bd739c8b1591854b1e54 Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Wed, 15 Jul 2015 09:52:47 -0600 Subject: [PATCH 2/3] version bump 0.7.3 --- app/app.go | 2 +- dist/README.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/app.go b/app/app.go index c35bded3..babe4930 100644 --- a/app/app.go +++ b/app/app.go @@ -20,7 +20,7 @@ const ( Name = "Caddy" // Version is the program version - Version = "0.7.2" + Version = "0.7.3" ) var ( diff --git a/dist/README.txt b/dist/README.txt index e490dc85..50793686 100644 --- a/dist/README.txt +++ b/dist/README.txt @@ -1,4 +1,4 @@ -CADDY 0.7.2 +CADDY 0.7.3 Website https://caddyserver.com From a74b20f278300583d2eff0b1c60f5509bb812ef8 Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Fri, 17 Jul 2015 17:26:33 -0600 Subject: [PATCH 3/3] .zip for Win/Mac, .tar.gz for Linux/BSD --- dist/automate.sh | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/dist/automate.sh b/dist/automate.sh index 4a91d611..3cc8d41b 100755 --- a/dist/automate.sh +++ b/dist/automate.sh @@ -19,28 +19,37 @@ ReleaseDir=$DistDir/release # Compile binaries mkdir -p $BuildDir cd $BuildDir -rm -f * +rm -f caddy* gox $Package # Zip them up with release notes and stuff mkdir -p $ReleaseDir cd $ReleaseDir -rm -f * +rm -f caddy* for f in $BuildDir/* do # Name .zip file same as binary, but strip .exe from end - zipname=$(basename ${f%".exe"}).zip + zipname=$(basename ${f%".exe"}) + if [[ $f == *"linux"* ]] || [[ $f == *"bsd"* ]]; then + zipname=${zipname}.tar.gz + else + zipname=${zipname}.zip + fi # Binary inside the zip file is simply the project name - bin=$BuildDir/$(basename $Package) - if [[ $f == *.exe ]] - then - bin=$bin.exe + binbase=$(basename $Package) + if [[ $f == *.exe ]]; then + binbase=$binbase.exe fi + bin=$BuildDir/$binbase mv $f $bin # Compress distributable - zip -j $zipname $bin $DistDir/CHANGES.txt $DistDir/LICENSES.txt $DistDir/README.txt + if [[ $zipname == *.zip ]]; then + zip -j $zipname $bin $DistDir/CHANGES.txt $DistDir/LICENSES.txt $DistDir/README.txt + else + tar -cvzf $zipname -C $BuildDir $binbase -C $DistDir CHANGES.txt LICENSES.txt README.txt + fi # Put binary filename back to original mv $bin $f