Compare commits

...

6 Commits

Author SHA1 Message Date
4629e12f67 apply universal styling to flash alerts
All checks were successful
Flask Run Test / Flask-Run-Test (push) Successful in 10s
2026-01-10 19:08:12 +09:00
Andrew K
0bdb09b23c apply bootstrap; apply corrections in information text
All checks were successful
Flask Run Test / Flask-Run-Test (push) Successful in 11s
2026-01-10 19:06:33 +09:00
763d360be6 Merge pull request '2601b/docker' (#4) from 2601b/docker into main
All checks were successful
Flask Run Test / Flask-Run-Test (push) Successful in 9s
Reviewed-on: #4
2026-01-09 15:53:59 +09:00
Andrew K
f3f9979a0e improve docker environment
All checks were successful
Flask Run Test / Flask-Run-Test (push) Successful in 9s
2026-01-09 15:08:32 +09:00
Andrew K
bd93caa375 make sure flask server is able to be accessed from host, outside container
All checks were successful
Flask Run Test / Flask-Run-Test (push) Successful in 10s
2026-01-09 15:02:13 +09:00
Andrew K
a48abc3b53 create docker files
All checks were successful
Flask Run Test / Flask-Run-Test (push) Successful in 10s
2026-01-09 15:01:56 +09:00
7 changed files with 93 additions and 25 deletions

14
.dockerignore Normal file
View 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
View 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
View File

@@ -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')

View File

@@ -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">

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>