-
Notifications
You must be signed in to change notification settings - Fork 1k
Android: Add support for HTTPS & HTTP for self hosted server #2001
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: sictiru
Are you sure you want to change the base?
Conversation
|
You know, honestly, we need to figure out how to do HTTPS for self-hosted servers. My development environment is a self-hosted server, and I have to type Does this look good @sictiru? Also, @claude, no need to review the code or write any code, but what do developers do to have https with self-signed certs to run NewsBlur in development (which is no different than self-hosting and figuring out tailscale/dns). Notice that we self-sign a cert (see |
|
Claude finished @samuelclay's task —— View job HTTPS Solutions for Local DevelopmentHere are the modern approaches developers use for HTTPS in local development, especially when mobile apps are involved: 1. mkcert (Most Popular for Local Development)
# Install mkcert
brew install mkcert # macOS
# or use other package managers
# Install local CA
mkcert -install
# Create cert for your domain
mkcert localhost 127.0.0.1 ::1 newsblur.localMobile App Support:
Pros: Works seamlessly across all browsers and mobile apps once CA is trusted 2. Tailscale with HTTPS CertificatesTailscale now offers HTTPS certificates for your tailnet: # Enable HTTPS in your tailnet
tailscale cert your-machine.your-tailnet.ts.netHow it works:
Pros:
Cons:
3. Caddy Server (Automatic HTTPS)Caddy can automatically provision certificates, even for local development: # Caddyfile
localhost {
reverse_proxy localhost:8000
tls internal
}For self-hosted with real domains: newsblur.yourdomain.com {
reverse_proxy localhost:8000
}Caddy will automatically get Let's Encrypt certificates if you have a real domain pointing to your server. Pros: Zero-config HTTPS with real domains 4. Let's Encrypt with DNS Challenge (For Self-Hosted)For self-hosted servers behind NAT/firewall: # Using certbot with DNS challenge
certbot certonly --manual --preferred-challenges dns -d newsblur.yourdomain.comYou can use services like:
Pros: Real certificates, works behind firewalls 5. Local DNS + Real Certificates (Hybrid Approach)Combine local DNS resolution with real certificates:
Recommendation for NewsBlur DevelopmentBased on your requirements, I'd recommend a two-tier approach: For Pure Local Development (your current use case):
For Self-Hosted Production:
Practical Implementation for NewsBlurTo solve your immediate problem:
Would you like me to create an updated |
|
Ok, from claude above my takeaway is that you should be using tailscale and I should switch to mkcert, which may work in your case but requires the installation of a root CA. I think that was the rec from #1924. I'm not sure if |
make user installed certificates on android phone/tablet used for HTTPS connection to a newsblur server (self-hosted for example) cf: https://developer.android.com/privacy-and-security/security-config
|
Thanks for your response. I removed some useless code, which is why I force pushed to my branch. I generated the X.509 certificates using OpenSSL (although other software, such as mkcert, could have been used), as well as the following private keys:
I installed the NewsBlur server using the intermediate CA, certificate and private key. My NewsBlur server, along with other servers, is on a private LAN. I access it via the internet using a StrongSwan IPSEC VPN, which gives me control over both ends. Therefore, I do not use Tailscale. |
This PR allows the use of a custom certificate for a self-hosted NewsBlur server with an HTTPS connection and enables the use of an HTTP connection to a NewsBlur server. (Fixes #1924)