shortn/README.md

66 lines
1.8 KiB
Markdown
Raw Normal View History

2024-12-07 22:53:27 +01:00
<p align="center">
<img align="center" src="src/static/img/favicon.png" alt="shortn logo" width="400px">
</p>
2024-12-07 22:52:42 +01:00
<h1 align="center"> shortn </h1>
2024-12-07 22:51:38 +01:00
2024-12-07 22:53:09 +01:00
<p align="center">
2024-12-07 23:19:08 +01:00
Pure vanilla HTML/CSS/JS ✅ • Lightweight ✅ • Functional ✅ • No plaintext passwords ✅
2024-12-07 22:53:09 +01:00
</p>
2024-12-07 20:59:41 +01:00
2024-12-07 22:38:43 +01:00
Simple link shortener built with flask.
2024-12-07 23:32:36 +01:00
> [!WARNING]
2024-12-07 23:31:06 +01:00
> PLEASE CHANGE THE SECRET IN `app.py` BEFORE RUNNING IN PRODUCTION (this applies to the docker installation as well)
2024-12-07 23:19:08 +01:00
- [Installation (no docker)](#installation-no-docker)
- [Usage](#usage)
- [Installation (docker)](#installation-docker)
- [Users](#users)
- [TODOs](#todos)
## Installation (no docker)
2024-12-07 22:38:43 +01:00
```bash
git clone https://git.confest.im/boyan_k/shortn
pip install -r requirements.txt
```
2024-12-07 23:19:08 +01:00
### Usage
2024-12-07 22:38:43 +01:00
```bash
2024-12-07 22:51:38 +01:00
python manage_users.py init # to create the database
python manage_users.py add # to add a user
>>> Name: admin
>>> Password: *****
>>> Again: *****
python manage_users.py list # to list users
python manage_users.py remove --username <username> # to remove a user
# Finally, running the app
2024-12-07 23:51:34 +01:00
python app.py # Running on http://localhost:49152
2024-12-07 22:38:43 +01:00
```
2024-12-07 23:19:08 +01:00
## Installation (docker)
2024-12-07 23:12:56 +01:00
This will init the database and create a user with the username `admin` and password `admin`.
```bash
2024-12-07 23:51:34 +01:00
docker compose up -d # remove -d for foreground, it is now running on http://localhost:49152
2024-12-07 23:12:56 +01:00
```
### Users
```bash
sudo docker exec -it shortn python src/manage_users.py add
sudo docker exec -it shortn python src/manage_users.py list
sudo docker exec -it shortn python src/manage_users.py remove --username <username>
```
2024-12-07 23:31:06 +01:00
> [!NOTE]
> The database is **ephemeral** and will be lost when the container is removed. That is intentional.
2024-12-07 23:12:56 +01:00
2024-12-07 22:38:43 +01:00
## TODOs
- [x] basic UI (to add links)
- [x] basic auth for UI
- [x] sqlite3 to store links
2024-12-07 22:51:38 +01:00
- [x] responsive? (sorta)
2024-12-07 23:12:56 +01:00
- [x] dockerize