(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Getting this running is a two-step process, not including preparation of a docker host with all the prereqs that come with that.
 
  
=== First of all we’ll create a new Canasta wiki, and then upgrade it to Open CSP. ===
+
This projects aims to integrate Open-CSP 2.0 into CanastaWiki. 
  
===== Creation of a new Canasta wiki: =====
+
== Getting started ==
For this we’ll use Canasta-DockerCompose.
 
  
# Clone the Canasta-DockerCompose repo, master branch. It can be found here : https://github.com/CanastaWiki/Canasta-DockerCompose
+
=== Clone the project and the Docker Compose companion project ===
# Copy the .env.example file to .env (optional; to override default values)
 
# Alter .env as needed (refer to https://canasta.wiki/other-maintenance/#configuration )
 
# Launch instance ( In your console you to the downloaded files and inside the main folder run : '''''docker-compose up -d''''' )
 
# Wait for the database container to become responsive
 
# Restart everything ( run '''''docker-compose down''''', then '''''docker-compose up -d''''' again )
 
# Navigate to your webpage (localhost in your web browser on the docker host)
 
# Follow the MediaWiki installation steps to install your version of MediaWiki
 
# Copy the downloaded LocalSettings.php to <where you installed the download rep in step 1>/config/ on the host
 
# Shut down Canasta instance ( run '''''docker-compose down''''' )
 
  
 +
<syntaxhighlight lang="bash">
 +
  git clone https://github.com/LarsS88/Canasta_OpenCSP.git
 +
</syntaxhighlight>
  
The shutdown and restart is needed to make the previously configured (either implicitly by defaults or explicitly through .env) MySQL root password become active.
+
<syntaxhighlight lang="bash">  
  You may encounter an issue like I did initially where the site will never initially come online.
+
  git clone https://github.com/LarsS88/Canasta-DockerCompose.git
In this case use ‘docker logs <container>’ to inspect your MediaWiki container’s goings-on.
+
</syntaxhighlight>
It may report that it cannot access files directly under the “/mediawiki/”, in which case shut it down and edit docker-compose.yml as follows:
 
 
Under services → web → volumes, at the top, add: - ./mediawiki:/mediawiki
 
 
It should then look something like :
 
  
web:
 
    image: ghcr.io/canastawiki/canasta:latest
 
    restart: unless-stopped
 
    extra_hosts:
 
      - "gateway.docker.internal:host-gateway"
 
    depends_on:
 
      - db
 
      - elasticsearch
 
    environment:
 
      # Sourced from .env
 
      - MW_SITE_SERVER=${MW_SITE_SERVER:-<nowiki>https://localhost}</nowiki>
 
      - PHP_UPLOAD_MAX_FILESIZE=${PHP_UPLOAD_MAX_FILESIZE:-10M}
 
      - PHP_POST_MAX_SIZE=${PHP_UPLOAD_MAX_FILESIZE:-10M}
 
      - PHP_MAX_INPUT_VARS=${PHP_MAX_INPUT_VARS:-1000}
 
      - MW_SITEMAP_SUBDIR
 
      - MW_SITEMAP_IDENTIFIER
 
    volumes:
 
      '''- ./mediawiki:/mediawiki'''
 
      - ./extensions:/var/www/mediawiki/w/user-extensions
 
      - ./skins:/var/www/mediawiki/w/user-skins
 
      - ./config:/mediawiki/config
 
      - ./images:/mediawiki/images
 
      - sitemap:/mediawiki/sitemap
 
  
Then spin the farm up again.
+
=== Go to the project directory ===
  
==== Upgrading to Open CSP: ====
+
<syntaxhighlight lang="bash">
 +
  cd Canasta_OpenCSP
 +
</syntaxhighlight>
  
# Clone the Canasta-OpenCSP fork, master branch. ( this can be found here : https://github.com/LarsS88/opencsp2-canasta, you can simply download and unzip )
 
# Build the image with a tag such as ‘open-csp:2.0’ for instance. ( inside the main folder that you have just downloaded, type '''''docker build --tag open-csp:2.0 .''''' ( do not forget the . at the end )
 
# Go back to your Canasta-DockerCompose repo and edit ''docker-compose.override.yml''
 
# Uncomment “web” and its “image” property.
 
# Set the image to your locally built Canasta-OpenCSP tag.  It should look something like this :
 
  
services:
+
=== Build the image ===
  #db:
+
 
  web:
+
<syntaxhighlight lang="bash">
      image: open-csp:2.0
+
   docker build . -t canasta-opencsp:2.0
  #elasticsearch:
+
</syntaxhighlight>
  caddy:
+
 
        ports:
+
 
        - "${PORT:-80}:80"
+
=== Change to the other project folder ===
        - "${HTTPS_PORT:-443}:443"
+
 
  #varnish:
+
<syntaxhighlight lang="bash">
Launch the farm again.
+
   cd ../Canasta-DockerCompose
 +
</syntaxhighlight>
 +
 
 +
 
 +
=== Start the Canasta stack ===
 +
 
 +
<mark>NOTE: If, in the build step, you tagged the image differently from how I specified it above, you will need to alter this docker-compose.override.yml file as well at before you try to spin up Canasta.</mark>
 +
 
 +
<syntaxhighlight lang="bash">
 +
   docker-compose up -d
 +
</syntaxhighlight>
 +
 
 +
 
 +
=== Install a wiki ===
 +
 
 +
Navigate to https://localhost and follow the installation steps
 +
 
 +
Copy the now downloaded LocalSettings.php to the config subdir
 +
 
 +
<syntaxhighlight lang="bash">
 +
   cp <browser download folder>/LocalSettings.php config/
 +
</syntaxhighlight>
 +
 
 +
=== Restart the stack ===
 +
 
 +
<syntaxhighlight lang="bash">
 +
  docker-compose down
 +
  docker-compose up -d
 +
</syntaxhighlight>
 +
 
 +
== OPTIONAL: ==
 +
Follow the Open-CSP installation progress
 +
 
 +
<syntaxhighlight lang="bash"
 +
  docker logs <web container name> --follow
 +
</syntaxhighlight>
 +
<mark>If you're just running the one Canasta instance it'll be canasta-dockercompose_web_1. Otherwise you can use 'docker ps' to find it.</mark>
 +
 
 +
 
 +
 
 +
You're done. 🥳
 +
Visit your site.
ws-seo
Line 1: Line 1:
 
+
{{SEO
 +
|Title=Open CSP on Canasta
 +
|Description=This projects aims to integrate Open-CSP 2.0 into CanastaWiki.
 +
|Section=open-csp
 +
|Published time=2025-04-24
 +
}}

Latest revision as of 12:18, 25 April 2025

This projects aims to integrate Open-CSP 2.0 into CanastaWiki.

Getting started

Clone the project and the Docker Compose companion project

  git clone https://github.com/LarsS88/Canasta_OpenCSP.git
  
  git clone https://github.com/LarsS88/Canasta-DockerCompose.git


Go to the project directory

 
  cd Canasta_OpenCSP


Build the image

  docker build . -t canasta-opencsp:2.0


Change to the other project folder

 
  cd ../Canasta-DockerCompose


Start the Canasta stack

NOTE: If, in the build step, you tagged the image differently from how I specified it above, you will need to alter this docker-compose.override.yml file as well at before you try to spin up Canasta.

 
  docker-compose up -d


Install a wiki

Navigate to https://localhost and follow the installation steps

Copy the now downloaded LocalSettings.php to the config subdir

 
  cp <browser download folder>/LocalSettings.php config/

Restart the stack

 
  docker-compose down
  docker-compose up -d

OPTIONAL:

Follow the Open-CSP installation progress

  
  docker logs <web container name> --follow

If you're just running the one Canasta instance it'll be canasta-dockercompose_web_1. Otherwise you can use 'docker ps' to find it.


You're done. 🥳 Visit your site.