mirror of
https://github.com/dathere/ckan-devstaller.git
synced 2026-07-05 16:52:19 +00:00
- Fix unquoted $flag in install.bash (unary operator error when no arg) - Fix pip install syntax: use PEP 440 direct URL format for CKAN and ckanext-scheming (pip 26+ rejects extras in #egg= fragment) - Add CLAUDE.md with architecture notes, known issues, and sysadmin setup - Add deployment-from-source section to README for ARM users Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2.3 KiB
2.3 KiB
ckan-devstaller
Rust CLI that installs CKAN 2.11.3 from source on Ubuntu 22.04. Two modes: interactive (prompts) or --default (silent).
Build
cargo build --release
./target/release/ckan-devstaller
Requires Rust. Install via curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh.
Source layout
| File | Purpose |
|---|---|
src/main.rs |
CLI entry, Config struct, full install orchestration (~499 lines) |
src/questions.rs |
inquire-based interactive prompts (SSH, CKAN version, sysadmin) |
src/steps.rs |
Step display helpers (intro, numbered steps) |
src/styles.rs |
Terminal color helpers via owo-colors |
install.bash |
Bootstrap script: apt update, curl binary from releases, run installer |
Key dependencies
clap— CLI arg parsing (--defaultflag)inquire— interactive terminal prompts (requires real TTY)xshell/xshell-venv— shell command execution and Python venv managementrust-ini— read/write/etc/ckan/default/ckan.inihuman-panic— friendly panic messages
Architecture
main.rs builds a Config struct (either from prompts or defaults), then runs install steps sequentially:
apt update && apt upgrade- Install curl + optional openssh-server
- Install Ahoy CLI (arm64 or x86_64 binary from GitHub releases)
- Clone and start ckan-compose (PostgreSQL, Solr, Redis via Docker)
- Create Python venv at
/usr/lib/ckan/default, install CKAN via pip - Set up
/etc/ckan/default/ckan.ini - Set up DataStore (DB permissions, config)
- Optionally install ckanext-scheming, DataPusher+
- Start CKAN dev server
Known issues / fixes applied
- pip 26+ incompatibility:
#egg=pkg[extras]fragment syntax rejected. Fixed to use PEP 440 direct URL syntax:pkg[extras] @ git+https://... - ARM support: Release binaries are x86_64. On ARM (e.g. Apple Silicon Ubuntu VM), build from source with
cargo build --release. - install.bash unquoted variable:
$flagmust be quoted in theifcheck to avoidunary operator expectederror when no arg is passed.
Adding a sysadmin after install
/usr/lib/ckan/default/bin/ckan -c /etc/ckan/default/ckan.ini user add <username> email=<email> password=<password>
/usr/lib/ckan/default/bin/ckan -c /etc/ckan/default/ckan.ini sysadmin add <username>