News for hackers. Stuff that matters.
Re:Raspberry Pi as a local server for self hosting applications by z3t4 on Monday September 14, 2020 @07:22PM (#24476258)
Most home routers have functionality to do port forwarding and dyndns. Certbot for TLS/cert. Just get a free domain from the dyndns service. No VPS needed if you got your own hardware/Rasbery. Make sure you have backups. Just Dont expect a $30 PC to be without issues.
Re:Raspberry Pi as a local server for self hosting applications by milankragujevic on Monday September 14, 2020 @08:21PM (#24476623)
Of course they do, but a lot of people are behind CGNAT and do not have a public IP address assigned to their CPE, and as such reaching a device in the LAN from the outside - without the device reaching out to you first - is impossible.

And, of course, it can't reach out to your phone because it's also behind CGNAT. So, you need a VPS to act as a bridge between your phone and the device, which would connect to the VPS on boot and route traffic through a tunnel.

Re:Raspberry Pi as a local server for self hosting applications by jeroenhd on Tuesday September 15, 2020 @02:02AM (#24478298)
CGNAT is a pain but if you have that type of internet connection you should just forget about hosting anything from home. Maybe ipv6 works if you're lucky, but your ISP clearly won't make it easy for you.

A VPS with a VPN works but there's alternatives. Some online services provide free port forwards/port forwards for a price (ngrok style) or if push comes to shove and you only need access yourself, you can probably host your services on a Tor hidden service and bookmark it.

I don't think I've seen that many ISPs do CGNAT though. Even mobile carriers often expose some ports to the outside world for IoT crap with a SIM card. Maybe CGNAT is more prevalent in other countries but that doesn't mean other people can make use of these guides.

Re:Raspberry Pi as a local server for self hosting applications by milankragujevic on Tuesday September 15, 2020 @03:19AM (#24478687)
In general in the Balkans there are cable ISPs (biggest one owned by United Group for example) that give out CGNAT IP addresses to all residential cable users. You can buy a static IP address for a 5€/mo, but it's a painful procedure with bureaucracy for some reason.

On mobile networks, you are assigned a CGNAT IP address per cell base station per device, and they are then all mixed into a few public IPs. There are no ports open, and they cannot be opened, becase it is not possible to assign ports to a mobile device and have the user know which ports to use.

Because hundreds or more users share a single IP address, you'd have to randomly assign them ports and keep track of devices entering and leaving the service area to delete the port mappings, which is not economical.

Ironically, one mobile carrier - Telenor, has a "feature" where on 3G only with a certain APN they assign you a public IPv4 address to your mobile broadband interface. The only catch is that it is reachable from Telenor's network only, except on ports >10000.

Re:Raspberry Pi as a local server for self hosting applications by Symbiote on Tuesday September 15, 2020 @03:37AM (#24478764)
Do those ISPs with CGNAT also provide IPv6?
Re:Raspberry Pi as a local server for self hosting applications by milankragujevic on Tuesday September 15, 2020 @03:49AM (#24478818)
No, and they have no excuse.

The cable ISP recently switched to a DOCSIS 3.1 network in certain areas, and almost all customers have a modem/gateway that has IPv6 support perfected (IPv6 is quite an old thing, would be weird for it not to work properly now - on the CPE side), but nope, they don't want to.

They don't like their users being able to host content, given the fact they make it extremely difficult to pay for a static IP and get a modem or have your gateway switched into bridge mode (the newest models have had that removed from firmware, and the ISP downgrades you to 3.0 speeds if you want bridge and pay for a static IP). I am not sure why, but the whole company is extremely antagonistic to the idea of a user having a public IP address of any kind.

Mobile carriers do not support it either, and have no excuse at all, given the modern LTE Advanced networks they have deployed, with VoLTE, and the modernized core infrastructure by Huawei to the highest standards of the 4th generation of networks. Except IPv6 of course.

This is the same in most Balkan countries and in other parts of the world.

Re:Raspberry Pi as a local server for self hosting applications by Symbiote on Tuesday September 15, 2020 @06:31AM (#24479674)
That is odd. I'm not involved in networking or ISPs, but supposedly a big motivation for IPv6 is to reduce load on CGNAT systems -- they're expensive, and problems with them generate support calls.

e.g. https://www.retevia.net/prisoner/

Re:Raspberry Pi as a local server for self hosting applications by milankragujevic on Tuesday September 15, 2020 @06:51AM (#24479776)
It is absolutely not logical, I know. That's the weirdest thing. I just don't know WHY, but the whole thing is oriented against letting the user host anything AT ALL COST.
Re:Raspberry Pi as a local server for self hosting applications by jsjohnst on Tuesday September 15, 2020 @12:14AM (#24477820)
> behind CGNAT and do not have a public IP address assigned to their CPE, and as such reaching a device in the LAN from the outside - without the device reaching out to you first - is impossible.

It’s pretty easy and free to get IPv6 from HE’s TunnelBroker.

Re:Raspberry Pi as a local server for self hosting applications by Nextgrid on Tuesday September 15, 2020 @01:06AM (#24478051)
I believe TunnelBroker can't work with CGNAT.
Re:Raspberry Pi as a local server for self hosting applications by imrelaxed on Monday September 14, 2020 @09:28PM (#24477018)
Huh? Why can’t you assign a port/s to the CPE? You can even implement a port knocking scheme if you’re worried about some service/s on your home network being wide open to the world.
Re:Raspberry Pi as a local server for self hosting applications by CydeWeys on Monday September 14, 2020 @09:32PM (#24477042)
The point is that outside traffic isn't even reaching anything you even have control over, because you don't have a public IP (i.e. the ISP won't set up port forwarding for you). Let's say you wanted to directly send a packet to my phone. There's no way we could make that happen even with both of our cooperation because my phone doesn't get a publicly addressable IP.
Re:Raspberry Pi as a local server for self hosting applications by z3t4 on Tuesday September 15, 2020 @01:25AM (#24478123)
Nat:ed ip's are a PITA. But any decent ISP will give you a public IP if you ask. We are running out of ipv4 addresses.
Re:Raspberry Pi as a local server for self hosting applications by SturgeonsLaw on Tuesday September 15, 2020 @05:29AM (#24479377)
> if you ask

And pay ;)

Getting a static IP on an internet plan here in Australia will typically cost around $5 a month, and not all ISPs offer it on residential plans.

Re:Raspberry Pi as a local server for self hosting applications by totetsu on Wednesday September 16, 2020 @05:54AM (#24491116)
I hope that goes away with ipv6
Re:Raspberry Pi as a local server for self hosting applications by mqus on Monday September 14, 2020 @07:53PM (#24476466)
For me its not the 30$ pc that has issues but the 10$ microsd card the os is on. I had to replace it for the third time in about 6 years now.

But this is not something new of course, everybody will tell you to either use good uSD cards or put the os somewhere else, like an external hdd or so.

Re:Raspberry Pi as a local server for self hosting applications by numpad0 on Tuesday September 15, 2020 @01:39AM (#24478189)
Many Raspberry Pi distro spend all the card’s TBW writing /var/log stuffs for no reason. It’s a known issue often attributed to “cheap microSD cards”.
Re:Raspberry Pi as a local server for self hosting applications by Moru on Tuesday September 15, 2020 @03:06AM (#24478605)
Yes, just to explain why:

microSD cards (and all flash storage) has a limited number of writes. If you let your rpi write logs, you will soon run out of writable space and if you are lucky you end up with a card that is read only. If unlucky it just stops working all toghether.

Re:Raspberry Pi as a local server for self hosting applications by sorenjan on Monday September 14, 2020 @09:10PM (#24476912)
This is purely an anecdote, but I had to replace a few SD cards in my Pi until I changed power supply. It's not even the official, it's just one that's rated for 5.0 V, 2.5 A. I've used the same card for a few years now.
Re:Raspberry Pi as a local server for self hosting applications by m-p-3 on Monday September 14, 2020 @09:41PM (#24477083)
It's possible to boot from USB with the Pi4, I wouldn't run anything important from the MicroSD.
Re:Raspberry Pi as a local server for self hosting applications by catdog on Tuesday September 15, 2020 @01:50AM (#24478243)
Even if direct USB boot does not work out you can just use the SD card to boot the kernel and have the root fs on USB.

With the PI4 you probably can even get better performance from using a USB storage device as it has USB 3.0 Ports.

Re:Raspberry Pi as a local server for self hosting applications by vorpalhex on Monday September 14, 2020 @11:14PM (#24477565)
A common setup is to pull the OS over the LAN and just use usb storage for all your actual stuff. Skip the sd card entirely except maybe as an OS fallback.
Re:Raspberry Pi as a local server for self hosting applications by jsjohnst on Tuesday September 15, 2020 @12:17AM (#24477832)
Go with the high endurance microSD cards. They are only a tiny bit more expensive and last a lot longer. If you’ve got a Pi with USB3 ports, I’d also recommend using an USB3 SSD flash drive for the majority of your writes.
Re:Raspberry Pi as a local server for self hosting applications by tuatoru on Tuesday September 15, 2020 @04:36PM (#24486409)
Like the Samsung Edge series for Dashcams/IoT devices? I wish I could get some.
Re:Raspberry Pi as a local server for self hosting applications by ptrwis on Tuesday September 15, 2020 @05:53AM (#24479498)
May I ask what fs did you use? Maybe F2FS would extend the life of the flash memory