toques finais
Deploy / Deploy (push) Successful in 2m14s
Details
Deploy / Deploy (push) Successful in 2m14s
Details
This commit is contained in:
parent
357eeb937b
commit
e8ab0b8f42
|
|
@ -247,7 +247,7 @@ const io = new Server(httpsServer, {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log("Backend V6 (Logs Dinâmicos) iniciado. Aguardando conexões...");
|
console.log("Servidor Backend do MMP-Search está no ar!");
|
||||||
|
|
||||||
// util de log das salas deste socket
|
// util de log das salas deste socket
|
||||||
function logMyRooms(socket, prefix = "SALAS") {
|
function logMyRooms(socket, prefix = "SALAS") {
|
||||||
|
|
@ -638,7 +638,6 @@ app.use(express.json({ limit: "250mb" }));
|
||||||
app.use((req, res, next) => {
|
app.use((req, res, next) => {
|
||||||
const origin = req.headers.origin;
|
const origin = req.headers.origin;
|
||||||
|
|
||||||
// ajuste se você usa outros hosts no dev
|
|
||||||
const allowed = new Set([
|
const allowed = new Set([
|
||||||
"https://alice.ufsj.edu.br",
|
"https://alice.ufsj.edu.br",
|
||||||
]);
|
]);
|
||||||
|
|
@ -659,7 +658,7 @@ const LMMS_BIN = process.env.LMMS_BIN || "lmms";
|
||||||
const LMMS_TIMEOUT_MS = Number(process.env.LMMS_TIMEOUT_MS || 5 * 60 * 1000);
|
const LMMS_TIMEOUT_MS = Number(process.env.LMMS_TIMEOUT_MS || 5 * 60 * 1000);
|
||||||
|
|
||||||
function buildLmmsCommand(inputMmp, outputAudio, ext) {
|
function buildLmmsCommand(inputMmp, outputAudio, ext) {
|
||||||
// ✅ igual ao Python: -r input -o output -f ext
|
// igual ao Python: -r input -o output -f ext
|
||||||
const lmmsArgs = ["-r", inputMmp, "-o", outputAudio, "-f", ext];
|
const lmmsArgs = ["-r", inputMmp, "-o", outputAudio, "-f", ext];
|
||||||
|
|
||||||
// Só usa xvfb se você pedir explicitamente
|
// Só usa xvfb se você pedir explicitamente
|
||||||
|
|
@ -772,7 +771,7 @@ app.post("/render", async (req, res) => {
|
||||||
let inputMmpPath = null;
|
let inputMmpPath = null;
|
||||||
let cwdForLmms = tmpDir;
|
let cwdForLmms = tmpDir;
|
||||||
|
|
||||||
// ✅ caminho novo: veio pacote (mmpz/zip) com samples/
|
// caminho novo: veio pacote (mmpz/zip) com samples/
|
||||||
if (mmpzBase64 && String(mmpzBase64).trim().length > 0) {
|
if (mmpzBase64 && String(mmpzBase64).trim().length > 0) {
|
||||||
const safeName = sanitizeFileName(mmpzName || "project.mmpz");
|
const safeName = sanitizeFileName(mmpzName || "project.mmpz");
|
||||||
const zipPath = path.join(tmpDir, safeName);
|
const zipPath = path.join(tmpDir, safeName);
|
||||||
|
|
@ -783,7 +782,7 @@ app.post("/render", async (req, res) => {
|
||||||
inputMmpPath = await findFirstMmp(tmpDir);
|
inputMmpPath = await findFirstMmp(tmpDir);
|
||||||
if (!inputMmpPath) throw new Error("nenhum .mmp encontrado após extrair o pacote");
|
if (!inputMmpPath) throw new Error("nenhum .mmp encontrado após extrair o pacote");
|
||||||
|
|
||||||
cwdForLmms = path.dirname(inputMmpPath); // 🔥 isso faz o LMMS resolver samples/...
|
cwdForLmms = path.dirname(inputMmpPath); // isso faz o LMMS resolver samples/...
|
||||||
} else {
|
} else {
|
||||||
// fallback antigo: xml puro (patterns ok, samples não)
|
// fallback antigo: xml puro (patterns ok, samples não)
|
||||||
let projectXml = null;
|
let projectXml = null;
|
||||||
|
|
@ -828,7 +827,7 @@ app.post("/notify-update", express.json(), (req, res) => {
|
||||||
|
|
||||||
if (updateType === "samples") {
|
if (updateType === "samples") {
|
||||||
// 1. Emitir o evento para TODAS as salas/clientes.
|
// 1. Emitir o evento para TODAS as salas/clientes.
|
||||||
// O evento deve ser algo que seu ui.js entenda.
|
// O evento deve ser algo que ui.js entenda.
|
||||||
io.emit("system_update", {
|
io.emit("system_update", {
|
||||||
type: "RELOAD_SAMPLES",
|
type: "RELOAD_SAMPLES",
|
||||||
message: "Novo Sample/Project adicionado. Recarregando o navegador de arquivos...",
|
message: "Novo Sample/Project adicionado. Recarregando o navegador de arquivos...",
|
||||||
|
|
@ -845,11 +844,11 @@ app.post("/notify-update", express.json(), (req, res) => {
|
||||||
|
|
||||||
app.get("/", (req, res) => {
|
app.get("/", (req, res) => {
|
||||||
res.send(
|
res.send(
|
||||||
"Servidor Backend V6 (Logs Dinâmicos) da DAW colaborativa está no ar!"
|
"Servidor Backend do MMP-Search está no ar novamente!"
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
// ====== START ======
|
// ====== START ======
|
||||||
httpsServer.listen(PORT, () => {
|
httpsServer.listen(PORT, () => {
|
||||||
console.log(`Servidor escutando na porta https://localhost:${PORT}`);
|
console.log(`Servidor escutando na porta ${PORT}`);
|
||||||
});
|
});
|
||||||
Loading…
Reference in New Issue