gofterdom Posted 10 hours ago Author Posted 10 hours ago No I want to learn ! But I thought you wanted me to rewrite my project in Python and felt overwhelmed lol I'm on it now ! Quote
gofterdom Posted 10 hours ago Author Posted 10 hours ago By the way this will feel like the smallest step for you, but the html/js part of the website actually works now on heliohost ! even if the server doesn't Quote
gofterdom Posted 9 hours ago Author Posted 9 hours ago (edited) Ok so : I've followed all the steps to start and stop the bot, but i've replaced the .py bot by server.js (my server script, placed in root directory). I've added the same permissions. Is that what was expected ? Unfortunately citadel.helioho.st/bot_control/ only shows : Cannot GET /bot_control/ i've also tried the full adress : console error : bot_control/:1 GET https://citadel.helioho.st/httpdocs/bot_control/ 404 (Not Found) The tutorial said to check the bot logs but i cannot find them in the bot_control dir. There are logs in the log dir, but i don't know which ones are the bot one. Am I on a wrong track ? Edited 9 hours ago by gofterdom Quote
gofterdom Posted 6 hours ago Author Posted 6 hours ago Ok i managed to find it by going directyly to https://citadel.helioho.st/bot_control/index.sh but now it's giving me errors, that seems like it's expecting a python document and not a js document, the comments are not read as comment... server.js is not running. Start - Check Load Logs: Clear Logs - Full Logs [2025-06-27 12:22:07] Starting server.js. File "/home/citadel.helioho.st/server.js", line 321 // Only add tiles that don't already exist at those coordinates ^ SyntaxError: unterminated string literal (detected at line 321) [2025-06-27 12:22:11] Starting server.js. File "/home/citadel.helioho.st/server.js", line 321 // Only add tiles that don't already exist at those coordinates ^ SyntaxError: unterminated string literal (detected at line 321) Quote
gofterdom Posted 4 hours ago Author Posted 4 hours ago I THINK i managed to adapt the bash script to start the node.js server.js script using passenger, but it feels like there is not much i can do now, since ports are not open to me... I don't know how to stop the node using passenger though. Can you please help me with the next steps ? server.js is not running. Start - Check Load Logs: Clear Logs - Full Logs [2025-06-27 13:38:48] Restarting server.js. [2025-06-27 13:39:22] Restarting server.js. [2025-06-27 13:39:27] Restarting server.js. [2025-06-27 13:42:32] Restarting server.js. #!/bin/bash # edit this to match your bot filename bot_name="server.js" ################################################################### printf 'Content-Type: text/html\n\n' username=`whoami` pwd=`printenv|grep '^PWD'|cut -f2 -d'='` main_domain=`echo "$pwd"|cut -f3 -d'/'` control=`echo "$pwd"|cut -f5 -d'/'` temp=`ps axo user:16,pid,pcpu,pmem,vsz,rss,tty,stat,start,time,command|grep -v grep|grep "^$username "` running=`echo "$temp"|grep -c "$bot_name"` file_base=`echo $bot_name|tr -cd "a-zA-Z0-9"` log_name="$file_base.txt" if [ "$QUERY_STRING" == "" ]; then if [ $running -ne 0 ]; then mem_kb=`echo "$temp"|grep "$bot_name"|awk '{print $6}'` mem_mb=$( echo "scale=2;$mem_kb/1024"|bc ) mem_24=$( echo "scale=2;$mem_kb*1440/1048576"|bc ) echo "$bot_name is running. <a href='?action=stop'>Stop</a><br>Current memory usage: $mem_mb MB<br>Estimated 24 hour usage: $mem_24 GB - " else echo "$bot_name is not running. <a href='?action=start'>Start</a> - " fi echo "<a href='https://heliohost.org/dashboard/load/' target='_blank'>Check Load</a><br><br>Logs: <a href='?action=clear'>Clear Logs</a> - <a href='/$control/$log_name'>Full Logs</a><pre>" tail -30 $pwd/$log_name echo "</pre><script>reloading = setTimeout('window.location.reload();', 10000);</script>" fi ts=`date +"%Y-%m-%d %H:%M:%S"` if [ "$QUERY_STRING" == "action=stop" ]; then echo "[$ts] Stop action requested for $bot_name." >> $pwd/$log_name echo "Stop action triggered. You must handle graceful shutdown inside your app.<br>" echo "<script>setInterval(\"window.location.replace('/$control/');\", 2000);</script>" fi if [ "$QUERY_STRING" == "action=start" ]; then echo "[$ts] Restarting $bot_name." >> $pwd/$log_name touch "$pwd/../tmp/restart.txt" echo "Restart triggered for $bot_name.<script>window.location.replace('/$control/');</script>" fi if [ "$QUERY_STRING" == "action=clear" ]; then cat /dev/null > $pwd/$log_name echo "Clearing logs...<script>window.location.replace('/$control/');</script>" fi exit 0 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.