Skip to content

Commit

Permalink
docs: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
DamienLaffond committed Nov 7, 2024
1 parent 95c73f4 commit c337fe0
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Open Source Project Template

This repository contains a template to seed a repository for an Open Source
This repository contains a template to seed a repository for an Aspire Open Source
project.

Prior to submitting your request for publication, make sure to review the
Expand Down
60 changes: 51 additions & 9 deletions template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,30 @@ Precise installations instructions are as follow:

### For WSL Users
- If you’re using Docker Desktop, remember to [enable it in your WSL distro](https://docs.docker.com/desktop/wsl/#enabling-docker-support-in-wsl-2-distros)
- VS Code extensions must be activated in WSL.
- Active WSL extension in VS Code.
- The ASP.NET Core developement certificate installed in WSL must be trusted in your Windows browser.

Then you need to trust the ASP.NET Core development certificate.

1. Install the .NET SDK in Windows [whichever way you want](https://learn.microsoft.com/en-us/dotnet/core/install/windows).
1. Install and activate the ASP.NET Core development certificate (`[password]` being any password you’ll remember in the next minute). In Windows:
1. Install and activate the ASP.NET Core development certificate (`[password]` being any password you’ll remember in the next minute).
In Windows terminal:
```console
dotnet dev-certs https --clean
dotnet dev-certs https --trust
dotnet dev-certs https -ep https.pfx -p [password]
```
If you get a message " A valid HTTPS certificate is already present." it doesnt failed.

3. Restart your browser to make sure it trusts the new certificate.
3. Import the certificate in WSL and trust it for inter-service communications (`[path]` being the path to the windows directory you executed the previous commands, and `[password]` being the password entered previously):
4. Open a WSL terminal to import the certificate and trust it for inter-service communications (`[path]` being the path to the windows directory you executed the previous commands after `C:`, and `[password]` being the password entered previously):

```console
sudo apt update
sudo apt install dotnet-sdk-8.0
dotnet dev-certs https --clean --import /mnt/c/[path]/https.pfx --password [password]
sudo -E dotnet dev-certs https -ep /usr/local/share/ca-certificates/aspnet/https.crt --format PEM
sudo mkdir /usr/local/share/ca-certificates/aspnet/
sudo -E dotnet dev-certs https -ep /usr/local/share/ca-certificates/aspnet/https.crt --format PEM
sudo update-ca-certificates
```

Expand All @@ -54,6 +60,7 @@ dotnet dev-certs https --trust

### For all OSes: install Nix, direnv

* All the following is done in WSL for windows users
Use the [Determinate Nix installer](https://github.com/DeterminateSystems/nix-installer):
```console
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
Expand All @@ -63,8 +70,20 @@ Follow any instructions, including those necessary to get nix in path.

1. Install direnv.
```console
nix profile install nixpkgs#nix-direnv
nix profile install nixpkgs#direnv
```

If running on zsh and getting a `no match found nixpkgs#direnv` error do the following and retry installing direnv :
```console
unsetopt extendedGlob
```

If you get `No such file or directory` error do the following and retry installing direnv :
```console
sudo mkdir /nix/var/nix/profiles/per-user/username
sudo chown username /nix/var/nix/profiles/per-user/username
```

2. [Hook direnv into your shell](https://direnv.net/docs/hook.html).

> For bash this means adding the following line in your `~/.bashrc`:
Expand Down Expand Up @@ -96,22 +115,45 @@ nix profile install nixpkgs#nix-direnv
### Start for real
1. Get this repository’s content
You need to configure the gitconfig to have correct credentials and setup to use git.
- Mount the windows git credential manager into your wsl :
``` git config --global credential.helper "/mnt/c/Program\ Files/Git/mingw64/bin/git-credential-manager.exe" ```
- configure http :
``` git config --global credential.https://dev.azure.com.useHttpPath true ```
- add name and email to be able to push :
``` git config --global user.name=[YourAccountName]```
``` git config --global user.email=[YourEmailAccountName]```
```console
git checkout [ProjectRepository]
git clone [ProjectRepository]
```
4. Start VS Code. NB: it has to be started this way to ensure the correct .NET frawework is found and debugging works.


#### Build and Test
*Note : Project config expires so if you're facing issues close the solution and reopen it using `just code`

- Launch docker desktop
Start VS Code. NB: it has to be started this way to ensure the correct .NET frawework is found and debugging works.
```console
just code
```

- Install C# Dev Kit extension in VS Code
In command palette (Mac: _command+shift+p_, windows: _ctrl+shift+p_) :
- .NET: Clean
- .NET: Build
- Run > Start Debugging > C# > [ProjectName].AppHost [Default]

Later it can be run from *run & debug* tab.


To get a list of other recipes:
```console
just --list
```

Further instructions are in the `README` of your new project.

## Features

{More details/listing of features of the project}
Expand Down

0 comments on commit c337fe0

Please sign in to comment.