CanastaWiki / Canasta-CLI

The Canasta command line interface, written in Go
MIT License
5 stars 14 forks source link

Canasta-CLI 2.0 adding wiki farm support #96

Closed chl178 closed 1 year ago

chl178 commented 1 year ago

AddWiki Farm Support in Canasta

Related Issue: #57
Related PR: #295

Overview

One big feature Canasta lacks is the ability to support running multiple wikis, i.e. a wiki family or wiki farm, within the same container. Such wikis would be differentiated by either:

a different directory (e.g. example.com/a, example.com/b) a different subdomain (e.g. a.example.com, b.example.com) or different domains for each wiki (example1.com, example2.com).

We added wiki farm support for canasta.

Test

We deployed the Canasta2.0 on the AWS. Now it have three wikis running in one container. https://canasta2.com https://canasta2.com/a https://subdomain.canasta2.com They are all publicly accessible and everyone is welcome to test them.

New Features and Improvements

Enhancements

create

Description: Creates a Canasta installation. Enhanced to support wiki farm setup with the -f flag.

Usage: sudo go run canasta.go create [flags]

YAML Format for Wiki Farm: To create a wiki farm, you need to provide a YAML file with the following format:

wikis:
  - id: [WIKI_ID] # Example: "mywiki1"
    url: [WIKI_URL] # Example: "mywiki1.example.com"
    name: [WIKI_NAME] 

sudo go run canasta.go create -f [yamlfile] # Example: "wikis.yaml

extension

Description: Manage Canasta extensions. Enhanced to target a specific wiki within the farm using the -w flag.

Subcommands:

Usage: sudo go run canasta.go extension [subcommand] [flags] Flags:

New Commands

add

Description: Adds a new wiki to a Canasta instance.

Usage: sudo go run canasta.go add [flags] Flags:

remove

Description: Removes a wiki from a Canasta instance.

Usage: sudo go run canasta.go remove [flags] Flags:

chl178 commented 1 year ago

@yaronkoren @jeffw16

chl178 commented 1 year ago

Test

  1. Install go, docker, docker compose
  2. Download the two branches
  3. cd to the canasta branch, and use docker build -t canastafarm . to build image
  4. Test: