Monday, August 28, 2023

Rootless Podman Privileged Port Binding

podman is a cool docker-replacement that is right at home on Linux. Among other cool party tricks, it is able to run containers (after some configuration) as a normal non-root user. This is good because a container breakout will not grant a root shell, but rather just a normal user shell (which you can further isolate to a "container-only" user). Great!

Just one problem - ye old "privileged ports", otherwise known as any port number below 1024 on Linux because trust and reasons. Thus, if you wanted to run things like nginx or AdGuardHome which bind to ports like 80 and 53, you have to run your container as root.

This is both not very nice for security, but also, limits you to things like network namespaces (as the root user podman will only know about the root user network namespaces) which is lame. Except for the one part where podman binds to privileged ports, a container like nginx or AdGuardHome can run entirely fine as non-root on the host machine.

You can do a fun little trick by running sudo sysctl net.ipv4.unprivileged_port_start and setting it to 0 which will remove protection from these ports < 1024, but this is also not great since that security does exist for a reason. But you can get the best of both worlds by running the dropping the port range, starting the container and binding the ports, and then resetting the port range back to the original 1024 in the background. I've just updated my container scripts to launch AdGuardHome and Cloudflared as a non-root user using this nice little trick.

It's brittle, since if the startup takes more than ~3 seconds, the port will protect again. I also haven't tested various scenarios in the no-worky path, but the happy path of container launches and services work is performing fine with this fun little shell workaround. Nerdy stuff.

Stay tuned!

========================
Follow pyamsoft around the Web for updates and announcements about the newest applications!
Like what I do?

Send me an email at: pyam.soft@gmail.com
Or find me online at: https://pyamsoft.blogspot.com

Follow my Facebook Page
Check out my code on GitHub
=========================

Friday, August 4, 2023

Tears of the Kingdom is a Good Game, but an OK Zelda

Tears of the Kingdom (TOTK) came out a few months back. I had played it semi-religiously for some 50 or 60 hours before beating the final boss for the first time and honestly, I haven't had the drive to pick it up since. TOTK is a great game, and I enjoyed almost every minute of my playthrough, but its not a great Zelda game - it's just a painful OK Zelda game.

First, let me just say that I played the snot out of Breath of the Wild (BOTW). I clocked 200 hours on the Wii U version when it first came out, beat it, bought a Nintendo Switch, clocked another 100 hours in the game again and beat it again. Then restarted in Master mode and clocked another 100 hours and beat it again. I have played and beaten the game across multiple hundreds of hours across multiple consoles and game modes. I loved BOTW.

I believe I can condense my problem with TOTK into 3 main issues. 1 - It's not Breath of the Wild. 2 - It is Breath of the Wild though if you look at it with your head tilted to the side. 3 - Its confused on where it fits with Breath of the Wild.

1. Tears of the Kingdom took six years to make. It was a labor of love crafted by hundreds of workers over thousands of hours of development - and for what? The new additions to map - the sky and the depths, are sadly empty feeling with little to do. Aside from the Great Sky Island that you start the game on, there is very little reason to explore the sky or depth areas except for the parts of the game which force you into sky dungeons or depth dungeons. Other than these main story requirements, your exploration rewards you with - Zonai part dispensers, Zonai construct mini-boss fights, or copy-pasted take-off platforms that come with 2 or 3 gliders, and maybe if you are lucky some rockets or flame emitters or fairies. There's nothing to do in the sky, and very little opportunity to explore given how sparse the sky platforms are. The sky's most valuable asset is that it is a high jumping-off point so that you can glide over to a point of interest on the ground.

The depths are more interesting than the sky, but your exploration is limited because of the Gloom, which stops you from progressing after you take enough hits that you have no more food to "repair" your hearts and are forced to leave the area. Yes if you discover a lightroot you can restore your lost hearts, but there is no reprieve if you want to re-explore an area that you have lit-up already but have not combed over yet. You are subtly punished for returning to explore an area again as you have no heal that can save you from the Gloom unless you pack a bunch of sundelions.


2. Even though I paid 70 dollars for it, the more I played it, the more I thought that it was just a "big DLC." For all the things they managed to add into the game as mechanics, they didn't actually take any development time to solve the problems the game had. Underneath it all it was still Breath of the Wild. Suffered the same problems that BOTW had, like weapon durability and menu mania, and buffets during combat and all that.

