mirror of
https://git.ari.lt/ari.lt/blog.ari.lt.git
synced 2025-02-04 09:39:25 +01:00
update @ Fri 23 Sep 01:29:49 EEST 2022
Signed-off-by: Ari Archer <ari.web.xyz@gmail.com>
This commit is contained in:
parent
b317c6daef
commit
10ce5f7ff5
3 changed files with 15 additions and 1 deletions
|
@ -61,4 +61,8 @@ Some blogs might be hidden for a day or two if
|
||||||
I'm working on it or just need to hide it to
|
I'm working on it or just need to hide it to
|
||||||
not show some stuff on the main page, though
|
not show some stuff on the main page, though
|
||||||
nobody is stopping you from using the static API,
|
nobody is stopping you from using the static API,
|
||||||
it's located at [/blog.json](https://blog.ari-web.xyz/blog.json)
|
it's located at [/blog.json](https://blog.ari-web.xyz/blog.json), also if you're using
|
||||||
|
this API generally, this API is **extremely** large, so
|
||||||
|
I implemented cache validation, just cache it,
|
||||||
|
including the sha256 hash and validate it with
|
||||||
|
the [hash on the api](https://blog.ari-web.xyz/blog_json_hash.txt)
|
||||||
|
|
1
blog_json_hash.txt
Normal file
1
blog_json_hash.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
fe9cdebb971b9c7a0ec8da637eb91cde4663e5d871ea3ac7f107b1cd46413fac
|
|
@ -2,6 +2,7 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
"""Manage blogs"""
|
"""Manage blogs"""
|
||||||
|
|
||||||
|
import hashlib
|
||||||
import os
|
import os
|
||||||
import random
|
import random
|
||||||
import string
|
import string
|
||||||
|
@ -651,6 +652,14 @@ def generate_metadata(config: Dict) -> Tuple[int, Dict]:
|
||||||
manifest,
|
manifest,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
with open(DEFAULT_CONFIG_FILE, "rb") as blog_api_file:
|
||||||
|
log(f"Generating hash for {DEFAULT_CONFIG_FILE!r}")
|
||||||
|
|
||||||
|
with open(
|
||||||
|
f"{DEFAULT_CONFIG_FILE.replace('.', '_')}_hash.txt", "w"
|
||||||
|
) as blog_api_hash:
|
||||||
|
blog_api_hash.write(hashlib.sha256(blog_api_file.read()).hexdigest())
|
||||||
|
|
||||||
return EXIT_OK, config
|
return EXIT_OK, config
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue