Skip to content
This repository has been archived by the owner on Apr 17, 2024. It is now read-only.

Commit

Permalink
Move mitractl documentation to docs/mitractl.md
Browse files Browse the repository at this point in the history
  • Loading branch information
silverpill committed Nov 25, 2022
1 parent 5ff2d19 commit 109168b
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 98 deletions.
112 changes: 14 additions & 98 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Ethereum contracts: https://codeberg.org/silverpill/mitra-contracts

Run:

```
```shell
cargo build --release --features production
```

Expand All @@ -64,7 +64,7 @@ Create configuration file by copying `contrib/mitra_config.yaml` and configure t

Start Mitra:

```
```shell
./mitra
```

Expand All @@ -78,7 +78,7 @@ To run Mitra as a systemd service, check out the [systemd unit file example](./c

Download and install Mitra package:

```
```shell
dpkg -i mitra.deb
```

Expand All @@ -93,7 +93,7 @@ Open configuration file `/etc/mitra/config.yaml` and configure the instance.

Start Mitra:

```
```shell
systemctl start mitra
```

Expand Down Expand Up @@ -123,53 +123,53 @@ See [CONTRIBUTING.md](./CONTRIBUTING.md)

### Start database server

```
```shell
docker-compose up -d
```

Test connection:

```
```shell
psql -h localhost -p 55432 -U mitra mitra
```

### Start Monero node and wallet server

(this step is optional)

```
```shell
docker-compose --profile monero up -d
```

### Run web service

Create config file, adjust settings if needed:

```
```shell
cp config.yaml.example config.yaml
```

Compile and run service:

```
```shell
cargo run
```

### Run CLI

```
```shell
cargo run --bin mitractl
```

### Run linter

```
```shell
cargo clippy
```

### Run tests

```
```shell
cargo test
```

Expand All @@ -179,99 +179,15 @@ See [FEDERATION.md](./FEDERATION.md)

## Client API

### Mastodon API

Most methods are similar to Mastodon API, but Mitra is not fully compatible.

[OpenAPI spec](./docs/openapi.yaml)

## CLI

Commands must be run as the same user as the web service:

```
su mitra -c "mitractl generate-invite-code"
```

### Commands

Print help:

```shell
mitractl --help
```

Generate RSA private key:

```
mitractl generate-rsa-key
```

Generate invite code:

```
mitractl generate-invite-code
```

List generated invites:

```
mitractl list-invite-codes
```

Set or change password:

```
mitractl set-password <user-id> <password>
```

Delete profile:

```
mitractl delete-profile 55a3005f-f293-4168-ab70-6ab09a879679
```

Delete post:

```
mitractl delete-post 55a3005f-f293-4168-ab70-6ab09a879679
```

Remove remote posts and media older than 30 days:

```
mitractl delete-extraneous-posts 30
```

Delete attachments that don't belong to any post:

```
mitractl delete-unused-attachments 5
```

Delete empty remote profiles:

```
mitractl delete-empty-profiles 100
```

Generate ethereum address:
`mitractl` is a command-line tool for performing instance maintenance.

```
mitractl generate-ethereum-address
```

Update synchronization starting block of Ethereum blockchain:

```shell
mitractl update-current-block 2000000
```

Create Monero wallet:

```shell
mitractl create-monero-wallet "mitra-wallet" "passw0rd"
```
[Documentation](./docs/mitractl.md)

## License

Expand Down
87 changes: 87 additions & 0 deletions docs/mitractl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# mitractl: a tool for instance administrators

Commands must be run as the same user as the web service:

```shell
su mitra -c "mitractl generate-invite-code"
```

---

Print help:

```shell
mitractl --help
```

Generate RSA private key:

```shell
mitractl generate-rsa-key
```

Generate invite code:

```shell
mitractl generate-invite-code
```

List generated invites:

```shell
mitractl list-invite-codes
```

Set or change password:

```shell
mitractl set-password <user-id> <password>
```

Delete profile:

```shell
mitractl delete-profile 55a3005f-f293-4168-ab70-6ab09a879679
```

Delete post:

```shell
mitractl delete-post 55a3005f-f293-4168-ab70-6ab09a879679
```

Remove remote posts and media older than 30 days:

```shell
mitractl delete-extraneous-posts 30
```

Delete attachments that don't belong to any post:

```shell
mitractl delete-unused-attachments 5
```

Delete empty remote profiles:

```shell
mitractl delete-empty-profiles 100
```

Generate ethereum address:

```shell
mitractl generate-ethereum-address
```

Update synchronization starting block of Ethereum blockchain:

```shell
mitractl update-current-block 2000000
```

Create Monero wallet:

```shell
mitractl create-monero-wallet "mitra-wallet" "passw0rd"
```

0 comments on commit 109168b

Please sign in to comment.