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.
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
Edit the WorkingDirectory and ExecStart lines with the appropriate disk path.
Edit the User line with the user that will run the application.
Edit the Environment=ASPNETCORE_URLS line to set the hostname and port if required.
Save the file as
/etc/systemd/system/ColecticaRepository.service
.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
Run the following command so systemd loads the new service.
sudo systemctl daemon-reload
To enable the service to start when the system boots, run:
sudo systemctl enable ColecticaRepository
To start the service, run:
sudo systemctl start ColecticaRepository