Skip to content

Latest commit

 

History

History
93 lines (57 loc) · 3.48 KB

Environment-Setup.md

File metadata and controls

93 lines (57 loc) · 3.48 KB

Environment Setup

.NET Dev Certs

This project runs over https which can be configured locally using the .NET SDK:

dotnet dev-certs https --trust

Troubleshooting

If you have issues with the Admin client Webpack dev server using the ASP.NET Core dev cert, you might have a cert on the filesystem being used by the webpack dev server that is no longer trusted. This can be caused by running dotnet dev-certs https --clean and then dotnet dev-certs https --trust. This will install a new dev cert and the previous cert, which webpack exported, is no longer valid.

To resolve this you can explicitly run the following commands to re-generate the certificates.

On Windows:

dotnet dev-certs https --format pem --no-password --export-path "$env:APPDATA/ASP.NET/https/kentico-community-portal-web-admin.pem"

On MacOS/Linux

dotnet dev-certs https --format pem --no-password -ep $HOME/.aspnet/https/kentico-community-portal-web-admin.pem

These are the commands that are automatically executed for you if no local certs exist when starting up the Admin local dev Node.js script (details in ~\src\Kentico.Community.Portal.Admin\Client\webpack.config.js).

Restore Database

  • Database backups are located in the .\database folder

    • .bacpac (database snapshot archive)

    • .bak (data + full transaction logs)

    • Note: The database backup listed on the first line of the .\database\backups.txt file is the most recent backup and should be used as a starting point for a newly set up project.

  • PowerShell

    1. Use the Restore-Database.ps1 script (.bacpac files only)

      cd .\scripts
      
      .\Restore-Database.ps1 `
      -ServerName "<server name>" `
      -DatabaseName "<database name>" `
      -BacpacFile "<filename.bacpac>" `
      -WorkspaceFolder $PWD
  • (alternative) Azure Data Studio

    1. Restore a .bacpac file (data + schema)
    2. Restore a .bak file
  • (alternative) Add database in SQL Server Management Studio

    • Restore a .bacpac file

    • (alternative) Restore a .bak file

      1. Launch SQL SSMS

      2. Extract backup file might require from .zip

        • .\database\<database-backup.zip>
      3. Restore database

        • Right click on 'Databases'
        • 'Restore Database'
        • Select source 'Device' -> ...-> 'Add'
        • Select .bak from .\database\<database-backup.bak> -> OK
      4. Add User mapping

        • 'Security' -> 'Logins'
        • Right click on your account
        • 'Properties' -> 'User Mapping' -> tick Kentico.Community -> tick 'db owner' -> OK

Configure Application

  1. Open .\Kentico.Community.Portal.sln OR open folder directly from VS Code.

    If using VS Code, install all recommended extensions

  2. Set your database Connection String in your local User Secrets

  3. Disable ReCaptcha validation in your local User Secrets (see settings for ReCaptcha in appsettings.CI.json) or supply a localhost ReCaptcha v3 key/secret