secret warning + toc

This commit is contained in:
Boyan 2024-12-07 23:19:08 +01:00
parent 9aafc9b37c
commit 2f75d1c85b
2 changed files with 15 additions and 6 deletions

View File

@ -4,19 +4,28 @@
<h1 align="center"> shortn </h1> <h1 align="center"> shortn </h1>
<p align="center"> <p align="center">
HTML/CSS/JS Framework Free ✅ • Lightweight ✅ • Functional ✅ • No plaintext passwords ✅ Pure vanilla HTML/CSS/JS ✅ • Lightweight ✅ • Functional ✅ • No plaintext passwords ✅
</p> </p>
Simple link shortener built with flask. Simple link shortener built with flask.
## Installation > ![WARNING] PLEASE CHANGE THE SECRET IN `app.py` BEFORE RUNNING IN PRODUCTION (this applies to the docker installation as well)
- [Installation (no docker)](#installation-no-docker)
- [Usage](#usage)
- [Installation (docker)](#installation-docker)
- [Users](#users)
- [TODOs](#todos)
## Installation (no docker)
```bash ```bash
git clone https://git.confest.im/boyan_k/shortn git clone https://git.confest.im/boyan_k/shortn
pip install -r requirements.txt pip install -r requirements.txt
``` ```
## Usage (no docker) ### Usage
```bash ```bash
python manage_users.py init # to create the database python manage_users.py init # to create the database
python manage_users.py add # to add a user python manage_users.py add # to add a user
@ -31,7 +40,7 @@ python manage_users.py remove --username <username> # to remove a user
python app.py python app.py
``` ```
## Usage (docker) ## Installation (docker)
This will init the database and create a user with the username `admin` and password `admin`. This will init the database and create a user with the username `admin` and password `admin`.
```bash ```bash
docker compose up -d # remove -d for foreground docker compose up -d # remove -d for foreground

View File

@ -5,7 +5,7 @@ from werkzeug.security import generate_password_hash, check_password_hash
import re import re
app = Flask(__name__) app = Flask(__name__)
app.secret_key = 'your_secret_key' # Replace with a strong secret key app.secret_key = 'super secret key' # FIXME: CHANGE THISSSSSSSSS!
# Database initialization # Database initialization
DATABASE = 'database.db' DATABASE = 'database.db'