OpenALPR Webhook Processor for IP Cameras

I haven't had a chance to modify the hosts file yet. I'll play with it this evening. If the local agent can send to the local server by simply modifying the hosts file, then the relay capability isn't needed is it?
 
Alright. I'll try this evening and report back. I mean, it seems like that would be too simple.
 
The agent must connect to their cloud via a hard coded IP address. Inputting cloud.openalpr.com and having it point to my local OpenALPR server didn't do anything. The agent still connects to their cloud servers.
 
you probably don't have your hosts set up correctly, it works for me. try getting into the docker container and pinging cloud.openalpr.com from there and see what it resolves to.
 
Bah. You are right! I edited the host machine /etc/hosts file. Not the file inside the container. Grrr.
 
There is no nano or vim installed in their minimal shell. Going to have to figure out how to edit it.
 
So editing the /etc/hosts file in the docker container doesn't seem to do anything for me. If I edit it while the container is running, heartbeats are still being sent to the cloud. If I restart the docker container, the file gets reset and looses my setting that points cloud.openalpr.com to my private server.
 
you need to set the hosts file of the parent maybe? then double check while inside the container it's hitting the correct ip
 
Well I'm not sure. I was able to add my private server to the /etc/hosts file but it doesn't connect to my local server. I get an authentication error in the container logs. May not be in the cards for me to do it that way.
 
the solution for using openalpr's web server isn't working out well, i'm going to try and write my own front end for the service.

angular 11, dotnet 5, sqllite db, all running inside a docker container:

output.gif
 
  • Love
Reactions: tech101
Great work! Thank you so much @mlapaglia for looking into creating this nice addition. Looking forward for it. Thank you!!
 
  • Like
Reactions: biggen
i'm working on the login screen / authentication functionality then it will be ready for testing. i'll start releasing alpha builds for early adopters and have a stable one for people that don't want to deal with bugs :)
 
  • Like
  • Love
Reactions: biggen and tech101
Ok new UI is out there. in my process of getting the new release strategy set up i accidently tagged the beta release as latest, so you'll have to upgrade. check out the example config file, some new fields.

1610322481476.png

currently search bar doesn't do anything, and the cropped plate image doesn't work, and the directional arrow is definitely wrong. but it's a start!
 
Last edited:
  • Like
Reactions: biggen
Crash on startup. I'll go back and look over the appsettings.json to see if I missed anything.

