diff --git a/package.json b/package.json index d3bba71c..e1777991 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "docs", "license": "Apache-2.0", "type": "module", - "version": "0.46.0", + "version": "0.47.0", "scripts": { "postinstall": "is-ci || husky", "dev": "astro dev --host", diff --git a/src/content/docs/installation/installation.mdx b/src/content/docs/installation/installation.mdx index 0b08d7ba..c18245e3 100644 --- a/src/content/docs/installation/installation.mdx +++ b/src/content/docs/installation/installation.mdx @@ -32,9 +32,9 @@ You can install Daytona by manually downloading the binary and placing it in you ```shell # x86-64 -curl -sf -L https://download.daytona.io/daytona/v0.46/daytona-linux-amd64 -o daytona +curl -sf -L https://download.daytona.io/daytona/v0.47/daytona-linux-amd64 -o daytona # ARM64 -curl -sf -L https://download.daytona.io/daytona/v0.46/daytona-linux-arm64 -o daytona +curl -sf -L https://download.daytona.io/daytona/v0.47/daytona-linux-arm64 -o daytona ``` ::: @@ -57,9 +57,9 @@ You can install Daytona by manually downloading the binary and placing it in you ```shell # x86-64/Intel-based -curl -sf -L https://download.daytona.io/daytona/v0.46/daytona-darwin-amd64 -o daytona +curl -sf -L https://download.daytona.io/daytona/v0.47/daytona-darwin-amd64 -o daytona # ARM64/Apple Silicon -curl -sf -L https://download.daytona.io/daytona/v0.46/daytona-darwin-arm64 -o daytona +curl -sf -L https://download.daytona.io/daytona/v0.47/daytona-darwin-arm64 -o daytona ``` ::: @@ -75,7 +75,7 @@ Install Daytona on Windows using the following PowerShell script: ```powershell $architecture = if ($env:PROCESSOR_ARCHITECTURE -eq "AMD64") { "amd64" } else { "arm64" } md -Force "$Env:APPDATA\bin\daytona"; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]'Tls,Tls11,Tls12'; -Invoke-WebRequest -URI "https://download.daytona.io/daytona/v0.46/daytona-windows-$architecture.exe" -OutFile "$Env:APPDATA\bin\daytona\daytona.exe"; +Invoke-WebRequest -URI "https://download.daytona.io/daytona/v0.47/daytona-windows-$architecture.exe" -OutFile "$Env:APPDATA\bin\daytona\daytona.exe"; $env:Path += ";" + $Env:APPDATA + "\bin\daytona"; [Environment]::SetEnvironmentVariable("Path", $env:Path, [System.EnvironmentVariableTarget]::User); daytona serve; ``` @@ -85,9 +85,9 @@ You can install Daytona by manually downloading the binary and placing it in you ```sh # x86-64 -curl -sf -L https://download.daytona.io/daytona/v0.46/daytona-windows-amd64.exe -o daytona +curl -sf -L https://download.daytona.io/daytona/v0.47/daytona-windows-amd64.exe -o daytona # AArch64 -curl -sf -L https://download.daytona.io/daytona/v0.46/daytona-windows-arm64.exe -o daytona +curl -sf -L https://download.daytona.io/daytona/v0.47/daytona-windows-arm64.exe -o daytona ``` ::: diff --git a/src/content/docs/installation/method/script-powershell.mdx b/src/content/docs/installation/method/script-powershell.mdx index 03e33c16..0aab4caf 100644 --- a/src/content/docs/installation/method/script-powershell.mdx +++ b/src/content/docs/installation/method/script-powershell.mdx @@ -11,7 +11,7 @@ export const partial = true ```powershell $architecture = if ($env:PROCESSOR_ARCHITECTURE -eq "AMD64") { "amd64" } else { "arm64" } md -Force "$Env:APPDATA\bin\daytona"; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]'Tls,Tls11,Tls12'; -Invoke-WebRequest -URI "https://download.daytona.io/daytona/v0.46/daytona-windows-$architecture.exe" -OutFile "$Env:APPDATA\bin\daytona\daytona.exe"; +Invoke-WebRequest -URI "https://download.daytona.io/daytona/v0.47/daytona-windows-$architecture.exe" -OutFile "$Env:APPDATA\bin\daytona\daytona.exe"; $env:Path += ";" + $Env:APPDATA + "\bin\daytona"; [Environment]::SetEnvironmentVariable("Path", $env:Path, [System.EnvironmentVariableTarget]::User); daytona serve; ``` @@ -21,9 +21,9 @@ You can install Daytona by manually downloading the binary and placing it in you ```powershell # x86-64 -curl -sf -L https://download.daytona.io/daytona/v0.46/daytona-windows-amd64.exe -o daytona +curl -sf -L https://download.daytona.io/daytona/v0.47/daytona-windows-amd64.exe -o daytona # AArch64 -curl -sf -L https://download.daytona.io/daytona/v0.46/daytona-windows-arm64.exe -o daytona +curl -sf -L https://download.daytona.io/daytona/v0.47/daytona-windows-arm64.exe -o daytona ``` diff --git a/src/content/docs/tools/api.mdx b/src/content/docs/tools/api.mdx index f90fccba..a7021b81 100644 --- a/src/content/docs/tools/api.mdx +++ b/src/content/docs/tools/api.mdx @@ -742,6 +742,16 @@ Set the server configuration | :-------- | :---------- | | `200` | OK | +## GET /server/logs + +List server log files + +### Responses + +| Status Code | Description | +| :-------- | :---------- | +| `200` | OK | + ## POST /server/network-key Generate a new authentication key diff --git a/src/content/docs/tools/cli.mdx b/src/content/docs/tools/cli.mdx index f4ebdd13..fb9fb241 100644 --- a/src/content/docs/tools/cli.mdx +++ b/src/content/docs/tools/cli.mdx @@ -947,8 +947,22 @@ daytona server logs [flags] __Flags__ | Long | Short | Description | | :--- | :---- | :---------- | -| `--file` | | Read logs from local server log file | +| `--file` | | Read specific log file | | `--follow` | `-f` | Follow logs | +| `--local` | `-l` | Read local server log files | +| `--help` | | help for daytona | + +## daytona server logs list + +Lists Daytona Server Log Files + +```shell +daytona server logs list [flags] +``` + +__Flags__ +| Long | Short | Description | +| :--- | :---- | :---------- | | `--help` | | help for daytona | ## daytona server restart diff --git a/tools/update-cli-reference.js b/tools/update-cli-reference.js index f9e7e80d..7bcac4a1 100644 --- a/tools/update-cli-reference.js +++ b/tools/update-cli-reference.js @@ -1,12 +1,11 @@ -import * as _fs from "fs"; -const fs = _fs.promises; -import { extname } from "path"; -const __dirname = import.meta.dirname; +import * as _fs from 'fs' +import { extname } from 'path' +import { parseArgs } from 'util' +import * as yaml from 'yaml' -import { parseArgs } from "util"; -import pkg from "../package.json" assert { type: "json" }; +const fs = _fs.promises -import * as yaml from "yaml"; +const __dirname = import.meta.dirname // content to appear above the commands outline const prepend = `--- @@ -35,119 +34,120 @@ You can access this documentation on a per-command basis by appending the \`--he -`; +` // content to appear below the commands outline -const append = ``; +const append = `` const notes = { - "daytona autocomplete": `\n`, +} async function fetchRawDocs(ref) { - const url = "https://api.github.com/repos/daytonaio/daytona/contents/hack/docs"; - const request = await fetch(`${url}?ref=${ref}`); - const response = await request.json(); + const url = + 'https://api.github.com/repos/daytonaio/daytona/contents/hack/docs' + const request = await fetch(`${url}?ref=${ref}`) + const response = await request.json() - const files = []; + const files = [] - for (const file of response) { - const { download_url } = file; + for (const file of response) { + const { download_url } = file - if (!download_url) continue; + if (!download_url) continue - const contentsReq = await fetch(download_url); - let contents = await contentsReq.text(); + const contentsReq = await fetch(download_url) + let contents = await contentsReq.text() - contents = yaml.parse(contents); + contents = yaml.parse(contents) - files.push(contents); - } + files.push(contents) + } - return files; + return files } function flagToRow(flag) { - let { name, shorthand, usage } = flag; + let { name, shorthand, usage } = flag - name = `\`--${name}\``; - shorthand = shorthand ? `\`-${shorthand}\`` : ""; - usage = usage ? usage : ""; + name = `\`--${name}\`` + shorthand = shorthand ? `\`-${shorthand}\`` : '' + usage = usage ? usage : '' - return `| ${name} | ${shorthand} | ${usage} |\n`; + return `| ${name} | ${shorthand} | ${usage} |\n` } function yamlToMarkdown(files) { - return files.map((rawDoc) => { - let output = ""; - output += `## ${rawDoc.name}\n`; - output += `${rawDoc.synopsis}\n\n`; - - if (!rawDoc.usage) { - rawDoc.usage = `${rawDoc.name} [flags]`; - } - - output += "```shell\n"; - output += `${rawDoc.usage}\n`; - output += "```\n\n"; - - - output += "__Flags__\n"; - output += "| Long | Short | Description |\n"; - output += "| :--- | :---- | :---------- |\n"; - - if (rawDoc.options) { - for (const flag of rawDoc.options) { - let row = flagToRow(flag); - output += row; - } - } - - if (rawDoc.inherited_options) { - for (const flag of rawDoc.inherited_options) { - let row = flagToRow(flag); - output += row; - } - } - - if (notes[rawDoc.name]) { - output += notes[rawDoc.name]; - } - - output += "\n"; - - return output; - }); + return files.map(rawDoc => { + let output = '' + output += `## ${rawDoc.name}\n` + output += `${rawDoc.synopsis}\n\n` + + if (!rawDoc.usage) { + rawDoc.usage = `${rawDoc.name} [flags]` + } + + output += '```shell\n' + output += `${rawDoc.usage}\n` + output += '```\n\n' + + output += '__Flags__\n' + output += '| Long | Short | Description |\n' + output += '| :--- | :---- | :---------- |\n' + + if (rawDoc.options) { + for (const flag of rawDoc.options) { + let row = flagToRow(flag) + output += row + } + } + + if (rawDoc.inherited_options) { + for (const flag of rawDoc.inherited_options) { + let row = flagToRow(flag) + output += row + } + } + + if (notes[rawDoc.name]) { + output += notes[rawDoc.name] + } + + output += '\n' + + return output + }) } async function process(args) { - const { output, ref } = args.values; - console.log(`grabbing docs for ${ref}...`); + const { output, ref } = args.values + console.log(`grabbing docs for ${ref}...`) - // grab the files from GitHub - let files = await fetchRawDocs(ref); - let transformed = yamlToMarkdown(files); + // grab the files from GitHub + let files = await fetchRawDocs(ref) + let transformed = yamlToMarkdown(files) - const singleMarkdown = transformed.join("\n"); - console.log(`writing to '${output}'...`); - await fs.writeFile(output, `${prepend}\n${singleMarkdown}\n${append}`); - console.log("done"); + const singleMarkdown = transformed.join('\n') + console.log(`writing to '${output}'...`) + await fs.writeFile(output, `${prepend}\n${singleMarkdown}\n${append}`) + console.log('done') } const commandOpts = { - ref: { - type: "string", - default: `v${pkg.version}` - }, - output: { - type: "string", - short: "o", - default: `${__dirname}/../src/content/docs/tools/cli.mdx` - } + ref: { + type: 'string', + default: `v0.47.0`, + }, + output: { + type: 'string', + short: 'o', + default: `${__dirname}/../src/content/docs/tools/cli.mdx`, + }, } -const args = parseArgs({ options: commandOpts }); -process(args); +const args = parseArgs({ options: commandOpts }) +process(args) diff --git a/tools/update-server-reference.js b/tools/update-server-reference.js index d5f24a16..d7bd826f 100644 --- a/tools/update-server-reference.js +++ b/tools/update-server-reference.js @@ -1,8 +1,9 @@ -const __dirname = import.meta.dirname; -import * as _fs from "fs"; -const fs = _fs.promises; -import { parseArgs } from "util"; -import pkg from "../package.json" assert { type: "json" }; +import * as _fs from 'fs' +import { parseArgs } from 'util' + +const __dirname = import.meta.dirname + +const fs = _fs.promises // content to appear above the commands outline const prepend = `--- @@ -15,108 +16,107 @@ import Label from '@components/Label.astro' -`; +` // content to appear below the commands outline -const append = ``; +const append = `` async function fetchSwaggerJSON(ref) { - const url = `https://raw.githubusercontent.com/daytonaio/daytona/${ref}/pkg/api/docs/swagger.json`; - const request = await fetch(url); - const response = await request.json(); + const url = `https://raw.githubusercontent.com/daytonaio/daytona/${ref}/pkg/api/docs/swagger.json` + const request = await fetch(url) + const response = await request.json() - return response; + return response } function escape(str) { - return str.replace(/\{/g, "\\{") - .replace(/\}/g, "\\}"); + return str.replace(/\{/g, '\\{').replace(/\}/g, '\\}') } function swaggerToMarkdown(swaggerJSON) { - let output = ""; - - for (const path of Object.keys(swaggerJSON.paths)) { - const methods = swaggerJSON.paths[path]; + let output = '' - for (const method of Object.keys(methods)) { - const methodDetails = methods[method]; - let { description, responses, parameters } = methodDetails; + for (const path of Object.keys(swaggerJSON.paths)) { + const methods = swaggerJSON.paths[path] - responses = responses ? responses : {}; - parameters = parameters ? parameters : {}; + for (const method of Object.keys(methods)) { + const methodDetails = methods[method] + let { description, responses, parameters } = methodDetails - output += `## ${method.toUpperCase()} ${escape(path)}\n`; - output += `${description}\n`; - output += "\n"; + responses = responses ? responses : {} + parameters = parameters ? parameters : {} - if (Object.keys(parameters).length > 0) { - output += "### Parameters\n" + output += `## ${method.toUpperCase()} ${escape(path)}\n` + output += `${description}\n` + output += '\n' - output += `| Name | Location | Required | Type | Description |\n`; - output += `| :--- | :------- | :------- | :--- | :---------- |\n` + if (Object.keys(parameters).length > 0) { + output += '### Parameters\n' - for (const param of Object.keys(parameters)) { - const responseDetails = parameters[param]; - const { - name, - in: location, - required, - type, - description: paramDescription - } = responseDetails; + output += `| Name | Location | Required | Type | Description |\n` + output += `| :--- | :------- | :------- | :--- | :---------- |\n` - output += `| \`${name}\` | ${location} | ${required} | ${type} | ${paramDescription} |\n`; - } + for (const param of Object.keys(parameters)) { + const responseDetails = parameters[param] + const { + name, + in: location, + required, + type, + description: paramDescription, + } = responseDetails - output += "\n"; - } + output += `| \`${name}\` | ${location} | ${required} | ${type} | ${paramDescription} |\n` + } - if (Object.keys(responses).length > 0) { - output += "### Responses\n"; + output += '\n' + } - output += `| Status Code | Description |\n`; - output += `| :-------- | :---------- |\n` + if (Object.keys(responses).length > 0) { + output += '### Responses\n' - for (const response of Object.keys(responses)) { - const responseDetails = responses[response]; - const { description: responseDescription } = responseDetails; + output += `| Status Code | Description |\n` + output += `| :-------- | :---------- |\n` - output += `| \`${response}\` | ${responseDescription} |\n`; - } + for (const response of Object.keys(responses)) { + const responseDetails = responses[response] + const { description: responseDescription } = responseDetails - output += "\n"; - } + output += `| \`${response}\` | ${responseDescription} |\n` } - output += "\n"; + output += '\n' + } } - return output + output += '\n' + } + + return output } async function process(args) { - const { output, ref } = args.values; - const swaggerJSON = await fetchSwaggerJSON(ref); + const { output, ref } = args.values + const swaggerJSON = await fetchSwaggerJSON(ref) - const markdown = swaggerToMarkdown(swaggerJSON); + const markdown = swaggerToMarkdown(swaggerJSON) - console.log(`writing to '${output}'...`); - await fs.writeFile(output, `${prepend}\n${markdown}\n${append}`); - console.log("done"); + console.log(`writing to '${output}'...`) + await fs.writeFile(output, `${prepend}\n${markdown}\n${append}`) + console.log('done') } const commandOpts = { - ref: { - type: "string", - default: `v${pkg.version}` - }, - output: { - type: "string", - short: "o", - default: `${__dirname}/../src/content/docs/tools/api.mdx` - } + ref: { + type: 'string', + default: `v0.47.0`, + }, + output: { + type: 'string', + short: 'o', + default: `${__dirname}/../src/content/docs/tools/api.mdx`, + }, } -const args = parseArgs({ options: commandOpts }); -process(args); \ No newline at end of file +const args = parseArgs({ options: commandOpts }) +process(args)