Skip to content

Commit ce62775

Browse files
committed
Revert "Replace nginx with ASP.NET Core static file hosting"
This reverts commit c0bbc9c.
1 parent 9661d02 commit ce62775

440 files changed

Lines changed: 267 additions & 899 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dockerignore

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
**/.dockerignore
2+
**/.env
3+
**/.git
4+
**/.gitignore
5+
**/.project
6+
**/.settings
7+
**/.toolstarget
8+
**/.vs
9+
**/.vscode
10+
**/.idea
11+
**/*.*proj.user
12+
**/*.dbmdl
13+
**/*.jfm
14+
**/azds.yaml
15+
**/bin
16+
**/node_modules
17+
**/npm-debug.log
18+
**/obj
19+
**/secrets.dev.yaml
20+
**/values.dev.yaml
21+
22+
**/.devcontainer
23+
**/.fleet
24+
**/.husky
25+
**/.run
26+
**/.space
27+
**/dist
28+
docker-compose*.yml
29+
Dockerfile*
30+
LICENSE
31+
LICENSE-CODE
32+
README.md
33+
redirect.conf

.github/workflows/ci.yml

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,9 @@ jobs:
1616
build:
1717
runs-on: ubuntu-latest
1818
steps:
19-
- uses: actions/checkout@v4
20-
21-
- name: Setup .NET
22-
uses: actions/setup-dotnet@v4
19+
- uses: actions/checkout@v2
2320
with:
24-
dotnet-version: '10.0.x'
25-
26-
- name: Setup Node.js
27-
uses: actions/setup-node@v4
28-
with:
29-
node-version: '22'
30-
31-
- name: Build container
32-
run: dotnet build.cs container
33-
34-
- name: Run tests
35-
run: dotnet build.cs dotnet-test
21+
submodules: true
22+
- name: build
23+
run: |
24+
docker build .

.github/workflows/link-checker.yml

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
workflow_dispatch:
55
schedule:
66
- cron: "0 10 * * 0"
7+
#push:
8+
# branches:
9+
# - main
710
pull_request:
811
types: [opened, synchronize, reopened, closed]
912
branches:
@@ -18,25 +21,21 @@ jobs:
1821
issues: write
1922
name: Link Checker Job
2023
steps:
21-
- uses: actions/checkout@v4
22-
23-
- name: Setup .NET
24-
uses: actions/setup-dotnet@v4
24+
- uses: actions/checkout@v2
2525
with:
26-
dotnet-version: '10.0.x'
27-
28-
- name: Setup Node.js
26+
submodules: true
27+
- name: Setup Node
2928
uses: actions/setup-node@v4
3029
with:
31-
node-version: '22'
32-
33-
- name: Build Astro
34-
run: dotnet build.cs astro-build
35-
30+
node-version: 22
31+
- name: Run build
32+
run: |
33+
echo $PWD
34+
./build.sh
3635
- name: Link Checker
3736
uses: lycheeverse/lychee-action@v2
3837
env:
3938
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
4039
with:
41-
args: '--header ''x-origin-verify: ${{ secrets.ORIGIN_VERIFICATION_HEADER_VALUE }}'' --no-progress --max-concurrency 8 --skip-missing --accept 200,429 --exclude-path server/src/Docs.Web/wwwroot/_llms-txt --exclude-path server/src/Docs.Web/wwwroot/llms.txt --exclude-path server/src/Docs.Web/wwwroot/llms-full.txt --exclude-path server/src/Docs.Web/wwwroot/llms-small.txt --exclude-loopback --require-https --exclude sample.duendesoftware.com --exclude "docs.duendesoftware.com/404" --exclude sitemap --exclude "https://github.com/DuendeArchive/IdentityModel.AspNetCore/" --root-dir "$PWD/server/src/Docs.Web/wwwroot" server/src/Docs.Web/wwwroot/**'
40+
args: "--header 'x-origin-verify: ${{ secrets.ORIGIN_VERIFICATION_HEADER_VALUE }}' --no-progress --max-concurrency 8 --skip-missing --accept 200,429 --exclude-path root/_llms-txt --exclude-path root/llms.txt --exclude-path root/llms-full.txt --exclude-path root/llms-small.txt --exclude-loopback --require-https --exclude sample.duendesoftware.com --exclude \"docs.duendesoftware.com/404\" --exclude sitemap --exclude \"https://github.com/DuendeArchive/IdentityModel.AspNetCore/\" --root-dir \"$PWD/root\" root/**"
4241
fail: true

