mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
config: Add option to use Apache's default home page as home page
This supports the use case of hosting a website on FreedomBox at Apache's web root. This makes the assumption that index.html is a file in the website. Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
8bc34f84c3
commit
bedc5ff96d
@ -76,7 +76,11 @@ def get_home_page():
|
||||
|
||||
# match this against the app_id in the entries of frontpage.get_shortcuts()
|
||||
# The underscore is to handle Ikiwiki app_ids
|
||||
return app_path.strip('/"').replace('/', '_')
|
||||
app = app_path.strip('/"').replace('/', '_')
|
||||
if app == "index.html":
|
||||
return "apache-default"
|
||||
else:
|
||||
return app
|
||||
|
||||
|
||||
def init():
|
||||
|
||||
@ -103,10 +103,12 @@ def _apply_changes(request, old_status, new_status):
|
||||
messages.success(request, _('Webserver home page set'))
|
||||
|
||||
|
||||
def change_default_app(app_id):
|
||||
def change_home_page(app_id):
|
||||
"""Changes the FreedomBox's default app to the app specified by app_id."""
|
||||
if app_id == 'plinth':
|
||||
url = '/plinth'
|
||||
elif app_id == 'apache-default':
|
||||
url = '/index.html'
|
||||
else:
|
||||
shortcuts = frontpage.get_shortcuts()
|
||||
url = [
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user