chore: Moving to Forgejo instead of Github
Signed-off-by: Awiteb <a@4rs.nl>
This commit is contained in:
parent
eb295d5b25
commit
e6121b3f52
6 changed files with 85 additions and 100 deletions
25
.forgejo/workflows/ci.yml
Normal file
25
.forgejo/workflows/ci.yml
Normal file
|
@ -0,0 +1,25 @@
|
|||
name: Rust CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
branches: [master]
|
||||
|
||||
jobs:
|
||||
rust_ci:
|
||||
name: Rust CI
|
||||
runs-on: debian
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: https://codeberg.org/TheAwiteb/rust-action@v1.75
|
||||
- name: Check MSRV
|
||||
run: cargo +1.75 build
|
||||
- name: Build the source code
|
||||
run: cargo build
|
||||
- name: Check the code format
|
||||
run: cargo fmt -- --check
|
||||
- name: Run cargo-check
|
||||
run: cargo check
|
||||
- name: Run cargo-clippy
|
||||
run: cargo clippy -- -D warnings
|
1
.github/FUNDING.yml
vendored
1
.github/FUNDING.yml
vendored
|
@ -1 +0,0 @@
|
|||
github: "TheAwiteb"
|
34
.github/workflows/auto_close_pr.yml
vendored
Normal file
34
.github/workflows/auto_close_pr.yml
vendored
Normal file
|
@ -0,0 +1,34 @@
|
|||
name: Auto close PR
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, reopened]
|
||||
|
||||
jobs:
|
||||
close_pr:
|
||||
name: Auto close PR
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Send close comment
|
||||
run: |
|
||||
curl -L \
|
||||
-X POST \
|
||||
-H "Accept: application/vnd.github+json" \
|
||||
-H "Authorization: Bearer $PAT" \
|
||||
-H "X-GitHub-Api-Version: 2022-11-28" \
|
||||
https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.number }}/comments \
|
||||
-d '{"body":"${{ env.BODY }}"}'
|
||||
env:
|
||||
PAT: ${{ secrets.PAT }}
|
||||
BODY: This repository is mirror only and you cannot create a pull request for it. Please open your PR in https://git.4rs.nl/awiteb/salvo-captcha
|
||||
- name: Close the PR
|
||||
run: |
|
||||
curl -L \
|
||||
-X PATCH \
|
||||
-H "Accept: application/vnd.github+json" \
|
||||
-H "Authorization: Bearer $PAT" \
|
||||
-H "X-GitHub-Api-Version: 2022-11-28" \
|
||||
https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.number }} \
|
||||
-d '{"state":"closed"}'
|
||||
env:
|
||||
PAT: ${{ secrets.PAT }}
|
35
.github/workflows/cd.yml
vendored
35
.github/workflows/cd.yml
vendored
|
@ -1,35 +0,0 @@
|
|||
name: CD
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- v[0-9]+.[0-9]+.[0-9]+
|
||||
|
||||
jobs:
|
||||
release:
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
- name: Build Changelog 🏗
|
||||
id: changelog
|
||||
uses: mikepenz/release-changelog-builder-action@v4.0.0
|
||||
with:
|
||||
configuration: "./.github/config/changelog-builder-action.json"
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.PAT }}
|
||||
|
||||
- name: Create Release 🖋
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
prerelease: ${{ contains(github.ref, 'rc') || contains(github.ref, 'pre') }}
|
||||
body: ${{steps.changelog.outputs.changelog}}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.PAT }}
|
||||
|
||||
- name: Publish to crates.io 🚀
|
||||
uses: katyo/publish-crates@v2
|
||||
with:
|
||||
token: ${{ secrets.PAT }}
|
||||
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
|
44
.github/workflows/ci.yml
vendored
44
.github/workflows/ci.yml
vendored
|
@ -1,44 +0,0 @@
|
|||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
branches: [master]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Rust build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
- run: cargo build --workspace --all-features --all-targets
|
||||
rustfmt:
|
||||
name: Rust format
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
- run: cargo fmt -- --check
|
||||
check:
|
||||
name: Rust check
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
- run: cargo check --workspace --all-features --all-targets
|
||||
clippy:
|
||||
name: Rust clippy
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
- run: cargo clippy --workspace --all-features -- -D warnings
|
||||
test:
|
||||
name: Rust test
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
- run: cargo test --workspace --all-features
|
46
README.md
46
README.md
|
@ -8,7 +8,8 @@ A captcha middleware for [salvo](salvo.rs) framework. It uses [`captcha`](https:
|
|||
|
||||
</div>
|
||||
|
||||
### Add to your project
|
||||
## Add to your project
|
||||
|
||||
First, add the following to your `Cargo.toml`:
|
||||
|
||||
```toml
|
||||
|
@ -22,36 +23,41 @@ Or use [cargo-add](https://doc.rust-lang.org/cargo/commands/cargo-add.html) to a
|
|||
$ cargo add salvo-captcha
|
||||
```
|
||||
|
||||
### Usage
|
||||
## Usage
|
||||
|
||||
See the [examples](examples) directory for a complete example.
|
||||
|
||||
## Storage
|
||||
|
||||
### Storage
|
||||
The storage of the captcha is handled by a [`CaptchaStore`] trait. You can implement your own storage or use the `cacache-rs` by enabling the `cacache-storage` feature.
|
||||
The storage of the captcha is handled by a [`CaptchaStore`] trait. You can implement your own storage or use the [`cacache-rs`] by enabling the `cacache-storage` feature.
|
||||
|
||||
```toml
|
||||
[dependencies]
|
||||
salvo-captcha = { version = "0.1", features = ["cacache-storage"] }
|
||||
```
|
||||
|
||||
### Captcha name and difficulty
|
||||
In this table you can see the different between the difficulties and the name of the captcha.
|
||||
## Captcha name and difficulty
|
||||
|
||||
| Name | Difficulty | Image |
|
||||
|------|------------|-------|
|
||||
| `Amelia` | Easy | ![Simple](https://i.suar.me/1JaxG/s) |
|
||||
| `Amelia` | Medium | ![Simple](https://i.suar.me/l7zBl/s) |
|
||||
| `Amelia` | Hard | ![Simple](https://i.suar.me/qXAlx/s) |
|
||||
| `Lucy` | Easy | ![Simple](https://i.suar.me/edwBG/s) |
|
||||
| `Lucy` | Medium | ![Simple](https://i.suar.me/NJmg0/s) |
|
||||
| `Lucy` | Hard | ![Simple](https://i.suar.me/OJK7M/s) |
|
||||
| `Mila` | Easy | ![Simple](https://i.suar.me/dO78z/s) |
|
||||
| `Mila` | Medium | ![Simple](https://i.suar.me/PXBwK/s) |
|
||||
| `Mila` | Hard | ![Simple](https://i.suar.me/8edgE/s) |
|
||||
In this table, you can see the difference between the difficulties and the name of the captcha.
|
||||
|
||||
| Name | Easy | Medium | Hard |
|
||||
| :----: | :----------------------------------: | :----------------------------------: | :----------------------------------: |
|
||||
| Amelia | ![Simple](https://i.suar.me/1JaxG/s) | ![Simple](https://i.suar.me/l7zBl/s) | ![Simple](https://i.suar.me/qXAlx/s) |
|
||||
| Lucy | ![Simple](https://i.suar.me/edwBG/s) | ![Simple](https://i.suar.me/NJmg0/s) | ![Simple](https://i.suar.me/OJK7M/s) |
|
||||
| Mila | ![Simple](https://i.suar.me/dO78z/s) | ![Simple](https://i.suar.me/PXBwK/s) | ![Simple](https://i.suar.me/8edgE/s) |
|
||||
|
||||
## Mirrors
|
||||
|
||||
- Github (https://github.com/TheAwiteb/salvo-captcha)
|
||||
- Codeberg (https://codeberg.org/awiteb/salvo-captcha)
|
||||
|
||||
### Main Repository
|
||||
|
||||
- My Git (https://git.4rs.nl/awiteb/salvo-captcha)
|
||||
|
||||
## License
|
||||
|
||||
### License
|
||||
This project is licensed under the MIT license for more details see [LICENSE](LICENSE) or http://opensource.org/licenses/MIT.
|
||||
|
||||
|
||||
[`CaptchaStore`]: https://docs.rs/salvo_captcha/0.1.0/salvo_captcha/trait.CaptchaStore.html
|
||||
[cacache-rs]: https://github.com/zkat/cacache-rs
|
||||
[`cacache-rs`]: https://github.com/zkat/cacache-rs
|
||||
|
|
Loading…
Reference in a new issue