Skip to content
This repository was archived by the owner on Oct 24, 2022. It is now read-only.

CovOpen/DataDonation

Repository files navigation

⚠️ Attention! This project will be continued here: https://github.com/OSPRS/DataDonation

DataDonation

The Data Donation Service for the CovApp

Production

Preparation

  1. Install .NET Core SDK or Runtime
  2. Install MySQL apt-get install mysql

Installation

Change the appsettings.json accordingly. (e.g. The Database Connection String)

# Add user to mysql: https://www.digitalocean.com/community/tutorials/how-to-create-a-new-user-and-grant-permissions-in-mysql
mysql 
  CREATE USER 'datadonation'@'localhost' IDENTIFIED BY 'YourPassword123';
  GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'localhost';
  FLUSH PRIVILEGES;
    
# Install this service
git clone https://github.com/CovOpen/DataDonation.git
cd ./DataDonation
dotnet restore
dotnet publish -c Release -o ./app
# Edit the appsettings.json file in ./app/appsettings.json and change the connection string to the just created user and database. 
nano ./app/appsettings.json
# Test the startup
dotnet ./app/DataDonation.dll

Add it to your reverse proxy, e.g. Nginx:

  location / {
    proxy_pass http://127.0.0.1:8000;
  }

Add it as system service:

cat > /etc/system/sytemd/data-donation.service <<EOF
[Unit]
Description=Data Donation
# Starts this service as soon as it is connected with the internet
After=network.target auditd.service

[Service]
ExecStart=/usr/bin/dotnet /home/path/to/DataDonation/app/DataDonation.dll
KillMode=process
Restart=on-failure
RestartPreventExitStatus=255
WorkingDirectory=/home/path/to/DataDonation/app

[Install]
WantedBy=multi-user.target
EOF

# Enable the service to restart
systemctl daemon-reload
systemctl enable data-donation.service
systemctl start data-donation.service
systemctl status data-donation.service

# Does not run? Find the whole error message with:
journalctl -u data-donation.service

Development

Install .NET Core SDK or Runtime

Run docker-compose up -d before to start the local database.

dotnet restore
dotnet watch run

About

The Data Donation Service for the CovApp

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors