From 475bcc49322551089fa1091f1089a0cca89d81d9 Mon Sep 17 00:00:00 2001 From: rzmk <30333942+rzmk@users.noreply.github.com> Date: Thu, 30 Oct 2025 09:10:01 -0400 Subject: [PATCH] feat: update ckan-devstaller to v0.3.1 --- .github/workflows/run-ckan-only-install.yml | 23 ++++++++++ README.md | 2 +- docs/app/(home)/page.tsx | 12 ++--- docs/app/global.css | 2 +- docs/bun.lock | 6 +++ .../builder-sections/ckan-version.tsx | 12 ++--- docs/components/builder-sections/presets.tsx | 2 +- docs/components/builder.tsx | 44 ++++++++++++------ docs/components/ui/label.tsx | 26 +++++++++++ docs/components/ui/switch.tsx | 29 ++++++++++++ docs/content/docs/builder.mdx | 13 ++++++ docs/content/docs/changelog/0.3.1.mdx | 33 +++++++++++++ docs/content/docs/index.mdx | 16 +++---- .../docs/reference/developing-with-wsl.mdx | 46 +++++++++++++++++-- .../reference/installation-architecture.mdx | 2 +- docs/content/docs/reference/meta.json | 4 +- docs/package.json | 2 + install.bash | 6 +-- src/main.rs | 11 +++-- src/questions.rs | 4 +- src/steps.rs | 2 +- 21 files changed, 240 insertions(+), 57 deletions(-) create mode 100644 .github/workflows/run-ckan-only-install.yml create mode 100644 docs/components/ui/label.tsx create mode 100644 docs/components/ui/switch.tsx create mode 100644 docs/content/docs/changelog/0.3.1.mdx diff --git a/.github/workflows/run-ckan-only-install.yml b/.github/workflows/run-ckan-only-install.yml new file mode 100644 index 0000000..5d525c1 --- /dev/null +++ b/.github/workflows/run-ckan-only-install.yml @@ -0,0 +1,23 @@ +name: Verify ckan-devstaller runs CKAN-only install successfully +on: + push: + branches: + - main + workflow_dispatch: +jobs: + ckanonlyinstall: + name: Run ckan-devstaller with a CKAN-only install + runs-on: ubuntu-22.04 + permissions: + # For the git-auto-commit-action + contents: write + steps: + - uses: actions/checkout@v4 + - name: Install Rust stable toolchain + uses: dtolnay/rust-toolchain@stable + - name: Cache cargo deps and target folder + uses: Swatinem/rust-cache@v2 + with: + workspaces: ". -> target" + - name: Run ckan-devstaller + run: cargo run --release --verbose -- --ckan-version 2.11.4 --skip-interactive --skip-run diff --git a/README.md b/README.md index 538a5b7..4d0c8a9 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ {1329F0BA-A29F-4BF8-BB6B-E3BA84FDAFCC} -`ckan-devstaller` attempts to install a [CKAN](https://ckan.org) instance using [ckan-compose](https://github.com/tino097/ckan-compose) for development usage in a new Ubuntu 22.04 instance. +`ckan-devstaller` attempts to install a [CKAN](https://ckan.org) instance using [ckan-compose](https://github.com/tino097/ckan-compose/tree/ckan-devstaller) for development usage in a new Ubuntu 22.04 instance. You may find `ckan-devstaller` useful for: diff --git a/docs/app/(home)/page.tsx b/docs/app/(home)/page.tsx index 734f3a4..72a91c6 100644 --- a/docs/app/(home)/page.tsx +++ b/docs/app/(home)/page.tsx @@ -118,7 +118,7 @@ function Hero() {

