Running Repository Standalone on Linux

HTTPS

To enable HTTPS, update the appsettings.json file with the path to your certificate’s .pfx file along with an optional password or empty password. The settings are located in the Kestrel:Certificates:Default setting.

See also

See the Kestrel documentation for information on configuring https and certificates.

Systemd

On Linux systems with systemd, you may wish to create a systemd service to run the Repository application. This helps ensure the Repository application is always accessible. Follow these steps to create and run a systemd service for Colectica Repository.

  1. Create a service unit configuration file with content similar to the following.

[Unit]
Description=Colectica Repository

[Service]
WorkingDirectory=/home/colectica/deploy/repository/ColecticaRepository
ExecStart=/home/colectica/deploy/repository/ColecticaRepository/ColecticaRepository
SyslogIdentifier=ColecticaRepository
User=colectica
Restart=always
RestartSec=5

KillSignal=SIGINT
Environment=ASPNETCORE_ENVIRONMENT=Production
Environment=DOTNET_PRINT_TELEMETRY_MESSAGE=false

# This environment variable will allow you to override
# which IP & ports the Kestrel Web Server will listen to
Environment=ASPNETCORE_URLS=http://*:80;https://*:443

# give the executed process the CAP_NET_BIND_SERVICE capability.
# This capability allows the process to bind to well known ports.
AmbientCapabilities=CAP_NET_BIND_SERVICE

[Install]
WantedBy=multi-user.target
  1. Edit the WorkingDirectory and ExecStart lines with the appropriate disk path.

  2. Edit the User line with the user that will run the application.

  3. Edit the Environment=ASPNETCORE_URLS line to set the hostname and port if required.

  4. Save the file as /etc/systemd/system/ColecticaRepository.service.

  5. You may have to update any built in firewall to allow traffic.

    sudo firewall-cmd --zone=public --add-port 80/tcp --permanent
    sudo firewall-cmd --zone=public --add-port 443/tcp --permanent
    sudo firewall-cmd --reload
    
  6. Run the following command so systemd loads the new service.

    sudo systemctl daemon-reload
    
  7. To enable the service to start when the system boots, run:

    sudo systemctl enable ColecticaRepository
    
  8. To start the service, run:

    sudo systemctl start ColecticaRepository