Skip to content

Commit

Permalink
Merge pull request #65 from Thorfusion/dev
Browse files Browse the repository at this point in the history
fixes files being zipped having wrong mimetype
  • Loading branch information
maggi373 authored May 31, 2024
2 parents c98d2b2 + 4dd1a7d commit 593e577
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ docker run --name solderpy --restart always -d -p 80:5000 thorfusion/solderpy
This is the public facing URL for your repository. If your repository location is already a URL, you can use the same value here. Include a trailing slash!

```bash
-e OLDER_MIRROR_URL=https://solder.example.com/mods/
-e SOLDER_MIRROR_URL=https://solder.example.com/mods/
```

This is the location of your mod reposistory. This can be a URL (remote repo), or an absolute file location (local repo, much faster). When a remote repo is used, Solder will have to download the entire file to calculate the MD5 hash.
Expand Down Expand Up @@ -168,6 +168,10 @@ Note that R2 Bucket functionality gets activated when R2_BUCKET is used
-e R2_BUCKET=
```

```bash
-e R2_REGION=
```

#### Adding a new user

Enables the /setup page if the database already exists and you need to add a new user
Expand Down
2 changes: 1 addition & 1 deletion api.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

@api.route("/api/")
def api_info():
return jsonify({"api": "solder.py", "version": "v1.2.0", "stream": "DEV"})
return jsonify({"api": "solder.py", "version": "v1.2.1", "stream": "DEV"})


@api.route("/api/verify")
Expand Down
12 changes: 4 additions & 8 deletions app.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "1.2.0"
__version__ = "1.2.1"

import os
from dotenv import load_dotenv
Expand Down Expand Up @@ -209,10 +209,6 @@ def newmodversion(id):
print(request.form["rehash_md5"])
print(request.form["rehash_url"])
if "newmodvermanual_submit" in request.form:
print(request.form["newmodvermanual_md5"])
print(request.form["newmodvermanual_version"])
print(request.form["newmodvermanual_mcversion"])
print(request.form["newmodvermanual_url"])
filesie2 = Modversion.get_file_size(mirror_url + request.form["newmodvermanual_url"])
print(filesie2)
if request.form["newmodvermanual_md5"] != "":
Expand Down Expand Up @@ -421,7 +417,6 @@ def modpackbuild(id):
if "token" not in session or not Session.verify_session(session["token"], request.remote_addr):
# New or invalid session, send to login
return redirect(url_for("login"))


try:
listmod = Mod.get_all_pretty_names()
Expand Down Expand Up @@ -508,8 +503,8 @@ def modlibrary_post():
if filew and allowed_file(filew.filename):
filename = secure_filename(filew.filename)
print("saving")
createFolder(app.config["UPLOAD_FOLDER"] + request.form["mod"] + "/")
filew.save(os.path.join(app.config["UPLOAD_FOLDER"] + request.form["mod"] + "/", filename))
createFolder(app.config["UPLOAD_FOLDER"] + secure_filename(request.form["mod"]) + "/")
filew.save(os.path.join(app.config["UPLOAD_FOLDER"] + secure_filename(request.form["mod"]) + "/", filename))
if R2_BUCKET != None:
keyname = "mods/" + request.form["mod"] + "/" + filename
R2.upload_file(app.config["UPLOAD_FOLDER"] + request.form["mod"] + "/" + filename, R2_BUCKET, keyname)
Expand Down Expand Up @@ -537,6 +532,7 @@ def modpacklibrary_post():
if "token" not in session or not Session.verify_session(session["token"], request.remote_addr):
# New or invalid session, send to login
return redirect(url_for("login"))

if request.method == "POST":
if "form-submit" in request.form:
hidden="0"
Expand Down
2 changes: 1 addition & 1 deletion static/js/solderpy.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ function submit_zipfile_mods() {
saveAs(file2, modslugname + "-" + mcversionname + "-" + modversionname + ".zip");
}
// replaces the submitted file with the new zip file generated by previous code from the original file
let finalfile = new File([file2], modslugname + "-" + mcversionname + "-" + modversionname + ".zip",{type:"application/x-zip-compressed", lastModified:new Date().getTime()});
let finalfile = new File([file2], modslugname + "-" + mcversionname + "-" + modversionname + ".zip",{type:"application/zip", lastModified:new Date().getTime()});

let container = new DataTransfer();
container.items.add(finalfile);
Expand Down
2 changes: 1 addition & 1 deletion templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
</ul>
</nav>
<div class="flex-column flex-shrink-0 p-3 text-white navcontainer2">
<p class="">Version 1.2.0</p>
<p class="">Version 1.2.1</p>
</div>

</div>
Expand Down

0 comments on commit 593e577

Please sign in to comment.