bash-fastapi/README.md

69 lines
1.8 KiB
Markdown
Raw Normal View History

# What's this?
2023-06-17 11:38:35 +03:00
This repository contains database of all quotes from the famous website bash.im
as well as the API that allows self-hosting your own quotes website. All of
this started in February 2022 when bash.im was shut down. Quotes were parsed
from the web archive.
2023-06-17 11:31:37 +03:00
# Requirements
2023-06-17 11:31:37 +03:00
- Python 3.8+ (Python 3.11 is recommended)
- Git LFS for fetching the quotes DB
# Quickstart
2023-06-17 11:31:37 +03:00
```bash
2023-06-17 11:30:28 +03:00
# Clone this repository and enter it:
git clone https://git.darkn.space/Darkn/bash-fastapi.git
2023-06-17 11:38:35 +03:00
cd bash-fastapi
# Download the quotes.sqlite3 using Git LFS
# and replace the pointer file with the actual database:
2023-06-17 11:30:28 +03:00
git lfs pull
# Configure virtualenv:
python3 -m venv .venv
# Activate virtualenv:
. .venv/bin/activate
# Install dependencies:
python3 -m pip install -r requirements.txt
# Start main.py
python main.py
```
# FAQ
2023-06-17 11:31:37 +03:00
2023-06-17 11:38:35 +03:00
**Q: How do I change the port on which API runs?**
2023-06-17 11:31:37 +03:00
2023-06-17 11:38:35 +03:00
A: Default port is 8001, but you can change it inside of main.py by modifying
those lines at the very end:
2023-06-17 11:31:37 +03:00
```python
if __name__ == "__main__":
uvicorn.run(app, port=8001, host="0.0.0.0")
```
2023-06-17 11:38:35 +03:00
**Q: Why is quotes.sqlite3 so small and has no quotes inside of it after I
cloned your repository?**
2023-06-17 11:31:37 +03:00
2023-06-17 11:38:35 +03:00
A: You probably forgot to install and/or use Git LFS. Go to the repository
directory and run following commands:
2023-06-17 11:31:37 +03:00
```bash
git lfs install
git lfs fetch
git lfs checkout
```
2023-06-17 11:31:37 +03:00
2023-06-17 11:38:35 +03:00
You can read more about using Git LFS
[here](https://docs.github.com/en/repositories/working-with-files/managing-large-files/installing-git-large-file-storage)
and
2023-06-17 13:46:14 +03:00
[there](https://stackoverflow.com/questions/72610494/what-is-the-difference-between-git-lfs-fetch-git-lfs-fetch-all-and-git).
2023-06-17 11:31:37 +03:00
2023-06-17 11:38:35 +03:00
**Q: Do you really have all quotes from bash.im?**
2023-06-17 11:31:37 +03:00
2023-06-17 11:38:35 +03:00
A: As long as it was indexed by the web archive, it's there.
2023-06-17 13:46:14 +03:00
# Credits
2023-06-17 11:38:35 +03:00
Thanks to ~~The Man, the Myth, the Legend~~ the Darkn member gameeroor for
helping with parsing and making such a nice API.