Skip to content

Commit

Permalink
Merge pull request #66 from MatthewL246/docs
Browse files Browse the repository at this point in the history
Create a Docusaurus documentation website
  • Loading branch information
MatthewL246 authored May 30, 2024
2 parents 682f8ab + 3827b0a commit f0c300a
Show file tree
Hide file tree
Showing 41 changed files with 15,520 additions and 346 deletions.
5 changes: 5 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,8 @@ updates:
directory: /
schedule:
interval: daily

- package-ecosystem: npm
directory: /docs
schedule:
interval: daily
61 changes: 61 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Build and deploy documentation site

on:
push:
paths:
- "docs/**"
pull_request:
paths:
- "docs/**"
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: docs
steps:
- name: Configure GitHub Pages
uses: actions/configure-pages@v5

- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: ./docs/package-lock.json

- name: Install dependencies
run: npm ci

- name: Build the documentation site
run: npm run build

- name: Upload GitHub Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./docs/build

deploy:
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
concurrency:
group: github-pages
cancel-in-progress: false
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
4 changes: 4 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ name: Test scripts and build Docker images

on:
push:
paths-ignore:
- "docs/**"
pull_request:
paths-ignore:
- "docs/**"
workflow_dispatch:

jobs:
Expand Down
9 changes: 9 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@
"isDefault": true
}
},
{
"label": "Start docs server",
"type": "shell",
"options": {
"cwd": "${workspaceFolder}/docs"
},
"command": "npm install && npm start",
"problemMatcher": []
},
{
"label": "Build account",
"type": "shell",
Expand Down
357 changes: 34 additions & 323 deletions README.md

Large diffs are not rendered by default.

4 changes: 0 additions & 4 deletions config/README.md

This file was deleted.

5 changes: 1 addition & 4 deletions console-files/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# Console files

This directly includes files that need to be copied to a console to help with the connection setup process, as well as
necessary dumps.
# Console files credits

The program `ResetFriendsTestAccount.3dsx` was created by [Trace](https://github.com/TraceEntertains) (`traceentertains`
on Discord) and was originally shared in the Pretendo Network Discord server as `manual_override.3dsx`. **All credit for
Expand Down
20 changes: 20 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Dependencies
/node_modules

# Production
/build

# Generated files
.docusaurus
.cache-loader

# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
33 changes: 33 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Pretendo Docker Documentation

This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.

[![Build and deploy documentation site](https://github.com/MatthewL246/pretendo-docker/actions/workflows/docs.yml/badge.svg)](https://github.com/MatthewL246/pretendo-docker/actions/workflows/docs.yml)

## [View the live site here](https://matthewl246.github.io/pretendo-docker)

## Development

### Install dependencies

```shell
npm install
```

### Start a local development server

```shell
npm start
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without
having to restart the server.

### Build the site

```shell
npm run build
```

This command generates static content into the `build` directory and can be served using any static contents hosting
service.
3 changes: 3 additions & 0 deletions docs/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: [require.resolve("@docusaurus/core/lib/babel/preset")],
};
43 changes: 43 additions & 0 deletions docs/docs/containers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
sidebar_position: 6
---

# Containers information

This page contains information about the various services that make up Pretendo Docker and how to administer them.

## Infrastructure

:::info

Check the `secrets.txt` file in the root of the repository to find the usernames and randomly-generated passwords needed
to authenticate with the servers.

:::

| Server | Purpose | Usage and administration |
| --------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [CoreDNS](https://coredns.io/) | DNS server for both internal container networking and external DNS resolution. It spoofs the Pretendo domains to the address of your local server. | No administration necessary. |
| [nginx](https://nginx.org/en/) | Reverse proxy and Web server. It sends HTTP requests to the right Pretendo server based on their hostname. | No administration necessary. |
| [MongoDB](https://www.mongodb.com/) | Primary database that the Pretendo account and Juxtaposition servers use to store PNIDs and Juxtaposition content. | Use Mongo Express (see below) to view the databases and perform simple edits. You can also use the `mongosh` command inside the container for more advanced administration tasks or download the [MongoDB Compass GUI](https://www.mongodb.com/products/tools/compass) for easier database editing. (Connect to `mongodb://127.0.0.1:27017/?directConnection=true`. Make sure to enable "Use direct connection".) |
| [Mongo Express](https://github.com/mongo-express/mongo-express) | Simple web GUI for MongoDB administration. | Open [127.0.0.1:8082](http://127.0.0.1:8082) in your browser with the container running. |
| [MinIO](https://min.io/) | Object store compatable with the AWS S3 API. It is used as file storage and a CDN for the Pretendo servers. Mii images, Juxtaposition screenshots, and more are uploaded here. | Open [127.0.0.1:8083](http://127.0.0.1:8083) in your browser with the container running. |
| [Redis](https://redis.io/) | Cache database used by the account server. | No administration necessary. |
| [MailDev](https://maildev.github.io/maildev/) | SMTP server used to test sending emails from the account server. Use this to view your PNID email verification code. | Open [127.0.0.1:8084](http://127.0.0.1:8084) in your browser with the container running. |
| [PostgreSQL](https://www.postgresql.org/) | Secondary database used by Friends and many game servers. | Use Adminer (see below) to view the databases and run SQL scripts. You can also download the [pgAdmin GUI](https://www.pgadmin.org/) and connect to `127.0.0.1:5432` to perform advanced administration tasks. |
| [Adminer](https://www.adminer.org/) | Web GUI for database administration, used for Postgres. | Open [127.0.0.1:8085](http://127.0.0.1:8085) in your browser with the container running. |
| [Redis Commander](https://joeferner.github.io/redis-commander/) | Web GUI for Redis database administration. | Open [127.0.0.1:8086](http://127.0.0.1:8086) in your browser with the container running. |

## Pretendo Network

| Server | Purpose |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [mitmproxy-pretendo](https://github.com/MatthewL246/mitmproxy-pretendo) | Intercepts HTTP requests from client devices and redirects them to the official Pretendo server to your local server. Uses [mitmproxy](https://mitmproxy.org) running on port 8080. |
| [account](https://github.com/PretendoNetwork/account) | The most important Pretendo server. It handles PNIDs, authentication, and tokens. |
| [website](https://github.com/PretendoNetwork/website) | Runs a local copy of the [Pretendo Network website](https://pretendo.network). Used for creating PNIDs without a console. |
| [friends](https://github.com/PretendoNetwork/friends) | Handles the Friend List applet and friendships. Juxt and other game servers use it to get friends. |
| [miiverse-api](https://github.com/PretendoNetwork/miiverse-api) | Handles Miiverse API requests from games and Miiverse portal discovery. |
| [juxtaposition-ui](https://github.com/PretendoNetwork/juxtaposition-ui) | The Miiverse applet GUI, as well as the Juxt web interface. |
| Wii U Chat ([authentication](https://github.com/PretendoNetwork/wiiu-chat-authentication) and [secure](https://github.com/PretendoNetwork/wiiu-chat-secure)) | Server for the Wii U Chat app. |
| [BOSS](https://github.com/PretendoNetwork/BOSS) | Server for BOSS (SpotPass) content. |
| [Super Mario Maker](https://github.com/PretendoNetwork/super-mario-maker) | Server for Super Mario Maker online features. |
4 changes: 4 additions & 0 deletions docs/docs/setup/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"position": 2,
"label": "Setup guide"
}
Loading

0 comments on commit f0c300a

Please sign in to comment.