Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
__pycache__/
*.py[cod]
*$py.class
*.so
.Python
venv/
env/
ENV/
.venv
instance/
.pytest_cache/
.coverage
htmlcov/
dist/
build/
*.egg-info/
.DS_Store
*.swp
*.swo
*~
11 changes: 11 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,0 +1,11 @@
from flask import Flask, render_template

app = Flask(__name__)

@app.route("/")
def index():
return render_template("index.html")

if __name__ == "__main__":
app.run(debug=True, host="0.0.0.0", port=5000)

Check failure

Code scanning / CodeQL

Flask app is run in debug mode High

A Flask app appears to be run in debug mode. This may allow an attacker to run arbitrary code through the debugger.

Copilot Autofix

AI 9 months ago

To fix this problem, you should ensure that the Flask application's debug mode is not enabled unconditionally. The best way is to disable debug mode by either removing the debug argument or setting it to False. Optionally, if you want to allow debug mode during development, you can make it conditional based on an environment variable or a configuration setting. However, since the code review context says to avoid assumptions and only modify visible code, you should simply set debug=False or omit the parameter (the default is False). This edit should be performed on line 10 of main.py, changing debug=True to debug=False.

Suggested changeset 1
main.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/main.py b/main.py
--- a/main.py
+++ b/main.py
@@ -7,5 +7,5 @@
     return render_template("index.html")
 
 if __name__ == "__main__":
-    app.run(debug=True, host="0.0.0.0", port=5000)
+    app.run(debug=False, host="0.0.0.0", port=5000)
 
EOF
@@ -7,5 +7,5 @@
return render_template("index.html")

if __name__ == "__main__":
app.run(debug=True, host="0.0.0.0", port=5000)
app.run(debug=False, host="0.0.0.0", port=5000)

Copilot is powered by AI and may make mistakes. Always verify output.

1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Flask==3.0.0
217 changes: 217 additions & 0 deletions static/css/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,217 @@
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}

body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', Meiryo, sans-serif;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
min-height: 100vh;
display: flex;
justify-content: center;
align-items: center;
padding: 20px;
}

.container {
width: 100%;
max-width: 450px;
}

.timer-card {
background: #f8f9fa;
border-radius: 20px;
padding: 30px;
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 30px;
}

.title {
font-size: 20px;
font-weight: 600;
color: #2d3748;
}

.window-controls {
display: flex;
gap: 10px;
}

.control {
color: #a0aec0;
font-size: 18px;
cursor: pointer;
user-select: none;
}

.control:hover {
color: #4a5568;
}

.timer-section {
text-align: center;
margin-bottom: 30px;
}

.status-text {
font-size: 16px;
color: #718096;
margin-bottom: 20px;
}

.timer-display {
position: relative;
width: 300px;
height: 300px;
margin: 0 auto 30px;
}

.progress-ring {
transform: rotate(-90deg);
}

.progress-ring-bg {
fill: none;
stroke: #e2e8f0;
stroke-width: 20;
}

.progress-ring-circle {
fill: none;
stroke: #667eea;
stroke-width: 20;
stroke-linecap: round;
transition: stroke-dashoffset 0.5s ease;
}

.time-text {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-size: 56px;
font-weight: 700;
color: #2d3748;
}

.controls {
display: flex;
gap: 15px;
justify-content: center;
}

.btn {
padding: 12px 32px;
border: none;
border-radius: 25px;
font-size: 16px;
font-weight: 600;
cursor: pointer;
transition: all 0.3s ease;
}

.btn-primary {
background: #667eea;
color: white;
}

.btn-primary:hover {
background: #5568d3;
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
transform: translateY(0);
}

.btn-primary:disabled {
background: #a0aec0;
cursor: not-allowed;
transform: none;
}

.btn-secondary {
background: white;
color: #667eea;
border: 2px solid #667eea;
}

.btn-secondary:hover {
background: #f7fafc;
}

.progress-section {
background: #edf2f7;
border-radius: 15px;
padding: 20px;
}

.progress-title {
font-size: 16px;
font-weight: 600;
color: #2d3748;
margin-bottom: 15px;
}

.progress-stats {
display: flex;
justify-content: space-around;
gap: 20px;
}

.stat {
text-align: center;
}

.stat-value {
font-size: 32px;
font-weight: 700;
color: #667eea;
margin-bottom: 5px;
}

.stat-label {
font-size: 14px;
color: #718096;
}

/* State-specific styling */
.timer-card.working .progress-ring-circle {
stroke: #667eea;
}

.timer-card.working .stat-value {
color: #667eea;
}

.timer-card.break .progress-ring-circle {
stroke: #48bb78;
}

.timer-card.break .stat-value {
color: #48bb78;
}

.timer-card.break .status-text {
color: #48bb78;
}

.timer-card.long-break .progress-ring-circle {
stroke: #ed8936;
}

.timer-card.long-break .stat-value {
color: #ed8936;
}

.timer-card.long-break .status-text {
color: #ed8936;
}
Loading