gleason
-
Posts
33 -
Joined
-
Last visited
Posts posted by gleason
-
-
If I supply certificates can you active SSL connection to postgres on tommy? Or can I only do this on my VPS if I host a postgres db? (trying to avoid putting one on my vps)
-
Is Postgres down on Tommy? I cannot use phpPgAdmin to get to the database, "Login Failed" coming from cpanel.
-
User is mule_wolfpack
-
tommy.heliohost.org
username: mule
if needed db: mule_wp13
hello can I please request remote access to the postgres db.
-
Recently bought a 12months VPS (vps34), do I still need to login to my webhosting monthly (mule) for it to stay active?
-
Awesome will do. Only let me do 6 months in the registration just FYI, sending shortly.
-
So this will probably end up being the same as when I donated to transfer to Tommy, evidently my program doesn't provide enough tx info. So the owner of the wallet will need to check. And I'll be doing a year worth so shouldn't be too annoying for you fellows. is 12 months the 10% discount like the 6 months being $43.20 or is that open to discussion?
Also, will I be able to keep my hosting on Tommy? -
Can I pay for a VPS with Bitcoin? I noticed you can pay via GoFundMe donation, I would imagine it may be okay/similar?
Thank you.
-
-
you use a python script to start and stop the bot
start.py in public_html/cgi-bin:#!/usr/bin/python3.7import os, subprocess, signalprint("Content-Type: text/html\n\n")counter = 0p = subprocess.Popen(['ps', '-u', 'mule'], stdout=subprocess.PIPE)# must match your username --------^^^^^^^^out, err = p.communicate()for line in out.splitlines():if 'node'.encode('utf-8') in line:# ^^^^^^^^^^^----- this has to match the filename of your bot scriptcounter += 1print("Bot already running.")if counter == 0:subprocess.Popen("/usr/bin/node /home/mule/node/index.js", shell=True)# ^^^^^^^^-- be sure to update it to your usernameprint("Bot started!")and stop.py in same location:
#!/usr/bin/python3.7import os, subprocess, signalprint("Content-Type: text/html\n\n")counter = 0p = subprocess.Popen(['ps', '-u', 'mule'], stdout=subprocess.PIPE)# must match your username --------^^^^^^^^out, err = p.communicate()for line in out.splitlines():if 'node'.encode('utf-8') in line:# ^^^^^^^--- this has to match the filename of your loopcounter += 1pid = int(line.split(None, 1)[0])print("Stopping bot.")os.kill(pid, signal.SIGTERM)if counter == 0:print("Already stopped.") -
Thanks
Here is the output of your bot:
MySQL has been connected! [ RowDataPacket { guildID: '700047xxxxx0608151', setting: '.', value: null, createdAt: 2021-03-28T20:31:06.000Z, updatedAt: 2021-03-28T20:31:06.000Z }, RowDataPacket { guildID: '775927xxxxx5018378', setting: '.', value: null, createdAt: 2021-03-28T20:50:39.000Z, updatedAt: 2021-03-28T20:50:39.000Z } ] Aesir-Wolf-Pack#0694 is online!
I edited out some of the guildID in case that's private. Not sure.
Anyways, since your bot starts just fine, it's up to you from there to log errors yourself from inside the bot's code. Don't rely on console.log(), and definitely don't rely on python. The python just starts the node code, and then disconnects from it to let it run on its own. Just write the logs to a file. Log file permissions can be tricky sometimes for non-linux people. The way I would do it is create an empty file that has write permissions on it and then have the bot append to that. If you have the bot try to create it's own files then you need to worry about directory permissions too, but if the file is already created it's less to figure out. -
Has anyone had any success logging node.js console.log to a file?
Was reading some other post about having to use home/username/logfile but coming up short
I did try home/mule/debug.log as well just for information
const fs = require('fs');var util = require('util');
var log_file = fs.createWriteStream(__dirname + 'home/mule/node/debug.log', {flags : 'w'});var log_stdout = process.stdout;console.log = function(d) { //log_file.write(util.format(d) + '\n');log_stdout.write(util.format(d) + '\n');};attempting to use this information to troubleshoot my code.
potentially better idea to modify start.py to log errors but no clue how to go about doing that.
-
Please close switched to MySQL.
You can actually close this yourself. Same for the other topic. Therr should be a link or buttom somewhere that says "Moderation Tools" an6s you can close it that way.
Untagging...
I do see text that says "Topic Moderation" but that just says "Lock" would that do the same thing?
-
Thank you. I would still appreciate the error logs.
-
Please close switched to MySQL.
-
Please close, switched to MySQL.
-
Have to change app.js to just node
-
I try to go to phpPgAdmin from cPanel and continuously get a login failed? I imagine I am doing something wrong?
-
Does anyone know where to view Node.js Errors? I tried under cpanel >> errors located under metrics. This doesn't seem to display anything (running a discord bot). I have noticed I can generate some feedback within the start.py "webpage" as in my app.js script I am running console.log commands, but when the script dies I don't have any logs that feedback to the start.py window or the Errors page. I have seen Krydos post logs on the forum before, do we have a page for those? Or if anyone familiar with a way for python to display these errors if (A) leave the start.py webpage up, or ( have a console.py script that watches for node crashes/or console crashes. Not positive how this would work in this use case, I would imagine watch console. But I would also imagine we don't have access to "console".
--GalaxyMule
-
So I ended up getting mine to work.
In username/node do you have app.js packages.json and node_modules folder?
You added node to application manager?
And you have start.py and stop.py in cgi-bin folder?
-
Thank you.
-
I feel like i should probably mention I am trying to run a discord bot located at public_html/ae13/app.js as the final goal. This is also tied to the remote postgre database access for some background information.
Issue, fixed node.js is running. Somehow the /node/ folder got deleted and I failed to realize it.
-
I followed the tutorial on the node.js application manager but I don't show it being installed. What do I do mule.heliohost.org/node
-
Hey Dam looks like I missed the initial node initialization process https://wiki.helionet.org/tutorials/node.js
New Partnership with Plesk
in News
Posted
I used bitcoin, worked really well for me.