mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
mediawiki: Enable short URLs
Fixes #1274 Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
This commit is contained in:
1 parent
644e9f8e93
commit
6fe172acc8
3 files changed
+24
-1
No files matched your search
@@ -85,6 +85,7 @@ def subcommand_setup(_):
|
||||
])
|
||||
subprocess.run(['chmod', '-R', 'o-rwx', data_dir], check=True)
|
||||
subprocess.run(['chown', '-R', 'www-data:www-data', data_dir], check=True)
|
||||
_change_article_path()
|
||||
_disable_public_registrations()
|
||||
_disable_anonymous_editing()
|
||||
_change_logo()
|
||||
@@ -119,6 +120,17 @@ def _change_logo():
|
||||
|
||||
file_handle.write(line)
|
||||
|
||||
def _change_article_path():
|
||||
lines = open(CONF_FILE, 'r').readlines()
|
||||
with open(CONF_FILE, 'a') as file_handle:
|
||||
conf_line = ""
|
||||
for line in lines:
|
||||
if not re.match('^\s*\$wgArticlePath', line):
|
||||
conf_line = "$wgArticlePath = \"/mediawiki/$1\";\n"
|
||||
if not re.match('^\s*\$wgUsePathInfo', line):
|
||||
conf_line = conf_line+"$wgUsePathInfo = true;\n";
|
||||
file_handle.write(conf_line)
|
||||
|
||||
|
||||
def _enable_file_uploads():
|
||||
"""Enable file uploads in mediawiki"""
|
||||
@@ -159,11 +171,13 @@ def subcommand_enable(_):
|
||||
"""Enable web configuration and reload."""
|
||||
action_utils.service_enable('mediawiki-jobrunner')
|
||||
action_utils.webserver_enable('mediawiki')
|
||||
action_utils.webserver_enable('mediawiki-freedombox')
|
||||
|
||||
|
||||
def subcommand_disable(_):
|
||||
"""Disable web configuration and reload."""
|
||||
action_utils.webserver_disable('mediawiki')
|
||||
action_utils.webserver_disable('mediawiki-freedombox')
|
||||
action_utils.service_disable('mediawiki-jobrunner')
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user