.gitignore

Lines changed: 5 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
# Astro build output
2-
astro/dist/
3-
astro/root/
4-
server/src/Docs.Web/wwwroot/
5-
1+
# build output
2+
dist/
3+
root/
64
# generated types
7-
astro/.astro/
5+
.astro/
86

97
# dependencies
108
node_modules/
@@ -30,41 +28,5 @@ pnpm-debug.log*
3028
opencode.json
3129
.idea/**/copilot.data.migration.*.xml
3230

33-
# .NET
34-
*.user
35-
*.suo
36-
*.userosscache
37-
*.sln.docstates
38-
[Bb]in/
39-
[Oo]bj/
40-
[Ll]og/
41-
[Ll]ogs/
31+
# ides
4232
.vs/
43-
*.nupkg
44-
*.snupkg
45-
project.lock.json
46-
project.fragment.lock.json
47-
artifacts/
48-
49-
# Rider
50-
.idea/**/workspace.xml
51-
.idea/**/tasks.xml
52-
.idea/**/usage.statistics.xml
53-
.idea/**/dictionaries
54-
.idea/**/shelf
55-
56-
# User-specific files
57-
*.rsuser
58-
59-
# JetBrains Rider
60-
*.sln.iml
61-
62-
# ASP.NET Scaffolding
63-
ScaffoldingReadMe.txt
64-
65-
# Windows
66-
Thumbs.db
67-
ehthumbs.db
68-
69-
# Azure Functions
70-
local.settings.json
File renamed without changes.
File renamed without changes.

