Compare commits
No commits in common. "0a4a8e2009ce3adcd2c350cd8ef76c86bb0366a4" and "b7da837654004fee3e267add35527bab377eaeb1" have entirely different histories.
0a4a8e2009
...
b7da837654
12
README.md
12
README.md
@ -4,16 +4,16 @@
|
|||||||
|
|
||||||
- [x] Simple file server
|
- [x] Simple file server
|
||||||
- [x] Serve static files
|
- [x] Serve static files
|
||||||
- [x] Search files
|
- [ ] Search files
|
||||||
- [x] Preview files
|
- [ ] Preview files
|
||||||
- [ ] Plugin system
|
- [ ] Plugin system
|
||||||
- [ ] Support for multiple languages
|
- [ ] Support for multiple languages
|
||||||
- [ ] Support for multiple themes
|
- [ ] Support for multiple themes
|
||||||
- [ ] Upload files
|
- [ ] Upload files
|
||||||
- [x] Authentication
|
- [ ] Authentication
|
||||||
- [x] Sort files
|
- [ ] Sort files
|
||||||
- [x] Download files
|
- [ ] Download files
|
||||||
- [x] SUMMARY.md for index
|
- [ ] DESCRIPTION.md for index
|
||||||
|
|
||||||
### Usage
|
### Usage
|
||||||
|
|
||||||
|
17
keyout.ts
17
keyout.ts
@ -5,21 +5,10 @@ import { prepareSecretKey } from "./util/secret.ts";
|
|||||||
export const key_out_cmd = new Command();
|
export const key_out_cmd = new Command();
|
||||||
key_out_cmd.name("keyout")
|
key_out_cmd.name("keyout")
|
||||||
.description("Output the secret key.")
|
.description("Output the secret key.")
|
||||||
.option("-f, --file <file:string>", "The file to output the key to. (default: stdout)")
|
.action(async () => {
|
||||||
.option("--dotenv", "Output the key in dotenv format.")
|
|
||||||
.action(async ({file, dotenv}) => {
|
|
||||||
const key = await prepareSecretKey();
|
const key = await prepareSecretKey();
|
||||||
const keyout = await crypto.subtle.exportKey("jwk", key);
|
const out = await crypto.subtle.exportKey("jwk", key);
|
||||||
let out = JSON.stringify(keyout);
|
console.log(JSON.stringify(out));
|
||||||
if (dotenv){
|
|
||||||
out = [`SECRET_KEY='${out}'`].join("\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (file){
|
|
||||||
await Deno.writeTextFile(file, out);
|
|
||||||
} else {
|
|
||||||
console.log(out);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
if ( import.meta.main ){
|
if ( import.meta.main ){
|
||||||
|
10
main.ts
10
main.ts
@ -17,9 +17,6 @@ import { fromFileUrl, join } from "path/mod.ts";
|
|||||||
import { prepareSecretKey } from "./util/secret.ts";
|
import { prepareSecretKey } from "./util/secret.ts";
|
||||||
import { serve } from "http/server.ts";
|
import { serve } from "http/server.ts";
|
||||||
|
|
||||||
import { user_command } from "./user.ts";
|
|
||||||
import { key_out_cmd } from "./keyout.ts";
|
|
||||||
|
|
||||||
const github_markdown= await Deno.readTextFile(join(fromFileUrl(import.meta.url), "..", "static", "github-markdown.css"))
|
const github_markdown= await Deno.readTextFile(join(fromFileUrl(import.meta.url), "..", "static", "github-markdown.css"))
|
||||||
|
|
||||||
const CSSPlugin: Plugin = {
|
const CSSPlugin: Plugin = {
|
||||||
@ -48,7 +45,7 @@ async function startServer(manifest: Manifest, options: StartOptions = {}){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function start({port = 8000, hostname = "localhost"}: {port?: number, hostname?: string} = {}){
|
async function start({port = 8000, hostname = "localhost"}: {port?: number, hostname?: string}){
|
||||||
await startServer(manifest, { plugins: [twindPlugin(twindConfig), CSSPlugin],
|
await startServer(manifest, { plugins: [twindPlugin(twindConfig), CSSPlugin],
|
||||||
port: port,
|
port: port,
|
||||||
hostname: hostname,
|
hostname: hostname,
|
||||||
@ -80,11 +77,10 @@ if (import.meta.main){
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
.command("user", user_command)
|
//.command("user")
|
||||||
.command("keyout", key_out_cmd)
|
|
||||||
;
|
;
|
||||||
await cmd.parse(Deno.args);
|
await cmd.parse(Deno.args);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
await start();
|
await start({});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user