mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-02-04 08:13:38 +00:00
mediawiki: Enable short URLs
Fixes #1274 Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
This commit is contained in:
parent
644e9f8e93
commit
6fe172acc8
@ -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')
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,9 @@
|
||||
<Directory /var/lib/mediawiki/>
|
||||
<IfModule mod_rewrite.c>
|
||||
RewriteEngine On
|
||||
RewriteRule ^/index.php/(.*)$ /$1 [R,L]
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteRule ^(.*)$ index.php [L]
|
||||
</IfModule>
|
||||
</Directory>
|
||||
@ -26,7 +26,7 @@ from plinth.menu import main_menu
|
||||
|
||||
from .manifest import clients
|
||||
|
||||
version = 3
|
||||
version = 4
|
||||
|
||||
managed_packages = ['mediawiki', 'imagemagick', 'php-sqlite3']
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user