Dockerfile

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
FROM node:22-alpine AS builder
2+
3+
EXPOSE 8080
4+
5+
WORKDIR /app
6+
COPY package.json package-lock.json ./
7+
RUN npm install --no-cache
8+
COPY . .
9+
RUN chmod +x build.sh
10+
11+
RUN ./build.sh
12+
13+
FROM nginx:stable-alpine AS final
14+
15+
ARG APPLICATION_VERSION
16+
COPY deployment/nginx.conf /etc/nginx/nginx.conf
17+
COPY deployment/default.conf /etc/nginx/conf.d/default.conf
18+
RUN sed -i "s|\$APPLICATION_VERSION|${APPLICATION_VERSION}|g" /etc/nginx/conf.d/default.conf
19+
COPY --from=builder --chown=nginx:nginx /app/root/redirect.conf /etc/nginx/extra/redirect.conf
20+
21+
RUN rm -rf /usr/share/nginx/html/*
22+
COPY --from=builder --chown=nginx:nginx /app/root/ /usr/share/nginx/html/
23+
RUN rm -rf /usr/share/nginx/html/redirect.conf
24+
25+
RUN mkdir -p /var/cache/nginx
26+
27+
RUN chown -R nginx:nginx /var/cache/nginx
28+
RUN touch /var/run/nginx.pid && \
29+
chown -R nginx:nginx /var/run/nginx.pid
30+
31+
USER nginx
32+
33+
WORKDIR /usr/share/nginx/html

README.md

Lines changed: 36 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -4,98 +4,35 @@ Welcome to the documentation of all [Duende Software](https://duendesoftware.com
44

55
## Getting Started
66

7-
You will need the following installed:
8-
* [.NET 10 SDK](https://dotnet.microsoft.com/download/dotnet/10.0)
9-
* Node.js 22+
7+
You will need Node 22+ installed on your operating system and available in the PATH.
108

11-
### Quick Start (Astro only)
12-
13-
```bash
14-
cd astro
15-
npm install
16-
npm run dev
17-
```
18-
19-
### Development with .NET Aspire
20-
21-
For local development with the full stack (Astro dev server + ASP.NET Core):
22-
23-
```bash
24-
dotnet build.cs aspire
25-
```
26-
27-
This starts:
28-
* **Astro dev server** at http://localhost:4321 (with hot reload)
29-
* **ASP.NET Core server** (for production-like static file serving)
30-
* **Aspire Dashboard** at https://localhost:17001 (for traces, logs, metrics)
9+
* Run `npm install` to restore all dependencies.
10+
* Use `npm run dev` to run the documentation site locally.
3111

3212
Alternatively in VS Code, GitHub Codespaces, or WebStorm, you can use the devcontainer to get a development environment set up.
3313

34-
## Build Commands
35-
36-
All commands use the `build.cs` file-based build script and can be run from any directory in the repository:
37-
38-
| Command | Action |
39-
| :------ | :----- |
40-
| `dotnet build.cs` | Build everything (Astro + .NET) |
41-
| `dotnet build.cs astro-build` | Build Astro to wwwroot |
42-
| `dotnet build.cs dotnet-build` | Build .NET solution |
43-
| `dotnet build.cs container` | Build container image |
44-
| `dotnet build.cs aspire` | Start Aspire dev environment |
45-
| `dotnet build.cs clean` | Clean all build outputs |
46-
| `dotnet build.cs verify-formatting` | Check .NET code formatting |
47-
| `dotnet build.cs --list-targets` | List all available targets |
48-
49-
## Container
50-
51-
The container is built using `dotnet publish /t:PublishContainer` (no Dockerfile required).
52-
53-
### Building the container
54-
55-
```bash
56-
dotnet build.cs container
57-
```
58-
59-
### Running the container
60-
61-
```bash
62-
docker run -p 8080:8080 docs
63-
```
64-
65-
The site will be available at http://localhost:8080.
66-
6714
## Project Structure
6815

69-
This project uses Astro + Starlight for the documentation site, served by ASP.NET Core in production.
16+
This project uses Astro + Starlight. You'll see the following folders and files:
7017

7118
```
7219
.
73-
├── build.cs # File-based build script
74-
├── astro/ # Astro documentation site
75-
│ ├── public/
76-
│ ├── src/
77-
│ │ ├── assets/
78-
│ │ ├── content/
79-
│ │ │ └── docs/
80-
│ │ └── content.config.ts
81-
│ ├── astro.config.mjs
82-
│ ├── package.json
83-
│ └── tsconfig.json
84-
└── server/ # ASP.NET Core server
85-
├── src/
86-
│ ├── Docs.Web/ # Static file server
87-
│ │ └── wwwroot/ # Astro build output (gitignored)
88-
│ ├── Docs.AppHost/ # .NET Aspire orchestrator
89-
│ └── Docs.ServiceDefaults/ # Shared configuration
90-
└── tests/
91-
└── Docs.Web.Tests/ # Integration tests
20+
├── public/
21+
├── src/
22+
│ ├── assets/
23+
│ ├── content/
24+
│ │ ├── docs/
25+
│ └── content.config.ts
26+
├── astro.config.mjs
27+
├── package.json
28+
└── tsconfig.json
9229
```
9330

94-
Starlight looks for `.md` or `.mdx` files in the `astro/src/content/docs/` directory. Each file is exposed as a route based on its file name.
31+
Starlight looks for `.md` or `.mdx` files in the `src/content/docs/` directory. Each file is exposed as a route based on its file name.
9532

96-
Images can be added to `astro/src/assets/` and embedded in Markdown with a relative link.
33+
Images can be added to `src/assets/` and embedded in Markdown with a relative link.
9734

98-
Static assets, like favicons, can be placed in the `astro/public/` directory.
35+
Static assets, like favicons, can be placed in the `public/` directory.
9936

10037
## ✍️ Authoring
10138

@@ -126,7 +63,7 @@ WebStorm has Grazie as a built-in spell checker and grammar checker, and support
12663
* When linking to external resources, use the full URL using HTTPS.
12764
* You can link to header anchors using the `#` symbol, for example `[multiple authentication methods](/identityserver/ui/federation.md#multiple-authentication-methods-for-users)`.
12865
* Link relevant text. Prefer `learn more about [improving the sign-in experience]` over `click [here] to learn more`.
129-
* Run `dotnet build.cs link-check` to build Astro for link validation (actual lychee check runs in CI).
66+
* Run `npm run linkchecker` to validate all links (note this will ignore links to GitHub because of rate limits in place).
13067
* When a markdown link is long (75+ characters) or a link is repeated multiple times on a page, prefer moving the link to the bottom of the file and using markdown anchor syntax `[test.cs][repo-test-file]`
13168

13269
### Markdown Style
@@ -147,7 +84,7 @@ WebStorm has Grazie as a built-in spell checker and grammar checker, and support
14784
* Make sure examples are runnable and complete. The goal is "Copy-paste from docs". Include namespaces, a result, and other prerequisites that are not obvious to someone new to the code.
14885
* Inline comments can be used to explain essential parts of the code. Expressive code can highlight line numbers, show diffs, and more.
14986
* Mention NuGet packages as a `bash` code block showing how to install it (`dotnet add package ...`). Link to the NuGet Gallery.
150-
* When referencing a property, field, class, or other symbol in text, use the `test` format instead of _test_.
87+
* When referencing a property, field, class, or other symbol in text, use the `test` format instead of *test*.
15188
* Values should also be back-ticked, especially HTTP Status codes like `404` or `401`.
15289
* Make sure code blocks start at the very first character space and don't have excessive starting padding.
15390

@@ -158,29 +95,30 @@ WebStorm has Grazie as a built-in spell checker and grammar checker, and support
15895
* Always have a `date` property to set the creation/significant update date for a page. Use the `YYYY-MM-DD` format.
15996
* Add the `sidebar` property and must include the `label` and `order`. The `label` is used in the menu, and should typically be shorter than the more descriptive `title`. For example:
16097

161-
```yaml
162-
title: "Using IdentityServer As A Federation Gateway"
163-
sidebar:
164-
label: "Federation"
165-
order: 1
166-
```
98+
```yaml
99+
title: "Using IdentityServer As A Federation Gateway"
100+
sidebar:
101+
label: "Federation"
102+
order: 1
103+
```
167104
168105
## 🧞 Commands
169106
170-
Astro commands are run from the `astro/` directory:
107+
All commands are run from the root of the project, from a terminal:
171108
172-
| Command | Action |
173-
| :------ | :----- |
174-
| `npm install` | Installs dependencies |
175-
| `npm run dev` | Starts local dev server at `localhost:4321` |
176-
| `npm run build` | Build production site (use `dotnet build.cs astro-build` instead) |
177-
| `npm run preview` | Preview your build locally |
178-
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
109+
| Command | Action |
110+
|:--------------------------|:-------------------------------------------------|
111+
| `npm install` | Installs dependencies |
112+
| `npm run dev` | Starts local dev server at `localhost:4321` |
113+
| `npm run build` | Build your production site to `./dist/` |
114+
| `npm run preview` | Preview your build locally, before deploying |
115+
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
116+
| `npm run astro -- --help` | Get help using the Astro CLI |
117+
| `npm run linkchecker` | Run lychee link checker |
179118

180119
## 🔀 Redirects
181120

182121
There are two ways to restructure content:
183-
184122
* Internal (move content around in the current structure)
185123
* External (move content outside the current structure)
186124

@@ -195,6 +133,7 @@ title: Page title
195133
redirect_from:
196134
- /old-path-to/content
197135
---
136+
198137
Page content goes here
199138
```
200139

@@ -203,7 +142,7 @@ This will generate the page at the new location, and put a redirect to it at the
203142
### External Restructuring
204143

205144
When moving a page outside the structure, or you need a redirect to another location altogether,
206-
edit the `astro/astro.config.mjs` file and append a key/value pair to the `redirects` property:
145+
edit the `astro.config.mjs` file and append a key/vaklue pair to the `redirects` property:
207146

208147
```json
209148
redirects: {
File renamed without changes.

0 commit comments

Comments
 (0)