SShortSingh.
Back to feed

How to Fix Nextcloud IP Detection and HSTS Headers Behind Traefik and Cloudflare

0
·1 views

A developer documented two key configuration issues encountered while hardening Nextcloud 29 running in Docker on a Proxmox LXC behind Traefik v3 and a Cloudflare Tunnel. The first problem involved Nextcloud misidentifying all client IPs as Traefik's IP, breaking brute-force protection and rate limiting, which was resolved by setting trusted proxies and Cloudflare CIDRs via the occ command-line tool. The second issue was that Traefik's built-in HSTS middleware failed to send Strict-Transport-Security headers because Cloudflare terminates TLS before traffic reaches Traefik, causing it to treat connections as non-HTTPS. The fix required adding an explicit custom response header in Traefik's dynamic configuration rather than relying on the stsSeconds directive. Additional hardening steps included setting a maintenance window, defining a default phone region, and installing apps such as Calendar, Contacts, and Talk directly via occ instead of the web UI.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

How Ditching WordPress Early Pushed Two Developers to Build a Custom Tech Stack

Developers Andrés and his partner initially used WordPress to build websites but found its plugin dependencies, update conflicts, and limited customizability frustrating. Rather than mastering WordPress management, they chose to learn web development from scratch, starting with React and later adopting Next.js. Each client project organically expanded their skills across technologies like AWS, Supabase, PostgreSQL, and various third-party services. The duo, who now run Developwave, emphasize that their stack is always chosen based on the specific problem at hand rather than a fixed preference. They acknowledge WordPress still suits simple use cases, but prefer the flexibility of custom builds for businesses with specific needs.

0
ProgrammingDEV Community ·

How to Use the Haversine Formula to Calculate GPS Distance in JavaScript

Calculating real-world distance between two GPS coordinates requires accounting for Earth's curvature, as simple arithmetic on latitude and longitude values produces meaningless results. The Haversine formula offers a practical solution by computing the great-circle distance between two points on a sphere using their coordinates. A JavaScript implementation involves converting degrees to radians, applying trigonometric functions, and multiplying the resulting central angle by Earth's radius. The approach supports output in kilometers, miles, and nautical miles, and can be extended with input validation and TypeScript support. As a practical example, the formula returns approximately 3,935 km between New York City and Los Angeles.

0
ProgrammingDEV Community ·

Researchers Propose LSTM-Based Smartwatch System to Detect Infections Before Symptoms

A technical framework published on DEV Community outlines how Long Short-Term Memory (LSTM) neural networks can be deployed on wearable devices to predict illness onset by monitoring resting heart rate. The system analyzes seven days of heart rate data to establish a personal baseline and flags deviations greater than two standard deviations as potential infection alerts. To fit within the hardware constraints of smartwatches, the model is compressed using post-training quantization, converting 32-bit floats to 8-bit integers via TensorFlow Lite. All inference runs locally on the device using TensorFlow Lite Micro, meaning health data never leaves the wearable. The guide recommends publicly available datasets such as PMData or MyHeart Counts for training and targets deployment on ARM Cortex-M processors.

0
ProgrammingDEV Community ·

Why Genetic Algorithms Can Overffit Trading Strategies — and How to Prevent It

Genetic algorithms (GAs) are powerful tools for optimizing trading strategy parameters, but are prone to overfitting when applied naively to backtests. The core risk lies in fitness function misspecification — rewarding raw returns instead of risk-adjusted metrics like Sharpe ratio, consistency across time periods, and drawdown limits. To prevent overfitting, practitioners should use walk-forward testing, evolving parameters on in-sample data and validating on out-of-sample windows the algorithm never trained on. A final held-out data vault, never touched during development, serves as the ultimate check on whether a discovered edge is real or illusory. Additional safeguards include decaying mutation rates, elitism, diversity pressure, and ensuring the backtest and live trading systems share identical code paths.