Skip to content
Open
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
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,7 @@ To run the flask app, activate the venv and run:
```bash
gunicorn -w 1 app:app
```

# Credits
original application, code and ideation by gruetzig
currently hosted and made available by eip and nintendo homebrew
13 changes: 12 additions & 1 deletion app.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from flask import Flask, request, make_response, render_template
from flask import Flask, request, make_response, render_template, send_from_directory, url_for
from flask_httpauth import HTTPBasicAuth
from configparser import ConfigParser
import os
Expand All @@ -8,6 +8,8 @@
class AdminEntry:
def __init__(self, name, sdserial, nandserial, twlnserial, secinfoserial, date):
self.name = name
self.retrieveurl = url_for('retrieve', username=name)
self.deleteurl = url_for('delete', username=name)
self.sdserial = sdserial
self.nandserial = nandserial
self.twlnserial = twlnserial
Expand Down Expand Up @@ -45,6 +47,11 @@ def get_essential_list():
app = Flask(__name__)
auth = HTTPBasicAuth()

@app.route('/favicon.ico')
def favicon():
return send_from_directory(os.path.join(app.root_path, 'static'),
'favicon.ico', mimetype='image/vnd.microsoft.icon')

@auth.verify_password
def verify_password(username, password):
if config_password == password and config_username == username:
Expand All @@ -62,6 +69,10 @@ def get_submission():

return "<p>Hi</p>"

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

@app.route('/admin')
@auth.login_required
def admin():
Expand Down
4 changes: 2 additions & 2 deletions source/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
DrawContext ctx;

#ifndef SERVER_ADDRESS
#define SERVER_ADDRESS "0.0.0.0"
#define SERVER_ADDRESS "https://soap.nintendohomebrew.com/submit"
#endif

void enter(char* inout, size_t len) {
Expand All @@ -35,7 +35,7 @@ int main() {
goto fail;
}
char discordtag[33] = "";
char address[52] = SERVER_ADDRESS;
char address[52] = "https://soap.nintendohomebrew.com/submit";
initContext(&ctx);
initColors(&ctx);
int menustate = 0;
Expand Down
Binary file added static/favicon.ico
Binary file not shown.
10 changes: 6 additions & 4 deletions templates/admin.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<head>
<meta charset="UTF-8">
<title>Admin Panel</title>
<link rel="favicon" href="templates/favicon.ico">
<style>
table {
width: 100%;
Expand Down Expand Up @@ -38,7 +39,8 @@
border-radius: 4px;
background-color: #f1f1f1;
transition: background-color 0.3s ease;
margin-right: 5px;
margin: 5px;
display: inline-block;
}

a:hover {
Expand All @@ -56,14 +58,14 @@
{% for entry in entries %}
<tr>
<td>{{ entry.name }}</td>
<td><b>SD:</b> {{ entry.sdserial }} <b>NAND:</b> {{ entry.nandserial }} <b>inspect.log:</b> {{ entry.twlnserial }} <b>SecureInfo:</b> {{ entry.secinfoserial }}<b>Date:</b> <span class="date-timestamp">{{ entry.date}}</span></td>
<td><a href="/retrieve?username={{ entry.name }}">Download</a> <a href="/delete?username={{ entry.name }}" class="delete-link">Delete</a></td>
<td><b>SD:</b> {{ entry.sdserial }} <b>NAND:</b> {{ entry.nandserial }} <b>inspect.log:</b> {{ entry.twlnserial }} <b>SecureInfo:</b> {{ entry.secinfoserial }}<b>Date:</b> <span class="date-timestamp">{{ entry.date }}</span></td>
<td><a href="{{ entry.retrieveurl }}">Download</a> <a href="{{ entry.deleteurl }}" class="delete-link">Delete</a></td>
</tr>
{% endfor %}
</table>
</body>
<script>
document.querySelectorAll(".date-timestamp").forEach(e => e.textContent = Date(Number(e.textContent)))
document.querySelectorAll(".date-timestamp").forEach(e => e.textContent = new Date(parseInt(e.textContent)*1000));
// Select all elements with the class 'delete-link'
const deleteLinks = document.querySelectorAll('.delete-link');

Expand Down
18 changes: 18 additions & 0 deletions templates/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>soap essential submitter</title>
<link rel="favicon" href="templates/favicon.ico">
<style>

</style>
</head>
<body>
<br><br><br><br><br><font size="40"><marquee>i fucking love personal hygiene</marquee></font>
<br><br><center>if you don't know what this service is for, you do not need to use it
<br>if you have been directed to use this service by someone and you are seeing this page, you are not following the instructions properly
<br>essential submitter application and backend both by gruetzig, hosted by eip/nh
<br>have a nice day</center>
</body>
</html>