-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
93 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
### Rust template | ||
# Generated by Cargo | ||
# will have compiled files and executables | ||
debug/ | ||
target/ | ||
|
||
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries | ||
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html | ||
Cargo.lock | ||
|
||
# These are backup files generated by rustfmt | ||
**/*.rs.bk | ||
|
||
# MSVC Windows builds of rustc generate these, which store debugging information | ||
*.pdb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
FROM rust:1.72.0-bullseye as Builder | ||
|
||
WORKDIR /root/app | ||
COPY --chown=root:root . . | ||
|
||
RUN cargo build --release --bin babyrite --features enable_sentry | ||
|
||
FROM debian:bullseye-slim as Runner | ||
|
||
COPY --from=Builder --chown=root:root /root/app/target/release/babyrite /usr/local/bin/babyrite | ||
|
||
RUN apt-get update && apt-get install -y libssl-dev ca-certificates | ||
|
||
RUN useradd --create-home --user-group babyrite | ||
USER babyrite | ||
WORKDIR /home/babyrite | ||
|
||
LABEL org.opencontainers.image.source=https://github.com/m1sk9/babyrite | ||
ENTRYPOINT [ "babyrite" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,62 @@ | ||
# babyrite | ||
|
||
[](https://github.com/m1sk9/babyrite/actions/workflows/release.yaml) | ||
[](https://github.com/m1sk9/babyrite/actions/workflows/build.yaml) | ||
[](https://github.com/m1sk9/babyrite/actions/workflows/clippy.yaml) | ||
[](https://github.com/m1sk9/babyrite/actions/workflows/fmt.yaml) | ||
|
||
A citation message Discord bot | ||
|
||
## Features | ||
|
||
- メッセージリンクのメッセージ内容を展開する | ||
|
||
### Todo | ||
|
||
- [ ] 添付ファイルのサポート | ||
|
||
## Installation | ||
|
||
babyrite の Docker Image は ghcr.io から取得することができます. | ||
|
||
```shell | ||
# 最新版 | ||
docker pull ghcr.io/m1sk9/babyrite:latest | ||
|
||
# マイナーバージョン (v0.x) | ||
## 破壊的変更がない限りは互換性があります. こちらから取得することをおすすめします. | ||
docker pull ghcr.io/m1sk9/babyrite:v0 | ||
|
||
# バージョン指定 | ||
docker pull ghcr.io/m1sk9/babyrite:vX.Y.Z | ||
``` | ||
|
||
取得した Docker Image に対して環境変数を与えると babyrite を起動できます. | ||
|
||
## Features Flag | ||
|
||
babyrite の各オプション機能は Features Flag で有効化が可能です. | ||
|
||
> **Note** | ||
> | ||
> Docker Image で起動する際は一部の Features Flag のみが利用できます. 自由に設定するには自分でビルドする必要があります. | ||
| Flag | Description | Default (Docker Image) | | ||
| ---- | ----------- | ------- | | ||
| `enable_sentry` | Sentry によるエラー報告を有効化します. | `true` | | ||
|
||
## Environment Variables | ||
|
||
以下は babyrite が利用する環境変数です. | ||
|
||
`Required` カラムが `Yes` の Key は指定必須です. 指定しない場合は正しく起動しません. | ||
|
||
| Key | Description | Required | Default | | ||
| --- | ----------- | -------- | ------- | | ||
| `DISCORD_API_TOKEN` | Discord API トークン | Yes | --- | | ||
|
||
環境変数の設定例は [`.env.example`](.env.example) を参照してください. | ||
|
||
```shell | ||
cp .env.example .env | ||
``` |