ari-web server where i do random things
This repository has been archived on 2024-06-20. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
Find a file
Ari Archer 03f0de2e59
why do i still have the /store route
todo rework

Signed-off-by: Ari Archer <ari.web.xyz@gmail.com>
2023-10-20 00:36:39 +03:00
src why do i still have the /store route 2023-10-20 00:36:39 +03:00
.editorconfig init 2023-03-25 15:39:50 +02:00
.gitignore app : add visit counter 2023-05-19 17:46:10 +03:00
LICENSE init 2023-03-25 15:39:50 +02:00
pyproject.toml init 2023-03-25 15:39:50 +02:00
README.md readme : document the visit api 2023-05-19 20:56:40 +03:00
requirements.txt why do i still have the /store route 2023-10-20 00:36:39 +03:00
tox.ini init 2023-03-25 15:39:50 +02:00

ari-web server -- https://server.ari-web.xyz/

random stuff for me to do

api key

api key is stored in a file on the server called pw, same directory as the app is working in, per average the default key will be secure enough, although you are free to change it, change the file, restart the app when you change the api key

comments api

none of these routes will work for you if youre ip banned and dont have the admin key to bypass the ban

  • POST / -- post a comment ( only if youre whitelisted or are an administrator )
    • data : content
  • GET /<from>/<to> -- get comments with IDs in range of from to to ( cannot request large entities, i.e. over max 25 kb ( 25 comments )
  • GET /total -- total comments count
  • POST /sql -- run sql queries ( requires api-key header )
    • data : sql ( multiple queries, like data={"sql": [...]} ), backup ( filename )
  • POST /apply -- apply to get whitelisted and put into the IP whitelist queue
    • data : content, author ( reason and the username tied to you IP address )
  • GET /whoami -- get your username
  • POST /lock -- lock comments section ( needs api-key header )
  • GET /lock -- get lock status ( 0 or 1 )
  • GET /amiadmin -- get admin status ( 0 or 1 )
  • GET /applied -- get 'if applied' status
  • POST /anon -- anonymously send a message to admins, like private feedback
    • data : content
  • GET /visit -- visit count

everything else

everything else can be achieved using /sql API, for example for bans you can do like :

INSERT INTO bans (ip) VALUES ("...")

or to whitelist someone

SELECT * FROM queue;
-- read the output whoever you want to unban
INSERT INTO whitelist (ip, author) VALUES ("...", "some author");
DELETE FROM queue WHERE author = "some author";

...

see this plugin for baz plugin manager to get pre-made CLI tools