Remove OTT log highlighter
This commit is contained in:
@@ -7,7 +7,7 @@
|
|||||||
"contactEmail": "contact@ente.io",
|
"contactEmail": "contact@ente.io",
|
||||||
"tagline": "Open Source End-to-End Encrypted Photos & Authentication",
|
"tagline": "Open Source End-to-End Encrypted Photos & Authentication",
|
||||||
"upstreamVersion": "1.0.0",
|
"upstreamVersion": "1.0.0",
|
||||||
"version": "0.1.121",
|
"version": "0.1.122",
|
||||||
"healthCheckPath": "/ping",
|
"healthCheckPath": "/ping",
|
||||||
"httpPort": 3080,
|
"httpPort": 3080,
|
||||||
"memoryLimit": 1073741824,
|
"memoryLimit": 1073741824,
|
||||||
|
39
start.sh
39
start.sh
@@ -463,34 +463,6 @@ for webapp in photos accounts auth cast; do
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# ===============================================
|
|
||||||
# Museum log highlighter (extract OTTs from logs)
|
|
||||||
# ===============================================
|
|
||||||
prepare_ott_highlighter() {
|
|
||||||
cat > "/app/data/ente/server/ott-log-highlight.js" << 'EOF'
|
|
||||||
const readline = require('readline');
|
|
||||||
const rl = readline.createInterface({ input: process.stdin });
|
|
||||||
|
|
||||||
const shouldHighlight = (line) => {
|
|
||||||
if (!line) return false;
|
|
||||||
const lower = line.toLowerCase();
|
|
||||||
if (lower.includes('added ott')) return true;
|
|
||||||
if (lower.includes('ott"') || lower.includes(' ott ')) return true;
|
|
||||||
return false;
|
|
||||||
};
|
|
||||||
|
|
||||||
rl.on('line', (line) => {
|
|
||||||
process.stdout.write(line + '\n');
|
|
||||||
if (shouldHighlight(line)) {
|
|
||||||
const trimmed = line.trim();
|
|
||||||
process.stdout.write('============================================================\n');
|
|
||||||
process.stdout.write(`HIGHLIGHT: ${trimmed}\n`);
|
|
||||||
process.stdout.write('============================================================\n');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
EOF
|
|
||||||
}
|
|
||||||
|
|
||||||
# ===============================================
|
# ===============================================
|
||||||
# Node.js Placeholder Server
|
# Node.js Placeholder Server
|
||||||
# ===============================================
|
# ===============================================
|
||||||
@@ -632,9 +604,7 @@ const apiHandlers = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const responsePayload = buildResponse(email);
|
const responsePayload = buildResponse(email);
|
||||||
log('============================================================');
|
log(`Verifying OTT ${ott} for ${email}`);
|
||||||
log(`HIGHLIGHT: Verifying OTT ${ott} for ${email}`);
|
|
||||||
log('============================================================');
|
|
||||||
|
|
||||||
res.writeHead(200, { 'Content-Type': 'application/json' });
|
res.writeHead(200, { 'Content-Type': 'application/json' });
|
||||||
res.end(JSON.stringify(responsePayload));
|
res.end(JSON.stringify(responsePayload));
|
||||||
@@ -721,9 +691,7 @@ const apiHandlers = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const ott = ('' + Math.floor(100000 + Math.random() * 900000)).slice(-6);
|
const ott = ('' + Math.floor(100000 + Math.random() * 900000)).slice(-6);
|
||||||
log('============================================================');
|
log(`Generated OTT ${ott} for ${email}`);
|
||||||
log(`HIGHLIGHT: Generated OTT ${ott} for ${email}`);
|
|
||||||
log('============================================================');
|
|
||||||
|
|
||||||
res.writeHead(200, { 'Content-Type': 'application/json' });
|
res.writeHead(200, { 'Content-Type': 'application/json' });
|
||||||
res.end(JSON.stringify({ success: true, ott, email }));
|
res.end(JSON.stringify({ success: true, ott, email }));
|
||||||
@@ -895,10 +863,9 @@ if [ "$USE_PLACEHOLDER" = true ]; then
|
|||||||
create_nodejs_placeholder
|
create_nodejs_placeholder
|
||||||
else
|
else
|
||||||
log "INFO" "Starting actual Museum server"
|
log "INFO" "Starting actual Museum server"
|
||||||
prepare_ott_highlighter
|
|
||||||
cd /app/data/ente/server
|
cd /app/data/ente/server
|
||||||
export ENVIRONMENT="${MUSEUM_ENVIRONMENT:-local}"
|
export ENVIRONMENT="${MUSEUM_ENVIRONMENT:-local}"
|
||||||
stdbuf -oL "$MUSEUM_BIN" 2>&1 | node ott-log-highlight.js | tee -a "$MUSEUM_LOG" &
|
stdbuf -oL "$MUSEUM_BIN" 2>&1 | tee -a "$MUSEUM_LOG" &
|
||||||
MUSEUM_PID=$!
|
MUSEUM_PID=$!
|
||||||
log "INFO" "Started Museum server (pipeline PID: $MUSEUM_PID)"
|
log "INFO" "Started Museum server (pipeline PID: $MUSEUM_PID)"
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user