diff --git a/.github/workflows/run-ckan-only-install.yml b/.github/workflows/run-ckan-only-install.yml new file mode 100644 index 0000000..68ea266 --- /dev/null +++ b/.github/workflows/run-ckan-only-install.yml @@ -0,0 +1,26 @@ +name: Verify ckan-devstaller runs CKAN-only install successfully +on: + push: + branches: + - main + paths-ignore: + - 'docs/**' + - 'README.md' + 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/Cargo.lock b/Cargo.lock index fbf07de..6bd3e74 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -126,7 +126,7 @@ checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" [[package]] name = "ckan-devstaller" -version = "0.1.0" +version = "0.3.0" dependencies = [ "anyhow", "clap", diff --git a/Cargo.toml b/Cargo.toml index 63bfc7a..732c927 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ckan-devstaller" -version = "0.1.0" +version = "0.3.0" edition = "2024" [dependencies] diff --git a/README.md b/README.md index 0de466c..762f607 100644 --- a/README.md +++ b/README.md @@ -1,39 +1,37 @@ # ckan-devstaller -`ckan-devstaller` attempts to install CKAN 2.11.3 from source using [ckan-compose](https://github.com/tino097/ckan-compose), intended for development use in a new Ubuntu 22.04 instance. The following are also installed and enabled by default: +{1329F0BA-A29F-4BF8-BB6B-E3BA84FDAFCC} -- [DataStore extension](https://docs.ckan.org/en/2.11/maintaining/datastore.html) -- [ckanext-scheming extension](https://github.com/ckan/ckanext-scheming) -- [DataPusher+ extension](https://github.com/dathere/datapusher-plus) -[DRUF mode](https://github.com/dathere/datapusher-plus?tab=readme-ov-file#druf-dataset-resource-upload-first-workflow) is available but disabled by default. The [`datatablesview-plus` extension](https://github.com/dathere/ckanext-datatables-plus) is planned to be included in a future release. +`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. -## Quick start +You may find `ckan-devstaller` useful for: -> [!CAUTION] -> 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. +- Exploring CKAN for the first time without spending hours on installation steps +- Developing/Testing CKAN extensions and fixing bugs +- Trying a new CKAN version to test an upgrade from a legacy version -> [!WARNING] -> 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. +`ckan-devstaller` was made to help speed up the installation time for CKAN and various extensions/features to boost development productivity. -> [!NOTE] -> The `/etc/ckan/default/ckan.ini` config file will have its comments removed for now. There are plans to fix this in a future release of `ckan-devstaller`. +**Get started at [ckan-devstaller.dathere.com](https://ckan-devstaller.dathere.com).** -You have two common options to choose from for installation. Paste one of the following scripts into your new Ubuntu 22.04 instance's terminal. +## Learn more about developing with CKAN -### Install with non-interactive mode (default config) +You may find the following guides useful while developing with CKAN: -```bash -wget -O - https://github.com/dathere/ckan-devstaller/releases/download/0.2.0/install.bash | bash -s default -``` +- [CKAN Hardware Requirements](https://github.com/ckan/ckan/wiki/Hardware-Requirements) - Learn what you need before installing CKAN +- [CKAN Sysadmin guide](https://docs.ckan.org/en/latest/sysadmin-guide.html) - Useful for CKAN instance administrators/sysadmins +- [CKAN Theming guide](https://docs.ckan.org/en/latest/theming/index.html) - Explore how to set up custom themes for your CKAN instance +- [CKAN Extending guide](https://docs.ckan.org/en/latest/extensions/index.html) - Develop CKAN extensions that can enhance your CKAN instance's functionality and add custom features -### Install with interactive mode +## What next? -```bash -wget -O - https://github.com/dathere/ckan-devstaller/releases/download/0.2.0/install.bash | bash -``` +- [Customize your config file](https://docs.ckan.org/en/latest/extensions/index.html) +- [Create test data](https://docs.ckan.org/en/latest/maintaining/getting-started.html#creating-test-data) +- [Visit ckan.org](https://ckan.org) +- [Interact with your CKAN API at ckanaction.dathere.com](https://ckanaction.dathere.com) -## Demos +## `ckan-devstaller` demos ### Interactive customizable installation diff --git a/docs/.env.example b/docs/.env.example new file mode 100644 index 0000000..1accae9 --- /dev/null +++ b/docs/.env.example @@ -0,0 +1,2 @@ +NEXT_TELEMETRY_DISABLED=1 +TURBO_TELEMETRY_DISABLED=1 diff --git a/docs/.gitignore b/docs/.gitignore new file mode 100644 index 0000000..3566783 --- /dev/null +++ b/docs/.gitignore @@ -0,0 +1,30 @@ +# deps +/node_modules + +# generated content +.contentlayer +.content-collections +.source + +# test & build +/coverage +/.next/ +/out/ +/build +*.tsbuildinfo + +# misc +.DS_Store +*.pem +/.pnp +.pnp.js +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# others +.env* +.env*.local +!.env.example +.vercel +next-env.d.ts \ No newline at end of file diff --git a/docs/.nvmrc b/docs/.nvmrc new file mode 100644 index 0000000..b009dfb --- /dev/null +++ b/docs/.nvmrc @@ -0,0 +1 @@ +lts/* diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 0000000..5144394 --- /dev/null +++ b/docs/README.md @@ -0,0 +1,39 @@ +# ckan-devstaller docs website (ckan-devstaller.dathere.com) + +![Docs landing page example](./public/docs-home-example.png) + +This directory includes a Next.js project built with [Fumadocs](https://github.com/fuma-nama/fumadocs) for documentation of ckan-devstaller. The documentation can be viewed at [ckan-devstaller.dathere.com](https://ckan-devstaller.dathere.com). + +We attempt to follow the [Divio documentation system](https://docs.divio.com/documentation-system/) which primarily includes: + +- Tutorials +- How-to guides +- Explanation +- Reference + +## Development + +Run development server: + +```bash +bun dev +``` + +Open http://localhost:3000 with your browser to see the result. + +## Explore + +In the project, you can see: + +- `lib/source.ts`: Code for content source adapter, `loader()` provides the interface to access your content. +- `lib/layout.shared.tsx`: Shared options for layouts, optional but preferred to keep. + +| Route | Description | +| ------------------------- | ------------------------------------------------------ | +| `app/(home)` | The route group for your landing page and other pages. | +| `app/docs` | The documentation layout and pages. | +| `app/api/search/route.ts` | The Route Handler for search. | + +## Linting + +We use [Biome](https://biomejs.dev) for linting. We recommend you install the [biome-vscode extension](https://github.com/biomejs/biome-vscode) if you are using [VSCodium](https://vscodium.com/) or VSCode for developing the docs. diff --git a/docs/app/(home)/ckan-devstaller-demo.gif b/docs/app/(home)/ckan-devstaller-demo.gif new file mode 100644 index 0000000..dda1cf9 Binary files /dev/null and b/docs/app/(home)/ckan-devstaller-demo.gif differ diff --git a/docs/app/(home)/layout.tsx b/docs/app/(home)/layout.tsx new file mode 100644 index 0000000..c16b056 --- /dev/null +++ b/docs/app/(home)/layout.tsx @@ -0,0 +1,6 @@ +import { HomeLayout } from "fumadocs-ui/layouts/home"; +import { baseOptions } from "@/lib/layout.shared"; + +export default function Layout({ children }: LayoutProps<"/">) { + return {children}; +} diff --git a/docs/app/(home)/page.tsx b/docs/app/(home)/page.tsx new file mode 100644 index 0000000..72a91c6 --- /dev/null +++ b/docs/app/(home)/page.tsx @@ -0,0 +1,415 @@ +/** biome-ignore-all lint/suspicious/noArrayIndexKey: Would need to look into this trivial issue */ +"use client"; + +import { CodeBlock } from "fumadocs-ui/components/codeblock"; +import defaultMdxComponents from "fumadocs-ui/mdx"; +import { cn } from "fumadocs-ui/utils/cn"; +import { + BlocksIcon, + GitMergeIcon, + HomeIcon, + SailboatIcon, + TerminalIcon, + Trash2Icon, + ZapIcon, +} from "lucide-react"; +import Image from "next/image"; +import Link from "next/link"; +import { type HTMLProps, type ReactNode, useState } from "react"; +import { Pre } from "@/components/codeblock"; +import { buttonVariants } from "@/components/ui/button"; +import CkanDevstallerDemo from "./ckan-devstaller-demo.gif"; + +export default function HomePage() { + const gridColor = + "color-mix(in oklab, var(--color-fd-primary) 10%, transparent)"; + const { Card, Cards } = defaultMdxComponents; + return ( + <> +
+
+
+
+ + +
+
+
+ +
+ + ); +} + +function Hero() { + const { Card, Cards } = defaultMdxComponents; + return ( +
+
+
+

ckan-devstaller

+

+ + ckan-devstaller{" "} + + +
+ Launch CKAN dev instances within minutes. +

+

+ ckan-devstaller is a command-line tool to automate installing CKAN for + development using ckan-compose on a new Ubuntu 22.04 instance. +

+

+ Provided by{" "} + + datHere + + . +

+
+ + Get Started + + + Source Code + +
+ + } href="/docs/builder" title="Quick start"> + Get started with ckan-devstaller and install CKAN within minutes + + } href="/docs/builder" title="Builder"> + Customize your installation with an interactive web GUI + + } + href="/docs/reference/installation-architecture" + title="Installation architecture" + > + Learn about where files are installed after running ckan-devstaller + + } + href="https://github.com/dathere/ckan-devstaller" + title="Source code" + > + View the source code of ckan-devstaller on GitHub + + + +
+ ); +} + +function PreviewImages() { + const [active, setActive] = useState(0); + const previews = [ + { + image: CkanDevstallerDemo, + name: "Demo", + }, + ]; + + return ( +
+
+ {/*
*/} + {/* {previews.map((item, i) => ( + + ))} */} +
+ {previews.map((item, i) => ( + preview + ))} +
+ ); +} + +function Why() { + return ( +
+ +
./ckan-devstaller
+ + } + codeblockUninstall={ + +
./ckan-devstaller uninstall
+
+ } + /> +
+ ); +} + +function WhyInteractive(props: { + codeblockInstall: ReactNode; + codeblockUninstall: ReactNode; +}) { + const [active, setActive] = useState(0); + const items = [ + [ + , + "Install CKAN within minutes", + ], + [ + , + "Customize your installation", + ], + [ + , + "Designed for developers", + ], + [ + , + "Uninstall with ease", + ], + ]; + + return ( +
+
+ {items.map((item, i) => ( + + ))} +
+ + +
+ {active === 0 ? ( + +

+ + Install CKAN within minutes. +

+

+ One of the primary goals of ckan-devstaller is to ease + installation of CKAN for development. Built with Rust for speed + and streamlining installation with{" "} + + ckan-compose + + , ckan-devstaller improves installation speeds{" "} + from hours/days to just minutes depending on your + download speed. +

+
+ + Get started + +
+
+ ) : null} + {active === 1 ? ( + +

+ + Customize your installation with the Builder. +

+

+ Try out the interactive web GUI for customizing your CKAN + installation. You can select: +

+
    +
  • Presets
  • +
  • CKAN version
  • +
  • Extensions
  • +
  • Features
  • +
+

+ Then you can copy the provided ckan-devstaller command to run your + selected configuration. +

+
+ + Try out the Builder + +
+
+ ) : null} + {active === 2 ? ( + +

+ + Designed for developers. +

+

+ We've kept development use cases in mind while developing + ckan-devstaller, such as: +

+
    +
  • Trying out a new version of CKAN
  • +
  • Developing CKAN extensions and themes
  • +
+
+ + View the installation architecture + + + Source code + +
+
+ ) : null} + {active === 3 ? ( + +

+ + Uninstall CKAN with ease. +

+

+ After you've installed CKAN with ckan-devstaller, you can + uninstall CKAN with ease. This allows for quickly re-installing + CKAN for a different use case. +

+ {props.codeblockUninstall} + + Learn more about uninstalling + +
+ ) : null} +
+
+ ); +} + +function WhyPanel(props: HTMLProps) { + return ( +
+ {props.children} +
+ ); +} diff --git a/docs/app/api/search/route.ts b/docs/app/api/search/route.ts new file mode 100644 index 0000000..ec6bc8d --- /dev/null +++ b/docs/app/api/search/route.ts @@ -0,0 +1,7 @@ +import { createFromSource } from "fumadocs-core/search/server"; +import { source } from "@/lib/source"; + +export const { GET } = createFromSource(source, { + // https://docs.orama.com/docs/orama-js/supported-languages + language: "english", +}); diff --git a/docs/app/docs/[[...slug]]/page.tsx b/docs/app/docs/[[...slug]]/page.tsx new file mode 100644 index 0000000..9a9b214 --- /dev/null +++ b/docs/app/docs/[[...slug]]/page.tsx @@ -0,0 +1,54 @@ +import { createRelativeLink } from "fumadocs-ui/mdx"; +import { + DocsBody, + DocsDescription, + DocsPage, + DocsTitle, +} from "fumadocs-ui/page"; +import type { Metadata } from "next"; +import { notFound } from "next/navigation"; +import { getPageImage, source } from "@/lib/source"; +import { getMDXComponents } from "@/mdx-components"; + +export default async function Page(props: PageProps<"/docs/[[...slug]]">) { + const params = await props.params; + const page = source.getPage(params.slug); + if (!page) notFound(); + + const MDX = page.data.body; + + return ( + + {page.data.title} + {page.data.description} + + + + + ); +} + +export async function generateStaticParams() { + return source.generateParams(); +} + +export async function generateMetadata( + props: PageProps<"/docs/[[...slug]]">, +): Promise { + const params = await props.params; + const page = source.getPage(params.slug); + if (!page) notFound(); + + return { + title: page.data.title, + description: page.data.description, + openGraph: { + images: getPageImage(page).url, + }, + }; +} diff --git a/docs/app/docs/layout.tsx b/docs/app/docs/layout.tsx new file mode 100644 index 0000000..2d250d0 --- /dev/null +++ b/docs/app/docs/layout.tsx @@ -0,0 +1,11 @@ +import { DocsLayout } from "fumadocs-ui/layouts/docs"; +import { baseOptions } from "@/lib/layout.shared"; +import { source } from "@/lib/source"; + +export default function Layout({ children }: LayoutProps<"/docs">) { + return ( + + {children} + + ); +} diff --git a/docs/app/favicon.ico b/docs/app/favicon.ico new file mode 100644 index 0000000..e92b746 Binary files /dev/null and b/docs/app/favicon.ico differ diff --git a/docs/app/global.css b/docs/app/global.css new file mode 100644 index 0000000..b6836ec --- /dev/null +++ b/docs/app/global.css @@ -0,0 +1,5 @@ +@import "tailwindcss"; +@import "fumadocs-ui/css/neutral.css"; +@import "fumadocs-ui/css/ocean.css"; +@import "fumadocs-ui/css/preset.css"; +@import "tw-animate-css"; \ No newline at end of file diff --git a/docs/app/layout.tsx b/docs/app/layout.tsx new file mode 100644 index 0000000..9d8e16f --- /dev/null +++ b/docs/app/layout.tsx @@ -0,0 +1,26 @@ +import "@/app/global.css"; +import { RootProvider } from "fumadocs-ui/provider"; +import localFont from "next/font/local"; +import Script from "next/script"; +import { Toaster } from "@/components/ui/sonner"; + +const inter = localFont({ src: "../lib/inter.ttf" }); + +export default function Layout({ children }: LayoutProps<"/">) { + return ( + + + {children} +