ikiwiki: Create and manage wikis/blogs.

This commit is contained in:
James Valleroy authored and Sunil Mohan Adapa committed 2015-04-13 20:43:07 +05:30
1 parent fbce204180
commit 1464ff3184
7 files changed
+174 -10

No files matched your search

+12 -4
View File
@@ -47,6 +47,9 @@ def parse_arguments():
# Disable ikiwiki site
subparsers.add_parser('disable', help='Disable ikiwiki site')
# Get wikis and blogs
subparsers.add_parser('get-sites', help='Get wikis and blogs')
# Create a wiki
create_wiki = subparsers.add_parser('create-wiki', help='Create a wiki')
create_wiki.add_argument('--name', help='Name of new wiki')
@@ -71,8 +74,9 @@ def subcommand_enable(_):
if not os.path.isfile(CONFIG_FILE):
setup()
subprocess.check_output(['a2enmod', 'cgi'])
subprocess.check_output(['a2enconf', 'ikiwiki'])
subprocess.check_output(['service', 'apache2', 'reload'])
subprocess.check_output(['service', 'apache2', 'restart'])
def subcommand_disable(_):
@@ -81,6 +85,12 @@ def subcommand_disable(_):
subprocess.check_output(['service', 'apache2', 'reload'])
def subcommand_get_sites(_):
"""Get wikis and blogs"""
sites = os.listdir(WIKI_PATH)
print('\n'.join(sites))
def subcommand_create_wiki(arguments):
"""Create a wiki"""
subprocess.check_output(['ikiwiki', '-setup', SETUP_WIKI, arguments.name])
@@ -163,18 +173,16 @@ def setup():
' url => "/ikiwiki/$wikiname_short",\n',
' cgiurl => "/ikiwiki/$wikiname_short/ikiwiki.cgi",\n',
' cgi_wrapper => "/var/www/ikiwiki/$wikiname_short/ikiwiki.cgi",\n',
' add_plugins => [qw{goodstuff websetup comments blogspam calendar sidebar trail httpauth}],\n',
' add_plugins => [qw{goodstuff websetup comments calendar sidebar trail httpauth}],\n',
' rss => 1,\n',
' atom => 1,\n',
' syslog => 1,\n',
'\n',
' example => "blog",\n',
' comments_pagespec => "posts/* and !*/Discussion",\n',
' blogspam_pagespec => "postcomment(*)",\n',
' archive_pagespec => "page(posts/*) and !*/Discussion",\n',
' global_sidebars => 0,\n',
' discussion => 0,\n',
' locked_pages => "* and !postcomment(*)",\n',
' tagbase => "tags",\n',
')\n',
])