Puzzles in shrines were a big problem of mine in BOTW. Due to it's non-linear nature, you were never able to have puzzles that were introduced in shrine A and then expanded on in shrine B. The closest we got were things like the dueling peaks which had two "paired" shrines. But any puzzle or setup had to be one-and-done in the shrine itself, since there was no practical way to ensure that a player would have discovered shrine A before getting to shrine B - so you couldn't assume the player had been introduced to any game mechanics at any point ever. Every shrine could potentially be the player's first shrine, so puzzles had to be introduced and finished with that idea in mind. This led to both ideas that repeated with effectively the same puzzle in multiple shrines (like the rolling ball with gyro puzzles), and deep ideas that could never be used again or inspected further (like EventTide island being a one-off idea). The non-linear nature honestly hindered the idea of puzzle-boxes in the game, which are by their very nature a linear activity.

The overworld map was also largely the same, so there was no real "reward" for exploring. In BOTW, everything was new, and so exploring an area, even without a treasure chest at the end, was still exciting because the discovery was in itself a rewarding experience. In TOTK, every area is either effectively untouched, been defaced by a magical crop-circle, or the same with with one quirky "change" to it. And the "change" always seemed to hinder progress. Found a new skyview tower, well you can't use it yet because the platform is broken! Went back to the Kakariko fairy, they aren't there anymore but if you find them in their new location you can't just pay them and upgrade you have to go find a trumpet. Or a flute. Or pull a wagon with your horse. Or a number of various other obstacles that just exist to stop you from progressing the way you used to. So many undocumented side-quests stop you in the middle of your current side-quest and tell you to go somewhere else. You can't just visit the goddess statue on the plateau anymore. You can't just go find the heroine statues in the desert. You can't just visit your house in Hateno, you can't just explore Kakariko. Every quest that re-visits a familiar area (where the reward should be the nostalgia hit of seeing the changed and unchanged bits) is stopped by some monotonous side quest. Link is never allowed to just exist and walk around. He always has to be doing something.


3. But seeing as every NPC in the game suffers from selective amnesia, I never know if it's even worth it to do things in the game in the first place. Teba knows me well, and I apparently know his tiny bird son too. Sidon and I are best friends apparently. But nobody seems to know that the Calamity ever existed. Bolson looks at me like I am a stranger. The champions are effectively written out of history except for the statues and rock walls that bear their faces. All the Sheikah tech is just gone, the Sheikah slate never existed, Guardians are nowhere to be seen. People talk to me like it's the first game in Hyrule. What's the point of fixing towers and killing pirates and building schools and rebuilding towns if in the next game everyone will forget all about my actions anyway. When almost no-one in-game acknowledges any of my accomplishments, what's my character motivation for even continuing?

3 Bonus. The game really suffered this time around from the non-linear story telling. In BOTW, Link had amnesia, so it made sense that he would remember bits and pieces out of order. In TOTK, Link is fine, minus 1 hand. So when I discover magical crop circle 11 before magical crop circle 3, it kind of messes up my flow. I learned that Zelda became a dragon before I learned she ever went back in time in the first place. Why was I even allowed to learn the story out of order. It doesn't make any in-game sense this time around. You're saying that within 15 minutes of landing on the ground again, Link learned Zelda was a dragon and told nobody? Just kept up with the charade of looking for her even though she obviously was a dragon? Really?

Also Ultrahand. Was not a fan of "just build a car bro." I'm long past the point where I can be creative enough to care about neat ways to solve problems. I build my 2 fan bike and just go, that's it. The spirit temple took me 3 days because I just could not be bothered anymore to make another random Ultrahand-whatever out of a box and rocket it over a gap for the third or fourth time. That's not a puzzle. That's just strapping a rocket to a shield, or a box, or combining 40 logs together into a long bridge. It's just tedious.


--

Ok that was a bit. Overall, I had a lot of fun with the game but ultimately left disappointed. It was a good game. It pushed the envelope on many game-mechanics, Fuse and Ascend are literal game changers and I can't wait to see how the industry further develops the idea of them. But as a Zelda game it was just "ok" in my eyes. Sad to think after so many years of waiting.


Nerdy code stuff soon maybe
Stay tuned!

========================
Follow pyamsoft around the Web for updates and announcements about the newest applications!
Like what I do?

Send me an email at: pyam.soft@gmail.com
Or find me online at: https://pyamsoft.blogspot.com

Follow my Facebook Page
Check out my code on GitHub
=========================