adds corepack-pnpm and uses Prettier fixes

This commit is contained in:
adagio 2024-06-19 01:26:43 -04:00
parent a9866733fc
commit df52412800
No known key found for this signature in database
GPG key ID: 0AE37F9649850573
9 changed files with 2561 additions and 27 deletions

3
.gitignore vendored
View file

@ -1,3 +1,6 @@
.preview
*~
node_modules
book book
.idea/ .idea/
.cache/ .cache/

53
package.json Normal file
View file

@ -0,0 +1,53 @@
{
"name": "pages-server",
"version": "0.0.0",
"description": "Pages Documentation",
"author": "Forgejo Contributors",
"license": "CC-BY-SA-4.0",
"private": true,
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"lint": "pnpm run lint:remark && pnpm run lint:prettier",
"lint:remark": "remark . --quiet --frail",
"lint:prettier": "prettier --check .",
"format:remark": "remark . --quiet --frail --output",
"format:prettier": "prettier -w --cache .",
"prepare": "husky install"
},
"lint-staged": {
"*.md": "remark --quiet --frail",
"*": "prettier -w --cache --ignore-unknown"
},
"remarkConfig": {
"plugins": [
"remark-frontmatter",
"remark-preset-lint-consistent",
"remark-preset-lint-recommended",
[
"remark-lint-list-item-indent",
"space"
],
[
"remark-lint-heading-style",
"atx"
],
[
"remark-lint-no-undefined-references",
false
]
]
},
"devDependencies": {
"husky": "^8.0.3",
"lint-staged": "^14.0.1",
"prettier": "^3.3.2",
"remark-cli": "^11.0.0",
"remark-frontmatter": "^4.0.1",
"remark-lint-heading-style": "^3.1.2",
"remark-lint-list-item-indent": "^3.1.2",
"remark-lint-no-undefined-references": "^4.2.1",
"remark-preset-lint-consistent": "^5.1.2",
"remark-preset-lint-recommended": "^6.1.3"
},
"packageManager": "pnpm@9.4.0+sha256.b6fd0bfda555e7e584ad7e56b30c68b01d5a04f9ee93989f4b93ca8473c49c74"
}

2483
pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load diff

View file

@ -1,9 +1,8 @@
# Pages # Pages
[Index of Contents](title-page.md) ## [Index of Contents](title-page.md)
----
[Also Used At](also-used-at.md) [Also Used At](also-used-at.md)
[Architecture](architecture.md) [Architecture](architecture.md)
[Overview](overview.md) [Overview](overview.md)
[Repo Configuration](repo-configuration.md) [Repo Configuration](repo-configuration.md)

View file

@ -1,4 +1,3 @@
# Also Used At # Also Used At
- https://gitnet.page/ (https://gitnet.fr) - https://gitnet.page/ (https://gitnet.fr)

View file

@ -1,19 +1,19 @@
# Architecture # Architecture
| package | description | depends on | | package | description | depends on |
|--|--|--| | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| main.go | init app in cmd/* | cmd, server/version | | main.go | init app in cmd/\* | cmd, server/version |
| cmd | start app, read config from args and env vars, validate args | server/{cache,certificates,gitea,handler}, github.com/urfave/cli | cmd | start app, read config from args and env vars, validate args | server/{cache,certificates,gitea,handler}, github.com/urfave/cli |
| server/cache | create key/value cache based con settings | github.com/OrlovEvgeny/go-mcache | | server/cache | create key/value cache based con settings | github.com/OrlovEvgeny/go-mcache |
| server/database | create cert database witch persist certs for main and custom domain | github.com/go-acme/lego/v4/{certcrypto,certificate}, xorm.io/xorm | | server/database | create cert database witch persist certs for main and custom domain | github.com/go-acme/lego/v4/{certcrypto,certificate}, xorm.io/xorm |
| server/certificates | request, mock, manage certificates via acme | server/{cache,context,database,dns,gitea,utils}, github.com/go-acme/lego/v4/{registration,providers/dns,upstream} | | server/certificates | request, mock, manage certificates via acme | server/{cache,context,database,dns,gitea,utils}, github.com/go-acme/lego/v4/{registration,providers/dns,upstream} |
| server/context | smal wrapper for net/http response and requests | server/utils | | server/context | smal wrapper for net/http response and requests | server/utils |
| server/dns | handle dns lookups for custom domains | server/cache | | server/dns | handle dns lookups for custom domains | server/cache |
| server/gitea | handle all gitea-backend calls and it's caching | server/cache, code.gitea.io/sdk/gitea | | server/gitea | handle all gitea-backend calls and it's caching | server/cache, code.gitea.io/sdk/gitea |
| server/handler | take all http(s) requests and determine how they need to be threated (default pages, custom domain, ...). it does however not serve stuff | html,server/{cache,context,dns,gitea,upstream,version} | | server/handler | take all http(s) requests and determine how they need to be threated (default pages, custom domain, ...). it does however not serve stuff | html,server/{cache,context,dns,gitea,upstream,version} |
| server/upstream | try to serve stuff based on args from handler | html,server/{cache,context,gitea} | | server/upstream | try to serve stuff based on args from handler | html,server/{cache,context,gitea} |
| server/utils | general purpose functions | | | server/utils | general purpose functions | |
| server/version | just store the program version | | | server/version | just store the program version | |
## Concepts ## Concepts
@ -22,4 +22,3 @@ Each package creates a client that others can use e.g.:
- server/gitea -> GiteaClient - server/gitea -> GiteaClient
- server/certificates -> AcmeClient - server/certificates -> AcmeClient
- ... - ...

View file

@ -27,15 +27,15 @@ Currently known pitfalls:
For custom domains, two things are required: For custom domains, two things are required:
- A `.domains` file in the repository (in the branch in question), containing a list of domains that shall be usable to access that repository: - A `.domains` file in the repository (in the branch in question), containing a list of domains that shall be usable to access that repository:
- One domain per line, leaving lines empty and comment out lines with #.
- All domains (including *.codeberg.page) will be redirected to the first domain in that file. - One domain per line, leaving lines empty and comment out lines with #.
- All domains (including \*.codeberg.page) will be redirected to the first domain in that file.
- A `CNAME` record pointing to one of the following targets: - A `CNAME` record pointing to one of the following targets:
- username.codeberg.page → https://username.codeberg.page - username.codeberg.page → https://username.codeberg.page
- reponame.username.codeberg.page → https://username.codeberg.page/reponame/ - reponame.username.codeberg.page → https://username.codeberg.page/reponame/
- branchname.reponame.username.codeberg.page → https://username.codeberg.page/reponame/@branchname/ - branchname.reponame.username.codeberg.page → https://username.codeberg.page/reponame/@branchname/
If a `CNAME` record cannot be used to configure the target (e.g. for a zone If a `CNAME` record cannot be used to configure the target (e.g. for a zone
root), a A/AAAA/ALIAS record to codeberg.page with an additional TXT record root), a A/AAAA/ALIAS record to codeberg.page with an additional TXT record
for the target (just as shown above for `CNAME` records) can be used. for the target (just as shown above for `CNAME` records) can be used.

View file

@ -1,4 +1,3 @@
# .domains # .domains
List allowed custom domains, first entry is default and all other domains will be redirected to it. List allowed custom domains, first entry is default and all other domains will be redirected to it.

View file

@ -4,4 +4,3 @@
[Architecture](architecture.md)\ [Architecture](architecture.md)\
[Overview](overview.md)\ [Overview](overview.md)\
[Repo Configuration](repo-configuration.md) [Repo Configuration](repo-configuration.md)