permacomputing

Source repository for the main permacomputing wiki site
git clone http://git.permacomputing.net/repos/permacomputing.git # read-only access
Log | Files | Refs

installing.mdwn (5376B)


      1 These install notes make the following assumptions: Debian OS, nginx, fcgi-wrap, stagit. Also these are notes, not all the steps are provided, such as restarting nginx, enabling https, etc.
      2 
      3 ## Base installation
      4 
      5     sudo apt install ikiwiki
      6     sudo mkdir /var/www/damaged.bleu255.com-src /var/www/damaged.bleu255.com
      7     sudo chown $USER:$USER /var/www/damaged.bleu255.com*
      8     echo "hello" > /var/www/damaged.bleu255.com-src/index.mdwn
      9     mkdir ~/ikiwiki-cfg
     10     ikiwiki --verbose /var/www/damaged.bleu255.com-src /var/www/damaged.bleu255.com --url=https://damaged.bleu255.com --dumpsetup ~/ikiwiki-cfg/damaged.setup
     11     ikiwiki --setup ~/ikiwiki-cfg/damaged.setup
     12 
     13 ## Configuration changes
     14 
     15 IMPORTANT, any changes to the wiki configuration must be followed by this to reflect changes:
     16 
     17     ikiwiki --setup ~/ikiwiki-cfg/damaged.setup
     18 
     19 ## Enable CGI
     20 
     21     # ~/ikiwiki-cfg/damaged.setup
     22     cgiurl: 'https://damaged.bleu255.com/ikiwiki.cgi'
     23     cgi_wrapper: '/var/www/damaged.bleu255.com/ikiwiki.cgi'
     24 
     25     # /etc/nginx/sites-available/damages.bleu255.com
     26     server {
     27       listen 443;
     28     
     29       server_name damaged.bleu255.com;
     30 
     31       root /var/www/damaged.bleu255.com;
     32       index index.html index.htm;
     33       access_log /var/log/nginx/damaged.bleu255.com-access.log;
     34       error_log /var/log/nginx/damaged.bleu255.com-error.log;
     35 
     36       location / {
     37         try_files $uri $uri/ =404;
     38       }
     39 
     40       # Max size of file upload
     41       client_max_body_size 10m;
     42 
     43       location /ikiwiki.cgi {
     44         gzip off;
     45         fastcgi_pass unix:/var/run/fcgiwrap.socket;
     46         fastcgi_index ikiwiki.cgi;
     47         fastcgi_param SCRIPT_FILENAME /var/www/damaged.bleu255.com/ikiwiki.cgi;
     48         fastcgi_param DOCUMENT_ROOT /var/www/damaged.bleu255.com/;
     49         include /etc/nginx/fastcgi_params;
     50       }
     51     }
     52 
     53 ## Enable git
     54 
     55     ikiwiki-makerepo git /var/www/damaged.bleu255.com-src /var/www/git.bleu255.com/repos/damaged.bleu255.com.git
     56 
     57     # ~/ikiwiki-cfg/damaged.setup
     58     rcs: 'git'
     59 
     60     ikiwiki --changesetup ~/ikiwiki-cfg/damaged.setup
     61 
     62     # ~/ikiwiki-cfg/damaged.setup
     63     git_wrapper: /var/www/git.bleu255.com/repos/damaged.bleu255.com.git/hooks/post-update
     64     git_wrapper_background_command: git push
     65 
     66     ikiwiki --setup ~/ikiwiki-cfg/damaged.setup
     67     cd /var/www/damaged.bleu255.com-src
     68     git config pull.rebase false
     69 
     70 ## stagit hooks and stagit diff URLs
     71 
     72     cd /var/www/git.bleu255.com/repos/damaged.bleu255.com.git/hooks
     73     ln -s ../../../update_single.sh post-receive
     74 
     75     # ~/ikiwiki-cfg/damaged.setup
     76     diffurl: https://git.bleu255.com/damaged.bleu255.com/commit/\[\[sha1_commit\]\].html
     77 
     78 
     79 ## Limited web access
     80 
     81 There are 2 ways to deal with user:pass for web access (if we rule out external auth like openid):
     82 
     83 * outsource it to httpd-auth, implies that someone has to maintain the list of users and their passwd manually 
     84 * or add a password prompt during account creation, something we'd share with only trusted people, or people showing interest, etc. We choose this approach
     85 
     86     # ~/ikiwiki-cfg/damaged.setup
     87     account_creation_password: pa55w0rd
     88     ikiwiki --setup ~/ikiwiki-cfg/damaged.setup
     89 
     90 ## Support for sending emails
     91 
     92 Useful to reset passwords, etc.
     93 
     94     sudo apt install libmail-sendmail-perl
     95     
     96     # ~/ikiwiki-cfg/damaged.setup
     97     adminemail: yolo29383@hotmail.com
     98 
     99     ikiwiki --setup ~/ikiwiki-cfg/damaged.setup
    100 
    101 ## Stronger password hashes
    102 
    103     sudo apt install libauthen-passphrase-perl
    104 
    105     # ~/ikiwiki-cfg/damaged.setup
    106     password_cost: 16
    107 
    108 ## Disable OpenID and emailauth
    109 
    110     ikiwiki --setup ikiwiki-cfg/damaged.setup --disable-plugin openid
    111     ikiwiki --setup ikiwiki-cfg/damaged.setup --disable-plugin emailauth
    112 
    113     # ~/ikiwiki-cfg/damaged.setup
    114     disable_plugins: [emailauth, openid]
    115 
    116 ## Default git commit message when none provided
    117 
    118 Ikiwiki and a recent enough version of git allow for empty git messages (the "Optional description of this change" while editing on the web), that's nice but it makes stagit history impossible to browse because it uses such messages as links. To make ikiwiki provide a default commit message when non given, you can do this:
    119 
    120     diff --git a/git.pm.old b/git.pm
    121     index 2bc2500..2198207 100644
    122     --- a/git.pm.old
    123     +++ b/git.pm
    124     @@ -680,21 +680,8 @@ sub rcs_commit_helper (@) {
    125             $params{message} = IkiWiki::possibly_foolish_untaint($params{message});
    126             my @opts;
    127             if ($params{message} !~ /\S/) {
    128     -               # Force git to allow empty commit messages.
    129     -               # (If this version of git supports it.)
    130     -               my ($version)=`git --version` =~ /git version (.*)/;
    131     -               if ($version ge "1.7.8") {
    132     -                       push @opts, "--allow-empty-message", "--no-edit";
    133     -               }
    134     -               if ($version ge "1.7.2") {
    135     -                       push @opts, "--allow-empty-message";
    136     -               }
    137     -               elsif ($version ge "1.5.4") {
    138     -                       push @opts, '--cleanup=verbatim';
    139     -               }
    140     -               else {
    141     -                       $params{message}.=".";
    142     -               }
    143     +               # Force a message to commit if none given.
    144     +               $params{message}.="empty web commit";
    145             }
    146             if (exists $params{file}) {
    147                     push @opts, '--', $params{file};
    148 
    149