Ocgineer

Members
  • Posts

    15
  • Joined

  • Last visited

Everything posted by Ocgineer

  1. with the updated rcon plugin you'll need to use quotes around the commands that contain spaces. timeout 1 rcon -a 192.168.20.5:25576 -p password "broadcast Saving..." else, AFAIK, it'll see the "Saving..." as a second RCON command.
  2. Ok good to know. And yes my shutdown script first announces shutdown in-game and then issues the save command about 10-15 seconds before shutdown if available via RCON so I'm good on that regard ๐Ÿ˜† I now can remove any "restart docker $name" from my restart scripts as that is not needed then ๐Ÿ˜„ I like to use a script to shutdown as I also let it create a fresh backup of the saved folder.
  3. Is this for all or most of your game docker containers or only Palworld? I actually have a few scripts to "gracefully" shutdown the server via rcon if the docker container is running, and then the container itself. But if it auto restarts and it is doing stuff again it could maybe cause issues if i then abruptly stop the container? If i needed to restart the game I've always used the docker restart command.
  4. You might want to update the description of rcon in the community apps as well, as it still states the old information regarding connecting. If not for the small warning under the change log I wouldn't have noticed the big change as i have plugins to auto update.
  5. Oh that is nifty, thought it had to be programmatically implemented but overriding is also a thing then! And yes all I wanted is to have the backups on a safe location, thanks!
  6. I have a user script running that check my total available ram every 2 minutes and when it goes below a threshold it initiates a shutdown via rcon ([updated] plugin) to announce in-game, shutdown, save, and then restarts the Docker container. It seems to work on my end for my users. It might not be pretty or can be done better, but I don't really have that much experience with Linux but it might help some people or give ideas ๐Ÿ˜… #!/bin/bash freemem=$(free -m | grep Mem | awk '{print $7}'); rconPalworld=$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' Palworld):25575; adminPassword=ADMINPASSWORD if [ $freemem -le 1200 ] then echo "CRITICAL: $freemem RESTARTING PALWORLD AND THE DOCKER CONTAINER" rcon -a $rconPalworld -p $adminPassword "Broadcast INITIATING_RESTART_IN_5_SECONDS!" sleep 1 rcon -a $rconPalworld -p $adminPassword "Broadcast INITIATING_RESTART_IN_4_SECONDS!" sleep 1 rcon -a $rconPalworld -p $adminPassword "Broadcast INITIATING_RESTART_IN_3_SECONDS!" sleep 1 rcon -a $rconPalworld -p $adminPassword "Broadcast INITIATING_RESTART_IN_2_SECONDS!" sleep 1 rcon -a $rconPalworld -p $adminPassword "Broadcast INITIATING_RESTART_IN_1_SECONDS!" sleep 1 rcon -a $rconPalworld -p $adminPassword "Shutdown 60 SERVER_SHUTDOWN_IN_60_SECONDS!" sleep 30 rcon -a $rconPalworld -p $adminPassword "Broadcast SERVER_SHUTDOWN_IN_30_SECONDS!" sleep 10 rcon -a $rconPalworld -p $adminPassword Save sleep 10 rcon -a $rconPalworld -p $adminPassword "Broadcast SERVER_SHUTDOWN_IN_10_SECONDS!" sleep 20 docker restart Palworld else echo "ALL OK: $freemem" fi
  7. For the backup feature on the Palworld Docker Container, is it possible to have the backups placed to another location? E.g. I have the gameservers installed to an unprotected nvme cache drive, where I have currently a user script running on a cron job that makes a backup of SaveGames to my appdata share which is on protected cache. If not, no worries then I'll keep using the user script, just curious if you have thought about these use cases.
  8. For those that try to use the KavitaEmail from the community apps there is an issue with the template where the 'key' of each environment variables is not set. So edit each variable and set the Key the same as the Name (e.g. Name: SMTP_HOST, Key: SMTP_HOST). Furthermore, if you are having Kavita and KavitaEmail on the same docker network (e.g. your reverse proxy network), simply set the Email Service Url in the Kavita settings to `http://kavitaemail:5003` (using the docker network domain name).
  9. Is it me or does the pihole-dot-doh container not download/install cloudflared anymore? After editing I got an error that it was unable to find cloudflared, which I resolved for now by manually downloading the latest cloudflared version and copying it to /usr/local/bin/cloudflared and chmod +x /usr/local/bin/cloudflared. or what others said here, use FlippinTurt's version.
  10. Glad that I still posted it my solution as it was already over a month old You might want to remove the hash check and roll with the downloaded installer, as you hard-coded the hash -of the current installer- in the script. If Composer ever got updated it won't match the hard-coded hash anymore and delete the installer. This is why I download the hash via wget and then compare it. Interesting that the script I use now didn't work for you, but I only modified it mainly to check the hash as I am not sure how to 'exit' if the hash was incorrect via the php part, or well, I could've ignored the hash check anyway. ๐Ÿ˜› Unless you forgot to use "composer require phpseclib/phpseclib:~2.0" as for me it installs into /bin as composer. I've updated my previous post adding the log file output, just for those that come after us to see the script in action.
  11. I have followed the tutorials, guides and videos multiple times but I am unable to figure out the following; I cannot access my other 'lan' devices, be it another PC with an SMB share or my Synology NAS via Share or WebGUI. I have access to my server and docker containers hosted on the Unraid Server however. I have set up the following on Unraid/Wireguard; Use NAT = No Use UPnP = Yes Host access to custom networks = enabled Local Network Pool = 10.253.0.0/24 Peer DNS = 1.1.1.1 Tried both Remote tunnled access and Remote Access to LAN In my Router (TP-LINK) I have set the following; Static Routing: dest-net 10.253.0.0 255.255.255.0 10.75.75.7 Enabled (Advanced Routing > Static Routing List) Port Forwarding: 51820 > 51820 on 10.75.75.7 (I know this should not be needed with UPnP, just to be sure) I have also tried; - With "Use NAT" = Yes and "Host access to custom networks" = disabled (static route optional) - With "Use NAT" = No and "Host access to custom networks" = disabled and static route Is there something I am totally overlooking as at this point I have no clue anymore. I tried different configs and double-checked stuff, assuming that "VMs and other systems on LAN - accessible!" also includes my other PC's and the Synology NAS?
  12. I think it was because SWAG was running and it locked the folder perhaps as well. But thank you for the information as well, I got this sorted out now as well I'm using the following startup script now to install Composer and then phpseclib, which works for me at the moment. It will install Composer to the bin directory as 'composer' so it can be used as `composer require phpseclib/phpseclib:~2.0` directly. #!/bin/sh # Check if Composer is installed. #if [ -f composer.phar ]; then if [ -f /usr/local/bin/composer ]; then echo "Composer is already installed." exit 0 fi # Get both latest Composer version and its hashfile. wget "https://getcomposer.org/installer" -O "composer-setup.php" wget "https://composer.github.io/installer.sha384sum" # Compare downloaded hash with the Composer Installer. if sha384sum -c installer.sha384sum then echo "Installing Composer..." #php composer-setup.php php composer-setup.php --install-dir=/usr/local/bin --filename=composer echo "Installing PHPSecLib v2 via Composer..." #php composer.phar require phpseclib/phpseclib:~2.0 composer require phpseclib/phpseclib:~2.0 else echo "Composer was not installed, SHA384 mismatch." fi # Cleanup files rm -f installer.sha384sum rm -f composer-setup.php Log file of initial load; [custom-init] install-phpseclib.sh: executing... Connecting to getcomposer.org (54.36.53.46:443) saving to 'composer-setup.php' composer-setup.php 100% |********************************| 57721 0:00:00 ETA 'composer-setup.php' saved Connecting to composer.github.io (185.199.108.153:443) saving to 'installer.sha384sum' installer.sha384sum 100% |********************************| 117 0:00:00 ETA 'installer.sha384sum' saved composer-setup.php: OK Installing Composer... All settings correct for using Composer Downloading... Composer (version 2.1.11) successfully installed to: /usr/local/bin/composer Use it: php /usr/local/bin/composer Installing PHPSecLib v2 via Composer... ./composer.json has been created Running composer update phpseclib/phpseclib Loading composer repositories with package information Updating dependencies Lock file operations: 1 install, 0 updates, 0 removals - Locking phpseclib/phpseclib (2.0.34) Writing lock file Installing dependencies from lock file (including require-dev) Package operations: 1 install, 0 updates, 0 removals - Downloading phpseclib/phpseclib (2.0.34) - Installing phpseclib/phpseclib (2.0.34): Extracting archive 1 package suggestions were added by new dependencies, use `composer suggest` to see details. Generating autoload files 1 package you are using is looking for funding. Use the `composer fund` command to find out more! [custom-init] install-phpseclib.sh: exited 0
  13. Ok, that is some nice info, at least better than creating a custom package/mod what is described on the linuxserver info website. I was unable to get permission to drop/edit files in the custom-cont-init.d directory via SMB so I had to mess around with VI, god that is... something lol. #! /bin/sh # Check if Composer is installed, assuming phpseclib as well then. if [ -f /composer.phar ]; then echo "Composer is already installed." exit 0 fi # Get both latest Composer version and its hashfile. php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" wget "https://composer.github.io/installer.sha384sum" # Compare downloaded hash with the Composer Installer. if sha384sum -c installer.sha384sum then echo "Installing Composer and phpseclib" php composer-setup.php --install-dir=/ php /composer.phar require phpseclib/phpseclib:~2.0 else echo "Composer was not installed, SHA384 mismatch" fi # Cleanup files rm -f installer.sha384sum php -r "unlink('composer-setup.php');" At least at restart it detects that Composer is already is installed so at least that works. I also feel like I can just use wget as well for the Composer installer and rm instead of using those PHP commands ๐Ÿค”
  14. I just followed the command line installation instructions on the composer website, that I linked, as it can change with version due to the hash check. It looks like it was installed directly in the root of the docker? "Successfully installed to: //composer.phar". I found a comment on some other forum using; php composer-setup.php --install-dir=/usr/local/bin --filename=composer But on the composer website, it used 'mv' instead after installation, I did neither of them as I only needed it to install phpseclib. When trying to get things to work I saw composer recommend to install 'libsodium-php' which I installed via 'molly/polyfill-libsodium', but no idea if this was necessary. As I stated in my first post I am pretty new to Linux and command line in general so I was just going around trying to get it to work. Also, I think updating SWAG actually removed composer and the vendor folder, not sure if this is normal for a docker container, so I had to re-install it today. After installation, however, my PHP script worked again without further actions to do.
  15. I am new to UnRaid and NGNIX, or just Linux in general but I wanted to start/stop docker containers via web-portal using ssh thus using phpseclib and managed to get it to work after some good ol' trial-and-error. I am just leaving this here incase someone else searches for this, as I stumbled across this post initially and it didn't had an answer yet. First Install Composer to SWAG; - Open the Console of the SWAG docker container. - Follow the Command-line Installation instructions from https://getcomposer.org/download/. While having the docker console open, install phpseclib (I used version 2) with the following command; php composer.phar require phpseclib/phpseclib:~2.0 And just to be sure I restarted the SWAG container after this. In my PHP script that runs in SWAG I could now successfully use SSH from phpseclib; <?php require('/vendor/autoload.php'); use phpseclib\Net\SSH2; $ssh = new SSH2('www.domain.tld or ipaddress'); if (!$ssh->login('username', 'password')) { exit('Login Failed'); } echo $ssh->exec('docker start dockername'); ?> You can create this as a helper php file to outside the www root folder and then require/include in your public facing script as it contains your SSH credentials, but then it is still risky I assume, but I am a total novice regarding security. Update; As pointed out by hernandito updating or changing the template will remove composer and the installed phpseclib. Creating a script in custom-cont-init.d can help with automatically installing composer and then phpseclib in those cases. See this post and the next post for mine and hernandito scripts as an example.