From bee7cf67c42d6119d0a1bdf1ac617cd2b9bbf37e Mon Sep 17 00:00:00 2001 From: Gustav Eek Date: Thu, 3 Oct 2019 12:51:22 +0200 Subject: SQUASH Full setup provided The rest of Creating a wiki preview is provided * TODO Link to more complicated guides * TODO Make the hole configuration rather a Bash script --- create-a-wiki-preview.mdwn | 210 +++++++++++++++++++++++++++++++++------------ 1 file changed, 157 insertions(+), 53 deletions(-) diff --git a/create-a-wiki-preview.mdwn b/create-a-wiki-preview.mdwn index 61d42b4..05f8153 100644 --- a/create-a-wiki-preview.mdwn +++ b/create-a-wiki-preview.mdwn @@ -1,5 +1,5 @@ --- -title: Create a wiki preview +title: Create a Fripost wiki preview ... This article describes how to set up preview of Friposts wiki. @@ -8,33 +8,43 @@ This article describes how to set up preview of Friposts wiki. [[!toc]] -The basic idea is something like the following: +The setup will produce the following layout: - Bare Git Repository - git.fripost.org:fripost-wiki.git - | - | - Repository for Local Edits - ~/git/fripost/wiki - | - | - The Preview Ikiwiki Web Part - ~/public_html/fripost-wiki +``` + Bare remote Git repository + (git.fripost.org:fripost-wiki.git) + | + | Library and config + Repository for Local Edits (~/.ikiwiki/) + (~/git/fripost/wiki) | + | +---------+ + | | Ikiwiki | + The Preview Ikiwiki Web Part -----| Pandoc | + (~/public_html/fripost-wiki) | Plugins | + | +---------+ + +------------+ +---------+ + | Web server | ---- | Browser | + +------------+ +---------+ +``` Where *~/git/fripost/wiki* is a local git repository with remote -tracking of the main bare wiki repository -*git.fripost.org:fripost-wiki.git*. I define an alias command for -recompilation of the local version of the. The local preview version -will reside in *~/public_html/fripost-wiki*. Eventually it -will be accessed by pointing the browser to -*http\://fripost.localhost* and *http://wiki.fripost.localhost* -respectively. - -Process overview: - -* Install and configure Git -* Install and configure Apache 2 -* Install Ikiwiki +tracking of Fripost's origin remote wiki repository +*git.fripost.org:fripost-wiki.git*. The local preview version will +reside in *~/public_html/fripost-wiki*. Eventually it will be accessed +by pointing the browser to *http://fripost.localhost* and +*http://wiki.fripost.localhost* respectively. The wiki configuration +*~/.ikiwiki/fripost-wiki.setup* will be only minor modifications of +Friposts wiki configuration. + +The guide assumes Debian stable. This is the overview of software +needed: + + * Git -- from Debian + * Ikiwiki -- from Debian + * Pandoc -- from Debian + * Some Ikiwiki plugins (e.g. for Pandoc) which will be provided from + Fripost's configuraiton + * Nginx -- webserver from Debian Install and configure Git ========================= @@ -44,17 +54,17 @@ instructions. You will need the following repositories: - * https://git.fripost.org/fripost-ansible - * https://git.fripost.org/fripost-wiki + * + * -Clone with ssh if you want to edit, which will require you to provide +Clone with SSH if you want to edit, which will require you to provide a public key to Fripost administrators. Below snippets assume: - $ git clone https://git.fripost.org/fripost-ansible ~/git/fripost/ansible - $ git clone https://git.fripost.org/fripost-wiki ~/git/fripost/wiki + git clone https://git.fripost.org/fripost-ansible ~/git/fripost/ansible + git clone https://git.fripost.org/fripost-wiki ~/git/fripost/wiki -Install and configure Ikiwiki and Pandoc -======================================== +Install and configure Ikiwiki, Pandoc and plugins +================================================= Refer to [ikiwiki setup](https://ikiwiki.info/setup/) at [ikiwiki's official website](https://ikiwiki.info) for initial @@ -62,40 +72,134 @@ install and configuration and [an article on Git](https://ikiwiki.info/rcs/git/) for more details on setting up Ikiwiki together with Git. -Install packages referred to in the ansible configuration: +Install packages referred to in the Ansible configuration: - sudo aptitude install \ + sudo apt install \ ikiwiki \ libauthen-passphrase-perl \ highlight-common libhighlight-perl libimage-magick-perl \ libmail-sendmail-perl libnet-dns-sec-perl \ fcgiwrap spawn-fcgi \ - pandoc + pandoc \ + clamdscan -Copy Ikiwiki configuration from Fripost ansible repository: +Copy Ikiwiki configuration from Fripost Ansible repository: - mkdir -p ~/public_html/fripost-wiki ~/.ikiwiki + mkdir -p ~/public_html/fripost-wiki ~/.ikiwiki cp -r ~/git/fripost/ansible/roles/wiki/files/var/lib/ikiwiki/* ~/.ikiwiki -Modify the configuration *~/.ikiwkik/fripost-wiki.setup* according to: +Modify the configuration *~/.ikiwkik/fripost-wiki.setup* according to +the below (inspect */tmp/fripost-wiki.sed*): ``` -adminemail: -adminuser: - - -srcdir: /git/fripost/wiki/ -destdir: /public_html/fripost-wiki -url: http://fripost.localhost/ # http://wiki.fripost.localhost/ -cgiurl: http://fripost.localhost/ikiwiki.cgi -cgi_wrapper: /public_html/fripost-wiki/ikiwiki.cgi -sslcookie: 0 -libdir: /.ikiwiki -# git_wrapper: /home/gustav/fripost/wiki/.git/hooks/post-update -#historyurl: -#diffurl: -gitorigin_branch: '' +cat < ~/.ikiwiki/fripost-wiki.setup ``` *TODO investegate what to do with post update thing.* - $ ikiwiki --setup ~/.ikiwkik/fripost-wiki.setup +Run setup: + + $ ikiwiki --setup ~/.ikiwiki/fripost-wiki.setup + +Install and conifgure Nginx and host files +========================================== + +Fripost uses [Nginx](http://nginx.org/en/docs/). For installation and +configuration +follow [Ikiwiki on Dot CGI](https://ikiwiki.info/tips/dot_cgi/). Note +the alexjj comment that on Debian the package *fcgiwrap* automatically +spwans the FastCGI program. + + sudo apt install nginx + +The follwing will configure *http://wiki.fripost.localhost* and +*http://fripost.localhost*: + +``` +cat < /tmp/hosts + +# Fripost wiki preview setup +127.0.1.1 wiki.fripost.localhost fripost.localhost +::1 wiki.fripost.localhost fripost.localhost +EOF +grep -q wiki.fripost.localhost /etc/hosts \ + || { sudo cp /etc/hosts /etc/hosts.bac_$(date +%Y%m%d) \ + && sudo sed -i '$ r /tmp/hosts' /etc/hosts ; } +``` + +Alternatives to Nginx include Apache. Fripost wiki used include +configuration for Apache, but these are not maintained any +longer. Brows this repository history for sample configurations. + +Refresh wiki +============ + +Now all is in place! Visit . Use the +following commands to refresh or fully rebuild the wiki: + +``` +ikiwiki --setup ~/.ikiwiki/fripost-wiki.setup --refresh +ikiwiki --setup ~/.ikiwiki/fripost-wiki.setup --rebuild +``` + +Happy hacking! -- cgit v1.2.3