diff --git a/curl.py b/curl.py index b1ca116..e7c4f37 100644 --- a/curl.py +++ b/curl.py @@ -1,5 +1,5 @@ from flask import render_template -from tools import error_response, getAddress, get_tools_data +from tools import error_response, getAddress, get_tools_data, getClientIP import os from functools import lru_cache import requests @@ -81,7 +81,7 @@ def curl_response(request): # Handle special cases if path == "index": # Get current project - return render_template("index.ascii",header=get_header(),repo=get_current_project()), 200, {'Content-Type': 'text/plain; charset=utf-8'} + return render_template("index.ascii",repo=get_current_project(), ip=getClientIP(request)), 200, {'Content-Type': 'text/plain; charset=utf-8'} if path == "projects": # Get projects return render_template("projects.ascii",header=get_header(),projects=get_projects()), 200, {'Content-Type': 'text/plain; charset=utf-8'} diff --git a/data/tools.json b/data/tools.json index 1d51384..4f33210 100644 --- a/data/tools.json +++ b/data/tools.json @@ -25,13 +25,13 @@ }, { "name": "Zellij", - "type": "terminal", + "type": "Terminal Tools", "url": "https://zellij.dev/", "description": "A terminal workspace and multiplexer" }, { "name": "Fx", - "type": "terminal", + "type": "Terminal Tools", "url": "https://fx.wtf/", "description": "A command-line JSON viewer and processor", "demo": "", @@ -39,7 +39,7 @@ }, { "name": "Zoxide", - "type": "terminal", + "type": "Terminal Tools", "url": "https://github.com/ajeetdsouza/zoxide", "description": "cd but with fuzzy matching and other cool features", "demo": "", @@ -47,7 +47,7 @@ }, { "name": "Atuin", - "type": "terminal", + "type": "Terminal Tools", "url": "https://atuin.sh/", "description": "A next-generation shell history manager", "demo": "", @@ -55,7 +55,7 @@ }, { "name": "Tmate", - "type": "terminal", + "type": "Terminal Tools", "url": "https://tmate.io/", "description": "Instant terminal sharing", "demo": "", @@ -63,7 +63,7 @@ }, { "name": "Eza", - "type": "terminal", + "type": "Terminal Tools", "url": "https://eza.rocks/", "description": "A modern replacement for 'ls'", "demo": "", @@ -71,7 +71,7 @@ }, { "name": "Bat", - "type": "terminal", + "type": "Terminal Tools", "url": "https://github.com/sharkdp/bat", "description": "A cat clone with syntax highlighting and Git integration", "demo": "", @@ -79,7 +79,7 @@ }, { "name": "Oh My Zsh", - "type": "terminal", + "type": "Terminal Tools", "url": "https://ohmyz.sh/", "description": "A delightful community-driven framework for managing your Zsh configuration" }, diff --git a/templates/index.ascii b/templates/index.ascii index 00c193b..4843b28 100644 --- a/templates/index.ascii +++ b/templates/index.ascii @@ -1,4 +1,15 @@ -{{header}} +───────────────────────────────────────────────────── + . . , . . . .. /  + |\ | _.-+-|_ _.._ | | _ _ _||_ . .._.._ /  + | \|(_] | [ )(_][ ) * |/\|(_)(_)(_][_)(_|[ [ )/  +───────────────────────────────────────────────────── + +Home [/] +Contact [/contact] +Projects [/projects] +Donate [/donate] +API [/api/v1/] + ───────────────────────────────────────────────  ABOUT ME  ────────── @@ -18,7 +29,7 @@ I'm currently working on: {{ repo | safe }} ──────── - Linux servers & CLI -- DNS, DNSSEC, and Trustless SSL +- DNS & DNSSEC - NGINX web servers - Programming: - Python 3 @@ -26,3 +37,7 @@ I'm currently working on: {{ repo | safe }} - Java - Bash + +Served to: {{ ip }} +─────────────────────────────────────────────── + diff --git a/templates/tools.ascii b/templates/tools.ascii index cadaa2c..5840c19 100644 --- a/templates/tools.ascii +++ b/templates/tools.ascii @@ -5,9 +5,16 @@ Here are some of the tools I use regularly — most of them are open source! 🛠️ -{% for tool in tools %} +{% for type, tools_in_type in tools | groupby('type') %} +{{type}} +{% for tool in tools_in_type %} {{tool.name}} {{tool.description}} Website: {{tool.url}} {% if tool.demo_url %}Demo: {{tool.demo_url}}{% endif %} {% endfor %} + +─────────────────────────────────────────────── +{% endfor %} + + diff --git a/tests/api.hurl b/tests/api.hurl index 899619e..0d16c63 100644 --- a/tests/api.hurl +++ b/tests/api.hurl @@ -14,4 +14,7 @@ GET http://127.0.0.1:5000/api/v1/message HTTP 200 GET http://127.0.0.1:5000/api/v1/project HTTP 200 - +GET http://127.0.0.1:5000/api/v1/tools +HTTP 200 +[Asserts] +jsonpath "$.tools" count > 5 \ No newline at end of file