Background
The HttpServer
was added back when there was no stand-alone webserver for .NET. It was chosen because it was a small-ish project with a simple interface. Sadly it was never maintained, and I ended up “saving” it from oblivion when Codeplex was shut down.
The entire codebase in there is pretty typical of that era with very few things one would expect from a modern webserver (CORS, Domain, WebSockets, Dependency Injection, etc). @Jojo-1000 recently discovered that it even has its own (broken) implementation of UrlDecode
.
I expect there to be many more problems hiding in various places. Fortunately some work was started by @tsuckow on creating a new webserver implementation using Kestrel and this was picked up by @npodbielski.
I have been looking at that combined work and I think it is important that this transition is done ASAP, so this post is an attempt to make a work plan for what should happen.
The current state is a mixed bag with some endpoints supported, some not, and most are wrapping existing functionality. My end-goal is to fully remove HttpServer
and rely only on Kestrel, while providing a code-base that is familiar to ASP.NET developers.
I have made a map of all endpoints that needs to be implemented, so I will be deleting them and then copy back the code into the Kestrel functions, adapting as needed.
As always, input and help is much appreciated!
Proposed plan
My current overview of the task is listed below, and I will update as I progress:
- Delete all references to
HttpServer
, including the endpoints - Get the Kestrel server starting
- Introduce the previous commandline options and map them to Kestrel
- Implement endpoints, update as needed
-
/api/v1/acknowledgements
- Duplicati.Server.WebServer.RESTMethods.Acknowledgements- GET
/api/v1/acknowledgements
- GET
-
/api/v1/backup
- Duplicati.Server.WebServer.RESTMethods.Backup- GET
/api/v1/backup
- PUT
/api/v1/backup
- POST
/api/v1/backup
- DELETE
/api/v1/backup
- GET
-
/api/v1/backupdefaults
- Duplicati.Server.WebServer.RESTMethods.BackupDefaults- GET
/api/v1/backupdefaults
- GET
-
/api/v1/backups
- Duplicati.Server.WebServer.RESTMethods.Backups- GET
/api/v1/backups
- POST
/api/v1/backups
- GET
-
/api/v1/bugreport
- Duplicati.Server.WebServer.RESTMethods.BugReport- GET
/api/v1/bugreport
- GET
-
/api/v1/captcha
- Duplicati.Server.WebServer.RESTMethods.Captcha- GET
/api/v1/captcha
- POST
/api/v1/captcha
- GET
-
/api/v1/changelog
- Duplicati.Server.WebServer.RESTMethods.Changelog- GET
/api/v1/changelog
- GET
-
/api/v1/commandline
- Duplicati.Server.WebServer.RESTMethods.CommandLine- GET
/api/v1/commandline
- POST
/api/v1/commandline
- GET
-
/api/v1/filesystem
- Duplicati.Server.WebServer.RESTMethods.Filesystem-
GET/api/v1/filesystem
- POST
/api/v1/filesystem
-
-
/api/v1/help
- Duplicati.Server.WebServer.RESTMethods.Help-
GET/api/v1/help
-
-
/api/v1/hyperv
- Duplicati.Server.WebServer.RESTMethods.HyperV- GET
/api/v1/hyperv
- GET
-
/api/v1/licenses
- Duplicati.Server.WebServer.RESTMethods.Licenses- GET
/api/v1/licenses
- GET
-
/api/v1/logdata
- Duplicati.Server.WebServer.RESTMethods.LogData- GET
/api/v1/logdata
- GET
-
/api/v1/mssql
- Duplicati.Server.WebServer.RESTMethods.MSSQL- GET
/api/v1/mssql
- GET
-
/api/v1/notification
- Duplicati.Server.WebServer.RESTMethods.Notification- GET
/api/v1/notification
- DELETE
/api/v1/notification
- GET
-
/api/v1/notifications
- Duplicati.Server.WebServer.RESTMethods.Notifications- GET
/api/v1/notifications
- GET
-
/api/v1/progressstate
- Duplicati.Server.WebServer.RESTMethods.ProgressState- GET
/api/v1/progressstate
- GET
-
/api/v1/remoteoperation
- Duplicati.Server.WebServer.RESTMethods.RemoteOperation-
GET/api/v1/remoteoperation
- POST
/api/v1/remoteoperation
-
-
/api/v1/serversetting
- Duplicati.Server.WebServer.RESTMethods.ServerSetting- GET
/api/v1/serversetting
- PUT
/api/v1/serversetting
- GET
-
/api/v1/serversettings
- Duplicati.Server.WebServer.RESTMethods.ServerSettings- GET
/api/v1/serversettings
- PATCH
/api/v1/serversettings
- GET
-
/api/v1/serverstate
- Duplicati.Server.WebServer.RESTMethods.ServerState- GET
/api/v1/serverstate
- POST
/api/v1/serverstate
- GET
-
/api/v1/systeminfo
- Duplicati.Server.WebServer.RESTMethods.SystemInfo- GET
/api/v1/systeminfo
- GET
-
/api/v1/systemwidesettings
- Duplicati.Server.WebServer.RESTMethods.SystemWideSettings-
GET/api/v1/systemwidesettings
-
-
/api/v1/tags
- Duplicati.Server.WebServer.RESTMethods.Tags-
GET/api/v1/tags
-
-
/api/v1/task
- Duplicati.Server.WebServer.RESTMethods.Task- GET
/api/v1/task
- POST
/api/v1/task
- GET
-
/api/v1/tasks
- Duplicati.Server.WebServer.RESTMethods.Tasks- GET
/api/v1/tasks
- GET
-
/api/v1/uisettings
- Duplicati.Server.WebServer.RESTMethods.UISettings- GET
/api/v1/uisettings
-
POST/api/v1/uisettings
- PATCH
/api/v1/uisettings
- GET
-
/api/v1/updates
- Duplicati.Server.WebServer.RESTMethods.Updates- POST
/api/v1/updates
- POST
-
/api/v1/webmodule
- Duplicati.Server.WebServer.RESTMethods.WebModule- POST
/api/v1/webmodule
- POST
-
/api/v1/webmodules
- Duplicati.Server.WebServer.RESTMethods.WebModules- GET
/api/v1/webmodules
- GET
-
- Testing
- Revisit login/auth/CSRF