Skip to content
This repository has been archived by the owner on Feb 16, 2018. It is now read-only.

Add TENT_SUBDIR option to run under a subdirectory #33

Merged
merged 1 commit into from Jan 1, 2013
Merged

Add TENT_SUBDIR option to run under a subdirectory #33

merged 1 commit into from Jan 1, 2013

Conversation

graue
Copy link
Contributor

@graue graue commented Jan 1, 2013

With this environment variable set (example: TENT_SUBDIR=/tent), all of TentD, TentD-Admin, OAuth, etc. will use a path under that subdirectory (in the example above, the profile will be at /tent/profile, the admin interface will be at /tent/admin, and so on).

I have tested this and the admin interface, OAuth login, and regular Tent use all work without issues.

If accepted, this should resolve issue tent/tentd-admin#31.

This also removes the TENT_SERVER environment variable, which did not work for me.

auth_url += '/admin/oauth/confirm'
auth_url += "?#{env['QUERY_STRING']}"
[301, { "Location" => auth_url }, []] }
end

map '/admin' do
map ((ENV['TENT_SUBDIR'] || '') + '/admin') do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You shouldn't need the outer parens on these statements.

@graue
Copy link
Contributor Author

graue commented Jan 1, 2013

OK, took out the debugging statements and the unneeded parens... looking good?

@titanous
Copy link
Member

titanous commented Jan 1, 2013

👍 Can you squash these commits?

With this environment variable set (example: TENT_SUBDIR=/tent),
all of TentD, TentD-Admin, OAuth, etc. will use a path under
that subdirectory (in the example above, the profile will be at
/tent/profile, the admin interface will be at /tent/admin, and
so on).

I have tested this and the admin interface, OAuth login, and
regular Tent use all work without issues.
@graue
Copy link
Contributor Author

graue commented Jan 1, 2013

Squashed.

titanous added a commit that referenced this pull request Jan 1, 2013
Add TENT_SUBDIR option to run under a subdirectory

Closes #31
@titanous titanous merged commit 49e85b4 into tent:master Jan 1, 2013
@titanous
Copy link
Member

titanous commented Jan 1, 2013

Merged, thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants