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