未验证 提交 4023d7fe 编写于 作者: J Joe Previte 提交者: GitHub

Merge branch 'master' into issue-2328-customize-go-home

......@@ -33,10 +33,10 @@ When done, the install script prints out instructions for running and starting c
We also have an in-depth [setup and configuration](./doc/guide.md) guide.
### Alpha Program 🐣
### Cloud Program ☁️
We're working on a cloud platform that makes deploying and managing code-server easier.
Consider updating to the latest version and running code-server with our experimental flag `--link` if you don't want to worry about
Consider running code-server with the beta flag `--link` if you don't want to worry about
- TLS
- Authentication
......
......@@ -11,6 +11,7 @@
- [Where are extensions stored?](#where-are-extensions-stored)
- [How is this different from VS Code Codespaces?](#how-is-this-different-from-vs-code-codespaces)
- [How should I expose code-server to the internet?](#how-should-i-expose-code-server-to-the-internet)
- [Can I store my password hashed?](#can-i-store-my-password-hashed)
- [How do I securely access web services?](#how-do-i-securely-access-web-services)
- [Sub-paths](#sub-paths)
- [Sub-domains](#sub-domains)
......@@ -160,6 +161,16 @@ for free.
Again, please follow [./guide.md](./guide.md) for our recommendations on setting up and using code-server.
## Can I store my password hashed?
Yes you can! Use `hashedPassword` instead of `password`. Generate the hash with:
```
echo "thisismypassword" | sha256sum | cut -d' ' -f1
```
Of course replace `"thisismypassword"` with your actual password.
## How do I securely access web services?
code-server is capable of proxying to any port using either a subdomain or a
......
......@@ -75,7 +75,7 @@ interface Option<T> {
description?: string
/**
* If marked as beta, the option is not printed unless $CS_BETA is set.
* If marked as beta, the option is marked as beta in help.
*/
beta?: boolean
}
......@@ -194,8 +194,6 @@ const options: Options<Required<Args>> = {
Securely bind code-server via Coder Cloud with the passed name. You'll get a URL like
https://myname.coder-cloud.com at which you can easily access your code-server instance.
Authorization is done via GitHub.
This is presently beta and requires being accepted for testing.
See https://github.com/cdr/code-server/discussions/2137
`,
beta: true,
},
......@@ -214,32 +212,24 @@ export const optionDescriptions = (): string[] => {
}),
{ short: 0, long: 0 },
)
return entries
.filter(([, v]) => {
// If CS_BETA is set, we show beta options but if not, then we do not want
// to show beta options.
return process.env.CS_BETA || !v.beta
})
.map(([k, v]) => {
const help = `${" ".repeat(widths.short - (v.short ? v.short.length : 0))}${
v.short ? `-${v.short}` : " "
} --${k} `
return (
help +
v.description
?.trim()
.split(/\n/)
.map((line, i) => {
line = line.trim()
if (i === 0) {
return " ".repeat(widths.long - k.length) + line
}
return " ".repeat(widths.long + widths.short + 6) + line
})
.join("\n") +
(typeof v.type === "object" ? ` [${Object.values(v.type).join(", ")}]` : "")
)
})
return entries.map(([k, v]) => {
const help = `${" ".repeat(widths.short - (v.short ? v.short.length : 0))}${v.short ? `-${v.short}` : " "} --${k} `
return (
help +
v.description
?.trim()
.split(/\n/)
.map((line, i) => {
line = line.trim()
if (i === 0) {
return " ".repeat(widths.long - k.length) + (v.beta ? "(beta) " : "") + line
}
return " ".repeat(widths.long + widths.short + 6) + line
})
.join("\n") +
(typeof v.type === "object" ? ` [${Object.values(v.type).join(", ")}]` : "")
)
})
}
export const parse = (
......
......@@ -11,7 +11,7 @@ import { plural } from "../../common/util"
import { AuthType, DefaultedArgs } from "../cli"
import { rootPath } from "../constants"
import { Heart } from "../heart"
import { replaceTemplates } from "../http"
import { replaceTemplates, redirect } from "../http"
import { PluginAPI } from "../plugin"
import { getMediaMime, paths } from "../util"
import { WebsocketRequest } from "../wsRouter"
......@@ -112,6 +112,10 @@ export const register = async (
if (args.auth === AuthType.Password) {
app.use("/login", login.router)
} else {
app.all("/login", (req, res) => {
redirect(req, res, "/", {})
})
}
app.use("/proxy", proxy.router)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册