- } href="/docs" title="Quick start"> + } href="/docs/builder" title="Quick start"> Get started with ckan-devstaller and install CKAN within minutes } href="/docs/builder" title="Builder"> @@ -312,15 +312,9 @@ function WhyInteractive(props: { download speed.

- + Get started - - Customize your installation -
) : null} diff --git a/docs/app/global.css b/docs/app/global.css index f415641..b6836ec 100644 --- a/docs/app/global.css +++ b/docs/app/global.css @@ -2,4 +2,4 @@ @import "fumadocs-ui/css/neutral.css"; @import "fumadocs-ui/css/ocean.css"; @import "fumadocs-ui/css/preset.css"; -@import "tw-animate-css"; +@import "tw-animate-css"; \ No newline at end of file diff --git a/docs/bun.lock b/docs/bun.lock index 3c1d10d..d5096fe 100644 --- a/docs/bun.lock +++ b/docs/bun.lock @@ -6,6 +6,8 @@ "dependencies": { "@radix-ui/react-accordion": "^1.2.12", "@radix-ui/react-collapsible": "^1.1.12", + "@radix-ui/react-label": "^2.1.7", + "@radix-ui/react-switch": "^1.2.6", "@radix-ui/react-tabs": "^1.1.13", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", @@ -227,6 +229,8 @@ "@radix-ui/react-id": ["@radix-ui/react-id@1.1.1", "", { "dependencies": { "@radix-ui/react-use-layout-effect": "1.1.1" }, "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-kGkGegYIdQsOb4XjsfM97rXsiHaBwco+hFI66oO4s9LU+PLAC5oJ7khdOVFxkhsmlbpUqDAvXw11CluXP+jkHg=="], + "@radix-ui/react-label": ["@radix-ui/react-label@2.1.7", "", { "dependencies": { "@radix-ui/react-primitive": "2.1.3" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-YT1GqPSL8kJn20djelMX7/cTRp/Y9w5IZHvfxQTVHrOqa2yMl7i/UfMqKRU5V7mEyKTrUVgJXhNQPVCG8PBLoQ=="], + "@radix-ui/react-navigation-menu": ["@radix-ui/react-navigation-menu@1.2.14", "", { "dependencies": { "@radix-ui/primitive": "1.1.3", "@radix-ui/react-collection": "1.1.7", "@radix-ui/react-compose-refs": "1.1.2", "@radix-ui/react-context": "1.1.2", "@radix-ui/react-direction": "1.1.1", "@radix-ui/react-dismissable-layer": "1.1.11", "@radix-ui/react-id": "1.1.1", "@radix-ui/react-presence": "1.1.5", "@radix-ui/react-primitive": "2.1.3", "@radix-ui/react-use-callback-ref": "1.1.1", "@radix-ui/react-use-controllable-state": "1.2.2", "@radix-ui/react-use-layout-effect": "1.1.1", "@radix-ui/react-use-previous": "1.1.1", "@radix-ui/react-visually-hidden": "1.2.3" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-YB9mTFQvCOAQMHU+C/jVl96WmuWeltyUEpRJJky51huhds5W2FQr1J8D/16sQlf0ozxkPK8uF3niQMdUwZPv5w=="], "@radix-ui/react-popover": ["@radix-ui/react-popover@1.1.15", "", { "dependencies": { "@radix-ui/primitive": "1.1.3", "@radix-ui/react-compose-refs": "1.1.2", "@radix-ui/react-context": "1.1.2", "@radix-ui/react-dismissable-layer": "1.1.11", "@radix-ui/react-focus-guards": "1.1.3", "@radix-ui/react-focus-scope": "1.1.7", "@radix-ui/react-id": "1.1.1", "@radix-ui/react-popper": "1.2.8", "@radix-ui/react-portal": "1.1.9", "@radix-ui/react-presence": "1.1.5", "@radix-ui/react-primitive": "2.1.3", "@radix-ui/react-slot": "1.2.3", "@radix-ui/react-use-controllable-state": "1.2.2", "aria-hidden": "^1.2.4", "react-remove-scroll": "^2.6.3" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-kr0X2+6Yy/vJzLYJUPCZEc8SfQcf+1COFoAqauJm74umQhta9M7lNJHP7QQS3vkvcGLQUbWpMzwrXYwrYztHKA=="], @@ -245,6 +249,8 @@ "@radix-ui/react-slot": ["@radix-ui/react-slot@1.2.3", "", { "dependencies": { "@radix-ui/react-compose-refs": "1.1.2" }, "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-aeNmHnBxbi2St0au6VBVC7JXFlhLlOnvIIlePNniyUNAClzmtAUEY8/pBiK3iHjufOlwA+c20/8jngo7xcrg8A=="], + "@radix-ui/react-switch": ["@radix-ui/react-switch@1.2.6", "", { "dependencies": { "@radix-ui/primitive": "1.1.3", "@radix-ui/react-compose-refs": "1.1.2", "@radix-ui/react-context": "1.1.2", "@radix-ui/react-primitive": "2.1.3", "@radix-ui/react-use-controllable-state": "1.2.2", "@radix-ui/react-use-previous": "1.1.1", "@radix-ui/react-use-size": "1.1.1" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-bByzr1+ep1zk4VubeEVViV592vu2lHE2BZY5OnzehZqOOgogN80+mNtCqPkhn2gklJqOpxWgPoYTSnhBCqpOXQ=="], + "@radix-ui/react-tabs": ["@radix-ui/react-tabs@1.1.13", "", { "dependencies": { "@radix-ui/primitive": "1.1.3", "@radix-ui/react-context": "1.1.2", "@radix-ui/react-direction": "1.1.1", "@radix-ui/react-id": "1.1.1", "@radix-ui/react-presence": "1.1.5", "@radix-ui/react-primitive": "2.1.3", "@radix-ui/react-roving-focus": "1.1.11", "@radix-ui/react-use-controllable-state": "1.2.2" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-7xdcatg7/U+7+Udyoj2zodtI9H/IIopqo+YOIcZOq1nJwXWBZ9p8xiu5llXlekDbZkca79a/fozEYQXIA4sW6A=="], "@radix-ui/react-use-callback-ref": ["@radix-ui/react-use-callback-ref@1.1.1", "", { "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-FkBMwD+qbGQeMu1cOHnuGB6x4yzPjho8ap5WtbEJ26umhgqVXbhekKUQO+hZEL1vU92a3wHwdp0HAcqAUF5iDg=="], diff --git a/docs/components/builder-sections/ckan-version.tsx b/docs/components/builder-sections/ckan-version.tsx index 2348d8b..d286068 100644 --- a/docs/components/builder-sections/ckan-version.tsx +++ b/docs/components/builder-sections/ckan-version.tsx @@ -11,26 +11,26 @@ export default function CKANVersionBuilderSection({ config, setConfig }: any) { } - title="2.11.3" + title="2.11.4" className={ - config.ckanVersion === "2.11.3" + config.ckanVersion === "2.11.4" ? selectedCardClasses : "cursor-pointer" } onClick={() => { - setConfig({ ...config, ckanVersion: "2.11.3" }); + setConfig({ ...config, ckanVersion: "2.11.4" }); }} > } - title="2.10.8" + title="2.10.9" className={ - config.ckanVersion === "2.10.8" + config.ckanVersion === "2.10.9" ? selectedCardClasses : "cursor-pointer" } onClick={() => { - setConfig({ ...config, ckanVersion: "2.10.8" }); + setConfig({ ...config, ckanVersion: "2.10.9" }); }} > diff --git a/docs/components/builder-sections/presets.tsx b/docs/components/builder-sections/presets.tsx index 444652b..4f0c276 100644 --- a/docs/components/builder-sections/presets.tsx +++ b/docs/components/builder-sections/presets.tsx @@ -49,7 +49,7 @@ export default function PresetsBuilderSection({ setConfig({ ...config, preset: "dathere-default", - ckanVersion: "2.11.3", + ckanVersion: "2.11.4", extensions: ["ckanext-scheming", "DataStore", "DataPusher+"], features: ["enable-ssh"], }); diff --git a/docs/components/builder.tsx b/docs/components/builder.tsx index 5680e7e..6b96529 100644 --- a/docs/components/builder.tsx +++ b/docs/components/builder.tsx @@ -1,18 +1,13 @@ "use client"; import { CodeBlock, Pre } from "fumadocs-ui/components/codeblock"; -import defaultMdxComponents from "fumadocs-ui/mdx"; -import { - BarChartBigIcon, - BlocksIcon, - SailboatIcon, - TerminalSquareIcon, -} from "lucide-react"; +import { Label } from "@/components/ui/label" +import { Switch } from "@/components/ui/switch" import { useEffect, useState } from "react"; -import PresetsBuilderSection from "./builder-sections/presets"; -import CKANVersionBuilderSection from "./builder-sections/ckan-version"; -import CKANExtensionsBuilderSection from "./builder-sections/ckan-extensions"; -import FeaturesBuilderSection from "./builder-sections/features"; +import PresetsBuilderSection from "@/components/builder-sections/presets"; +import CKANVersionBuilderSection from "@/components/builder-sections/ckan-version"; +import CKANExtensionsBuilderSection from "@/components/builder-sections/ckan-extensions"; +import FeaturesBuilderSection from "@/components/builder-sections/features"; export type Config = { preset: string | undefined; @@ -25,11 +20,28 @@ export const selectedCardClasses = "bg-blue-100 dark:bg-blue-950 border-blue-300 dark:border-blue-900 border-2"; export default function Builder() { - const { Card, Cards } = defaultMdxComponents; + const [downloadScript, setDownloadScript] = useState(true); + const downloadScriptString = `#!/usr/bin/env bash + +# Update/Upgrade system dependencies +sudo apt update -y +sudo apt upgrade -y + +# Install curl +sudo apt install curl -y + +# Change to the home directory +cd ~/ + +# Download the ckan-devstaller binary file +wget https://github.com/dathere/ckan-devstaller/releases/download/0.3.1/ckan-devstaller + +# Add execute permission to ckan-devstaller binary file +sudo chmod +x ./ckan-devstaller\n\n# Run ckan-devstaller script\n`; const [command, setCommand] = useState("./ckan-devstaller"); const [config, setConfig] = useState({ preset: "ckan-only", - ckanVersion: "2.11.3", + ckanVersion: "2.11.4", extensions: [], features: [], }); @@ -56,8 +68,12 @@ ${ckanVersionString}${extensionsString ? extensionsString : ""}${featuresString

ckan-devstaller command

+
+ setDownloadScript(!downloadScript)} id="download-script" /> + +
-
{command}
+
{downloadScript ? downloadScriptString : ""}{command}

Selected configuration

diff --git a/docs/components/ui/label.tsx b/docs/components/ui/label.tsx new file mode 100644 index 0000000..5341821 --- /dev/null +++ b/docs/components/ui/label.tsx @@ -0,0 +1,26 @@ +"use client" + +import * as React from "react" +import * as LabelPrimitive from "@radix-ui/react-label" +import { cva, type VariantProps } from "class-variance-authority" + +import { cn } from "@/lib/utils" + +const labelVariants = cva( + "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70" +) + +const Label = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef & + VariantProps +>(({ className, ...props }, ref) => ( + +)) +Label.displayName = LabelPrimitive.Root.displayName + +export { Label } diff --git a/docs/components/ui/switch.tsx b/docs/components/ui/switch.tsx new file mode 100644 index 0000000..9511e19 --- /dev/null +++ b/docs/components/ui/switch.tsx @@ -0,0 +1,29 @@ +"use client" + +import * as React from "react" +import * as SwitchPrimitives from "@radix-ui/react-switch" + +import { cn } from "@/lib/utils" + +const Switch = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + + + +)) +Switch.displayName = SwitchPrimitives.Root.displayName + +export { Switch } diff --git a/docs/content/docs/builder.mdx b/docs/content/docs/builder.mdx index 565a7b9..41701ea 100644 --- a/docs/content/docs/builder.mdx +++ b/docs/content/docs/builder.mdx @@ -4,6 +4,19 @@ description: Customize your CKAN installation before running ckan-devstaller. icon: Blocks --- +ckan-devstaller attempts to install a CKAN instance from source along with [ckan-compose](https://github.com/tino097/ckan-compose/tree/ckan-devstaller) and other optional features, intended for development use in a new Ubuntu 22.04 instance. + +Make sure `ckan-devstaller` is run in a **new** Ubuntu 22.04 instance. Do NOT run `ckan-devstaller` in an existing instance that is important for your usage. + +import { Accordion, Accordions } from 'fumadocs-ui/components/accordion'; + + + If you are using Ubuntu 22.04 on VirtualBox, you may need to add your user to the sudoers file before running the ckan-devstaller install script. Open a terminal in your virtual machine (VM), run `su -` and log in as the root user with the password you used to set up the VM, then type:

`sudo adduser sudo`

where `` is your username then restart your VM and run the ckan-devstaller installer script.
+ Currently `ckan-devstaller` supports `x86_64` architecture. `ARM64` support is planned. +
+ +--- + import Builder from "@/components/builder"; diff --git a/docs/content/docs/changelog/0.3.1.mdx b/docs/content/docs/changelog/0.3.1.mdx new file mode 100644 index 0000000..ab4a70a --- /dev/null +++ b/docs/content/docs/changelog/0.3.1.mdx @@ -0,0 +1,33 @@ +--- +title: Changelog for ckan-devstaller v0.3.1 (2025-10-30) +--- + +## Updated CKAN default versions to latest stable versions + +We have updated ckan-devstaller to suggest the recent releases of CKAN [2.11.4](https://docs.ckan.org/en/2.11/changelog.html#v-2-11-4-2025-10-29) and [2.10.9](https://docs.ckan.org/en/2.10/changelog.html#v-2-10-9-2025-10-29). + +## Added the "Developing with WSL" page in the Reference section + +Developers using Windows may benefit from the new [Developing with WSL](/docs/reference/developing-with-wsl) page in the Reference section to try their builds of ckan-devstaller and verify things work on a new install of Ubuntu 22.04. + +Alternatively if not trying to reset an entire WSL environment, developers can look into [`ckan-devstaller uninstall`](/docs/tutorials/uninstall-ckan). + +## Added install script switch to Builder page + +There is now a switch on the Builder page that is enabled by default for including the installation script for ckan-devstaller before running it. This is necessary for users that don't have ckan-devstaller installed yet and are using the Builder over the Quick Start scripts. + +## Default start with the Builder page + +We've changed "Get Started" links (and similar links) to the Builder page instead of the Quick Start page to users can quickly access the Builder again and get started using ckan-devstaller. + +## Update ckan-compose links to use ckan-devstaller branch + +We've updated ckan-compose links to use [the ckan-devstaller branch](https://github.com/tino097/ckan-compose/tree/ckan-devstaller). + +## Update VirtualBox notice with better formatting + +To ensure users using VirtualBox see the full command for adding a user to the sudoers file, we've improved the formatting of the note. + +## GitHub Action to verify CKAN install runs + +We've added a GitHub Action to run on push to the main branch to verify that a CKAN-only install runs. This doesn't include verbose testing but rather ensuring that the ckan-devstaller finishes without errors. diff --git a/docs/content/docs/index.mdx b/docs/content/docs/index.mdx index 649b0c3..ffa0d8d 100644 --- a/docs/content/docs/index.mdx +++ b/docs/content/docs/index.mdx @@ -4,14 +4,14 @@ description: Get started with ckan-devstaller and install CKAN within minutes. icon: Zap --- -ckan-devstaller attempts to install a CKAN instance from source along with [ckan-compose](https://github.com/tino097/ckan-compose) and other optional features, intended for development use in a new Ubuntu 22.04 instance. +ckan-devstaller attempts to install a CKAN instance from source along with [ckan-compose](https://github.com/tino097/ckan-compose/tree/ckan-devstaller) and other optional features, intended for development use in a new Ubuntu 22.04 instance. Make sure `ckan-devstaller` is run in a **new** Ubuntu 22.04 instance. Do NOT run `ckan-devstaller` in an existing instance that is important for your usage. import { Accordion, Accordions } from 'fumadocs-ui/components/accordion'; - If you are using Ubuntu 22.04 on VirtualBox, you may need to add your user to the sudoers file before running the ckan-devstaller install script. Open a terminal in your virtual machine (VM), run `su -` and log in as the root user with the password you used to set up the VM, then type `sudo adduser sudo` where `` is your username then restart your VM and run the ckan-devstaller installer script. + If you are using Ubuntu 22.04 on VirtualBox, you may need to add your user to the sudoers file before running the ckan-devstaller install script. Open a terminal in your virtual machine (VM), run `su -` and log in as the root user with the password you used to set up the VM, then type:

`sudo adduser sudo`

where `` is your username then restart your VM and run the ckan-devstaller installer script.
Currently `ckan-devstaller` supports `x86_64` architecture. `ARM64` support is planned.
@@ -42,16 +42,16 @@ import { Step, Steps } from 'fumadocs-ui/components/steps'; ### Install the "CKAN-only" preset -By running the following script, ckan-devstaller will be downloaded and the default configuration for installing CKAN 2.11.3 with ckan-compose will be selected. You can then customize your configuration interactively in your terminal after running this script. +By running the following script, ckan-devstaller will be downloaded and the default configuration for installing CKAN with ckan-compose will be selected. You can then customize your configuration interactively in your terminal after running this script. ```bash -wget -O - https://github.com/dathere/ckan-devstaller/releases/download/0.3.0/install.bash | bash +wget -O - https://github.com/dathere/ckan-devstaller/releases/download/0.3.1/install.bash | bash ``` If you'd rather skip the interactivity and go straight to installation, then run the following script instead: ```bash -wget -O - https://github.com/dathere/ckan-devstaller/releases/download/0.3.0/install.bash | bash -s skip-interactive +wget -O - https://github.com/dathere/ckan-devstaller/releases/download/0.3.1/install.bash | bash -s skip-interactive ``` @@ -62,7 +62,7 @@ wget -O - https://github.com/dathere/ckan-devstaller/releases/download/0.3.0/ins The following script will download ckan-devstaller and select the following configuration: -- CKAN 2.11.3 +- CKAN latest stable version - [ckan-compose](https://github.com/tino097/ckan-compose/tree/ckan-devstaller) - [DataStore extension](https://docs.ckan.org/en/2.11/maintaining/datastore.html) - [ckanext-scheming extension](https://github.com/ckan/ckanext-scheming) @@ -73,13 +73,13 @@ The following script will download ckan-devstaller and select the following conf You can then customize your configuration interactively in your terminal after running this script. ```bash -wget -O - https://github.com/dathere/ckan-devstaller/releases/download/0.3.0/install.bash | bash -s dathere-default +wget -O - https://github.com/dathere/ckan-devstaller/releases/download/0.3.1/install.bash | bash -s dathere-default ``` If you'd rather skip the interactivity and go straight to installation, then run the following script instead: ```bash -wget -O - https://github.com/dathere/ckan-devstaller/releases/download/0.3.0/install.bash | bash -s dathere-default skip-interactive +wget -O - https://github.com/dathere/ckan-devstaller/releases/download/0.3.1/install.bash | bash -s dathere-default skip-interactive ``` diff --git a/docs/content/docs/reference/developing-with-wsl.mdx b/docs/content/docs/reference/developing-with-wsl.mdx index 16956f2..c413785 100644 --- a/docs/content/docs/reference/developing-with-wsl.mdx +++ b/docs/content/docs/reference/developing-with-wsl.mdx @@ -3,10 +3,6 @@ title: Developing with WSL description: Tips on how to develop ckan-devstaller on a Windows machine by leveraging Windows Subsystem for Linux. --- - - This page is a work in progress and is not intended to be used yet. - - When developing ckan-devstaller on Windows, using Windows Subsystem for Linux (WSL) can be advantageous to demo an Ubuntu 22.04 environment without having to set up a virtual machine. import { Step, Steps } from 'fumadocs-ui/components/steps'; @@ -30,7 +26,6 @@ wsl --install Ubuntu-22.04 --version 2 ### Export a base image - Here's the expected set up where we create a WSL folder: @@ -42,12 +37,40 @@ Here's the expected set up where we create a WSL folder: | ├── cdr.vdhx ``` +First we'll generate the `images/ubuntu-22-04-snapshot.tar` file: + +```bash +wsl --export Ubuntu-22.04 ./images/ubuntu-22-04-snapshot.tar +``` + + + +### Generate a VDHX file for our new instance + +Next we'll generate the `instances/cdr.vdhx` file, so we can run the following: + +```bash +wsl --import cdr ./instances ./images/ubuntu-22-04-snapshot.tar +``` + + + + + +### Access your new instance as root + Now try to access your new Ubuntu 22.04 instance `cdr` as the `root` user by running: ```bash wsl -d cdr ``` + + + + +### Set yourself as the admin user on the instance and log in as the admin user + Once logged in as `root`, you'll want to edit the `/etc/wsl.conf` file and modify it so you can login as an admin user instead of `root`. We can use the `nano` editor to modify the file: ```bash @@ -82,14 +105,27 @@ Run the instance again and you should be logged in as your admin user by default wsl -d cdr ``` + + + + +### Install ckan-devstaller + Great, now you can go to the home directory and run one of the [quick start](/docs) scripts: ```bash cd ~/ ``` + + + +## Removing your instance + When you want to remove your instance (e.g. so that you can start a brand new instance) then run the following to unregister it: ```bash wsl --unregister cdr ``` + +Then you can follow the steps again from step 3 to generate and try out a new instance. diff --git a/docs/content/docs/reference/installation-architecture.mdx b/docs/content/docs/reference/installation-architecture.mdx index 87c255e..16369f0 100644 --- a/docs/content/docs/reference/installation-architecture.mdx +++ b/docs/content/docs/reference/installation-architecture.mdx @@ -27,7 +27,7 @@ The configuration file for CKAN is installed at `/etc/ckan/default/ckan.ini`: ## ckan-compose -We install certain first-time install files and `ckan-compose` as a directory in the user's home (`~`) directory. For example for the user `adam`: +We install certain first-time install files and [`ckan-compose`](https://github.com/tino097/ckan-compose/tree/ckan-devstaller) as a directory in the user's home (`~`) directory. For example for the user `adam`: ```files /home/adam diff --git a/docs/content/docs/reference/meta.json b/docs/content/docs/reference/meta.json index 3cbd321..0d08c26 100644 --- a/docs/content/docs/reference/meta.json +++ b/docs/content/docs/reference/meta.json @@ -1,6 +1,6 @@ { "pages": [ - "...", - "!developing-with-wsl" + "installation-architecture", + "developing-with-wsl" ] } \ No newline at end of file diff --git a/docs/package.json b/docs/package.json index a13a8ad..52dd9d0 100644 --- a/docs/package.json +++ b/docs/package.json @@ -13,6 +13,8 @@ "dependencies": { "@radix-ui/react-accordion": "^1.2.12", "@radix-ui/react-collapsible": "^1.1.12", + "@radix-ui/react-label": "^2.1.7", + "@radix-ui/react-switch": "^1.2.6", "@radix-ui/react-tabs": "^1.1.13", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", diff --git a/install.bash b/install.bash index dc0ec57..b8b0001 100644 --- a/install.bash +++ b/install.bash @@ -11,7 +11,7 @@ sudo apt install curl -y cd ~/ # Download the ckan-devstaller binary file -curl -LO https://github.com/dathere/ckan-devstaller/releases/download/0.3.0/ckan-devstaller +curl -LO https://github.com/dathere/ckan-devstaller/releases/download/0.3.1/ckan-devstaller # Add execute permission to ckan-devstaller binary file sudo chmod +x ./ckan-devstaller @@ -22,9 +22,9 @@ skip_interactive=$2 if [ $preset == "dathere-default" ]; then if [ $skip_interactive == "skip-interactive" ]; then - ./ckan-devstaller --ckan-version 2.11.3 --extensions ckanext-scheming DataStore DataPusher+ --features enable-ssh --skip-interactive + ./ckan-devstaller --ckan-version 2.11.4 --extensions ckanext-scheming DataStore DataPusher+ --features enable-ssh --skip-interactive else - ./ckan-devstaller --ckan-version 2.11.3 --extensions ckanext-scheming DataStore DataPusher+ --features enable-ssh + ./ckan-devstaller --ckan-version 2.11.4 --extensions ckanext-scheming DataStore DataPusher+ --features enable-ssh fi else if [ $preset == "skip-interactive" ]; then diff --git a/src/main.rs b/src/main.rs index 8bd5919..11676ca 100644 --- a/src/main.rs +++ b/src/main.rs @@ -27,6 +27,9 @@ struct Args { /// Skip interactive steps #[arg(short, long)] skip_interactive: bool, + /// Skip running CKAN at the end of installation + #[arg(short, long)] + skip_run: bool, #[arg(short, long)] /// CKAN version to install defined by semantic versioning from official releases from https://github.com/ckan/ckan ckan_version: Option, @@ -110,7 +113,7 @@ rm -rf README ckan-compose ahoy dpp_default_config.ini get-docker.sh permissions ckan_version: if args.ckan_version.is_some() { args.ckan_version.unwrap() } else { - "2.11.3".to_string() + "2.11.4".to_string() }, sysadmin: default_sysadmin.clone(), extension_datastore: args @@ -134,7 +137,7 @@ rm -rf README ckan-compose ahoy dpp_default_config.ini get-docker.sh permissions if config.ssh { default_config_text.push_str("\n- Install openssh-server to enable SSH access"); } - default_config_text.push_str("\n- Install ckan-compose (https://github.com/tino097/ckan-compose) which sets up the CKAN backend (PostgreSQL, SOLR, Redis)"); + default_config_text.push_str("\n- Install ckan-compose (https://github.com/tino097/ckan-compose/tree/ckan-devstaller) which sets up the CKAN backend (PostgreSQL, SOLR, Redis)"); default_config_text.push_str(format!("\n- Install CKAN v{}", config.ckan_version).as_str()); if config.extension_datastore { default_config_text.push_str("\n- Install the DataStore extension"); @@ -281,7 +284,9 @@ rm -rf README ckan-compose ahoy dpp_default_config.ini get-docker.sh permissions } println!("\n{}", success_text("Running CKAN instance...")); - cmd!(sh, "ckan -c /etc/ckan/default/ckan.ini run").run()?; + if !args.skip_run { + cmd!(sh, "ckan -c /etc/ckan/default/ckan.ini run").run()?; + } } else { println!("Cancelling installation."); } diff --git a/src/questions.rs b/src/questions.rs index f8d5122..402639e 100644 --- a/src/questions.rs +++ b/src/questions.rs @@ -16,7 +16,7 @@ pub fn question_ssh() -> Result { } pub fn question_ckan_version() -> Result { - let ckan_version_options: Vec<&str> = vec!["2.11.3", "2.10.8", "Other"]; + let ckan_version_options: Vec<&str> = vec!["2.11.4", "2.10.9", "Other"]; let answer_ckan_version = Select::new( "What CKAN version would you like to install? (optional)", ckan_version_options, @@ -26,7 +26,7 @@ pub fn question_ckan_version() -> Result { if answer_ckan_version == "Other" { Ok( Text::new("What CKAN version would you like to install? (optional)") - .with_default("2.11.3") + .with_default("2.11.4") .prompt()?, ) } else { diff --git a/src/steps.rs b/src/steps.rs index 65b3e4b..af19091 100644 --- a/src/steps.rs +++ b/src/steps.rs @@ -11,7 +11,7 @@ pub fn step_intro() { ); println!( "This installer should assist in setting up {} from a source installation along with ckan-compose. If you have any issues, please report them at https://support.dathere.com or https://github.com/dathere/ckan-devstaller/issues.", - highlighted_text("CKAN 2.11.3") + highlighted_text("CKAN 2.11.4") ); println!( "\nYou may also learn more about ckan-devstaller at https://ckan-devstaller.dathere.com."