Compare commits
13 commits
Author | SHA1 | Date | |
---|---|---|---|
3f3efe4afa | |||
37b51bcbee | |||
3cc69f3d4f | |||
7432ffd5f9 | |||
764a632ae6 | |||
396bff909e | |||
fb44c25e47 | |||
a7aec1b94e | |||
8cedeb531d | |||
912f16e0c3 | |||
999d68ab60 | |||
2d9fc0d559 | |||
8c386d5ac6 |
11 changed files with 130 additions and 37 deletions
47
.forgejo/workflows/publish.yml
Normal file
47
.forgejo/workflows/publish.yml
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
name: Publish latest version
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
container:
|
||||||
|
image: ghcr.io/catthehacker/ubuntu:act-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout Code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Checkout LFS
|
||||||
|
run: |
|
||||||
|
# Replace double auth header, see https://github.com/actions/checkout/issues/1830
|
||||||
|
AUTH=$(git config --local http.${{ github.server_url }}/.extraheader)
|
||||||
|
git config --local --unset http.${{ github.server_url }}/.extraheader
|
||||||
|
git config --local http.${{ github.server_url }}/${{ github.repository }}.git/info/lfs/objects/batch.extraheader "$AUTH"
|
||||||
|
|
||||||
|
# Get files
|
||||||
|
git lfs fetch
|
||||||
|
git lfs checkout
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Sanitize metadata
|
||||||
|
id: meta
|
||||||
|
uses: docker/metadata-action@v5
|
||||||
|
with:
|
||||||
|
tags: latest
|
||||||
|
images: git.mylloon.fr/${{ github.repository }}
|
||||||
|
|
||||||
|
- name: Login to Registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: ${{ github.server_url }}
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.TOKEN }}
|
||||||
|
|
||||||
|
- name: Build and push
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
|
tags: ${{ steps.meta.outputs.tags }}
|
|
@ -1,15 +0,0 @@
|
||||||
steps:
|
|
||||||
publish:
|
|
||||||
image: woodpeckerci/plugin-docker-buildx:2
|
|
||||||
settings:
|
|
||||||
labels:
|
|
||||||
platform: linux/amd64
|
|
||||||
repo: git.mylloon.fr/${CI_REPO,,}
|
|
||||||
auto_tag: true
|
|
||||||
registry: git.mylloon.fr
|
|
||||||
username: ${CI_REPO_OWNER}
|
|
||||||
password:
|
|
||||||
from_secret: cb_token
|
|
||||||
when:
|
|
||||||
event: push
|
|
||||||
branch: main
|
|
31
Cargo.lock
generated
31
Cargo.lock
generated
|
@ -152,9 +152,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "actix-web"
|
name = "actix-web"
|
||||||
version = "4.8.0"
|
version = "4.9.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1988c02af8d2b718c05bc4aeb6a66395b7cdf32858c2c71131e5637a8c05a9ff"
|
checksum = "9180d76e5cc7ccbc4d60a506f2c727730b154010262df5b910eb17dbe4b8cb38"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"actix-codec",
|
"actix-codec",
|
||||||
"actix-http",
|
"actix-http",
|
||||||
|
@ -173,6 +173,7 @@ dependencies = [
|
||||||
"encoding_rs",
|
"encoding_rs",
|
||||||
"futures-core",
|
"futures-core",
|
||||||
"futures-util",
|
"futures-util",
|
||||||
|
"impl-more",
|
||||||
"itoa 1.0.11",
|
"itoa 1.0.11",
|
||||||
"language-tags",
|
"language-tags",
|
||||||
"log",
|
"log",
|
||||||
|
@ -633,9 +634,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "chrono-tz"
|
name = "chrono-tz"
|
||||||
version = "0.9.0"
|
version = "0.10.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "93698b29de5e97ad0ae26447b344c482a7284c737d9ddc5f9e52b74a336671bb"
|
checksum = "cd6dd8046d00723a59a2f8c5f295c515b9bb9a331ee4f8f3d4dd49e428acd3b6"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"chrono",
|
"chrono",
|
||||||
"chrono-tz-build",
|
"chrono-tz-build",
|
||||||
|
@ -644,12 +645,11 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "chrono-tz-build"
|
name = "chrono-tz-build"
|
||||||
version = "0.3.0"
|
version = "0.4.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "0c088aee841df9c3041febbb73934cfc39708749bf96dc827e3359cd39ef11b1"
|
checksum = "e94fea34d77a245229e7746bd2beb786cd2a896f306ff491fb8cecb3074b10a7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"parse-zoneinfo",
|
"parse-zoneinfo",
|
||||||
"phf 0.11.2",
|
|
||||||
"phf_codegen 0.11.2",
|
"phf_codegen 0.11.2",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -702,9 +702,9 @@ checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "comrak"
|
name = "comrak"
|
||||||
version = "0.26.0"
|
version = "0.28.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "395ab67843c57df5a4ee29d610740828dbc928cc64ecf0f2a1d5cd0e98e107a9"
|
checksum = "c93ab3577cca16b4a1d80a88c2e0cd8b6e969e51696f0bbb0d1dcb0157109832"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"caseless",
|
"caseless",
|
||||||
"clap",
|
"clap",
|
||||||
|
@ -865,6 +865,12 @@ dependencies = [
|
||||||
"syn 2.0.72",
|
"syn 2.0.72",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "cyborgtime"
|
||||||
|
version = "2.1.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "817fa642fb0ee7fe42e95783e00e0969927b96091bdd4b9b1af082acd943913b"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "darling"
|
name = "darling"
|
||||||
version = "0.20.10"
|
version = "0.20.10"
|
||||||
|
@ -1069,6 +1075,7 @@ dependencies = [
|
||||||
"chrono",
|
"chrono",
|
||||||
"chrono-tz",
|
"chrono-tz",
|
||||||
"comrak",
|
"comrak",
|
||||||
|
"cyborgtime",
|
||||||
"glob",
|
"glob",
|
||||||
"lol_html",
|
"lol_html",
|
||||||
"mime_guess",
|
"mime_guess",
|
||||||
|
@ -1505,6 +1512,12 @@ dependencies = [
|
||||||
"unicode-normalization",
|
"unicode-normalization",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "impl-more"
|
||||||
|
version = "0.1.6"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "206ca75c9c03ba3d4ace2460e57b189f39f43de612c2f85836e65c929701bb2d"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "indexmap"
|
name = "indexmap"
|
||||||
version = "2.2.6"
|
version = "2.2.6"
|
||||||
|
|
|
@ -10,7 +10,7 @@ publish = false
|
||||||
license = "AGPL-3.0-or-later"
|
license = "AGPL-3.0-or-later"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
actix-web = { version = "4.6", default-features = false, features = ["macros", "compress-brotli"] }
|
actix-web = { version = "4.9", default-features = false, features = ["macros", "compress-brotli"] }
|
||||||
actix-files = "0.6"
|
actix-files = "0.6"
|
||||||
cached = { version = "0.53", features = ["async", "ahash"] }
|
cached = { version = "0.53", features = ["async", "ahash"] }
|
||||||
ramhorns = "1.0"
|
ramhorns = "1.0"
|
||||||
|
@ -21,16 +21,17 @@ serde_json = "1.0"
|
||||||
minify-html = "0.15"
|
minify-html = "0.15"
|
||||||
minify-js = "0.6"
|
minify-js = "0.6"
|
||||||
glob = "0.3"
|
glob = "0.3"
|
||||||
comrak = "0.26"
|
comrak = "0.28"
|
||||||
reqwest = { version = "0.12", features = ["json"] }
|
reqwest = { version = "0.12", features = ["json"] }
|
||||||
chrono = { version = "0.4.38", default-features = false, features = ["clock"]}
|
chrono = { version = "0.4.38", default-features = false, features = ["clock"]}
|
||||||
chrono-tz = "0.9"
|
chrono-tz = "0.10"
|
||||||
rss = { version = "2.0", features = ["atom"] }
|
rss = { version = "2.0", features = ["atom"] }
|
||||||
lol_html = "1.2"
|
lol_html = "1.2"
|
||||||
base64 = "0.22"
|
base64 = "0.22"
|
||||||
mime_guess = "2.0"
|
mime_guess = "2.0"
|
||||||
urlencoding = "2.1"
|
urlencoding = "2.1"
|
||||||
regex = "1.10"
|
regex = "1.10"
|
||||||
|
cyborgtime = "2.1.1"
|
||||||
|
|
||||||
[lints.clippy]
|
[lints.clippy]
|
||||||
pedantic = "warn"
|
pedantic = "warn"
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
Easy WebPage generator
|
Easy WebPage generator
|
||||||
|
|
||||||
[![dependency status](https://deps.rs/repo/gitea/git.mylloon.fr/Anri/mylloon.fr/status.svg)](https://deps.rs/repo/gitea/git.mylloon.fr/Anri/mylloon.fr)
|
[![dependency status](https://deps.rs/repo/gitea/git.mylloon.fr/Anri/mylloon.fr/status.svg)](https://deps.rs/repo/gitea/git.mylloon.fr/Anri/mylloon.fr)
|
||||||
[![status-badge](https://ci.mylloon.fr/api/badges/Anri/mylloon.fr/status.svg)](https://ci.mylloon.fr/Anri/mylloon.fr)
|
[![status-badge](https://git.mylloon.fr/Anri/mylloon.fr/badges/workflows/publish.yml/badge.svg)](https://git.mylloon.fr/Anri/mylloon.fr/actions?workflow=publish.yml)
|
||||||
|
|
||||||
- See [issues](https://git.mylloon.fr/Anri/mylloon.fr/issues)
|
- See [issues](https://git.mylloon.fr/Anri/mylloon.fr/issues)
|
||||||
- See [documentation](https://git.mylloon.fr/Anri/mylloon.fr/src/branch/main/Documentation.md)
|
- See [documentation](https://git.mylloon.fr/Anri/mylloon.fr/src/branch/main/Documentation.md)
|
||||||
|
|
|
@ -42,7 +42,14 @@ async fn main() -> Result<()> {
|
||||||
.add(("Server", format!("ewp/{}", env!("CARGO_PKG_VERSION"))))
|
.add(("Server", format!("ewp/{}", env!("CARGO_PKG_VERSION"))))
|
||||||
.add(("Permissions-Policy", "interest-cohort=()")),
|
.add(("Permissions-Policy", "interest-cohort=()")),
|
||||||
)
|
)
|
||||||
.service(web::scope("/api").service(web::scope("v1").service(api_v1::love)))
|
.service(
|
||||||
|
web::scope("/api").service(
|
||||||
|
web::scope("v1")
|
||||||
|
.service(api_v1::love)
|
||||||
|
.service(api_v1::btf)
|
||||||
|
.service(api_v1::websites),
|
||||||
|
),
|
||||||
|
)
|
||||||
.service(index::page)
|
.service(index::page)
|
||||||
.service(agreements::security)
|
.service(agreements::security)
|
||||||
.service(agreements::humans)
|
.service(agreements::humans)
|
||||||
|
|
|
@ -167,6 +167,7 @@ pub fn get_options<'a>() -> ComrakOptions<'a> {
|
||||||
options.render.ignore_empty_links = true;
|
options.render.ignore_empty_links = true;
|
||||||
options.render.gfm_quirks = true;
|
options.render.gfm_quirks = true;
|
||||||
options.render.prefer_fenced = false;
|
options.render.prefer_fenced = false;
|
||||||
|
options.render.figure_with_caption = false;
|
||||||
|
|
||||||
options
|
options
|
||||||
}
|
}
|
||||||
|
@ -178,7 +179,7 @@ fn custom_img_size(html: &str) -> String {
|
||||||
RewriteStrSettings {
|
RewriteStrSettings {
|
||||||
element_content_handlers: vec![element!("img[alt]", |el| {
|
element_content_handlers: vec![element!("img[alt]", |el| {
|
||||||
let alt = el.get_attribute("alt").unwrap();
|
let alt = el.get_attribute("alt").unwrap();
|
||||||
let possible_piece = alt.split(|c| c == '|').collect::<Vec<&str>>();
|
let possible_piece = alt.split('|').collect::<Vec<&str>>();
|
||||||
|
|
||||||
if possible_piece.len() > 1 {
|
if possible_piece.len() > 1 {
|
||||||
let data = possible_piece.last().unwrap().trim();
|
let data = possible_piece.last().unwrap().trim();
|
||||||
|
|
|
@ -1,15 +1,53 @@
|
||||||
|
use std::time::Duration;
|
||||||
|
|
||||||
use actix_web::{get, HttpResponse, Responder};
|
use actix_web::{get, HttpResponse, Responder};
|
||||||
|
use chrono::Utc;
|
||||||
|
use cyborgtime::format_duration;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
/// Response
|
/// Response for /love
|
||||||
#[derive(Serialize)]
|
#[derive(Serialize)]
|
||||||
struct Info {
|
struct InfoLove {
|
||||||
unix_epoch: u32,
|
unix_epoch: u32,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[get("/love")]
|
#[get("/love")]
|
||||||
pub async fn love() -> impl Responder {
|
pub async fn love() -> impl Responder {
|
||||||
HttpResponse::Ok().json(Info {
|
HttpResponse::Ok().json(InfoLove {
|
||||||
unix_epoch: 1_605_576_600,
|
unix_epoch: 1_605_576_600,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Response for /backtofrance
|
||||||
|
#[derive(Serialize)]
|
||||||
|
struct InfoBTF {
|
||||||
|
unix_epoch: u64,
|
||||||
|
countdown: String,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[get("/backtofrance")]
|
||||||
|
pub async fn btf() -> impl Responder {
|
||||||
|
let target = 1_736_618_100;
|
||||||
|
let current_time: u64 = Utc::now().timestamp().try_into().unwrap();
|
||||||
|
|
||||||
|
let info = InfoBTF {
|
||||||
|
unix_epoch: target,
|
||||||
|
countdown: if current_time > target {
|
||||||
|
"Already happened".to_owned()
|
||||||
|
} else {
|
||||||
|
let duration_epoch = target - current_time;
|
||||||
|
let duration = Duration::from_secs(duration_epoch);
|
||||||
|
format_duration(duration).to_string()
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
HttpResponse::Ok().json(info)
|
||||||
|
}
|
||||||
|
|
||||||
|
#[get("/websites")]
|
||||||
|
pub async fn websites() -> impl Responder {
|
||||||
|
HttpResponse::Ok().json((
|
||||||
|
"http://www.bocal.cs.univ-paris8.fr/~akennel/",
|
||||||
|
"https://anri.up8.site/",
|
||||||
|
))
|
||||||
|
}
|
||||||
|
|
BIN
static/badges/friends/jas.webp
(Stored with Git LFS)
BIN
static/badges/friends/jas.webp
(Stored with Git LFS)
Binary file not shown.
|
@ -18,6 +18,7 @@ window.addEventListener("load", () => {
|
||||||
new Tag("Comment fonctionne un PC 😵💫"),
|
new Tag("Comment fonctionne un PC 😵💫"),
|
||||||
new Tag("undefined", mono),
|
new Tag("undefined", mono),
|
||||||
new Tag("/api/v1/love", mono),
|
new Tag("/api/v1/love", mono),
|
||||||
|
new Tag("/api/v1/websites", mono),
|
||||||
new Tag("Peak D2 sur Valo 🤡"),
|
new Tag("Peak D2 sur Valo 🤡"),
|
||||||
new Tag(
|
new Tag(
|
||||||
"0x520",
|
"0x520",
|
||||||
|
@ -47,7 +48,7 @@ window.addEventListener("load", () => {
|
||||||
`
|
`
|
||||||
),
|
),
|
||||||
new Tag("School hater"),
|
new Tag("School hater"),
|
||||||
new Tag("Stagiaire"),
|
new Tag("Étudiant"),
|
||||||
new Tag("Rempli de malice"),
|
new Tag("Rempli de malice"),
|
||||||
new Tag(
|
new Tag(
|
||||||
"#NouveauFrontPopulaire ✊",
|
"#NouveauFrontPopulaire ✊",
|
||||||
|
|
|
@ -11,6 +11,9 @@ window.addEventListener("load", () => {
|
||||||
RA: "Rightarrow",
|
RA: "Rightarrow",
|
||||||
LA: "Leftarrow",
|
LA: "Leftarrow",
|
||||||
u: "mu",
|
u: "mu",
|
||||||
|
Tau: "mathrm{T}",
|
||||||
|
lb: "textlbrackdbl",
|
||||||
|
rb: "textrbrackdbl",
|
||||||
})
|
})
|
||||||
)[Symbol.iterator]()) {
|
)[Symbol.iterator]()) {
|
||||||
const bs = "\\";
|
const bs = "\\";
|
||||||
|
|
Loading…
Reference in a new issue