Difference between revisions of "Canasta"

From Freephile Wiki
Jump to navigation Jump to search
(wip)
Line 1: Line 1:
 
Canasta Quick links
 
Canasta Quick links
 +
 +
=== Communication ===
 
<ol>
 
<ol>
 
<li> https://groups.google.com/g/canasta-wiki
 
<li> https://groups.google.com/g/canasta-wiki
Line 7: Line 9:
 
@todo Combine this page, and Jeffrey's post into documentation on the wiki / Canasta project
 
@todo Combine this page, and Jeffrey's post into documentation on the wiki / Canasta project
  
 +
=== Repos ===
  
 +
# The Canasta repo - this is the [https://github.com/CanastaWiki/Canasta/blob/master/Dockerfile Dockerfile] for MediaWiki alone.  Based on Debian, it sets up the basic Linux environment by adding things like Apache, Composer, [https://marlam.de/msmtp/ Msmtp] and tools (git, vim, mc); downloads the proper version of MediaWiki, extension and skins based on the Release plus a specific SHA for each package (reproducible builds - no accidental drift). Installs everything and [https://github.com/CanastaWiki/Canasta/tree/master/_sources/configs configures] everything like Apache, PHP, Varnish cache, and copies composer.canasta.json as composer.local.json. This repo also patches core so that the MediaWiki Installer installs the Bootstrap skin if the user has Chameleon selected as a skin (default). Bootstrap is a requirement of Chameleon, and the user would receive an error the dependency were not met. The Dockerfile [https://github.com/CanastaWiki/Canasta/blob/master/Dockerfile#L549-L562 alters all the Composer autoload files] to use 'canasta-extensions' rather than 'extensions'. That is because the included extensions and skins get included with the image, while user-added extensions and skins get volumed in to the running container in the standard 'extensions' and 'skins' directories. The standard MediaWiki 'images' and 'cache' directories are moved from the image to the volume mount $MW_ORIGIN_FILES. All [https://github.com/CanastaWiki/Canasta/blob/master/Dockerfile#L575 git artifacts are removed from the image]. It creates a sort of manifest list of installed extensions and skins, with commented lines that can later be enabled simply by removing the comment. (Vector gets enabled by default). In the final build phase, the _sources/configs get copied into /etc/ or $WWW_ROOT to setup email (msmtp), apache, php; scripts got into / or ./maintenance. There are 3 Canasta settings files:
 +
## CanastaUtils.php - where deprecated cfLoadExtension() and cfLoadSkin() are defined/intercepted; and a handy sitenotice is displayed, only for Special Pages where email is used, and only if email is not setup.
 +
## CanastaLocalSettings.php - which just does a <syntaxhighlight lang="php">
 +
require_once "$IP/CanastaDefaultSettings.php";
 +
</syntaxhighlight>
 +
## <br />
  
== Getting Started on Windows ==
+
==Getting Started on Windows==
 
<ol>
 
<ol>
 
<li> logo key -> winver Check your version of Windows (Using Windows 11)
 
<li> logo key -> winver Check your version of Windows (Using Windows 11)
Line 24: Line 33:
 
</ol>
 
</ol>
 
==Tips==  
 
==Tips==  
 +
 
;<code>explorer.exe . </code>:will open Windows Explorer for the folder in your Ubuntu container
 
;<code>explorer.exe . </code>:will open Windows Explorer for the folder in your Ubuntu container
 
;<code>code . </code>:will open VSCode for the folder in your Ubuntu container
 
;<code>code . </code>:will open VSCode for the folder in your Ubuntu container
* pin to quick access can put your Ubuntu filesystem in your Windows Explorer quick access
+
 
 +
*pin to quick access can put your Ubuntu filesystem in your Windows Explorer quick access
 +
 
 +
== Creating a wiki ==
 +
There are two basic approaches:
 +
 
 +
# Use the [https://canasta.wiki/cli/ Canasta CLI]. The Canasta CLI is a command-line tool written in Go that offers simple commands to create, delete and manage your Canasta installations
 +
# Use the Canasta "stack repo" directly. The Stack Repo is the Docker-based setup that the CLI interfaces with. If you would rather just work with Docker directly, you can use the stack repo.
 +
 
 +
<br />
 +
 
 +
== Canasta CLI ==
 +
<pre>
 +
A CLI tool to create, import, start, stop and backup multiple Canasta installations
 +
 
 +
Usage:
 +
  canasta [command]
 +
 
 +
Available Commands:
 +
  create      Create a Canasta installation
 +
  delete      Delete a Canasta installation
 +
  extension  Manage Canasta extensions
 +
  extension  Manage Canasta extensions
 +
  help        Help about any command
 +
  import      Import a wiki installation
 +
  list        List all Canasta installations
 +
  maintenance Run maintenance update jobs
 +
  restart    Restart the Canasta installation
 +
  restic      Use restic to backup and restore Canasta
 +
  skin        Manage Canasta skins
 +
  start      Start the Canasta installation
 +
  stop        Shuts down the Canasta installation
 +
  version    Show the Canasta version
 +
 
 +
Flags:
 +
  -h, --help      help for canasta
 +
  -v, --verbose  Verbose output
 +
 
 +
Use "canasta [command] --help" for more information about a command.
 +
</pre>

Revision as of 22:34, 26 March 2023

Canasta Quick links

Communication[edit | edit source]

  1. https://groups.google.com/g/canasta-wiki
  2. https://groups.google.com/g/canasta-wiki/c/Ou_HIG_bjkc/m/CSvBrwGiAgAJ

@todo Combine this page, and Jeffrey's post into documentation on the wiki / Canasta project

Repos[edit | edit source]

  1. The Canasta repo - this is the Dockerfile for MediaWiki alone. Based on Debian, it sets up the basic Linux environment by adding things like Apache, Composer, Msmtp and tools (git, vim, mc); downloads the proper version of MediaWiki, extension and skins based on the Release plus a specific SHA for each package (reproducible builds - no accidental drift). Installs everything and configures everything like Apache, PHP, Varnish cache, and copies composer.canasta.json as composer.local.json. This repo also patches core so that the MediaWiki Installer installs the Bootstrap skin if the user has Chameleon selected as a skin (default). Bootstrap is a requirement of Chameleon, and the user would receive an error the dependency were not met. The Dockerfile alters all the Composer autoload files to use 'canasta-extensions' rather than 'extensions'. That is because the included extensions and skins get included with the image, while user-added extensions and skins get volumed in to the running container in the standard 'extensions' and 'skins' directories. The standard MediaWiki 'images' and 'cache' directories are moved from the image to the volume mount $MW_ORIGIN_FILES. All git artifacts are removed from the image. It creates a sort of manifest list of installed extensions and skins, with commented lines that can later be enabled simply by removing the comment. (Vector gets enabled by default). In the final build phase, the _sources/configs get copied into /etc/ or $WWW_ROOT to setup email (msmtp), apache, php; scripts got into / or ./maintenance. There are 3 Canasta settings files:
    1. CanastaUtils.php - where deprecated cfLoadExtension() and cfLoadSkin() are defined/intercepted; and a handy sitenotice is displayed, only for Special Pages where email is used, and only if email is not setup.
    2. CanastaLocalSettings.php - which just does a
      require_once "$IP/CanastaDefaultSettings.php";
      

Getting Started on Windows[edit | edit source]

  1. logo key -> winver Check your version of Windows (Using Windows 11)
  2. logo key 'Windows features' make sure WSL is enabled (Yes)
  3. Not even listed? = Install WSL Windows Subsystem for Linux and check again.
  4. Virtualization should be enabled, and should be WSL not Hyper-V
    Right-click the Taskbar -> 'Task Manager' -> Performance (see that virtualization is enabled)
  5. Install Docker Desktop This YouTube video covers Setting up Docker on Windows with some references to working with the development framework Laravel. In your mind, substitute 'Canasta' for 'Laravel'.
    @todo Create a similar video for Canasta
  6. Open PowerShell as Administrator
  7. List distributions wsl -l -v
  8. Install Ubuntu wsl --install -d Ubuntu (You can hit logo key and find it as an "app" in the Windows Play Store) Once installed, I pinned it to the taskbar for easy access

Tips[edit | edit source]

explorer.exe .
will open Windows Explorer for the folder in your Ubuntu container
code .
will open VSCode for the folder in your Ubuntu container
  • pin to quick access can put your Ubuntu filesystem in your Windows Explorer quick access

Creating a wiki[edit | edit source]

There are two basic approaches:

  1. Use the Canasta CLI. The Canasta CLI is a command-line tool written in Go that offers simple commands to create, delete and manage your Canasta installations
  2. Use the Canasta "stack repo" directly. The Stack Repo is the Docker-based setup that the CLI interfaces with. If you would rather just work with Docker directly, you can use the stack repo.


Canasta CLI[edit | edit source]

A CLI tool to create, import, start, stop and backup multiple Canasta installations

Usage:
  canasta [command]

Available Commands:
  create      Create a Canasta installation
  delete      Delete a Canasta installation
  extension   Manage Canasta extensions
  extension   Manage Canasta extensions
  help        Help about any command
  import      Import a wiki installation
  list        List all Canasta installations
  maintenance Run maintenance update jobs
  restart     Restart the Canasta installation
  restic      Use restic to backup and restore Canasta
  skin        Manage Canasta skins
  start       Start the Canasta installation
  stop        Shuts down the Canasta installation
  version     Show the Canasta version

Flags:
  -h, --help      help for canasta
  -v, --verbose   Verbose output

Use "canasta [command] --help" for more information about a command.