hata

Members
  • Posts

    4
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

hata's Achievements

Noob

Noob (1/14)

0

Reputation

  1. I ended up fixing things today. I couldn’t login to my vault no matter what, guess the newer bitwarden clients are incompatible. So I added the vaultwarden container from the app repo (my old was was still named bitwarden for some reason) to my dockers. And just exported my old users vault as json and imported it in the new server under my user account. Everything seems fine so far. I didn’t have to do anything other than basic setup on the new container, just put in an admin token, put my hostname, setup email under the admin page, and sent myself an invite. Maybe there was more little things, can’t remember. And I’d like to just note that switching the tag to :latest didn’t work on my old container, not sure what the issue there was. Container still ran, just couldn’t login.
  2. I had to specify 1.24.0 to get my container working reliably again. I had to restart the container basically every 20 minutes otherwise I couldn't access / log in to my vault.
  3. I made this bash script to simplify consoling my running docker containers via SSH/terminal. Apologies if this is nothing new, I didn't find one prior to making this topic. I also used this method to keep the script persistent in my .bash_profile on Unraid The script: function conn() { docker exec -it "$1" bash -c "grep @$1 ~/.bashrc >/dev/null || echo \"export PS1='\[\033[01;32m\]\u@$1\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\\\\\$ '\" >> ~/.bashrc ; bash" ; } alias ds='dss' function dss() { cons=$(docker ps --format '{{.Names}}') if [ "$cons" ]; then declare -A dvar=() c=1 echo "Press a number to enter a container or 0 to exit" echo " [0] Exit" for i in $cons do echo " [$c] $i" dvar[$c]="$i" ((c=c+1)) done ((c=c-1)) echo "Input choice: " read input if [ "$input" == 0 ]; then return 0 elif [ "$input" -ge 1 ] && [ "$input" -le "$c" ]; then conn "${dvar[$input]}" else return 0 fi else echo "No running containers" fi } Here is some sample output root@Gensokyo:~# ds Press a number to enter a container or 0 to exit [0] Exit [1] quakejs [2] transmission [3] tubesync [4] Plex-Media-Server Input choice: 1 root@quakejs:/# exit root@Gensokyo:~# The conn() function will append a PS1 to the ~/.bashrc file, but only if it hasn't done so already / if the line isn't there. I have tested this on all my containers without issue. I don't know if there are any weird containers out there where this may not work. If you run into an issue with the PS1 setting you can just remove the entire 'bash -c ...' bit from conn() and put literally just the word "bash" instead (no quotes, though I suppose it may not matter). Any feedback or suggestions welcome, also keep in mind I'm extremely inexperienced in scripting. Here it is again with comments.
  4. Here is how to make quakejs work local and remote simultaneously. It's pretty quick and easy surprisingly. 1. Set up port forwarding. In my router I have public port 88 pointing towards quakejs docker IP with local port 80, and public port 27960 also pointing towards my quakejs docker IP with port 27960. The two ports here will correspond with the code below, you must use port 27960 for the game. I used public port 88 for actually accessing the game, but you can use anything you want except port 80. Port 80 may cause issues if your router's web interface is on port 80. 2. Edit your index.html Open the quakejs docker console Install a text editor of your choice apt update && apt install nano Open the index.html file nano /var/www/html/index.html At the end of the <script>, at the bottom of the file you will see how the game makes it's connection with "var args = [...]". I have added some code that determines if the game is being run locally or remotely. In my case, I have an afraid.org subdomain pointing towards my home IP. You will want to make your file look like mine, just with your domain or home IP instead of MYDOMAIN. I removed some of the comment lines so you will notice some lines starting with // are missing here, you don't need those. window.addEventListener('resize', resizeViewport); let locw = window.location.host // var for the web access IP+port, window.location.host returns the IP/domain+port from the address bar, such as "192.168.1.5:88" or "myquake.example.com:88" let locg = window.location.host // same as above except for the game port let regex = /:.*/ if (locg.includes("MYDOMAIN")) { locg = locg.replace(regex,"") } // replace MYDOMAIN with your domain (eg. myquake.example.com) or IP, do not remove the quotes. This modifies the var by removing the web access port. You do not need to make any further adjustments, the regex will handle whatever port you used without issue. var args = ['+set', 'fs_cdn', locw, '+connect', locg]; // this line has been modified to use the above variables args.push.apply(args, getQueryCommands()); ioq3.callMain(args); }; 3. Reload apache2 service apache2 reload 4. (Optional) Password protecting your game From the quakejs docker console Generate a username and password. The command will prompt you for a password after you run it. Replace USERNAME with a name of your choice. htpasswd -c /etc/apache2/.htpasswd USERNAME Enable .htaccess restrictions for /var/www/. This command just blindly modifies a specific line, I'm assuming you didn't make any major changes here yet so this should be fine. sed -i '172s/None/All/' /etc/apache2/apache2.conf (Alternatively, if you don't want to blindly edit the file, just open the file and go to the "<Directory /var/www/>" section and change "AllowOverride None" to "AllowOverride All".) Create the .htaccess file in /var/www/ echo -e 'AuthType Basic\nAuthName "Password Required"\nRequire valid-user\nAuthUserFile /etc/apache2/.htpasswd' > /var/www/.htaccess Restart apache service apache2 reload Done. Note: Certain maps are missing textures, seems like just a quakejs quirk as the official site has the same problem.