add password protection

This commit is contained in:
2021-05-19 09:17:41 +02:00
parent ea44d38a0d
commit 934c4877b2
7 changed files with 20 additions and 2 deletions

1
.gitignore vendored
View File

@@ -143,3 +143,4 @@ cython_debug/
# Project specific
message.txt
config.py

View File

@@ -4,4 +4,4 @@ app = Flask(__name__)
import autoreply_editor.main
app.config.from_pyfile("config.py")
app.config.from_pyfile("../config.py")

View File

@@ -1 +0,0 @@
MESSAGE_FILE = "message.txt"

View File

@@ -1,5 +1,8 @@
from autoreply_editor import app
from flask import Flask, request, render_template, redirect
from flask_basicauth import BasicAuth
basic_auth = BasicAuth(app)
@app.route("/")
def index():

6
config.sample.py Normal file
View File

@@ -0,0 +1,6 @@
"""Configuration file"""
MESSAGE_FILE = "message.txt"
BASIC_AUTH_FORCE = True
BASIC_AUTH_USERNAME = "username"
BASIC_AUTH_PASSWORD = "password"

6
message.txt.sample Normal file
View File

@@ -0,0 +1,6 @@
Hello,
This is my autoreply message.
Best,
Me

3
requirements.txt Normal file
View File

@@ -0,0 +1,3 @@
Flask
Flask-BasicAuth
gunicorn