init
This commit is contained in:
commit
e76582ebac
|
@ -0,0 +1,2 @@
|
|||
/node_modules/*
|
||||
/releases/*
|
|
@ -0,0 +1,21 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2024 iceyrazor
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
|
@ -0,0 +1,55 @@
|
|||
# imporntant
|
||||
note that i dont know much about security, use any of the online features of this at your own risk!
|
||||
|
||||
# iceys-modpack-manager
|
||||
a small program i planned to make for myself. then finally made it. and decided to share. minecraft modpack manager for client and server
|
||||
|
||||
|
||||
# what is this for?
|
||||
this is built with minecraft modding in mind
|
||||
|
||||
# what does this do?
|
||||
multible togglable things......
|
||||
|
||||
it will sync all mods FROM the server TO the client (NOT client(s)!). currently ONLY on the same machine!
|
||||
|
||||
it will automatacally create a zip of your modpack in the src/zip_managed folder
|
||||
|
||||
it has the option to run a webserver and you can port forward it if you want to. BUT keep in mind, this is not built to be 100% secure. i did my best.
|
||||
ssh is not being run
|
||||
|
||||
and if you want. it will automatuially move the zip to the webserver.
|
||||
|
||||
this can also do multible modpacks at once. witch you can disable if your not using it
|
||||
|
||||
and theres a client sync program that the other user can download and run to sync mods as well
|
||||
|
||||
# small detail?
|
||||
i tried to make all the code open source even when downloaded. so that you can edit the webpage and mostly everything as you like.
|
||||
|
||||
# extra info
|
||||
the config has some info on what all the stuff does. but if you need more detail, let me know in issues :)
|
||||
|
||||
this only syncs ONCE once it is ran. if you want it to sync again. close the file and reopen it.
|
||||
|
||||
this ONLY syncs the MODS folder. and scripts(like zs files from craftweaker), and configs. are not synced
|
||||
|
||||
# how do i use it?
|
||||
edit the config to your liking. run the exe.
|
||||
|
||||
# console output
|
||||
if you have both folders set. you will see mods being added to the client. and mods being removed.
|
||||
|
||||
if you have zip enabled. it will tell you that the zip is done. and if you have it auto move to the server. it will tell you that it moved, in case
|
||||
you forget.
|
||||
|
||||
finally if you have the webserver enabled, it will show that it is running.
|
||||
|
||||
if you dont have the webserver running. you can close the exe once console output stops.
|
||||
|
||||
# todo
|
||||
1. allow for multible modpack managament on client
|
||||
|
||||
# possible future plans
|
||||
2. allow custom synced folders and files for configs and scripts
|
||||
3. allow make option to share client and config on web server
|
|
@ -0,0 +1,212 @@
|
|||
const path=require('path'),
|
||||
fs=require('fs'),
|
||||
http=require('http'),
|
||||
readline = require('readline'),
|
||||
consoleinput = readline.createInterface({
|
||||
input: process.stdin,
|
||||
output: process.stdout
|
||||
}),
|
||||
main_dir=process.cwd();
|
||||
|
||||
console.log("welcome to icey's modpack sync client");
|
||||
|
||||
if(fs.existsSync(path.join(main_dir,"client_config.json"))){
|
||||
config=JSON.parse(fs.readFileSync(path.join(main_dir,"client_config.json")))
|
||||
//
|
||||
|
||||
if(fs.existsSync(path.join(config.folder,"mods"))){
|
||||
let data = {}
|
||||
|
||||
data.mods=fs.readdirSync(path.join(config.folder,"mods"))
|
||||
|
||||
//ive only now used filter as i just remembered it exist :p
|
||||
data.mods=data.mods.filter(data_mods_first=>{
|
||||
let match=false
|
||||
config.ignore_filter.forEach(ignore_filter=>{
|
||||
if(data_mods_first==ignore_filter){
|
||||
match=true
|
||||
return
|
||||
}
|
||||
})
|
||||
if(match==false){
|
||||
return data_mods_first
|
||||
}
|
||||
})
|
||||
|
||||
data.modpack=config.modpack
|
||||
|
||||
data=JSON.stringify(data)
|
||||
|
||||
const options = {
|
||||
hostname: config.server_host.split(":")[0],
|
||||
path: "/clientS_comparemods/",
|
||||
method: 'POST',
|
||||
port: parseInt(config.server_host.split(":")[1]),
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Content-Length': data.length
|
||||
}
|
||||
};
|
||||
|
||||
let post_data_arr_in=[]
|
||||
req=http.request(options,(res)=>{
|
||||
res.on('data',chunk=>{
|
||||
post_data_arr_in.push(chunk)
|
||||
})
|
||||
res.on('end',()=>{
|
||||
data=JSON.parse(Buffer.concat(post_data_arr_in).toString())
|
||||
|
||||
if(data.error){
|
||||
console.log(data.error);
|
||||
} else {
|
||||
console.log(data);
|
||||
console.log("the add part, are mods that will be added, the remove part, are mods that will");
|
||||
console.log("be removed.");
|
||||
console.log("make these changes? type y");
|
||||
|
||||
let download_count=data.add.length
|
||||
|
||||
consoleinput.question("input>",input=>{
|
||||
if(input=="y"){
|
||||
data.remove.forEach(remove_mods=>{
|
||||
fs.unlink(path.join(config.folder,"mods",remove_mods),(err)=>{console.log(err);})
|
||||
})
|
||||
|
||||
if(data.add.length<1){
|
||||
console.log("done!");
|
||||
setTimeout(()=>{
|
||||
process.exit()
|
||||
},2000)
|
||||
}
|
||||
|
||||
data.add.forEach(add_mods=>{
|
||||
let file = fs.createWriteStream(path.join(config.folder,"mods",add_mods));
|
||||
|
||||
let post_data={}
|
||||
post_data.mod=add_mods
|
||||
post_data.modpack=config.modpack
|
||||
|
||||
post_data=JSON.stringify(post_data)
|
||||
|
||||
const options2 = {
|
||||
hostname: config.server_host.split(":")[0],
|
||||
path: "/clientS_getmods/",
|
||||
method: 'POST',
|
||||
port: parseInt(config.server_host.split(":")[1]),
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Content-Length': post_data.length
|
||||
}
|
||||
};
|
||||
|
||||
request = http.request(options2,(response)=>{
|
||||
response.pipe(file);
|
||||
|
||||
// after download completed close filestream
|
||||
file.on("finish", () => {
|
||||
file.close();
|
||||
console.log("Downloaded "+add_mods);
|
||||
download_count--
|
||||
console.log("remaining",download_count);
|
||||
if(download_count<=0){
|
||||
console.log("done!");
|
||||
setTimeout(()=>{
|
||||
process.exit()
|
||||
},2000)
|
||||
}
|
||||
});
|
||||
}).on("error", (err) => {
|
||||
console.log("Error: ", err.message);
|
||||
});
|
||||
|
||||
request.write(post_data);
|
||||
request.end();
|
||||
})
|
||||
} else {
|
||||
process.exit();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
}).on("error", (err) => {
|
||||
console.log("Error: ", err.message);
|
||||
});
|
||||
|
||||
req.write(data);
|
||||
req.end();
|
||||
} else {
|
||||
console.log("ERROR: folder "+config.folder+"/mods does not exist");
|
||||
}
|
||||
} else {
|
||||
//if config doesnt exist. prompt user to create one
|
||||
console.log("you can right click to paste if ctrl+v does not work");
|
||||
console.log("it seems the config is mising, this is required to work, lets set it up");
|
||||
console.log("please enter the directory of your modpack folder (NOT the mods folder)");
|
||||
consoleinput.question("folder>",(folder)=>{
|
||||
let config={}
|
||||
config.folder=folder
|
||||
console.log("folder selected: "+folder);
|
||||
console.log("-------------");
|
||||
console.log("please select the host to connect to, eg host.com:2480");
|
||||
console.log("do not do http://");
|
||||
console.log("this host has to be a modpack server host");
|
||||
consoleinput.question("host>",(host)=>{
|
||||
config.server_host=host
|
||||
console.log("host: "+host);
|
||||
console.log("------------");
|
||||
console.log("now if you want, add some mods to be ignored. full name +.jar");
|
||||
console.log("these are mods that are not going to be deleted by this client");
|
||||
console.log("for example. it xaros minimap, journey map, optifine.");
|
||||
console.log("--");
|
||||
console.log("you can either do one mod at a time and hit enter");
|
||||
console.log("or do all mods in one line seperated by a , no space.");
|
||||
console.log("type end when you are done");
|
||||
console.log("-----------");
|
||||
config.ignore_filter=[]
|
||||
function conedit_add_filter(){
|
||||
console.log("----");
|
||||
config.ignore_filter.forEach((config_fill)=>{
|
||||
console.log(config_fill);
|
||||
})
|
||||
console.log("----");
|
||||
consoleinput.question("add_ignore>",(ignore)=>{
|
||||
if(ignore=="end"){
|
||||
console.log("----");
|
||||
config.ignore_filter.forEach((config_fill)=>{
|
||||
console.log(config_fill);
|
||||
})
|
||||
console.log("----");
|
||||
console.log("now, what modpack are you syncing with? enter full name");
|
||||
consoleinput.question("modpack>",(modpack)=>{
|
||||
config.modpack=modpack
|
||||
console.log("config----");
|
||||
console.log(config);
|
||||
fs.writeFileSync(path.join(main_dir,"client_config.json"),JSON.stringify(config, undefined, 2),
|
||||
(err)=>{
|
||||
console.log(err);
|
||||
})
|
||||
console.log("thats all of the config, program will now restart");
|
||||
console.log("simply reopen");
|
||||
setTimeout(()=>{
|
||||
process.exit()
|
||||
},5000)
|
||||
})
|
||||
} else {
|
||||
if(ignore.includes(",")){
|
||||
ignore=ignore.split(",")
|
||||
ignore.forEach(igarr=>{
|
||||
config.ignore_filter.push(igarr)
|
||||
})
|
||||
} else {
|
||||
config.ignore_filter.push(ignore)
|
||||
}
|
||||
conedit_add_filter()
|
||||
}
|
||||
})
|
||||
}
|
||||
conedit_add_filter()
|
||||
})
|
||||
});
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"folder": "C:\\", //same as client folder on server
|
||||
"server_host": "localhost:4350", //host ip/address and port to connect to.
|
||||
"ignore_filter": [
|
||||
"same as client ignore filter on server",
|
||||
],
|
||||
"modpack": "modpack name" //modpack name (not .zip)
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"name": "iceys-server-modpack-manager-client",
|
||||
"version": "0.0.2",
|
||||
"description": "client for iceys-server-modpack-manager",
|
||||
"main": "client.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"start":"node ."
|
||||
},
|
||||
"author": "iceyrazor",
|
||||
"license": "ISC",
|
||||
"pkg": {
|
||||
"scripts": "client.js"
|
||||
},
|
||||
"bin":"client.js"
|
||||
}
|
|
@ -0,0 +1,293 @@
|
|||
const express=require('express'),
|
||||
app = express(),
|
||||
fs=require('fs'),
|
||||
path=require('path'),
|
||||
JSZip = require('jszip'),
|
||||
webdir=path.join(process.cwd(),"src","web"),
|
||||
readline = require('readline'),
|
||||
consoleinput = readline.createInterface({
|
||||
input: process.stdin,
|
||||
output: process.stdout
|
||||
});
|
||||
////////
|
||||
//time format function because it just has to be complicated
|
||||
function changeTimezone(date, ianatz) {
|
||||
|
||||
// suppose the date is 12:00 UTC
|
||||
let invdate = new Date(date.toLocaleString('en-US', {
|
||||
timeZone: ianatz
|
||||
}));
|
||||
|
||||
// then invdate will be 07:00 in Toronto
|
||||
// and the diff is 5 hours
|
||||
let diff = date.getTime() - invdate.getTime();
|
||||
|
||||
// so 12:00 in Toronto is 17:00 UTC
|
||||
return new Date(date.getTime() - diff); // needs to substract
|
||||
|
||||
}
|
||||
|
||||
|
||||
//get config
|
||||
if(fs.existsSync(path.join(process.cwd(),"src","config.json"))){
|
||||
config=JSON.parse(fs.readFileSync(path.join(process.cwd(),"src","config.json")))
|
||||
} else {
|
||||
console.log("ERROR: config does not exist!");
|
||||
process.exit()
|
||||
}
|
||||
|
||||
function server_to_client_sync(modpack){
|
||||
let mod_list={client_mods:[],server_mods:[],diff:{add:[],remove:[]}}
|
||||
mod_list.server_mods=fs.readdirSync(path.join(modpack.server_folder,"mods"))
|
||||
mod_list.client_mods=fs.readdirSync(path.join(modpack.client_folder,"mods"))
|
||||
|
||||
mod_list.server_mods.forEach(mods=>{
|
||||
let match=false
|
||||
mod_list.client_mods.forEach(cmods=>{
|
||||
if(mods==cmods){
|
||||
match=true
|
||||
}
|
||||
})
|
||||
modpack.server_ignore_filter.forEach(igmods=>{
|
||||
if(mods==igmods){
|
||||
match=true
|
||||
}
|
||||
})
|
||||
if(match==false){
|
||||
mod_list.diff.add.push(mods)
|
||||
}
|
||||
})
|
||||
|
||||
mod_list.client_mods.forEach(mods=>{
|
||||
let match=false
|
||||
mod_list.server_mods.forEach(cmods=>{
|
||||
if(mods==cmods){
|
||||
match=true
|
||||
}
|
||||
})
|
||||
modpack.client_ignore_filter.forEach(igmods=>{
|
||||
if(mods==igmods){
|
||||
match=true
|
||||
}
|
||||
})
|
||||
if(match==false){
|
||||
mod_list.diff.remove.push(mods)
|
||||
}
|
||||
})
|
||||
console.log(mod_list.diff);
|
||||
|
||||
|
||||
mod_list.diff.remove.forEach(remove_mods=>{
|
||||
fs.unlink(path.join(modpack.client_folder,"mods",remove_mods),(err)=>{console.log(err);})
|
||||
})
|
||||
|
||||
mod_list.diff.add.forEach(add_mods=>{
|
||||
fs.copyFileSync(path.join(modpack.server_folder,"mods",add_mods),path.join(modpack.client_folder,"mods",add_mods))
|
||||
})
|
||||
|
||||
mod_list={}
|
||||
}
|
||||
|
||||
//does both client and server folder exist on same machine? and is said modpack active? sync it!
|
||||
config.modpacks.forEach(modpacks=>{
|
||||
if(modpacks.active==true&&modpacks.server_folder&&modpacks.client_folder){
|
||||
server_to_client_sync(modpacks)
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
//zip de file
|
||||
config.modpacks.forEach(modpacks=>{
|
||||
if(modpacks.active==true&&modpacks.compile_zip==true){
|
||||
try {
|
||||
let zip = new JSZip();
|
||||
let zip_path=path.join("src","zip_managed",modpacks.name+".zip")
|
||||
if(fs.existsSync(zip_path)){
|
||||
fs.unlinkSync(zip_path)
|
||||
}
|
||||
if(fs.existsSync(path.join("src","web","modpacks",modpacks.name+".zip"))&&modpacks.move_zip_to_server==true){
|
||||
fs.unlinkSync(path.join("src","web","modpacks",modpacks.name+".zip"))
|
||||
}
|
||||
let mod_com_list=fs.readdirSync(path.join(modpacks.zip_folder,"mods"))
|
||||
|
||||
mod_com_list.forEach(mod_name=>{
|
||||
let ignore_file=false
|
||||
modpacks.zip_ignore_filter.forEach(igmods=>{
|
||||
if(mod_name==igmods){
|
||||
ignore_file=true
|
||||
}
|
||||
})
|
||||
|
||||
if(ignore_file==false){
|
||||
const pdfData = fs.readFileSync(path.join(modpacks.zip_folder,"mods",mod_name));
|
||||
zip.file(mod_name, pdfData);
|
||||
}
|
||||
})
|
||||
|
||||
zip.generateNodeStream({ type: 'nodebuffer', streamFiles: true })
|
||||
.pipe(fs.createWriteStream(zip_path))
|
||||
.on('finish', function () {
|
||||
console.log(modpacks.name+".zip written.");
|
||||
move_file_to_web(modpacks)
|
||||
});
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//move to web
|
||||
function move_file_to_web(modpacks){
|
||||
if(modpacks.move_zip_to_server==true){
|
||||
console.log(modpacks.name+".zip moved to server folder");
|
||||
fs.renameSync(path.join("src","zip_managed",modpacks.name+".zip"),path.join("src","web","modpacks",modpacks.name+".zip"))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//run webserver
|
||||
if(config.use_webserver==true){
|
||||
app.use(express.urlencoded({ extended: true }));
|
||||
app.use(express.json());
|
||||
app.use(express.text());
|
||||
|
||||
app.use(function(req,res,next){
|
||||
server_log = function server_log(str){
|
||||
let newDate=changeTimezone(new Date(),"US/Central");
|
||||
let date={
|
||||
day:(newDate.getMonth()+1)+" "+newDate.getDate()+" "+newDate.getFullYear(),
|
||||
time:newDate.getHours()+":"+newDate.getMinutes()+":"+newDate.getSeconds()
|
||||
}
|
||||
let logfile=path.resolve("src","logs",date.day+".txt")
|
||||
let content="--"+date.time+": "+"hostname: "+req.socket.remoteAddress+" url: "+req.url+"\n"+str+"\n"
|
||||
console.log(content)
|
||||
fs.writeFile(logfile,content,{flag:'a+'},err=>{if(err){server_log(err)}})
|
||||
}
|
||||
next();
|
||||
})
|
||||
|
||||
app.use(function(req,res,next){
|
||||
req.checkdir = function checkdir(des_dir,curr_dir){
|
||||
let isdir=path.resolve(webdir,curr_dir.replace(/^\//g,"")).includes(path.join(webdir,des_dir))
|
||||
if(isdir==false){
|
||||
server_log("out of dir at: "+curr_dir)
|
||||
res.send("access denied")
|
||||
}
|
||||
return isdir
|
||||
}
|
||||
next();
|
||||
});
|
||||
|
||||
app.get("/modpacks/*",function(req,res){
|
||||
req.url=req.url.replace(/%20/g," ");
|
||||
if(req.checkdir("modpacks",req.url)==true){
|
||||
res.sendFile(path.join(webdir,req.url))
|
||||
}
|
||||
});
|
||||
|
||||
app.get("/modpacklist",function(req,res){
|
||||
res.send(fs.readdirSync(path.join(webdir,"modpacks")))
|
||||
})
|
||||
|
||||
if(config.enable_client_server_sync==true){
|
||||
app.post("/clientS_comparemods",function(req,res){
|
||||
let modpack_exist=false
|
||||
config.modpacks.forEach(modpacks=>{
|
||||
if(modpacks.name==req.body.modpack){
|
||||
modpack_exist=true
|
||||
}
|
||||
})
|
||||
if(modpack_exist==true){
|
||||
config.modpacks.forEach(modpacks=>{
|
||||
if(modpacks.name==req.body.modpack){
|
||||
if(modpacks.active==true&&modpacks.use_client_sync==true){
|
||||
let mod_list={client_mods:[],server_mods:[],diff:{add:[],remove:[]}}
|
||||
mod_list.server_mods=fs.readdirSync(path.join(modpacks.client_sync_folder,"mods"))
|
||||
mod_list.client_mods=req.body.mods
|
||||
|
||||
mod_list.server_mods.forEach(mods=>{
|
||||
let match=false
|
||||
mod_list.client_mods.forEach(cmods=>{
|
||||
if(mods==cmods){
|
||||
match=true
|
||||
}
|
||||
})
|
||||
modpacks.client_sync_ignore_filter.forEach(igmods=>{
|
||||
if(mods==igmods){
|
||||
match=true
|
||||
}
|
||||
})
|
||||
if(match==false){
|
||||
mod_list.diff.add.push(mods)
|
||||
}
|
||||
})
|
||||
|
||||
mod_list.client_mods.forEach(mods=>{
|
||||
let match=false
|
||||
mod_list.server_mods.forEach(cmods=>{
|
||||
if(mods==cmods){
|
||||
match=true
|
||||
modpacks.client_sync_ignore_filter.forEach(igmods=>{
|
||||
if(mods==igmods){
|
||||
match=false
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
if(match==false){
|
||||
mod_list.diff.remove.push(mods)
|
||||
}
|
||||
})
|
||||
res.send(JSON.stringify(mod_list.diff))
|
||||
} else {
|
||||
res.send(JSON.stringify({error:"modpack does not exist"}))
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
res.send(JSON.stringify({error:"modpack does not exist"}))
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
app.post("/clientS_getmods",function(req,res){
|
||||
let modpack_exist=false
|
||||
config.modpacks.forEach(modpacks=>{
|
||||
if(modpacks.name==req.body.modpack){
|
||||
modpack_exist=true
|
||||
}
|
||||
})
|
||||
if(modpack_exist==true){
|
||||
config.modpacks.forEach(modpacks=>{
|
||||
if(modpacks.name==req.body.modpack){
|
||||
if(modpacks.active==true&&modpacks.use_client_sync==true){
|
||||
res.sendFile(path.join(modpacks.client_sync_folder,"mods",req.body.mod))
|
||||
} else {
|
||||
res.send(JSON.stringify({error:"modpack does not exist"}))
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
} else {
|
||||
app.post("/clientS_comparemods",function(req,res){
|
||||
res.send(JSON.stringify({error:"sync is not enabled"}))
|
||||
});
|
||||
|
||||
app.post("/clientS_getmods",function(req,res){
|
||||
res.send(JSON.stringify({error:"sync is not enabled"}))
|
||||
});
|
||||
}
|
||||
|
||||
app.get("/*",function(req,res){
|
||||
res.sendFile(path.join(process.cwd(),"src","web","index.html"))
|
||||
})
|
||||
|
||||
|
||||
|
||||
let port=config.server_port
|
||||
app.listen(port,'0.0.0.0', () => {
|
||||
console.log(`Example app listening at http://localhost:${port}`)
|
||||
});
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"name": "iceys-server-modpack-manager",
|
||||
"version": "0.0.2",
|
||||
"description": "",
|
||||
"main": "main.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"start": "node ."
|
||||
},
|
||||
"author": "iceyrazor",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"express": "^4.18.1",
|
||||
"jszip": "^3.10.0"
|
||||
},
|
||||
"pkg": {
|
||||
"scripts": "main.js"
|
||||
},
|
||||
"bin":"main.js"
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
{
|
||||
"modpacks":[ //you can have this do multible modpacks
|
||||
{
|
||||
"active":true, //you can deactivate a modpack if you dont want to use it currently
|
||||
"name":"modpack name", //..... really??
|
||||
"server_folder":"C:\\", //optional, but required if you want server > client sync
|
||||
//not the mods folder!
|
||||
//remove this entirely if not in use! do not leave it blank
|
||||
"server_ignore_filter":[
|
||||
"mod to ignore on server.jar",
|
||||
"mod to ignore on server.jar"
|
||||
],
|
||||
"client_folder":"C:\\", //optional but required for server > client sync
|
||||
"client_ignore_filter":[
|
||||
"same as server. mods to ignore/ not be deleted by sync"
|
||||
],
|
||||
"compile_zip":false, //should this make a zip of your mods from the defined folder?
|
||||
//it will use the modpack name as the name for the zip
|
||||
"zip_folder":"folder for mods to be ziped", //not the mods folder!! it finds that by itself
|
||||
//make sure your mods are in the /mods folder and NOT /mods/version. ive yet to work with that
|
||||
"zip_ignore_filter":[
|
||||
"same as other. mods to ignore"
|
||||
],
|
||||
"move_zip_to_server":false, //will this move the mod zip to the server folder?
|
||||
"use_client_sync":true, //should this be used with the client sync software?
|
||||
//requires enable_client_server_sync enabled
|
||||
"client_sync_folder":"C:\\", //same as others
|
||||
//can either be client folder, server folder, or different folder. you chose
|
||||
"client_sync_ignore_filter":[
|
||||
"same as others but server ignore"
|
||||
]
|
||||
}
|
||||
],
|
||||
"use_webserver":false, //do you even want to run the webserver?
|
||||
"server_port":4350,
|
||||
"enable_client_server_sync":true //should the client software be allowed?
|
||||
//requires use_webserver to be enabled
|
||||
//use at your own risk!
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
<div align="center">
|
||||
<h1>modpack webpage</h1>
|
||||
<p>here is a list of modpacks</p>
|
||||
|
||||
<div id="modpacks"></div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
fetch("/modpacklist")
|
||||
.then(res=>res.json())
|
||||
.then(res=>{
|
||||
res.forEach(modpack_name=>{
|
||||
modpacks.innerHTML+='<div><a href="/modpacks/'+modpack_name+
|
||||
'">'+modpack_name+'</div>';
|
||||
})
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Reference in New Issue