WIP
This commit is contained in:
parent
ad7cd98d85
commit
afb53b087b
4 changed files with 95 additions and 2 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -419,7 +419,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a"
|
checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "fishctl"
|
name = "firefish-cli"
|
||||||
version = "0.1.0-alpha.1"
|
version = "0.1.0-alpha.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap",
|
"clap",
|
||||||
|
|
|
@ -1,10 +1,14 @@
|
||||||
[package]
|
[package]
|
||||||
name = "fishctl"
|
name = "firefish-cli"
|
||||||
version = "0.1.0-alpha.1"
|
version = "0.1.0-alpha.1"
|
||||||
rust-version = "1.74"
|
rust-version = "1.74"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|
||||||
|
[[bin]]
|
||||||
|
name = "fishctl"
|
||||||
|
path = "src/main.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
clap = { version = "4.5", features = ["derive"] }
|
clap = { version = "4.5", features = ["derive"] }
|
||||||
color-print = "0.3"
|
color-print = "0.3"
|
||||||
|
|
|
@ -7,3 +7,4 @@ RUN cargo install --locked --path .
|
||||||
FROM docker.io/busybox:musl
|
FROM docker.io/busybox:musl
|
||||||
COPY LICENSE ./
|
COPY LICENSE ./
|
||||||
COPY --from=builder /usr/local/cargo/bin/fishctl /usr/local/bin/fishctl
|
COPY --from=builder /usr/local/cargo/bin/fishctl /usr/local/bin/fishctl
|
||||||
|
WORKDIR /firefish
|
||||||
|
|
88
README.md
Normal file
88
README.md
Normal file
|
@ -0,0 +1,88 @@
|
||||||
|
# Firefish CLI tool
|
||||||
|
|
||||||
|
## Install and Update
|
||||||
|
|
||||||
|
### Install pre-built executable using [cargo-binstall](https://github.com/cargo-bins/cargo-binstall)
|
||||||
|
|
||||||
|
```sh
|
||||||
|
# If you don't have cargo-binstall, install it first
|
||||||
|
# curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
|
||||||
|
|
||||||
|
# Install pre-built executable
|
||||||
|
cargo binstall --locked --git https://firefish.dev/firefish-cli.git
|
||||||
|
```
|
||||||
|
|
||||||
|
You can update the package using the same command.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
cargo binstall --locked --git https://firefish.dev/firefish-cli.git
|
||||||
|
```
|
||||||
|
|
||||||
|
### Install from source
|
||||||
|
|
||||||
|
```sh
|
||||||
|
# Build from source
|
||||||
|
cargo install --locked --git https://firefish.dev/firefish-cli.git
|
||||||
|
```
|
||||||
|
|
||||||
|
You can update the package using the same command.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
cargo install --locked --git https://firefish.dev/firefish-cli.git
|
||||||
|
```
|
||||||
|
|
||||||
|
### Use pre-built OCI image
|
||||||
|
|
||||||
|
You can also use `registry.firefish.dev/firefish-cli` container image.
|
||||||
|
|
||||||
|
Please replace `fishctl ___` commands with
|
||||||
|
|
||||||
|
```sh
|
||||||
|
docker run -it --rm --volume "$(pwd)":/firefish \
|
||||||
|
registry.firefish.dev/firefish-cli \
|
||||||
|
fishctl ___
|
||||||
|
|
||||||
|
# or
|
||||||
|
|
||||||
|
podman run -it --rm --volume "$(pwd)":/firefish \
|
||||||
|
registry.firefish.dev/firefish-cli \
|
||||||
|
fishctl ___
|
||||||
|
```
|
||||||
|
|
||||||
|
to run it inside a container.
|
||||||
|
|
||||||
|
If you are using a container network (which is typically the case if you using `docker-compose.yml` to run Firefish), you also have to specify the network name like this:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
docker run -it --rm --network network_name --volume "$(pwd)":/firefish \
|
||||||
|
registry.firefish.dev/firefish-cli \
|
||||||
|
fishctl ___
|
||||||
|
|
||||||
|
# or
|
||||||
|
|
||||||
|
podman run -it --rm --network network_name --volume "$(pwd)":/firefish \
|
||||||
|
registry.firefish.dev/firefish-cli \
|
||||||
|
fishctl ___
|
||||||
|
```
|
||||||
|
|
||||||
|
You can search for your network name by `docker network ls` or `podman network ls`.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
Please make sure to `cd` to the Firefish local repository before running these commands.
|
||||||
|
|
||||||
|
### Migrate the config files
|
||||||
|
|
||||||
|
[The admin note](https://firefish.dev/firefish/firefish/-/blob/main/docs/notice-for-admins.md) may tell you that you need to update the config files. In such a case, please execute the following command.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
fishctl config migrate <revision>
|
||||||
|
```
|
||||||
|
|
||||||
|
### Validate the config files
|
||||||
|
|
||||||
|
To validate the config files, run the following command. Note that this only performs a formal validation and does not check that the settings are appropriate. For example, this command does not check if the database password is correct.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
fishctl config validate
|
||||||
|
```
|
Loading…
Reference in a new issue