JSON:
{"log":"[00:19:19 WRN] Storing keys in a directory '/root/.aspnet/DataProtection-Keys' that may not be persisted outside of the container. Protected data will be unavailable when container is destroyed.\n","stream":"stdout","time":"2021-01-11T00:19:19.731288761Z"}
{"log":"[00:19:19 INF] User profile is available. Using '/root/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest.\n","stream":"stdout","time":"2021-01-11T00:19:19.731997153Z"}
{"log":"[00:19:19 INF] Creating key {b3d9e3b6-abab-4409-b216-7224c669ca35} with creation date 2021-01-11 00:19:19Z, activation date 2021-01-11 00:19:19Z, and expiration date 2021-04-11 00:19:19Z.\n","stream":"stdout","time":"2021-01-11T00:19:19.763728619Z"}
{"log":"[00:19:19 WRN] No XML encryptor configured. Key {b3d9e3b6-abab-4409-b216-7224c669ca35} may be persisted to storage in unencrypted form.\n","stream":"stdout","time":"2021-01-11T00:19:19.80450408Z"}
{"log":"[00:19:19 INF] Writing data to file '/root/.aspnet/DataProtection-Keys/key-b3d9e3b6-abab-4409-b216-7224c669ca35.xml'.\n","stream":"stdout","time":"2021-01-11T00:19:19.814141927Z"}
{"log":"[00:19:19 FTL] Application startup exception\n","stream":"stdout","time":"2021-01-11T00:19:19.932521413Z"}
{"log":"System.Exception: Could not resolve a service of type 'OpenAlprWebhookProcessor.Users.Data.UsersContext' for the parameter 'usersContext' of method 'Configure' on type 'OpenAlprWebhookProcessor.Startup'.\n","stream":"stdout","time":"2021-01-11T00:19:19.932556054Z"}
{"log":" ---\u003e System.ArgumentNullException: Value cannot be null. (Parameter 'connectionString')\n","stream":"stdout","time":"2021-01-11T00:19:19.932563736Z"}
{"log":"   at Microsoft.EntityFrameworkCore.Utilities.Check.NotEmpty(String value, String parameterName)\n","stream":"stdout","time":"2021-01-11T00:19:19.932569812Z"}
{"log":"   at Microsoft.EntityFrameworkCore.SqliteDbContextOptionsBuilderExtensions.UseSqlite(DbContextOptionsBuilder optionsBuilder, String connectionString, Action`1 sqliteOptionsAction)\n","stream":"stdout","time":"2021-01-11T00:19:19.932577774Z"}
{"log":"   at OpenAlprWebhookProcessor.Startup.\u003c\u003ec__DisplayClass4_0.\u003cConfigureServices\u003eb__5(DbContextOptionsBuilder options) in /src/Startup.cs:line 91\n","stream":"stdout","time":"2021-01-11T00:19:19.93258385Z"}
{"log":"   at Microsoft.Extensions.DependencyInjection.EntityFrameworkServiceCollectionExtensions.\u003c\u003ec__DisplayClass1_0`2.\u003cAddDbContext\u003eb__0(IServiceProvider p, DbContextOptionsBuilder b)\n","stream":"stdout","time":"2021-01-11T00:19:19.932590346Z"}
{"log":"   at Microsoft.Extensions.DependencyInjection.EntityFrameworkServiceCollectionExtensions.CreateDbContextOptions[TContext](IServiceProvider applicationServiceProvider, Action`2 optionsAction)\n","stream":"stdout","time":"2021-01-11T00:19:19.932596701Z"}
{"log":"   at Microsoft.Extensions.DependencyInjection.EntityFrameworkServiceCollectionExtensions.\u003c\u003ec__DisplayClass17_0`1.\u003cAddCoreServices\u003eb__0(IServiceProvider p)\n","stream":"stdout","time":"2021-01-11T00:19:19.932602637Z"}
{"log":"   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitFactory(FactoryCallSite factoryCallSite, RuntimeResolverContext context)\n","stream":"stdout","time":"2021-01-11T00:19:19.932608714Z"}
{"log":"   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)\n","stream":"stdout","time":"2021-01-11T00:19:19.93261479Z"}
{"log":"   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType)\n","stream":"stdout","time":"2021-01-11T00:19:19.932620656Z"}
{"log":"   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScopeCache(ServiceCallSite singletonCallSite, RuntimeResolverContext context)\n","stream":"stdout","time":"2021-01-11T00:19:19.932626593Z"}
{"log":"   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)\n","stream":"stdout","time":"2021-01-11T00:19:19.932633437Z"}
{"log":"   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)\n","stream":"stdout","time":"2021-01-11T00:19:19.932652713Z"}
{"log":"   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)\n","stream":"stdout","time":"2021-01-11T00:19:19.932659348Z"}
{"log":"   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType)\n","stream":"stdout","time":"2021-01-11T00:19:19.932666192Z"}
{"log":"   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScopeCache(ServiceCallSite singletonCallSite, RuntimeResolverContext context)\n","stream":"stdout","time":"2021-01-11T00:19:19.932672199Z"}
{"log":"   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)\n","stream":"stdout","time":"2021-01-11T00:19:19.932677925Z"}
{"log":"   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)\n","stream":"stdout","time":"2021-01-11T00:19:19.932683652Z"}
{"log":"   at Microsoft.Extensions.DependencyInjection.ServiceLookup.DynamicServiceProviderEngine.\u003c\u003ec__DisplayClass1_0.\u003cRealizeService\u003eb__0(ServiceProviderEngineScope scope)\n","stream":"stdout","time":"2021-01-11T00:19:19.932689449Z"}
{"log":"   at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngine.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope)\n","stream":"stdout","time":"2021-01-11T00:19:19.932697411Z"}
{"log":"   at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType)\n","stream":"stdout","time":"2021-01-11T00:19:19.932703278Z"}
{"log":"   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)\n","stream":"stdout","time":"2021-01-11T00:19:19.932709005Z"}
{"log":"   at Microsoft.AspNetCore.Hosting.ConfigureBuilder.Invoke(Object instance, IApplicationBuilder builder)\n","stream":"stdout","time":"2021-01-11T00:19:19.932714731Z"}
{"log":"   --- End of inner exception stack trace ---\n","stream":"stdout","time":"2021-01-11T00:19:19.932721087Z"}
{"log":"   at Microsoft.AspNetCore.Hosting.ConfigureBuilder.Invoke(Object instance, IApplicationBuilder builder)\n","stream":"stdout","time":"2021-01-11T00:19:19.932726674Z"}
{"log":"   at Microsoft.AspNetCore.Hosting.ConfigureBuilder.\u003c\u003ec__DisplayClass4_0.\u003cBuild\u003eb__0(IApplicationBuilder builder)\n","stream":"stdout","time":"2021-01-11T00:19:19.93273282Z"}
{"log":"   at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.\u003c\u003ec__DisplayClass15_0.\u003cUseStartup\u003eb__1(IApplicationBuilder app)\n","stream":"stdout","time":"2021-01-11T00:19:19.932739036Z"}
{"log":"   at Microsoft.AspNetCore.Mvc.Filters.MiddlewareFilterBuilderStartupFilter.\u003c\u003ec__DisplayClass0_0.\u003cConfigure\u003eg__MiddlewareFilterBuilder|0(IApplicationBuilder builder)\n","stream":"stdout","time":"2021-01-11T00:19:19.932744903Z"}
{"log":"   at Microsoft.AspNetCore.HostFilteringStartupFilter.\u003c\u003ec__DisplayClass0_0.\u003cConfigure\u003eb__0(IApplicationBuilder app)\n","stream":"stdout","time":"2021-01-11T00:19:19.932751048Z"}
{"log":"   at Microsoft.AspNetCore.Hosting.GenericWebHostService.StartAsync(CancellationToken cancellationToken)\n","stream":"stdout","time":"2021-01-11T00:19:19.932757404Z"}
{"log":"Unhandled exception. System.Exception: Could not resolve a service of type 'OpenAlprWebhookProcessor.Users.Data.UsersContext' for the parameter 'usersContext' of method 'Configure' on type 'OpenAlprWebhookProcessor.Startup'.\n","stream":"stderr","time":"2021-01-11T00:19:19.943309254Z"}
{"log":" ---\u003e System.ArgumentNullException: Value cannot be null. (Parameter 'connectionString')\n","stream":"stderr","time":"2021-01-11T00:19:19.943368269Z"}
{"log":"   at Microsoft.EntityFrameworkCore.Utilities.Check.NotEmpty(String value, String parameterName)\n","stream":"stderr","time":"2021-01-11T00:19:19.943377907Z"}
{"log":"   at Microsoft.EntityFrameworkCore.SqliteDbContextOptionsBuilderExtensions.UseSqlite(DbContextOptionsBuilder optionsBuilder, String connectionString, Action`1 sqliteOptionsAction)\n","stream":"stderr","time":"2021-01-11T00:19:19.943384821Z"}
{"log":"   at OpenAlprWebhookProcessor.Startup.\u003c\u003ec__DisplayClass4_0.\u003cConfigureServices\u003eb__5(DbContextOptionsBuilder options) in /src/Startup.cs:line 91\n","stream":"stderr","time":"2021-01-11T00:19:19.943393621Z"}
{"log":"   at Microsoft.Extensions.DependencyInjection.EntityFrameworkServiceCollectionExtensions.\u003c\u003ec__DisplayClass1_0`2.\u003cAddDbContext\u003eb__0(IServiceProvider p, DbContextOptionsBuilder b)\n","stream":"stderr","time":"2021-01-11T00:19:19.943400745Z"}
{"log":"   at Microsoft.Extensions.DependencyInjection.EntityFrameworkServiceCollectionExtensions.CreateDbContextOptions[TContext](IServiceProvider applicationServiceProvider, Action`2 optionsAction)\n","stream":"stderr","time":"2021-01-11T00:19:19.943408637Z"}
{"log":"   at Microsoft.Extensions.DependencyInjection.EntityFrameworkServiceCollectionExtensions.\u003c\u003ec__DisplayClass17_0`1.\u003cAddCoreServices\u003eb__0(IServiceProvider p)\n","stream":"stderr","time":"2021-01-11T00:19:19.943417158Z"}
{"log":"   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitFactory(FactoryCallSite factoryCallSite, RuntimeResolverContext context)\n","stream":"stderr","time":"2021-01-11T00:19:19.943428751Z"}
{"log":"   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)\n","stream":"stderr","time":"2021-01-11T00:19:19.943435595Z"}
{"log":"   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType)\n","stream":"stderr","time":"2021-01-11T00:19:19.9434423Z"}
{"log":"   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScopeCache(ServiceCallSite singletonCallSite, RuntimeResolverContext context)\n","stream":"stderr","time":"2021-01-11T00:19:19.943451519Z"}
{"log":"   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)\n","stream":"stderr","time":"2021-01-11T00:19:19.943460319Z"}
{"log":"   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)\n","stream":"stderr","time":"2021-01-11T00:19:19.943467233Z"}
{"log":"   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)\n","stream":"stderr","time":"2021-01-11T00:19:19.943473798Z"}
{"log":"   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType)\n","stream":"stderr","time":"2021-01-11T00:19:19.943482598Z"}
{"log":"   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScopeCache(ServiceCallSite singletonCallSite, RuntimeResolverContext context)\n","stream":"stderr","time":"2021-01-11T00:19:19.943490141Z"}
{"log":"   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)\n","stream":"stderr","time":"2021-01-11T00:19:19.94349922Z"}
{"log":"   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)\n","stream":"stderr","time":"2021-01-11T00:19:19.943518356Z"}
{"log":"   at Microsoft.Extensions.DependencyInjection.ServiceLookup.DynamicServiceProviderEngine.\u003c\u003ec__DisplayClass1_0.\u003cRealizeService\u003eb__0(ServiceProviderEngineScope scope)\n","stream":"stderr","time":"2021-01-11T00:19:19.943527226Z"}
{"log":"   at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngine.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope)\n","stream":"stderr","time":"2021-01-11T00:19:19.943537423Z"}
{"log":"   at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType)\n","stream":"stderr","time":"2021-01-11T00:19:19.943545734Z"}
{"log":"   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)\n","stream":"stderr","time":"2021-01-11T00:19:19.943554324Z"}
{"log":"   at Microsoft.AspNetCore.Hosting.ConfigureBuilder.Invoke(Object instance, IApplicationBuilder builder)\n","stream":"stderr","time":"2021-01-11T00:19:19.943571715Z"}
{"log":"   --- End of inner exception stack trace ---\n","stream":"stderr","time":"2021-01-11T00:19:19.943580654Z"}
{"log":"   at Microsoft.AspNetCore.Hosting.ConfigureBuilder.Invoke(Object instance, IApplicationBuilder builder)\n","stream":"stderr","time":"2021-01-11T00:19:19.943589105Z"}
{"log":"   at Microsoft.AspNetCore.Hosting.ConfigureBuilder.\u003c\u003ec__DisplayClass4_0.\u003cBuild\u003eb__0(IApplicationBuilder builder)\n","stream":"stderr","time":"2021-01-11T00:19:19.943597555Z"}
{"log":"   at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.\u003c\u003ec__DisplayClass15_0.\u003cUseStartup\u003eb__1(IApplicationBuilder app)\n","stream":"stderr","time":"2021-01-11T00:19:19.943677872Z"}
{"log":"   at Microsoft.AspNetCore.Mvc.Filters.MiddlewareFilterBuilderStartupFilter.\u003c\u003ec__DisplayClass0_0.\u003cConfigure\u003eg__MiddlewareFilterBuilder|0(IApplicationBuilder builder)\n","stream":"stderr","time":"2021-01-11T00:19:19.943699942Z"}
{"log":"   at Microsoft.AspNetCore.HostFilteringStartupFilter.\u003c\u003ec__DisplayClass0_0.\u003cConfigure\u003eb__0(IApplicationBuilder app)\n","stream":"stderr","time":"2021-01-11T00:19:19.943710348Z"}
{"log":"   at Microsoft.AspNetCore.Hosting.GenericWebHostService.StartAsync(CancellationToken cancellationToken)\n","stream":"stderr","time":"2021-01-11T00:19:19.943721313Z"}
{"log":"   at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)\n","stream":"stderr","time":"2021-01-11T00:19:19.943730043Z"}
{"log":"   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)\n","stream":"stderr","time":"2021-01-11T00:19:19.943738633Z"}
{"log":"   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)\n","stream":"stderr","time":"2021-01-11T00:19:19.94374883Z"}
{"log":"   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host)\n","stream":"stderr","time":"2021-01-11T00:19:19.943758258Z"}
{"log":"   at OpenAlprWebhookProcessor.Program.Main(String[] args) in /src/Program.cs:line 20\n","stream":"stderr","time":"2021-01-11T00:19:19.943767408Z"}
 
you're missing the users database string which i just realized is missing from the example :) "UsersContext": "Data Source=config/users.db" put it under the connectionstring json
 
  • Like
Reactions: biggen