Skip to content

Commit

Permalink
ensure Staticfile is in root folder; not public/
Browse files Browse the repository at this point in the history
  • Loading branch information
drnic committed Aug 13, 2014
1 parent ce66c51 commit 4dc404e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions bin/compile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ status "Copying project files into public/"
mkdir -p $cache_dir/public
mv $root_dir/* $cache_dir/public
mv $cache_dir/public .
# [[ -f public/Procfile ]] && mv public/Procfile .
mv public/Staticfile* .

status "Setting up nginx"
tar xzf $compile_nginx_tgz
Expand All @@ -46,9 +46,9 @@ cp -f $compile_buildpack_dir/conf/mime.types nginx/conf/mime.types
[[ -f $build_dir/public/nginx.conf ]] && mv $build_dir/public/nginx.conf nginx/conf/nginx.conf
[[ -f $build_dir/public/mime.types ]] && mv $build_dir/public/mime.types nginx/conf/mime.types

if [[ -f public/Staticfile.auth ]]; then
if [[ -f Staticfile.auth ]]; then
status "Enabling basic authentication"
mv public/Staticfile.auth nginx/conf/.htpasswd
mv Staticfile.auth nginx/conf/.htpasswd
cat nginx/conf/.htpasswd | indent
echo
protip "Learn about basic authentication" "https://github.com/drnic/staticfile-buildpack#basic-authentication"
Expand All @@ -60,9 +60,8 @@ if [[ "$(grep directory: Staticfile)X" != "X" ]]; then
touch nginx/conf/.enable_directory_index
fi

# [[ -f public/Procfile ]] && mv public/Procfile .
# echo "-----> Ensuring manifest.yml & stackato.yml aren't available in public/"
# rm -f public/{manifest,stackato}.yml

rm -f public/Staticfile*

cp $compile_buildpack_bin/boot.sh .
2 changes: 1 addition & 1 deletion conf/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ http {
location / {
root <%= ENV["APP_ROOT"] %>/public;
index index.html index.htm Default.htm;
<% if File.exists?(auth_file = File.join(ENV["APP_ROOT"], "nginx/conf/.enable_directory_index")) %>
<% if File.exists?(File.join(ENV["APP_ROOT"], "nginx/conf/.enable_directory_index")) %>
autoindex on;
<% end %>
<% if File.exists?(auth_file = File.join(ENV["APP_ROOT"], "nginx/conf/.htpasswd")) %>
Expand Down

0 comments on commit 4dc404e

Please sign in to comment.