autofocus
This commit is contained in:
@@ -9,8 +9,8 @@ Configure service with .env:
|
||||
|
||||
```
|
||||
EXPOSE=0.0.0.0:8136 # IP/Port to bind
|
||||
UID=1000 # files will be written as user
|
||||
GID=1000 # files will be writter as group
|
||||
UUID=1000 # files will be written as user
|
||||
UGID=1000 # files will be writter as group
|
||||
TZ=Europe/Helsinki # your timezone
|
||||
WORKERS=4 # number of concurrent processes
|
||||
FLASK_APP_SECRET_KEY=8a36bfea77d842386a2a0c7c3e044228363d # Key that encrypts cookies
|
||||
|
||||
@@ -223,13 +223,14 @@ def login():
|
||||
session[request.form["token"]] = request.form["password"]
|
||||
return redirect(request.form["redirect"])
|
||||
|
||||
if set(('name','redirect','token')).issubset(session.keys()):
|
||||
return render_template(
|
||||
"login.html",
|
||||
filename=session["name"],
|
||||
redirect=session["redirect"],
|
||||
token=session["token"],
|
||||
)
|
||||
|
||||
return "",400
|
||||
|
||||
@app.route("/logout", methods=["GET"])
|
||||
def logout():
|
||||
|
||||
@@ -1,25 +1,19 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title></title>
|
||||
</head>
|
||||
<body style="background: gray;">
|
||||
<div style="
|
||||
width: max-content;
|
||||
background: lightgray;
|
||||
padding: 2ex;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
margin-top: 2em;
|
||||
border-radius: 5px;
|
||||
line-height: 5ex;
|
||||
">
|
||||
<form method=POST>
|
||||
<div style=
|
||||
"width: max-content; background: lightgray; padding: 2ex; margin-left: auto; margin-right: auto; margin-top: 2em; border-radius: 5px; line-height: 5ex;">
|
||||
<form method="post">
|
||||
Password required for file <a href="{{ redirect | safe }}"><strong>{{ filename }}</strong></a><br>
|
||||
<input type=hidden name="redirect" value="{{ redirect | safe }}">
|
||||
<input type=hidden name="token" value="{{ token }}">
|
||||
<input type="password" name="password" required><br>
|
||||
<input type="hidden" name="redirect" value="{{ redirect | safe }}">
|
||||
<input type="hidden" name="token" value="{{ token }}">
|
||||
<input type="password" name="password" required autofocus><br>
|
||||
<input type="submit" value="Submit">
|
||||
</form>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
EXPOSE=0.0.0.0:8136
|
||||
UID=1000
|
||||
GID=1000
|
||||
UUID=1000
|
||||
UGID=1000
|
||||
TZ=Europe/Helsinki
|
||||
WORKERS=4
|
||||
TIMEOUT=1800
|
||||
|
||||
Reference in New Issue
Block a user