skoruba / Duende.IdentityServer.Admin

The administration for the Duende IdentityServer and Asp.Net Core Identity ⚡
Apache License 2.0
556 stars 194 forks source link

Allow the application run under Linux OS family #74

Open Maxmyd opened 2 years ago

Maxmyd commented 2 years ago

Hello, Problem is the application now is not running on Linux, though it supports .NET 6

What to do (I did, and it worked)

  1. Import Microsoft.Extensions.Hosting.Systemd package from Nuget
  2. In Program.cs:
    Host.CreateDefaultBuilder(args)
                .UseSystemd() // add this line
  3. Add a .service file to the project. Names, urls and variables in the file might vary of course:
    
    [Unit]
    Description=Identity server admin

[Service] WorkingDirectory=/var/www/Identity/Admin ExecStart=/usr/bin/dotnet /var/www/Identity/Admin/Skoruba.Duende.IdentityServer.Admin.dll --urls=http://localhost:5001/ Restart=always RestartSec=10 SyslogIdentifier=IdentityServerAdmin User=linux_login_here Environment=ASPNETCORE_ENVIRONMENT=Development Environment=DOTNET_PRINT_TELEMETRY_MESSAGE=false

[Install] WantedBy=multi-user.target


4. Compile, deploy and start service using "systemctl" command

Would be nice if you add these changes, right now I had to clone repository and make changes manually