Major refactor: Fix SQLite concurrency, remove rate limiting, simplify architecture
- Switch to single Gunicorn worker to eliminate SQLite database locking issues - Remove Flask-Limiter and all rate limiting complexity - Remove Cloudflare proxy setup and dependencies - Simplify configuration and remove unnecessary features - Update all templates and static files for streamlined operation - Clean up old files and documentation - Restore stable database from backup - System now runs fast and reliably without database locks
This commit is contained in:
@@ -30,7 +30,7 @@
|
||||
<font size="+1"><b><i>ircquotes</i></b></font>
|
||||
</td>
|
||||
<td bgcolor="#c08000" align="right">
|
||||
<font face="arial" size="+1"><b>Browse Quotes</b></font>
|
||||
<font face="arial" size="+1"><b>{% if is_top %}Top Quotes{% else %}Browse Quotes{% endif %}</b></font>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -69,6 +69,14 @@
|
||||
<a href="#" onclick="return flag({{ quote.id }}, this)" class="qa">X</a>
|
||||
|
||||
<a href="#" onclick="return copyQuote({{ quote.id }}, this)" class="qa" title="Copy quote to clipboard">C</a>
|
||||
|
||||
<span style="color: #666; font-size: 0.9em;">
|
||||
{% if quote.submitted_at %}
|
||||
{{ quote.submitted_at.strftime('%d/%m/%y %H:%M') }}
|
||||
{% elif quote.date %}
|
||||
{{ quote.date.strftime('%d/%m/%y') }}
|
||||
{% endif %}
|
||||
</span>
|
||||
</p>
|
||||
<p class="qt">{{ quote.text|e }}</p>
|
||||
<hr>
|
||||
|
||||
@@ -56,37 +56,24 @@
|
||||
<h2>Frequently Asked Questions (FAQ)</h2>
|
||||
|
||||
<h3>What is ircquotes?</h3>
|
||||
<p>ircquotes is a community-driven website where users can submit and browse memorable quotes from IRC (Internet Relay Chat). You can browse quotes, submit your own, and vote on others.</p>
|
||||
<p>ircquotes is a community-driven website where users can submit and browse memorable quotes from IRC (Internet Relay Chat) and other chat platforms. You can browse quotes, submit your own, and vote on others.</p>
|
||||
|
||||
<h3>How does the API work?</h3>
|
||||
<p>The ircquotes API allows users to retrieve quotes programmatically. It is designed for developers who want to integrate IRC quotes into their own applications.</p>
|
||||
<p>The ircquotes API is a read-only interface that allows users to retrieve quotes programmatically. It is designed for developers who want to integrate IRC quotes into their own applications. Quote submissions must be done through the web interface to prevent abuse.</p>
|
||||
|
||||
<h4>Available API Endpoints</h4>
|
||||
<ul>
|
||||
<li><strong>Get All Approved Quotes</strong>: <code>GET /api/quotes</code></li>
|
||||
<li><strong>Get a Specific Quote by ID</strong>: <code>GET /api/quotes/<id></code></li>
|
||||
<li><strong>Get a Random Quote</strong>: <code>GET /api/random</code></li>
|
||||
<li><strong>Get Top Quotes</strong>: <code>GET /api/top</code></li>
|
||||
<li><strong>Search Quotes</strong>: <code>GET /api/search?q=<search_term></code></li>
|
||||
</ul>
|
||||
|
||||
<h4>Submitting Quotes via the API</h4>
|
||||
<p>The API also allows you to submit quotes, but this feature is rate-limited to prevent abuse. Each user is allowed 5 submissions per minute.</p>
|
||||
<ul>
|
||||
<li><strong>Submit a Quote</strong>: <code>POST /api/submit</code></li>
|
||||
<li><strong>Request Body</strong>: The request body should be in JSON format and contain the quote text like this:</li>
|
||||
<pre><code>{
|
||||
"text": "This is a memorable quote!"
|
||||
}</code></pre>
|
||||
<li><strong>Validation Rules</strong>: Quotes must be between 5 and 1000 characters.</li>
|
||||
</ul>
|
||||
|
||||
<h3>Rules for Submitting Quotes</h3>
|
||||
<p>To ensure that ircquotes remains a fun and enjoyable platform for everyone, we ask that you follow a few simple rules when submitting quotes:</p>
|
||||
<ul>
|
||||
<li><strong>No Offensive Content</strong>: Do not submit quotes that contain offensive language, hate speech, or other harmful content.</li>
|
||||
<li><strong>No Spam</strong>: Please avoid submitting irrelevant or repetitive content. The site is for memorable IRC quotes, not spam.</li>
|
||||
<li><strong>Stay On-Topic</strong>: Ensure that your submissions are actual quotes from IRC, not made-up content.</li>
|
||||
<li><strong>Stay On-Topic</strong>: Ensure that your submissions are actual quotes from chat platforms, not made-up content.</li>
|
||||
<li><strong>Rate Limiting</strong>: The submission rate is limited to 5 quotes per minute to prevent spam.</li>
|
||||
<li><strong>Moderation</strong>: All quotes are subject to approval by site moderators. Rejected quotes will not be publicly visible.</li>
|
||||
</ul>
|
||||
|
||||
@@ -68,8 +68,8 @@
|
||||
|
||||
<td class="bodytext" width="50%" valign="top">
|
||||
<b>Latest Updates</b>
|
||||
<p><strong>20/09/25</strong><br>Major security and feature update! Added copy quotes, bulk moderation, mobile support, rate limiting, and enhanced security.</p>
|
||||
<p><strong>13/10/24</strong><br>Added dark theme and re added all of bash.org's old quotes.</p>
|
||||
<p><strong>20/09/25</strong><br>Improved some things in the backend and added Dark theme</p>
|
||||
<p><strong>13/10/24</strong><br>Re added all of bash.org's old quotes.</p>
|
||||
<p><strong>09/10/24</strong><br>We are now live! Start submitting your favourite IRC quotes.</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
})();
|
||||
</script>
|
||||
<script src="{{ url_for('static', filename='theme.js') }}"></script>
|
||||
<script src="{{ url_for('static', filename='modapp.js') }}"></script>
|
||||
</head>
|
||||
<body bgcolor="#ffffff" text="#000000" link="#c08000" vlink="#c08000" alink="#c08000">
|
||||
|
||||
@@ -125,7 +126,15 @@
|
||||
0
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="mobile-hide">{{ quote.submitted_at.strftime('%Y-%m-%d %H:%M:%S') if quote.submitted_at else 'N/A' }}</td>
|
||||
<td class="mobile-hide">
|
||||
{% if quote.submitted_at %}
|
||||
{{ quote.submitted_at.strftime('%d/%m/%y %H:%M:%S') }}
|
||||
{% elif quote.date %}
|
||||
{{ quote.date.strftime('%d/%m/%y') }} (legacy)
|
||||
{% else %}
|
||||
No date
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="mobile-hide">{{ quote.ip_address|e }}</td>
|
||||
<td class="mobile-hide">{{ quote.user_agent|e|truncate(50) }}</td>
|
||||
<td>
|
||||
|
||||
@@ -68,6 +68,14 @@
|
||||
<a href="#" onclick="return flag({{ quote.id }}, this)" class="qa">X</a>
|
||||
|
||||
<a href="#" onclick="return copyQuote({{ quote.id }}, this)" class="qa" title="Copy quote to clipboard">C</a>
|
||||
|
||||
<span style="color: #666; font-size: 0.9em;">
|
||||
{% if quote.submitted_at %}
|
||||
{{ quote.submitted_at.strftime('%d/%m/%y %H:%M') }}
|
||||
{% elif quote.date %}
|
||||
{{ quote.date.strftime('%d/%m/%y') }}
|
||||
{% endif %}
|
||||
</span>
|
||||
</p>
|
||||
|
||||
<p class="qt">{{ quote.text|e }}</p>
|
||||
|
||||
@@ -64,6 +64,14 @@
|
||||
<a href="#" onclick="return flag({{ quote.id }}, this)" class="qa">X</a>
|
||||
|
||||
<a href="#" onclick="return copyQuote({{ quote.id }}, this)" class="qa" title="Copy quote to clipboard">C</a>
|
||||
|
||||
<span style="color: #666; font-size: 0.9em;">
|
||||
{% if quote.submitted_at %}
|
||||
{{ quote.submitted_at.strftime('%d/%m/%y %H:%M') }}
|
||||
{% elif quote.date %}
|
||||
{{ quote.date.strftime('%d/%m/%y') }}
|
||||
{% endif %}
|
||||
</span>
|
||||
</p>
|
||||
<p class="qt">{{ quote.text|e }}</p>
|
||||
</td>
|
||||
|
||||
@@ -94,6 +94,14 @@
|
||||
<a href="#" onclick="return flag({{ quote.id }}, this)" class="qa">X</a>
|
||||
|
||||
<a href="#" onclick="return copyQuote({{ quote.id }}, this)" class="qa" title="Copy quote to clipboard">C</a>
|
||||
|
||||
<span style="color: #666; font-size: 0.9em;">
|
||||
{% if quote.submitted_at %}
|
||||
{{ quote.submitted_at.strftime('%d/%m/%y %H:%M') }}
|
||||
{% elif quote.date %}
|
||||
{{ quote.date.strftime('%d/%m/%y') }}
|
||||
{% endif %}
|
||||
</span>
|
||||
</p>
|
||||
<p class="qt">{{ quote.text|e }}</p>
|
||||
<hr>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
</script>
|
||||
<script src="{{ url_for('static', filename='theme.js') }}"></script>
|
||||
</head>
|
||||
<body bgcolor="#ffffff" text="#000000" link="#c08000" vlink="#c08000" alink="#c08000" onload="document.add.newquote.focus();">
|
||||
<body bgcolor="#ffffff" text="#000000" link="#c08000" vlink="#c08000" alink="#c08000" onload="document.add.quote.focus();">
|
||||
<center>
|
||||
<!-- Header -->
|
||||
<table cellpadding="2" cellspacing="0" width="80%" border="0">
|
||||
@@ -54,8 +54,20 @@
|
||||
<form action="/submit" name="add" method="POST">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
|
||||
<table cellpadding="2" cellspacing="0" width="60%">
|
||||
{% if preview_text %}
|
||||
<!-- Preview Section -->
|
||||
<tr>
|
||||
<td><textarea cols="100%" rows="10" name="quote" class="text"></textarea></td>
|
||||
<td>
|
||||
<h3>Quote Preview:</h3>
|
||||
<div style="border: 1px solid #ccc; padding: 10px; margin: 10px 0; background-color: #f9f9f9;">
|
||||
<pre style="white-space: pre-wrap; font-family: monospace;">{{ preview_text }}</pre>
|
||||
</div>
|
||||
<p><strong>If this looks correct, click "Submit Quote" below. Otherwise, edit your quote and preview again.</strong></p>
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
<tr>
|
||||
<td><textarea cols="100%" rows="10" name="quote" class="text">{{ original_text or '' }}</textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><input type="checkbox" name="strip" checked> Automatically attempt to fix timestamps and common mistakes.</td>
|
||||
@@ -71,7 +83,7 @@
|
||||
<td>
|
||||
<br><br>
|
||||
You may submit quotes from any chat medium, so long as they have reasonable
|
||||
formatting (IRC, AIM, ICQ, Yahoo, NOT MSN or MS Chat).<br><br>
|
||||
formatting (IRC, etc.).<br><br>
|
||||
Tips for approval: no timestamps, keep it short (trim useless parts), remove trailing laughs, and avoid inside jokes.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
Reference in New Issue
Block a user