Backing out sub-uri changes
This commit is contained in:
parent
e09771d9b4
commit
b865c20b2d
5 changed files with 5 additions and 50 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -18,7 +18,6 @@ public/stylesheets/application.css
|
||||||
public/stylesheets/sessions.css
|
public/stylesheets/sessions.css
|
||||||
public/stylesheets/ui.css
|
public/stylesheets/ui.css
|
||||||
public/stylesheets/mobile.css
|
public/stylesheets/mobile.css
|
||||||
public/diaspora
|
|
||||||
public/well-known/host-meta
|
public/well-known/host-meta
|
||||||
spec/fixtures/users.yaml
|
spec/fixtures/users.yaml
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,12 +26,3 @@ end
|
||||||
|
|
||||||
# Initialize the rails application
|
# Initialize the rails application
|
||||||
Diaspora::Application.initialize!
|
Diaspora::Application.initialize!
|
||||||
|
|
||||||
# Presume the assets are exposed on the sub_uri.
|
|
||||||
if AppConfig[ :pod_uri].path != "/"
|
|
||||||
ActionController::Base.asset_host =
|
|
||||||
Proc.new{ |source, request|
|
|
||||||
request.scheme + "://" +
|
|
||||||
request.host_with_port + AppConfig[:pod_uri].path
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ Feature: Flexible uri deployment
|
||||||
Scenario: Present application to user
|
Scenario: Present application to user
|
||||||
Given configuration parameter pod_url is http://localhost:3000/diaspora
|
Given configuration parameter pod_url is http://localhost:3000/diaspora
|
||||||
When I visit url http://localhost:3000/diaspora
|
When I visit url http://localhost:3000/diaspora
|
||||||
And I retrieve http://localhost:3000/diaspora/ into tmp/index.html
|
And I retrieve http://localhost:3000/diaspora into tmp/index.html
|
||||||
Then I should see "put something in"
|
Then I should see "put something in"
|
||||||
And a page-asset should be http://localhost:3000/diaspora/stylesheets/ui.css
|
And a page-asset should be http://localhost:3000/diaspora/stylesheets/ui.css
|
||||||
And I should match 'http://localhost:3000/diaspora/stylesheets/blueprint/print.css.[0-9]+"' in tmp/index.html
|
And I should match 'http://localhost:3000/diaspora/stylesheets/blueprint/print.css.[0-9]+"' in tmp/index.html
|
||||||
|
|
|
||||||
|
|
@ -1,26 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
#
|
|
||||||
# Get value from AppConfig
|
|
||||||
#
|
|
||||||
# Usage get_env [key ...]
|
|
||||||
|
|
||||||
path=$( readlink -fn $0) && cd $(dirname $path)/.. || exit 2
|
|
||||||
|
|
||||||
size=0
|
|
||||||
size=$( wc tmp/environment 2>/dev/null | awk '{print $1}') || :
|
|
||||||
if [[ "$size" = "0" || tmp/environment -ot config/app_config.yml ]]
|
|
||||||
then
|
|
||||||
ruby > tmp/environment << 'EOT'
|
|
||||||
require File.join('config', 'environment.rb')
|
|
||||||
AppConfig.config_vars.each { |key, value|
|
|
||||||
puts key.to_s + "\t" + value.to_s
|
|
||||||
}
|
|
||||||
puts "pod_uri.host\t" + AppConfig[:pod_uri].host.to_s
|
|
||||||
puts "pod_uri.path\t" + AppConfig[:pod_uri].path.to_s
|
|
||||||
puts "pod_uri.port\t" + AppConfig[:pod_uri].port.to_s
|
|
||||||
EOT
|
|
||||||
fi
|
|
||||||
|
|
||||||
for key in $@; do
|
|
||||||
awk -v key=$key '{ if ($1 == key ) print $2 }' < tmp/environment
|
|
||||||
done
|
|
||||||
|
|
@ -9,16 +9,6 @@ OS=`uname -s`
|
||||||
|
|
||||||
[ -e config/server.sh ] && source config/server.sh
|
[ -e config/server.sh ] && source config/server.sh
|
||||||
|
|
||||||
function init_suburi_assets
|
|
||||||
# fix a symlink corresponding to sub-uri
|
|
||||||
{
|
|
||||||
find public -maxdepth 1 -type l -delete
|
|
||||||
sub_uri=$(./script/get_env.sh pod_uri.path)
|
|
||||||
if [ -n "$sub_uri" -a "$sub_uri" != "/" ]; then
|
|
||||||
cd public; ln -sf . ${sub_uri##/}; cd ..
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
function init_public
|
function init_public
|
||||||
# Create all dynamically generated files in public/ folder
|
# Create all dynamically generated files in public/ folder
|
||||||
{
|
{
|
||||||
|
|
@ -117,6 +107,8 @@ if [ -n "$services" ]; then
|
||||||
exit 64
|
exit 64
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Check if Mongo is running
|
# Check if Mongo is running
|
||||||
if ! ps ax | grep -v grep | grep mongod >/dev/null
|
if ! ps ax | grep -v grep | grep mongod >/dev/null
|
||||||
then
|
then
|
||||||
|
|
@ -157,7 +149,6 @@ if [ ! -e 'public/stylesheets/application.css' ]; then
|
||||||
exit 66
|
exit 66
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[ -w public ] && init_suburi_assets
|
|
||||||
|
|
||||||
mkdir -p -v log/thin/
|
mkdir -p -v log/thin/
|
||||||
bundle exec ruby ./script/websocket_server.rb&
|
bundle exec ruby ./script/websocket_server.rb&
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue