mirror of
https://github.com/caddyserver/caddy.git
synced 2025-01-07 11:28:48 +03:00
Merge branch 'master' of https://github.com/mholt/caddy
This commit is contained in:
commit
2fa6e278d2
5 changed files with 25 additions and 15 deletions
|
@ -20,7 +20,7 @@ const (
|
||||||
Name = "Caddy"
|
Name = "Caddy"
|
||||||
|
|
||||||
// Version is the program version
|
// Version is the program version
|
||||||
Version = "0.7.2"
|
Version = "0.7.3"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
9
dist/CHANGES.txt
vendored
9
dist/CHANGES.txt
vendored
|
@ -1,10 +1,11 @@
|
||||||
CHANGES
|
CHANGES
|
||||||
|
|
||||||
<master>
|
0.7.3 (July 15, 2015)
|
||||||
- errors: Error log now includes timestamp with each entry
|
- errors: Error log now shows timestamp with each entry
|
||||||
- gzip: Default filtering is by extension (fixes bug); removed MIME type filter
|
- gzip: Fixed; Default filtering is by extension; removed MIME type filter
|
||||||
- import: Fixed; works inside and outside server blocks
|
- 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)
|
0.7.2 (July 1, 2015)
|
||||||
|
|
2
dist/README.txt
vendored
2
dist/README.txt
vendored
|
@ -1,4 +1,4 @@
|
||||||
CADDY 0.7.2
|
CADDY 0.7.3
|
||||||
|
|
||||||
Website
|
Website
|
||||||
https://caddyserver.com
|
https://caddyserver.com
|
||||||
|
|
25
dist/automate.sh
vendored
25
dist/automate.sh
vendored
|
@ -19,28 +19,37 @@ ReleaseDir=$DistDir/release
|
||||||
# Compile binaries
|
# Compile binaries
|
||||||
mkdir -p $BuildDir
|
mkdir -p $BuildDir
|
||||||
cd $BuildDir
|
cd $BuildDir
|
||||||
rm -f *
|
rm -f caddy*
|
||||||
gox $Package
|
gox $Package
|
||||||
|
|
||||||
# Zip them up with release notes and stuff
|
# Zip them up with release notes and stuff
|
||||||
mkdir -p $ReleaseDir
|
mkdir -p $ReleaseDir
|
||||||
cd $ReleaseDir
|
cd $ReleaseDir
|
||||||
rm -f *
|
rm -f caddy*
|
||||||
for f in $BuildDir/*
|
for f in $BuildDir/*
|
||||||
do
|
do
|
||||||
# Name .zip file same as binary, but strip .exe from end
|
# 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
|
# Binary inside the zip file is simply the project name
|
||||||
bin=$BuildDir/$(basename $Package)
|
binbase=$(basename $Package)
|
||||||
if [[ $f == *.exe ]]
|
if [[ $f == *.exe ]]; then
|
||||||
then
|
binbase=$binbase.exe
|
||||||
bin=$bin.exe
|
|
||||||
fi
|
fi
|
||||||
|
bin=$BuildDir/$binbase
|
||||||
mv $f $bin
|
mv $f $bin
|
||||||
|
|
||||||
# Compress distributable
|
# 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
|
# Put binary filename back to original
|
||||||
mv $bin $f
|
mv $bin $f
|
||||||
|
|
|
@ -23,7 +23,7 @@ type Redirect struct {
|
||||||
func (rd Redirect) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, error) {
|
func (rd Redirect) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, error) {
|
||||||
for _, rule := range rd.Rules {
|
for _, rule := range rd.Rules {
|
||||||
if rule.From == "/" {
|
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)
|
toURL, err := url.Parse(rule.To)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return http.StatusInternalServerError, err
|
return http.StatusInternalServerError, err
|
||||||
|
|
Loading…
Reference in a new issue