mirror of
https://github.com/c9fe/22120.git
synced 2024-08-18 07:09:45 +02:00
commit
9640c37615
22
global-run.cjs
Executable file
22
global-run.cjs
Executable file
@ -0,0 +1,22 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
const os = require('os');
|
||||||
|
const { spawn } = require('child_process');
|
||||||
|
const fs = require('fs');
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
|
if (!fs.existsSync(path.join(process.cwd(), 'node_modules'))) {
|
||||||
|
spawn('npm', ['i'], { stdio: 'inherit' });
|
||||||
|
}
|
||||||
|
|
||||||
|
// Getting the total system memory
|
||||||
|
const totalMemory = os.totalmem();
|
||||||
|
|
||||||
|
// Allocating 90% of the total memory
|
||||||
|
const memoryAllocation = Math.floor((totalMemory / (1024 * 1024)) * 0.8); // Converted bytes to MB and took 90% of it
|
||||||
|
|
||||||
|
console.log(`Index can use up to: ${memoryAllocation}MB RAM`);
|
||||||
|
|
||||||
|
// Running the application
|
||||||
|
spawn('node', [`--max-old-space-size=${memoryAllocation}`, path.resolve(__dirname, 'build', 'diskernet.cjs')], { stdio: 'inherit' });
|
||||||
|
|
4
package-lock.json
generated
4
package-lock.json
generated
@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "diskernet",
|
"name": "diskernet",
|
||||||
"version": "2.9.0",
|
"version": "3.0.6",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "diskernet",
|
"name": "diskernet",
|
||||||
"version": "2.9.0",
|
"version": "3.0.6",
|
||||||
"license": "PolyForm Strict 1.0",
|
"license": "PolyForm Strict 1.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@667/ps-list": "^1.1.3",
|
"@667/ps-list": "^1.1.3",
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "diskernet",
|
"name": "diskernet",
|
||||||
"version": "3.0.0",
|
"version": "3.0.6",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"description": "Library server and an archivist browser controller.",
|
"description": "Library server and an archivist browser controller.",
|
||||||
"main": "src/app.js",
|
"main": "src/app.js",
|
||||||
"module": "dist/diskernet.mjs",
|
"module": "dist/diskernet.mjs",
|
||||||
"bin": {
|
"bin": {
|
||||||
"diskernet": "build/diskernet.cjs"
|
"diskernet": "./global-run.cjs"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "node src/app.js",
|
"start": "node src/app.js",
|
||||||
|
17
scripts/download-entitlements.xml
Normal file
17
scripts/download-entitlements.xml
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>com.apple.security.network.server</key>
|
||||||
|
<true/>
|
||||||
|
<key>com.apple.security.cs.allow-jit</key>
|
||||||
|
<true/>
|
||||||
|
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
|
||||||
|
<true/>
|
||||||
|
<key>com.apple.security.cs.disable-library-validation</key>
|
||||||
|
<true/>
|
||||||
|
<key>com.apple.security.cs.disable-executable-page-protection</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user