Compare commits
6 Commits
c27377cd60
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 4629e12f67 | |||
|
|
0bdb09b23c | ||
| 763d360be6 | |||
|
|
f3f9979a0e | ||
|
|
bd93caa375 | ||
|
|
a48abc3b53 |
14
.dockerignore
Normal file
14
.dockerignore
Normal file
@@ -0,0 +1,14 @@
|
||||
.idea
|
||||
__pycache__
|
||||
.git
|
||||
.dockerignore
|
||||
Dockerfile
|
||||
*.md
|
||||
db.json
|
||||
users.json
|
||||
test.py
|
||||
update_db.py
|
||||
logs
|
||||
*.log
|
||||
.vscode
|
||||
uploads/
|
||||
10
Dockerfile
Normal file
10
Dockerfile
Normal file
@@ -0,0 +1,10 @@
|
||||
FROM python:3.9.5
|
||||
WORKDIR /app
|
||||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
COPY . .
|
||||
COPY container/* .
|
||||
RUN mkdir -p /app/uploads
|
||||
EXPOSE 3133
|
||||
|
||||
CMD ["python", "app.py"]
|
||||
2
app.py
2
app.py
@@ -330,4 +330,4 @@ def download(code):
|
||||
flash('Invalid code! Check if you typed the correct code, and for one-time codes, make sure nobody else entered the code before you did.', 'error')
|
||||
return redirect(url_for('upload'))
|
||||
|
||||
app.run(debug=True, port=3133)
|
||||
app.run(debug=True, port=3133, host='0.0.0.0')
|
||||
|
||||
@@ -12,12 +12,24 @@
|
||||
<div class="app">
|
||||
{% with messages = get_flashed_messages(with_categories=true) %}
|
||||
{% if messages %}
|
||||
<ul class="flashes">
|
||||
{% for category, message in messages %}
|
||||
<!-- category: message, error, info, warning -->
|
||||
<li class="{{ category }}"><strong>{{ message }}</strong></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
<ul class="flashes">
|
||||
{% for category, message in messages %}
|
||||
<!-- category: message, error, info, warning -->
|
||||
{% if category == 'message' %}
|
||||
{% set category = 'primary' %}
|
||||
{% endif %}
|
||||
{% if category == 'error' %}
|
||||
{% set category = 'danger' %}
|
||||
{% endif %}
|
||||
{% if category == 'info' %}
|
||||
{% set category = 'info' %}
|
||||
{% endif %}
|
||||
{% if category == 'warning' %}
|
||||
{% set category = 'warning' %}
|
||||
{% endif %}
|
||||
<li class="alert alert-{{ category }}">{{ message }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
<div class="dashboard-container">
|
||||
|
||||
@@ -7,17 +7,30 @@
|
||||
<title>ADrive Share</title>
|
||||
<script src="https://kit.fontawesome.com/972393379b.js" crossorigin="anonymous"></script>
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='styles.css') }}">
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<div class="app">
|
||||
{% with messages = get_flashed_messages(with_categories=true) %}
|
||||
{% if messages %}
|
||||
<ul class="flashes">
|
||||
{% for category, message in messages %}
|
||||
<!-- category: message, error, info, warning -->
|
||||
<li class="{{ category }}"><strong>{{ message }}</strong></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
<ul class="flashes">
|
||||
{% for category, message in messages %}
|
||||
<!-- category: message, error, info, warning -->
|
||||
{% if category == 'message' %}
|
||||
{% set category = 'primary' %}
|
||||
{% endif %}
|
||||
{% if category == 'error' %}
|
||||
{% set category = 'danger' %}
|
||||
{% endif %}
|
||||
{% if category == 'info' %}
|
||||
{% set category = 'info' %}
|
||||
{% endif %}
|
||||
{% if category == 'warning' %}
|
||||
{% set category = 'warning' %}
|
||||
{% endif %}
|
||||
<li class="alert alert-{{ category }}">{{ message }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
|
||||
@@ -27,8 +40,8 @@
|
||||
Enter your credentials to access your dashboard and manage your files.
|
||||
</p>
|
||||
<form id="loginForm" action="/login" method="post">
|
||||
Username: <input type="text" name="username" id="username" placeholder="📋" required aria-required>
|
||||
Passphrase: <input type="password" name="password" id="password" placeholder="🗝️" aria-required>
|
||||
Username: <input type="text" class="form-control" name="username" id="username" placeholder="📋" required aria-required>
|
||||
Passphrase: <input type="password" class="form-control" name="password" id="password" placeholder="🗝️" aria-required>
|
||||
<input type="submit" value="Sign In" id="uploadBtn">
|
||||
</form>
|
||||
|
||||
@@ -70,5 +83,8 @@
|
||||
</script>
|
||||
|
||||
<script src="{{ url_for('static', filename='script.js') }}"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/js/bootstrap.bundle.min.js"
|
||||
integrity="sha384-FKyoEForCGlyvwx9Hj09JcYn3nv7wiPVlz7YYwJrWVcXK/BmnVDxM+D2scQbITxI"
|
||||
crossorigin="anonymous"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -7,17 +7,30 @@
|
||||
<title>ADrive Share</title>
|
||||
<script src="https://kit.fontawesome.com/972393379b.js" crossorigin="anonymous"></script>
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='styles.css') }}">
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<div class="app">
|
||||
{% with messages = get_flashed_messages(with_categories=true) %}
|
||||
{% if messages %}
|
||||
<ul class="flashes">
|
||||
{% for category, message in messages %}
|
||||
<!-- category: message, error, info, warning -->
|
||||
<li class="{{ category }}"><strong>{{ message }}</strong></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
<ul class="flashes">
|
||||
{% for category, message in messages %}
|
||||
<!-- category: message, error, info, warning -->
|
||||
{% if category == 'message' %}
|
||||
{% set category = 'primary' %}
|
||||
{% endif %}
|
||||
{% if category == 'error' %}
|
||||
{% set category = 'danger' %}
|
||||
{% endif %}
|
||||
{% if category == 'info' %}
|
||||
{% set category = 'info' %}
|
||||
{% endif %}
|
||||
{% if category == 'warning' %}
|
||||
{% set category = 'warning' %}
|
||||
{% endif %}
|
||||
<li class="alert alert-{{ category }}">{{ message }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
|
||||
@@ -27,8 +40,8 @@
|
||||
With an account, you can manage up to 3GB in one dashboard. If you use up your limit, you can delete to free up space or upload files without the ability to manage them.
|
||||
</p>
|
||||
<form id="loginForm" action="/register" method="post">
|
||||
Username: <input type="text" name="username" id="username" placeholder="📋" required aria-required>
|
||||
Passphrase: <input type="password" name="password" id="password" placeholder="🗝️" aria-required>
|
||||
Username: <input type="text" class="form-control" name="username" id="username" placeholder="📋" required aria-required>
|
||||
Passphrase: <input type="password" class="form-control" name="password" id="password" placeholder="🗝️" aria-required>
|
||||
Managable Storage Quota: <select name="quota_files" id="quota_files" class="fancy-select" disabled aria-disabled>
|
||||
<option value="3GB">3GB</option>
|
||||
</select>
|
||||
@@ -72,5 +85,8 @@
|
||||
</script>
|
||||
|
||||
<script src="{{ url_for('static', filename='script.js') }}"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/js/bootstrap.bundle.min.js"
|
||||
integrity="sha384-FKyoEForCGlyvwx9Hj09JcYn3nv7wiPVlz7YYwJrWVcXK/BmnVDxM+D2scQbITxI"
|
||||
crossorigin="anonymous"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -74,7 +74,7 @@
|
||||
</form>
|
||||
|
||||
<form>
|
||||
<input type="text" id="codeInput">
|
||||
<input type="text" class="form-control" id="codeInput">
|
||||
<button type="button" value="Download" class="btn btn-primary" onclick="downloadClick()">Download</button>
|
||||
</form>
|
||||
{% if not loggedIn %}
|
||||
@@ -83,7 +83,7 @@
|
||||
<a href="/register" class="sign-in-button"
|
||||
style="text-decoration: none; background: rgb(32, 0, 139)">Register</a><br><br>
|
||||
<p style="color: gray; font-size: 11px; text-align: center;">Signing in is not required. You can at any time
|
||||
register and sign in to manage your existing codes for free. You can manage up to 1GB of files.</p>
|
||||
register and sign in to manage your existing codes for free. You can manage up to 3GB of files.</p>
|
||||
{% else %}
|
||||
<a href="/dashboard" class="sign-in-button" style="text-decoration: none; background: blue">View
|
||||
Dashboard</a>
|
||||
|
||||
Reference in New Issue
Block a user