Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Canasta-CLI 2.0 adding wiki farm support #96

Merged
merged 1 commit into from
Sep 29, 2023

Conversation

chl178
Copy link
Contributor

@chl178 chl178 commented Sep 12, 2023

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

  • Wiki Farm Support: The updated implementation allows multiple wikis to run independently within a single container.
  • Enhanced CLI: Canasta's command-line interface is now extended to manage wiki farm configurations effortlessly.

Table of Contents

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]

  • -p, --path: Canasta directory.
  • -o, --orchestrator: Orchestrator to use for installation (default: "docker-compose").
  • -i, --id: Canasta instance ID.
  • -w, --wiki: Name of the wiki.
  • -n, --domain-name: Domain name (default: "localhost").
  • -a, --WikiSysop: Initial wiki admin username.
  • -s, --password: Initial wiki admin password.
  • -f, --yamlfile: Initial wiki yaml file for wiki farm setup.
  • -k, --keep-config: Keep the config files on installation failure.

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:

  • list: Lists all the installed Canasta extensions.
  • enable: Enables specified extensions.
  • disable: Disables specified extensions.

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

  • -i, --id: Specifies the Canasta instance ID.
  • -p, --path: Specifies the Canasta installation directory.
  • -w, --wiki: Specifies the ID of a specific wiki within the Canasta farm.
  • -v, --verbose: Enables verbose output.

New Commands

add

Description: Adds a new wiki to a Canasta instance.

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

  • -w, --wiki: ID of the new wiki.
  • -u, --url: URL of the new wiki.
  • -s, --site-name: Name of the new wiki site.
  • -p, --path: Path to the new wiki.
  • -i, --id: Canasta instance ID.
  • -o, --orchestrator: Orchestrator to use for installation (default: "docker-compose").
  • -d, --database: Path to the existing database dump.

remove

Description: Removes a wiki from a Canasta instance.

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

  • -w, --wiki: ID of the wiki to be removed.
  • -p, --path: Path to the wiki.
  • -i, --id: Canasta instance ID.

@chl178
Copy link
Contributor Author

chl178 commented Sep 12, 2023

@yaronkoren @jeffw16

@chl178 chl178 force-pushed the canasta2.0 branch 3 times, most recently from 1854541 to 8ee8296 Compare September 20, 2023 16:08
Canasta-CLI2.0 adding wiki farm support

s

s

test

s
@chl178
Copy link
Contributor Author

chl178 commented Sep 20, 2023

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:
  • Test the new version: sudo go run canasta.go [cammands]
    Note: For create and import commands add the -t flag
  • Test migrating function: first use sudo go run canasta.go create to create the old version canasta, then use add or restart to test the migrating functionality.

@jeffw16 jeffw16 changed the base branch from main to release/2.0-rc September 22, 2023 18:17
@yaronkoren yaronkoren merged commit 7d2bc19 into CanastaWiki:release/2.0-rc Sep 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants