Jump to content

gofterdom

Members
  • Posts

    25
  • Joined

  • Last visited

gofterdom's Achievements

Apprentice

Apprentice (3/14)

  • Week One Done Rare
  • Dedicated Rare
  • Collaborator Rare
  • First Post Rare
  • Conversation Starter Rare

Recent Badges

1

Reputation

  1. @Krydos I didn't know that. I have been re-reading your messages and cannot find any mention of this anywhere : I did find this though : And I also did say : I said it was good enough, I Didn't insist on you to waste your time. The FAQ did say to open a customer ticket for this specific NGINX request, I didn't know I was supposed to understand everything at first try. I also mentionned I was very new to all of this, my first line of code was 1 month ago, sorry for not understanding node.js, ports and websockets right away. Also, it does work in the main citadel.helio.st domain, the files just need to be in 2 different folders, i'm sure there is a better way to do this, that is why I asked. Thank you for your help, won't take up more of your time
  2. @Krydos Would you please help me fix this last issue ? Now it works because i put all my files in double, once in the public folder, and once in httpsdoc folder If I only put them in one folder, i : - either get an error from server.js saying that it cannot find the file, in the bot control script. - or (if i choose the other folder), I get consoles errors from index.html saying that it cannot locate the files Both seem to be looking for the files at different locations. This wasn't the case before the websocket redirect. Could you guide me on how I could resolve this, in order to have my files in only one place ? In my local folder, the files are in the public folder
  3. Thank you ! However.. nothing works anymore 😄. This is the console error : GET https://citadel.helioho.st/styles.css net::ERR_ABORTED 404 (Not Found) index.html:7 GET https://citadel.helioho.st/game.js net::ERR_ABORTED 404 (Not Found) index.html:89 However, the game.js and css files have not moved, they are in the same public folder as index.html (which seems to be foudn and opened)... Is there a waiting period for the changes to fully take effect ? I'm sure there is a very simple reason but i can't find it
  4. Ok i managed to redirect from citadel to wss.citadel using .htaccess. If it's not possible to do otherwise, i guess it will be a good enough workaround for now. Thank you very much for all your help
  5. ok for the port. I wish I picked a less obvious one then. I'm not sure what you mean by "set up passenger" as my understanding was that it was automatically installed when we were using node.js, it wasn't a conscious choice from my side. My goal was to use https://citadel.helioho.st/ as the main website (it's the only domain i have created). Right now i can access it, and the html works, but the consol says : network.js:3 WebSocket connection to 'wss://citadel.helioho.st/' failed: And it's not possible to play the game. However, I can acess https://wss.citadel.helioho.st/ and this one loads both the html and the websocket, allowing the game to be played. Is that expected behaviour ? If so, is there a way for me to redirect traffic from https://citadel.helioho.st/ to https://wss.citadel.helioho.st/, so I can use the more elegant website name as an entry point for visitors ?
  6. Indeed it's now working on https://wss.citadel.helioho.st/ ! Thank you !! However https://citadel.helioho.st/ had a nicer ring to it 😄, i'm guessing it's not possible to use this domain instead, because of the websockets issue ? (swap https://citadel.helioho.st/ and https://wss.citadel.helioho.st/ ?) I'm down for trying to move the files myself, but don't want to break anything in the process, as I haven't understood completely how it got solved. Also, I've used the 8080 port randomly, since 3000 was taken. Is it smart to have used this one, and not a more obscure/random one ? Does it make a difference ? (since you said "There are 65535 internal ports, and only a handful are in use by other users") Thanks again
  7. Ok, https://control.citadel.helioho.st/ works now, and the server is running : server.js is running. Stop Current memory usage: 64.07 MB Estimated 24 hour usage: 90.10 GB - Check Load Logs: Clear Logs - Full Logs [2025-06-27 22:06:54] Starting server.js. SERVER STARTED AND RUNNING Server running on port 8080 [2025-06-28 08:26:41] Starting server.js. SERVER STARTED AND RUNNING Server running on port 8080 However, the websocketsin the game itself seem to be still be blocked : network.js:3 WebSocket connection to 'wss://citadel.helioho.st/' failed: setupWebSocket @ network.js:3 (anonymous) @ game.js:39 Is there something i should do in wss.citadel.helioho.st ?
  8. Thanks a lot ! I have moved the files. I am going to bed now but will carry on first thing tomorrow
  9. I am unsure if there is something else I can do from my side ? You said : we need to either add another subdomain to access /bot_control/ or you'll need to disable Passenger. I am down for either, but as I mentioned, I am lost. Is there a tutorial I can follow for any one of these options ? I'll be glad to stop bothering you, I just don't know what i'm supposed to do next
  10. I thought the whole point was that no port was available ;( that's why i didn't try further I switched to 8080 and it works now indeed : server.js is running. Stop Current memory usage: 62.12 MB Estimated 24 hour usage: 87.36 GB - Check Load However on the main game itself : network.js:3 WebSocket connection to 'wss://citadel.helioho.st/' failed: setupWebSocket @ network.js:3 (anonymous) @ game.js:39 Is that where nginx/apache are needed ? I've been able to stop the script as well server.js is not running. Start - Check Load Logs: Clear Logs - Full Logs [2025-06-27 21:48:01] Stop action requested for server.js. [2025-06-27 21:48:38] Stop action requested for server.js. [2025-06-27 21:50:19] Stop action requested for server.js. [2025-06-27 21:52:03] Stopping server.js.
  11. thank you, it seems to work ! now i'm blocked by the port issue we discussed, but i'm guessing that's expected ? Only need the apache/nginx redirect that was mentioned in the FAQ ? Or am i forgetting something [2025-06-27 19:35:41] Starting server.js. SERVER STARTED AND RUNNING node:events:496 throw er; // Unhandled 'error' event ^ Error: listen EADDRINUSE: address already in use :::3000 at Server.setupListenHandle [as _listen2] (node:net:1940:16) at listenInCluster (node:net:1997:12) at Server.listen (node:net:2102:7) at Object. (/home/citadel.helioho.st/server.js:548:8) at Module._compile (node:internal/modules/cjs/loader:1730:14) at Object..js (node:internal/modules/cjs/loader:1895:10) at Module.load (node:internal/modules/cjs/loader:1465:32) at Function._load (node:internal/modules/cjs/loader:1282:12) at TracingChannel.traceSync (node:diagnostics_channel:322:14) at wrapModuleLoad (node:internal/modules/cjs/loader:235:24) Emitted 'error' event on WebSocketServer instance at: at Server.emit (node:events:518:28) at emitErrorNT (node:net:1976:8) at process.processTicksAndRejections (node:internal/process/task_queues:90:21) { code: 'EADDRINUSE', errno: -98, syscall: 'listen', address: '::', port: 3000 } Node.js v22.17.0
  12. I have not been able to start and stop the websocket from the /bot_control/index.sh script, it is looking for the node install folder and i don't know where to indicate it. it is looking in /usr/local/bin/node, but not finding it Could you please tell me what i need to change in that bash script to make it work with node.js ? In its initial state, it seemed to be looking for a python file only apologies for taking your time, i have been trying all day
  13. 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
  14. 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)
  15. 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 ?
×
×
  • Create New...