0218
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"MIXIO_HTTP_PORT": 8080,
|
||||
"MIXIO_HTTPS_PORT": 443,
|
||||
"MIXIO_HTTPS_PORT": 8081,
|
||||
"HTTPS_PRIVATE_PEM": "./certs/private.pem",
|
||||
"HTTPS_CRT_FILE": "./certs/file.crt",
|
||||
"MAX_PROJECT_NUM_PER_USER": 20,
|
||||
|
||||
@@ -17,8 +17,16 @@ const { execPath } = require('process');
|
||||
var { JSLang, arrLang, lang } = require("./js/lang.js")
|
||||
const path = require('path');
|
||||
|
||||
var VERSION = JSON.parse(fs.readFileSync("../version.json", "utf-8"))["version"]
|
||||
var configs = fs.readFileSync('./config.json');
|
||||
var versionPath = "../version.json"
|
||||
if(!fs.existsSync(versionPath)){
|
||||
versionPath = path.join(__dirname,"../version.json")
|
||||
}
|
||||
var VERSION = JSON.parse(fs.readFileSync(versionPath), "utf-8")["version"]
|
||||
var configPath = "./config.json"
|
||||
if(!fs.existsSync(configPath)){
|
||||
configPath = path.join(__dirname,"./config.json")
|
||||
}
|
||||
var configs = fs.readFileSync(configPath);
|
||||
configs = JSON.parse(configs.toString());
|
||||
|
||||
|
||||
@@ -224,7 +232,7 @@ async function daemon_start() {
|
||||
app.get('/saveAndRestart', async function(req, res) {
|
||||
newConfig = req.query.configs
|
||||
if (newConfig) {
|
||||
fs.writeFileSync('./config.json', newConfig)
|
||||
fs.writeFileSync(configPath, newConfig)
|
||||
configs = JSON.parse(newConfig)
|
||||
console.log("[INFO] Shutting down MixIO Server...")
|
||||
await mixio.stop();
|
||||
@@ -301,15 +309,25 @@ async function daemon_start() {
|
||||
}
|
||||
|
||||
var mixioServer = function() {
|
||||
var privateKey = fs.readFileSync(configs['HTTPS_PRIVATE_PEM'], 'utf8');
|
||||
var certificate = fs.readFileSync(configs['HTTPS_CRT_FILE'], 'utf8');
|
||||
var keyPath = "./certs/private.pem"
|
||||
if(!fs.existsSync(keyPath))
|
||||
keyPath = path.join(__dirname,"./certs/private.pem")
|
||||
var crtPath = "./certs/file.crt"
|
||||
if(!fs.existsSync(crtPath))
|
||||
crtPath = path.join(__dirname,"./certs/file.crt")
|
||||
var privateKey = fs.readFileSync(keyPath, 'utf8');
|
||||
var certificate = fs.readFileSync(crtPath, 'utf8');
|
||||
|
||||
var credentials = {
|
||||
key: privateKey,
|
||||
cert: certificate
|
||||
};
|
||||
if(fs.existsSync("./certs/chain.crt"))
|
||||
credentials['ca'] = fs.readFileSync("./certs/chain.crt", 'utf8')
|
||||
|
||||
var chainPath = "./certs/chain.crt"
|
||||
if(!fs.existsSync(chainPath))
|
||||
chainPath = path.join(__dirname,"./certs/chain.crt")
|
||||
if(fs.existsSync(chainPath))
|
||||
credentials['ca'] = fs.readFileSync(chainPath, 'utf8')
|
||||
|
||||
aedes = aedesmodule()
|
||||
const httpServer = http.createServer()
|
||||
@@ -1415,10 +1433,13 @@ var mixioServer = function() {
|
||||
}
|
||||
})
|
||||
|
||||
var filterPath = "./reserve/filter.json"
|
||||
if(!fs.existsSync(filterPath))
|
||||
filterPath = path.join(__dirname,'./reserve/filter.json')
|
||||
app.get('/startHook', function(req, res) {
|
||||
if (req.session.userName) {
|
||||
reserveJSON[req.session.userName] = true
|
||||
fs.writeFileSync('./reserve/filter.json', JSON.stringify(reserveJSON, false, 4))
|
||||
fs.writeFileSync(filterPath, JSON.stringify(reserveJSON, false, 4))
|
||||
res.send('1')
|
||||
} else {
|
||||
res.send('0')
|
||||
@@ -1428,7 +1449,7 @@ var mixioServer = function() {
|
||||
app.get('/stopHook', function(req, res) {
|
||||
if (req.session.userName) {
|
||||
reserveJSON[req.session.userName] = false
|
||||
fs.writeFileSync('./reserve/filter.json', JSON.stringify(reserveJSON, false, 4))
|
||||
fs.writeFileSync(filterPath, JSON.stringify(reserveJSON, false, 4))
|
||||
res.send('1')
|
||||
} else {
|
||||
res.send('0')
|
||||
@@ -1482,13 +1503,20 @@ var mixioServer = function() {
|
||||
|
||||
app.use('/documentation', express.static(path.join(__dirname, 'documentation')));
|
||||
|
||||
|
||||
if(fs.existsSync('./mixly')){
|
||||
app.use('/mixly', express.static(path.join(__dirname, 'mixly')));
|
||||
var mixlyPath = "./mixly"
|
||||
if(!fs.existsSync(mixlyPath)) {
|
||||
mixlyPath = path.join(__dirname,'./mixly')
|
||||
}
|
||||
if(fs.existsSync(mixlyPath)){
|
||||
app.use('/mixly', express.static(mixlyPath));
|
||||
}
|
||||
|
||||
var dbPath = "./mixio.db"
|
||||
if(!fs.existsSync(dbPath)) {
|
||||
dbPath = path.join(__dirname,'./mixio.db')
|
||||
}
|
||||
db = new sqlite3.Database(
|
||||
'./mixio.db',
|
||||
dbPath,
|
||||
sqlite3.OPEN_READWRITE,
|
||||
function(err) {
|
||||
if (err) {
|
||||
@@ -1501,9 +1529,13 @@ var mixioServer = function() {
|
||||
|
||||
reserveDBs = []
|
||||
for (var i = 1; i <= 8; i = i + 1) {
|
||||
var dbPath = "./reserve/" + i + ".db"
|
||||
if(!fs.existsSync(dbPath)) {
|
||||
dbPath = path.join(__dirname,'./reserve/' + i + ".db")
|
||||
}
|
||||
reserveDBs.push(
|
||||
new sqlite3.Database(
|
||||
'./reserve/' + i + ".db",
|
||||
dbPath,
|
||||
sqlite3.OPEN_READWRITE,
|
||||
function(err) {
|
||||
if (err)
|
||||
@@ -1512,8 +1544,7 @@ var mixioServer = function() {
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
var reserveJSON = JSON.parse(fs.readFileSync('./reserve/filter.json'), "utf8")
|
||||
var reserveJSON = JSON.parse(fs.readFileSync(filterPath), "utf8")
|
||||
|
||||
|
||||
return new Promise(resolve => {
|
||||
|
||||
BIN
src/mixly/board/ThirdParty/common/media/1x1.gif
vendored
|
Before Width: | Height: | Size: 43 B |
@@ -1,9 +0,0 @@
|
||||
.blocklyTable {
|
||||
vertical-align: top;
|
||||
}
|
||||
.blocklyTree .blocklyActiveDescendant > label,
|
||||
.blocklyTree .blocklyActiveDescendant > div > label,
|
||||
.blocklyActiveDescendant > button,
|
||||
.blocklyActiveDescendant > input {
|
||||
outline: 2px dotted #00f;
|
||||
}
|
||||
BIN
src/mixly/board/ThirdParty/common/media/ban.png
vendored
|
Before Width: | Height: | Size: 6.1 KiB |
BIN
src/mixly/board/ThirdParty/common/media/blocks.png
vendored
|
Before Width: | Height: | Size: 207 KiB |
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 4.6 KiB |
|
Before Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 106 KiB |
|
Before Width: | Height: | Size: 330 KiB |
|
Before Width: | Height: | Size: 561 KiB |
|
Before Width: | Height: | Size: 298 KiB |
|
Before Width: | Height: | Size: 444 KiB |
|
Before Width: | Height: | Size: 45 KiB |
|
Before Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 528 KiB |
|
Before Width: | Height: | Size: 606 KiB |
|
Before Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 94 KiB |
|
Before Width: | Height: | Size: 487 KiB |
|
Before Width: | Height: | Size: 142 KiB |
|
Before Width: | Height: | Size: 676 KiB |
|
Before Width: | Height: | Size: 138 KiB |
|
Before Width: | Height: | Size: 173 KiB |
|
Before Width: | Height: | Size: 97 KiB |
|
Before Width: | Height: | Size: 138 KiB |
|
Before Width: | Height: | Size: 561 KiB |
|
Before Width: | Height: | Size: 811 KiB |
|
Before Width: | Height: | Size: 350 KiB |
|
Before Width: | Height: | Size: 236 KiB |
|
Before Width: | Height: | Size: 599 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
BIN
src/mixly/board/ThirdParty/common/media/click.mp3
vendored
BIN
src/mixly/board/ThirdParty/common/media/click.ogg
vendored
BIN
src/mixly/board/ThirdParty/common/media/click.wav
vendored
BIN
src/mixly/board/ThirdParty/common/media/config.png
vendored
|
Before Width: | Height: | Size: 27 KiB |
BIN
src/mixly/board/ThirdParty/common/media/delete.mp3
vendored
BIN
src/mixly/board/ThirdParty/common/media/delete.ogg
vendored
BIN
src/mixly/board/ThirdParty/common/media/delete.wav
vendored
|
Before Width: | Height: | Size: 326 B |
|
Before Width: | Height: | Size: 766 B |
BIN
src/mixly/board/ThirdParty/common/media/handopen.cur
vendored
|
Before Width: | Height: | Size: 198 B |
BIN
src/mixly/board/ThirdParty/common/media/help.png
vendored
|
Before Width: | Height: | Size: 16 KiB |
BIN
src/mixly/board/ThirdParty/common/media/help1.png
vendored
|
Before Width: | Height: | Size: 16 KiB |
BIN
src/mixly/board/ThirdParty/common/media/help2.png
vendored
|
Before Width: | Height: | Size: 16 KiB |
BIN
src/mixly/board/ThirdParty/common/media/loading.gif
vendored
|
Before Width: | Height: | Size: 5.4 KiB |
@@ -1,11 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 14 32 18" width="32" height="4" fill="#f20" preserveAspectRatio="none">
|
||||
<path opacity="0.8" transform="translate(0 0)" d="M2 14 V18 H6 V14z">
|
||||
<animateTransform attributeName="transform" type="translate" values="0 0; 24 0; 0 0" dur="2s" begin="0" repeatCount="indefinite" keySplines="0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8" calcMode="spline" />
|
||||
</path>
|
||||
<path opacity="0.5" transform="translate(0 0)" d="M0 14 V18 H8 V14z">
|
||||
<animateTransform attributeName="transform" type="translate" values="0 0; 24 0; 0 0" dur="2s" begin="0.1s" repeatCount="indefinite" keySplines="0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8" calcMode="spline" />
|
||||
</path>
|
||||
<path opacity="0.25" transform="translate(0 0)" d="M0 14 V18 H8 V14z">
|
||||
<animateTransform attributeName="transform" type="translate" values="0 0; 24 0; 0 0" dur="2s" begin="0.2s" repeatCount="indefinite" keySplines="0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8" calcMode="spline" />
|
||||
</path>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 980 B |
BIN
src/mixly/board/ThirdParty/common/media/logo.png
vendored
|
Before Width: | Height: | Size: 874 B |
|
Before Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 15 KiB |
BIN
src/mixly/board/ThirdParty/common/media/mark/act.png
vendored
|
Before Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 954 B |
|
Before Width: | Height: | Size: 1.2 KiB |
BIN
src/mixly/board/ThirdParty/common/media/mark/ai.png
vendored
|
Before Width: | Height: | Size: 16 KiB |
BIN
src/mixly/board/ThirdParty/common/media/mark/ai2.png
vendored
|
Before Width: | Height: | Size: 15 KiB |
BIN
src/mixly/board/ThirdParty/common/media/mark/av.png
vendored
|
Before Width: | Height: | Size: 576 B |
BIN
src/mixly/board/ThirdParty/common/media/mark/av2.png
vendored
|
Before Width: | Height: | Size: 513 B |
|
Before Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 946 B |
|
Before Width: | Height: | Size: 729 B |
|
Before Width: | Height: | Size: 465 B |
|
Before Width: | Height: | Size: 389 B |
|
Before Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 18 KiB |
BIN
src/mixly/board/ThirdParty/common/media/mark/cv.png
vendored
|
Before Width: | Height: | Size: 1.2 KiB |
BIN
src/mixly/board/ThirdParty/common/media/mark/cv2.png
vendored
|
Before Width: | Height: | Size: 948 B |
|
Before Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 15 KiB |