add password protection
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -143,3 +143,4 @@ cython_debug/
|
|||||||
|
|
||||||
# Project specific
|
# Project specific
|
||||||
message.txt
|
message.txt
|
||||||
|
config.py
|
||||||
|
|||||||
@@ -4,4 +4,4 @@ app = Flask(__name__)
|
|||||||
|
|
||||||
import autoreply_editor.main
|
import autoreply_editor.main
|
||||||
|
|
||||||
app.config.from_pyfile("config.py")
|
app.config.from_pyfile("../config.py")
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
MESSAGE_FILE = "message.txt"
|
|
||||||
@@ -1,5 +1,8 @@
|
|||||||
from autoreply_editor import app
|
from autoreply_editor import app
|
||||||
from flask import Flask, request, render_template, redirect
|
from flask import Flask, request, render_template, redirect
|
||||||
|
from flask_basicauth import BasicAuth
|
||||||
|
|
||||||
|
basic_auth = BasicAuth(app)
|
||||||
|
|
||||||
@app.route("/")
|
@app.route("/")
|
||||||
def index():
|
def index():
|
||||||
|
|||||||
6
config.sample.py
Normal file
6
config.sample.py
Normal 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
6
message.txt.sample
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
Hello,
|
||||||
|
|
||||||
|
This is my autoreply message.
|
||||||
|
|
||||||
|
Best,
|
||||||
|
Me
|
||||||
3
requirements.txt
Normal file
3
requirements.txt
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
Flask
|
||||||
|
Flask-BasicAuth
|
||||||
|
gunicorn
|
||||||
Reference in New Issue
Block a user