aboutsummaryrefslogtreecommitdiff
path: root/cmd
AgeCommit message (Collapse)Author
2024-05-18lib/geoip, cmd/relaypoolsrv, cmd/ursrv: Automatically manage GeoIP updates ↵Jakob Borg
(#9342) This adds a small package `geoip` which knows how to download and manage the Maxmind GeoLite2 database we use. This removes the need for various scripts to download and manage the geoip database, something that today happens on Docker startup for the relay pool server and using various hand written hacks for the usage reporting server. The database is downloaded when needed and then refreshed on a best-effort basis weekly.
2024-02-27all: Use own automaxprocs package that doesn't log (ref #9436) (#9437)v1.27.4-rc.2v1.27.4Jakob Borg
### Purpose 🤫
2024-02-26all: Use Linux container CPU quota (fixes #9357, fixes #9435) (#9436)Thomas
Go is not cgroup aware and by default will set GOMAXPROCS to the number of available threads, regardless of whether it is within the allocated quota. This behaviour causes high amount of CPU throttling and degraded application performance.
2024-02-26cmd/syncthing: Remove legacy GOMAXPROCS handling (ref #9436)Jakob Borg
2024-01-16cmd/ursrv: Add FreeBSD detection (#9351)bt90
### Purpose Classify `ports@freebsd` as `FreeBSD (3rd party)`
2024-01-16cmd/ursrv: Fix Arch detection (#9350)bt90
### Purpose Classify `syncthing@archlinux` as `Arch (3rd party)`
2024-01-04cmd/syncthing: Add CLI completion functionality (fixes #8616) (#9226)Daniel Padrta
### Purpose This implements CLI completion using the Kongplete module. As a side effect a CLI structure for syncthing/cli was created for kongplete to be able to parse and implement CLI completion. ### Testing I've tested the autocompletion manually, and it had worked, but I hadn't added any tests so as to test it automatically. Additionally, I ran `go run build.go test` with all tests passing.
2024-01-04lib/api: Save session & CSRF tokens to database, add option to stay logged ↵Jakob Borg
in (fixes #9151) (#9284) This adds a "token manager" which handles storing and checking expired tokens, used for both sessions and CSRF tokens. It removes the old, corresponding functionality for CSRFs which saved things in a file. The result is less crap in the state directory, and active login sessions now survive a Syncthing restart (this really annoyed me). It also adds a boolean on login to create a longer-lived session cookie, which is now possible and useful. Thus we can remain logged in over browser restarts, which was also annoying... :) <img width="1001" alt="Screenshot 2023-12-12 at 09 56 34" src="https://github.com/syncthing/syncthing/assets/125426/55cb20c8-78fc-453e-825d-655b94c8623b"> Best viewed with whitespace-insensitive diff, as a bunch of the auth functions became methods instead of closures which changed indentation.
2023-12-11lib/model: Use a single lock (phase two: cleanup) (#9276)v1.27.2-rc.1Jakob Borg
Cleanup after #9275. This renames `fmut` -> `mut`, removes the deadlock detector and associated plumbing, renames some things from `...PRLocked` to `...RLocked` and similar, and updates comments. Apart from the removal of the deadlock detection machinery, no functional code changes... i.e. almost 100% diff noise, have fun reviewing.
2023-12-11cmd/syncthing: Better cli stdin handling (ref #9166) (#9281)Jakob Borg
Seems to work for me, @AudriusButkevicius.
2023-12-11cmd/syncthing: Mostly replace urfave/cli command line parser with ↵cjc7373
alecthomas/kong (#9166) `syncthing cli` subcommand was using urfave/cli as the command parser. This PR replace it with kong, which the main command uses. Some help texts and error message format are changed. Other than that, all the command usage and logic remains unchanged. There's only one place which still uses urfave/cli, which is `syncthing cli config`, because it uses some magic to dynamically build commands from struct reflects. I used kong's `passthrough:""` tag to pass any argument following `syncthing cli config` to urfave/cli parser. This PR also fixes #9041 --------- Co-authored-by: Jakob Borg <jakob@kastelo.net>
2023-12-11lib/nat, lib/upnp: IPv6 UPnP support (#9010)Maximilian
This pull request allows syncthing to request an IPv6 [pinhole](https://en.wikipedia.org/wiki/Firewall_pinhole), addressing issue #7406. This helps users who prefer to use IPv6 for hosting their services or are forced to do so because of [CGNAT](https://en.wikipedia.org/wiki/Carrier-grade_NAT). Otherwise, such users would have to configure their firewall manually to allow syncthing traffic to pass through while IPv4 users can use UPnP to take care of network configuration already. ### Testing I have tested this in a virtual machine setup with miniupnpd running on the virtualized router. It successfully added an IPv6 pinhole when used with IPv6 only, an IPv4 port mapping when used with IPv4 only and both when dual-stack (IPv4 and IPv6) is used. Automated tests could be added for SOAP responses from the router but automatically testing this with a real network is likely infeasible. ### Documentation https://docs.syncthing.net/users/firewall.html could be updated to mention the fact that UPnP now works with IPv6, although this change is more "behind the scenes". --------- Co-authored-by: Simon Frei <freisim93@gmail.com> Co-authored-by: bt90 <btom1990@googlemail.com> Co-authored-by: André Colomb <github.com@andre.colomb.de>
2023-11-27cmd/stcrashreceiver: Add metrics for diskstore inventoryJakob Borg
2023-11-27cmd/stcrashreceiver: Minor cleanup, stricter file permissionsJakob Borg
2023-11-27cmd/stcrashreceiver: Add metrics for incoming reportsJakob Borg
2023-11-27cmd/ursrv: Add metrics for incoming reportsJakob Borg
2023-11-15cmd/ursrv: Add link to source code (#9224)Anatoli Babenia
To see that https://data.syncthing.net is open source, study the code and change it.
2023-11-15cmd/ursrv: Anchor distribution expressions to avoid mismatches (ref #9141)Jakob Borg
2023-11-15cmd/ursv: Report on copy range methodJakob Borg
2023-11-14cmd/stdiscorv: Expose build info in metricsJakob Borg
2023-11-08cmd/stdiscosrv: Metric for returned retry-afterJakob Borg
2023-11-08cmd/stdiscosrv: Account IPv4 & IPv6Jakob Borg
2023-11-08cmd/stdiscosrv: Prevent nil IPs from X-Forwarded-For (fixes #9189) (#9190)vapatel2
### Purpose Treat X-Forwarded-For as a comma-separated string to prevent nil IP being returned by the Discovery Server ### Testing Unit Tests implemented Testing with a Discovery Client can be done as follows: ``` A simple example to replicate this entails running Discovery with HTTP, use Nginx as a reverse proxy and hardcode (as an example) a list of IPs in the X-Forwarded-For header. 1. Send an Announcement with tcp://0.0.0.0:<some-port> 2. Query the DeviceID 3. Observe the returned IP Address is no longer nil; i.e. `tcp://<nil>:<some-port>` ```
2023-10-16Revert "cmd/stcrashreceiver: Aggregate slice out of bounds errors"Jakob Borg
This reverts commit dc6a10dff4bddab178118cc0e32a56925118293b.
2023-10-14cmd/stdiscosrv: Only attempt unescaping when there are %-encodings in the ↵Jakob Borg
header (fixes #9143)
2023-10-14cmd/stcrashreceiver: Aggregate slice out of bounds errorsJakob Borg
2023-10-14cmd/stcrashreceiver: Propagate synthetic user ID for crashesJakob Borg
2023-10-11cmd/ursrv: Replace "2006-01-02" with time.DateOnly (#9157)orangekame3
This commit replaces "2006-01-02" to time.DateOnly. time.DateOnly is introduced since Go1.20
2023-10-07cmd/stdiscosrv: Handle unescaped cert header from Traefik (fixes #9143) (#9153)Jakob Borg
2023-10-04cmd/stdiscosrv: Slightly tweak replication settingsJakob Borg
2023-10-02cmd/ursrv: Add linuxserver.io detection (#9145)bt90
Detect linuxserver
2023-09-29cmd/ursrv: Fix f-droid detection (#9142)bt90
Fix f-droid detection
2023-09-29cmd/ursrv: Support new android build user (#9141)bt90
Support new android build user
2023-09-24lib/config: Accept pre-hashed password (fixes #9123) (#9124)Jakob Borg
2023-09-06cmd/stdiscosrv: Deduplicate addresses (fixes #8482) (#9080)bt90
2023-09-06all: Support multiple device connections (fixes #141) (#8918)Jakob Borg
This adds the ability to have multiple concurrent connections to a single device. This is primarily useful when the network has multiple physical links for aggregated bandwidth. A single connection will never see a higher rate than a single link can give, but multiple connections are load-balanced over multiple links. It is also incidentally useful for older multi-core CPUs, where bandwidth could be limited by the TLS performance of a single CPU core -- using multiple connections achieves concurrency in the required crypto calculations... Co-authored-by: Simon Frei <freisim93@gmail.com> Co-authored-by: tomasz1986 <twilczynski@naver.com> Co-authored-by: bt90 <btom1990@googlemail.com>
2023-08-30cmd/stdiscosrv: Streamline context handlingJakob Borg
2023-08-30cmd/stdiscosrv: Explicitly enable HTTP/2Jakob Borg
The server supports it, but it's not negotiated unless explicitly allowed in the TLS config NextProtos.
2023-08-23cmd/stdiscosrv: Separate HTTPS and replication certificatesJakob Borg
2023-08-23cmd/stdiscosrv: Use larger database settingsJakob Borg
2023-08-23cmd/stdiscosrv: Modernise TLS settings, remove excessive HTTP loggingJakob Borg
2023-08-23cmd/stdiscosrv: Serve compressed responsesJakob Borg
2023-08-09cmd/stupgrades: Serve friendlier URLs for upgrade assets (fixes #9033)Jakob Borg
2023-07-26cmd/strelaysrv: Handle accept error with debug set (fixes #9001) (#9004)Jakob Borg
2023-07-18all: unused parameter should be replaced by underscore (#8989)deepsource-autofix[bot]
refactor: unused parameter should be replaced by underscore Unused parameters in functions or methods should be replaced with `_` (underscore) or removed. Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
2023-07-16cmd/syncthing: Mention STVERSIONEXTRA in --help output (ref #8980)Jakob Borg
2023-07-16cmd/ursrv: Update map tile URLJakob Borg
2023-07-16cmd/strelaypoolsrv: Update map tile URL (#8985)bt90
2023-07-12cmd/stcrashreceiver: Correct parsing of current version stringJakob Borg
2023-07-10cmd/ursrv: Remove old, unused user movement codeJakob Borg