mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
config: Allow better Apache default home page
- Don't redirect to '/index.html' when Apache Default is set as the home page. This allows having other files such as 'index.php' as index file in /var/www/html/. - If the home page is currently set to 'Apache Default' upgrade the configuration. Tests: - With Home page set to 'Apache Default' apply the patches. Config setup is re-run. The configuration file becomes empty but is still present. Correctly value is shown in the UI. /var/www/html/index.html is still shown as the home page. - With Home page set to 'Bepasty' apply the patches. Config setup is re-reun. The configuration file is not modified. Bepasty is still shown as the home page. Correctly value is shown in the UI. - With Home page not modified apply the patches. Config setup is re-reun. The configuration file is created. FreedomBox is the home page. Correctly value is shown in the UI. - On fresh machine with patches applied, perform first run. The configuration file is not created. FreedomBox is the home page. Correctly value is shown in the UI. - Changing home page to Bepasty or 'Apache Default' works. Changing back to 'FreedomBox Service (Plinth)' also works. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
1 parent
007d8de346
commit
298bb5ae58
4 files changed
+37
-28
No files matched your search
@@ -17,7 +17,7 @@ from plinth.modules.config import (_home_page_scid2url, change_home_page,
|
||||
def test_homepage_mapping():
|
||||
"""Basic tests for homepage functions."""
|
||||
func = home_page_url2scid
|
||||
assert func(None) == 'plinth'
|
||||
assert func(None) == 'apache-default'
|
||||
assert func('/unknown/url') is None
|
||||
assert func('/plinth/') == 'plinth'
|
||||
assert func('/plinth') == 'plinth'
|
||||
@@ -27,9 +27,8 @@ def test_homepage_mapping():
|
||||
assert func('/~user/whatever/else') == 'uws-user'
|
||||
|
||||
func = _home_page_scid2url
|
||||
assert func(None) is None
|
||||
assert func('plinth') == '/plinth/'
|
||||
assert func('apache-default') == '/index.html'
|
||||
assert func('apache-default') is None
|
||||
|
||||
|
||||
def test_homepage_mapping_skip_ci():
|
||||
|
||||
Reference in new issue
Block a user