mirror of https://github.com/zer0bin-dev/zer0bin
feat: 🔖 v0.7.0 release candidate!
This commit is contained in:
parent
59f73bbd57
commit
fb51056fa0
|
@ -28,7 +28,7 @@ Submit your public instance [here](https://github.com/Domterion/zer0bin/issues/n
|
|||
| Website | Expiration | Max paste size | Version | Country |
|
||||
| ---------------------------------------------- | ---------- | -------------- | ------- | ------- |
|
||||
| zer0b.in (not up yet) | 7 days | 40,000 chars | vx.x.x | ? |
|
||||
| [stepbro.voring.me](https://stepbro.voring.me) | 365 days | 69,000 chars | v0.6.1 | 🇺🇸 US |
|
||||
| [stepbro.voring.me](https://stepbro.voring.me) | 365 days | 69,000 chars | v0.7.0 | 🇺🇸 US |
|
||||
|
||||
# Technologies used
|
||||
|
||||
|
@ -60,11 +60,10 @@ Submit your public instance [here](https://github.com/Domterion/zer0bin/issues/n
|
|||
- 🐈 [Yarn](https://yarnpkg.com/) ≥ 1.0.0
|
||||
- 🐘 [PostgreSQL](https://www.postgresql.org/) ≥ 9.6
|
||||
- 🦝 [Nginx](https://www.nginx.com/) ≥ 1.18.0
|
||||
- 🌾 [Brotli plugin](https://github.com/google/ngx_brotli) recommended
|
||||
- 🌾 [Brotli plugin](https://github.com/google/ngx_brotli) recommended
|
||||
- 🐧 [Linux](https://kernel.org/) or 😈 [FreeBSD](https://freebsd.org/)
|
||||
- 🌄 Domain with [SSL](https://letsencrypt.org/)
|
||||
|
||||
|
||||
<details>
|
||||
<summary><h3>Steps</h3></summary>
|
||||
|
||||
|
@ -89,12 +88,12 @@ $EDITOR config.json # Edit as appropriate
|
|||
cargo build --release
|
||||
./target/release/zer0bin-bin # Preferably in a tmux session or as a service
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><h3>Configuration</h3></summary>
|
||||
|
||||
|
||||
| Key | Values | Description |
|
||||
| ------------------------------------------ | ------------------------ | ------------------------------------------------------------------------------ |
|
||||
| server.backend_host | 127.0.0.1 or 0.0.0.0 | The host to run the backend on |
|
||||
|
|
|
@ -268,7 +268,7 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
|
|||
|
||||
[[package]]
|
||||
name = "backend"
|
||||
version = "0.1.0"
|
||||
version = "0.7.0"
|
||||
dependencies = [
|
||||
"actix-cors",
|
||||
"actix-governor",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "backend"
|
||||
version = "0.6.1"
|
||||
version = "0.7.0"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
|
|
@ -38,6 +38,7 @@ pub struct GetPasteResponse {
|
|||
#[derive(Serialize)]
|
||||
pub struct GetStatsResponse {
|
||||
pub count: i64,
|
||||
pub version: String,
|
||||
}
|
||||
|
||||
#[derive(Serialize)]
|
||||
|
|
|
@ -19,6 +19,7 @@ use crate::{
|
|||
|
||||
#[get("/s")]
|
||||
pub async fn get_stats(state: web::Data<AppState>) -> impl Responder {
|
||||
let version = env!("CARGO_PKG_VERSION").to_string();
|
||||
// TODO: Maybe there's a less hacky way to do this..?
|
||||
let count: Result<i64, sqlx::Error> = sqlx::query(r#"SELECT COUNT(*) FROM pastes"#)
|
||||
.try_map(|row: PgRow| row.try_get::<i64, _>("count"))
|
||||
|
@ -41,6 +42,7 @@ pub async fn get_stats(state: web::Data<AppState>) -> impl Responder {
|
|||
success: true,
|
||||
data: GetStatsResponse {
|
||||
count: count.unwrap(),
|
||||
version
|
||||
},
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue