Hardcoded mongodb credential
There are hardcoded mongodb credentials in several modules. Those wishing to develop can easily create a docker container with the appropriate hostname, however these credentials should probably reference a .env file instead.
Notably, the IMongoRepository<MapLayer> _mapLayersRepository which is used within the live mapping locations (opening the map in mapping or calls), will cause an excessive timeout of ~30 seconds before failing and continuing. This results in long page load times. See : https://github.com/Resgrid/Core/blob/master/Core/Resgrid.Services/MappingService.cs#L16 --> https://github.com/Resgrid/Core/blob/8b3f079e2f0d1ffe792a757886429942b739406e/Core/Resgrid.Config/DataConfig.cs#L28
Locations with hardcoded credentials:
Core/Resgrid.Config/ApiConfig.cs
Core/Resgrid.Config/DataConfig.cs
Core/Resgrid.Config/OidcConfig.cs
Core/Resgrid.Config/AuditConfig.cs
Core/Resgrid.Config/WorkerConfig.cs
Thanks for opening this issue. A contributor should be by to give feedback soon. In the meantime, please check out the contributing guidelines.
Hey @Escalion thank you for raising this issue. Yes the discoverability isn't there for the setup that needs to be done for local dev. Some of those, like the app.config are just old and we can probably just remove.
I don't know if a .env would be ideal, as for local dev I don't build into a container but just use Visual Studio and even deploy to a local IIS for rapid testing/validation. But the current state does need to change.