Commit Graph

45 Commits

Author SHA1 Message Date
Łukasz Domeradzki
c8e8cd27b8 .NET 10 (#3482)
* Initial .NET 10 bump

* Use KnownIPNetworks

* .NET 10 library updates

* First round of trimming fixes

* Fix docker in .NET 10

* Resolve trimming warning

* Bump packages to rc2
2025-11-11 16:37:43 +01:00
Łukasz Domeradzki
9e207025c5 Happy new year 2025-01-05 02:40:56 +01:00
Archi
48a14136a9 Update all file headers, again 2024-03-17 02:35:40 +01:00
Archi
f98a159799 File header update 2024-03-17 00:06:13 +01:00
Archi
1fd6c8a477 Minimize dependencies for starting IPC server
Previously WebApplication didn't offer any advantages over generic Host, but with release of .NET 8 there is now slim and empty builders, which limit amount of initialized dependencies and allow us to skip some unnecessary features in default pipeline.
2024-03-09 18:24:15 +01:00
Archi
556f3fdac0 Misc 2024-02-28 21:40:54 +01:00
Łukasz Domeradzki
6b0bf0f9c1 Closes #3061 (#3145)
* Good start

* Misc

* Make ApiAuthenticationMiddleware use new json

* Remove first newtonsoft dependency

* Pull latest ASFB json enhancements

* Start reimplementing newtonsoft!

* One thing at a time

* Keep doing all kind of breaking changes which need to be tested later

* Add back ShouldSerialize() support

* Misc

* Eradicate remaining parts of newtonsoft

* WIP

* Workaround STJ stupidity in regards to derived types

STJ can't serialize derived type properties by default, so we'll use another approach in our serializable file function

* Make CI happy

* Bunch of further fixes

* Fix AddFreeLicense() after rewrite

* Add full support for JsonDisallowNullAttribute

* Optimize our json utilities even further

* Misc

* Add support for fields in disallow null

* Misc optimization

* Fix deserialization of GlobalCache in STD

* Fix non-public [JsonExtensionData]

* Fix IM missing method exception, correct db storage helpers

* Fix saving into generic databases

Thanks STJ

* Make Save() function abstract to force inheritors to implement it properly

* Correct ShouldSerializeAdditionalProperties to be a method

* Misc cleanup

* Code review

* Allow JSON comments in configs, among other

* Allow trailing commas in configs

Users very often add them accidentally, no reason to throw on them

* Fix confirmation ID

Probably needs further fixes, will need to check later

* Correct confirmations deserialization

* Use JsonNumberHandling

* Misc

* Misc

* [JsonDisallowNull] corrections

* Forbid [JsonDisallowNull] on non-nullable structs

* Not really but okay

* Add and use ToJson() helpers

* Misc

* Misc
2024-02-21 03:09:36 +01:00
LRFLEW
6ab9e2958d Use FixedTimeEquals for IPC Password testing (#3142) 2024-02-10 17:42:45 +01:00
Sebastian Göls
dbf7148fbe Happy new year! (#3121)
Co-authored-by: Sebastian Göls <sebastian.goels@salvagninigroup.com>
2024-01-08 11:33:28 +01:00
Archi
f2ff2f4929 Closes #3060 2023-11-14 20:01:29 +01:00
Łukasz Domeradzki
b34f18497d .NET 8 (#3005)
* Initial .NET 8

* Make it compile in release mode ignoring warnings for now

* First round of improvements

* Second round of improvements

* Third round of improvements

* Use new throws

* Fix .NET Framework, YAY, thanks madness!

Madness devs are awesome

* Misc

* Misc

* AF_NETLINK might be required for some http calls

No clue why

* Fix service files

Doesn't do what it should

* Update CardsFarmer.cs

* New improvements

* Address feedback

* Misc

* Misc

* Misc refactor

* Misc
2023-11-14 19:12:33 +01:00
Archi
8008a04354 Code cleanups and improvements
- Make use of new UnixFileMode, always one native method we need to maintain less
- Add madness support for it, because new feature of course
- Add optional netstandard target and required compatibility for it, so I can test netf-oriented changes easier
2023-02-09 02:25:11 +01:00
Sebastian Göls
0c125db118 Happy new year! (#2809) 2023-01-25 15:43:12 +01:00
JustArchi
6227f84931 Misc cleanup 2022-10-10 22:50:36 +02:00
Sebastian Göls
321e02c0ff Add endpoints to manage IPC bans (#2715)
* Add endpoints to manage IPC bans

* Remove debug code

* Misc.

* Simplify unban logic

* Add explanatory comment to new string resource
2022-10-10 19:28:07 +02:00
Archi
1809028c77 Rider cleanup 2022-01-06 20:22:38 +01:00
Archi
225003c5d1 Try to fix netf, once again into the breach 2021-12-12 01:44:17 +01:00
Archi
4f598d5c8f Latest Rider cleanups 2021-12-12 01:12:54 +01:00
Archi
1e6ab11d9f Use file-scoped namespaces 2021-11-10 21:23:24 +01:00
Sebastian Göls
fb4eb0b03a Use Madness via global usings (#2447)
* Use Madness via global usings

* Apply feedback

* Disable false positive null warning
2021-11-09 16:33:09 +01:00
Archi
7e9e90764b Use static lambdas wherever possible
Thanks Rider
2021-09-27 21:33:52 +02:00
Archi
69e2a3590c ApiAuthenticationMiddleware performance improvements
Previously we've used one semaphore per all ongoing authentication attempts, which is suboptimal given the existence of a lot of consumers, including ongoing (D)DoS or distributed bruteforce attack. ASF should be as resistant to that as possible, therefore it makes sense to replace the global semaphore with per-IP semaphore (actually task), that can control the access just as well, without stopping other consumers from accessing the same authentication process concurrently.
2021-08-24 01:37:14 +02:00
Archi
5f5dcfbb99 Misc 2021-08-23 16:50:26 +02:00
Archi
882443711b Optimize ApiAuthenticationMiddleware for bruteforcing
We can favour bruteforcers by checking first if the client is even eligible for talking with us, this will (in a very negligible way) improve defense against common DoS.

Also rewrite Timer initialization while at it. This is internal class and we don't expect this middleware to be initialized more than once anyway.
2021-08-23 16:49:19 +02:00
Archi
859d2d54c6 Misc 2021-07-21 09:58:09 +02:00
Archi
a92c212a69 Misc 2021-07-20 14:43:16 +02:00
Archi
1b3ef7a41d Add support for supplying additional information on 401/403 status codes
In particular permanent: true/false value indicating whether 403 comes from rate limiting or ASF block due to lack of IPCPassword
2021-07-20 14:32:53 +02:00
Archi
d479eb9f97 Address Rider EAP inspections/cleanup 2021-07-12 21:45:17 +02:00
Łukasz Domeradzki
13e9f1ac2a Closes #2371 (#2372)
* Closes #2371

* Change the default to no known networks

* Address @Vital7 note

* Handle both IPv4 and IPv6 when mapped

This follows ASP.NET Core logic

* Refactor forwarded headers usage
2021-07-12 13:40:23 +02:00
JustArchi
e60b54e402 Refactor EVERYTHING
Directories structure + namespaces relevant to them
2021-05-08 01:37:22 +02:00
JustArchi
45a5fec95a Happy 2021
And let's hope it'll be better than 2020
2021-01-03 22:24:22 +01:00
JustArchi
e82560259b Final code cleanup 2020-11-14 22:37:00 +01:00
JustArchi
60ae4977da Initial code cleanup 2020-11-11 16:51:31 +01:00
Łukasz Domeradzki
35f4651ed6 .NET 5.0 (#1999)
* Initial work

* Fix CIs

* Fix warnings

* Update .travis.yml

* Update dockerfiles

* Update libraries to .NET 5.0

* Misc

* Remove workaround for #1812

* Update cc.sh

* CI updates

* CI updates

* Update .travis.yml
2020-11-10 23:22:57 +01:00
JustArchi
f99d296687 Closes #2014 2020-11-04 23:39:57 +01:00
JustArchi
b3d476dea4 Round 2 of nullable checks 2020-08-23 20:45:24 +02:00
Łukasz Domeradzki
9fc1ea65a5 Closes #1543 (#1944)
* Start working on nullable checks

help me

* Update GlobalConfig.cs

* Finish initial fixup round

* nullability code review
2020-08-22 21:41:01 +02:00
JustArchi
4b4b323164 R# code improvements 2020-04-18 16:54:57 +02:00
JustArchi
0370168b02 Happy new year 2020-02-01 23:33:35 +01:00
JustArchi
738b70e57a Do not record failed attempts on empty passwords 2019-11-11 22:32:01 +01:00
JustArchi
a0dfb28e59 R# cleanup 2019-10-13 17:21:40 +02:00
Łukasz Domeradzki
5b4867c387 Update ASF to .NET Core 3.0 (#1427)
* Initial bump to .net core 3.0

* Update cc.sh

* Update appveyor.yml

* Update ArchiSteamFarm.csproj

* Update appveyor.yml

* Update .travis.yml

* Build corrections

* Cleanup

* Update .travis.yml

* Don't publish trimmed for now

* Update ArchiSteamFarm.csproj
2019-09-26 20:28:25 +02:00
JustArchi
4592a20c89 General code review 2019-06-29 15:59:38 +02:00
JustArchi
b677ba8202 Code/style cleanup 2019-02-16 17:34:17 +01:00
JustArchi
c594da5acb Add 2FA actions to ASF API 2019-01-23 17:58:37 +01:00