diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index b8b3ff1..e1fc53c 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -8,39 +8,57 @@ assignees: '' --- **Describe the bug** -A clear and concise description of what the bug is. + +> A clear and concise description of what the bug is. **To Reproduce** -Steps to reproduce the behavior: + +> Steps to reproduce the behavior: + 1. Go to '...' 2. Click on '....' 3. Scroll down to '....' 4. See error **Expected behavior** -A clear and concise description of what you expected to happen. + +> A clear and concise description of what you expected to happen. **Screenshots** -If applicable, add screenshots to help explain your problem. + +> If applicable, add screenshots to help explain your problem. **Desktop (please complete the following information):** + +``` - OS: [e.g. iOS] - Browser [e.g. chrome, safari] - Version [e.g. 22] +``` + +**System Time** + +> Run `timedatectl` and share the output + +``` +(timedatectl output here) +``` **Logs** -run following command to collect corresponding logs: +> Run following command to collect corresponding logs: ```bash sudo journalctl -xef -u casaos-gateway sudo journalctl -xef -u casaos-user-service sudo journalctl -xef -u casaos-local-storage +sudo journalctl -xef -u casaos-app-management sudo journalctl -xef -u casaos.service ``` - - **Additional context** -Add any other context about the problem here. + +> Add any other context about the problem here. +> +> If you are a Zimaboard user, make it explicit with when you got your Zimaboard. diff --git a/.github/ISSUE_TEMPLATE/feedback.yml b/.github/ISSUE_TEMPLATE/feedback.yml deleted file mode 100644 index b76c8c6..0000000 --- a/.github/ISSUE_TEMPLATE/feedback.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: "Feedback" -description: Feedback, showcases, thoughts, needs and questions, etc. -title: "[Feedback] " -labels: ["feedback"] -body: - - type: markdown - attributes: - value: | - ### ❤️ Thanks for your feedback! - > Come join our [Discord community](https://discord.gg/knqAbbBbeX) and paint the ideal home cloud with us. - - type: textarea - id: description - attributes: - label: Description - placeholder: What do you want to tell us? - validations: - required: true - - type: textarea - id: additional - attributes: - label: Additional Information - description: Please add logs/files/screenshots if you have them to help us better understanding. - diff --git a/.github/ISSUE_TEMPLATE/submit-application.md b/.github/ISSUE_TEMPLATE/submit-application.md deleted file mode 100644 index 23fc1a4..0000000 --- a/.github/ISSUE_TEMPLATE/submit-application.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -name: Submit application -about: Add an app to this project -title: '' -labels: '' -assignees: LinkLeong - ---- - -Tested platform -e.g. linux/amd64,linux/arm-v7,linux-arm64 - - - -Please export and upload the configuration file of this application diff --git a/.goreleaser.debug.yaml b/.goreleaser.debug.yaml index fb6f160..04e112a 100644 --- a/.goreleaser.debug.yaml +++ b/.goreleaser.debug.yaml @@ -113,24 +113,22 @@ builds: goarm: - "7" archives: - - name_template: "{{ .Os }}-{{ .Arch }}-{{ .ProjectName }}-v{{ .Version }}" + - name_template: >- + {{ .Os }}-{{- if eq .Arch "arm" }}arm-7{{- else }}{{ .Arch }}{{- end }}-{{ .ProjectName }}-v{{ .Version }} id: casaos builds: - casaos-amd64 - casaos-arm64 - casaos-arm-7 - replacements: - arm: arm-7 files: - build/**/* - - name_template: "{{ .Os }}-{{ .Arch }}-{{ .ProjectName }}-migration-tool-v{{ .Version }}" + - name_template: >- + {{ .Os }}-{{- if eq .Arch "arm" }}arm-7{{- else }}{{ .Arch }}{{- end }}-{{ .ProjectName }}-migration-tool-v{{ .Version }} id: casaos-migration-tool builds: - casaos-migration-tool-amd64 - casaos-migration-tool-arm64 - casaos-migration-tool-arm-7 - replacements: - arm: arm-7 files: - build/sysroot/etc/**/* checksum: diff --git a/README.md b/README.md index e71df8f..be3aace 100644 --- a/README.md +++ b/README.md @@ -199,6 +199,8 @@ Everyone's contribution is greatly appreciated. ([Emoji Key](https://allcontribu
llwaini

📆 ⚠️ +
CorrectRoadH

💻 📖 +
zhanghengxin

💻 📖 diff --git a/main.go b/main.go index 34bd121..0240a0e 100644 --- a/main.go +++ b/main.go @@ -48,6 +48,9 @@ var ( //go:embed api/casaos/openapi.yaml _docYAML string + //go:embed build/sysroot/etc/casaos/casaos.conf.sample + _confSample string + configFlag = flag.String("c", "", "config address") dbFlag = flag.String("db", "", "db path") versionFlag = flag.Bool("v", false, "version") @@ -63,7 +66,7 @@ func init() { println("git commit:", commit) println("build date:", date) - config.InitSetup(*configFlag) + config.InitSetup(*configFlag, _confSample) logger.LogInit(config.AppInfo.LogPath, config.AppInfo.LogSaveName, config.AppInfo.LogFileExt) if len(*dbFlag) == 0 { @@ -81,6 +84,7 @@ func init() { route.InitFunction() + //service.MyService.System().GenreateSystemEntry() /// //service.MountLists = make(map[string]*mountlib.MountPoint) //configfile.Install() @@ -101,20 +105,15 @@ func main() { if *versionFlag { return } - v1Router := route.InitV1Router() v2Router := route.InitV2Router() v2DocRouter := route.InitV2DocRouter(_docHTML, _docYAML) - v3file := route.InitFile() - v4dir := route.InitDir() mux := &util_http.HandlerMultiplexer{ HandlerMap: map[string]http.Handler{ "v1": v1Router, "v2": v2Router, "doc": v2DocRouter, - "v3": v3file, - "v4": v4dir, }, } @@ -143,9 +142,10 @@ func main() { "/v1/cloud", "/v1/recover", "/v1/other", + "/v1/zt", + "/v1/test", route.V2APIPath, route.V2DocPath, - route.V3FilePath, } for _, apiPath := range routers { err = service.MyService.Gateway().CreateRoute(&model.Route{ diff --git a/package.json b/package.json new file mode 100644 index 0000000..704442c --- /dev/null +++ b/package.json @@ -0,0 +1,39 @@ +{ + "name": "@icewhale/casaos-openapi", + "version": "0.0.1", + + "scripts": { + "clean": "rm -rf generate", + "build": "rm -rf dist && tsc && yarn clean", + "generate:local": "openapi-generator-cli generate -g typescript-axios -i ./api/casaos/openapi.yaml -o ./generate", + "generate:npx": "npx @openapitools/openapi-generator-cli generate -g typescript-axios -i ./api/casaos/openapi.yaml -o ./generate", + "generate:ts": "npx openapi-typescript-codegen --input ./api/casaos/openapi.yaml --output ./generate", + "start": "yarn generate:local && yarn build" + }, + "homepage": "https://github.com/IceWhaleTech/CasaOS#readme", + "description": "Casaos Typescript+Axios SDK", + "keywords": [ + "CasaOS", + "SDK", + "CasaOS Axios" + ], + "main": "dist/index.js", + "files": [ + "LICENSE", + "README.md", + "dist", + "generate" + ], + "dependencies": { + "axios": "^1.1.0" + }, + "devDependencies": { + "all-contributors-cli": "^6.24.0", + "@openapitools/openapi-generator-cli": "2.5.2", + "@types/node": "^18.8.3", + "openapi-typescript-codegen": "^0.23.0", + "typescript": "^4.9.5" + }, + "author": "casaos", + "license": "Apache-2.0" +} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..89d3573 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "declaration": true, + "lib": [ + "es2017", + "DOM" + ], + "module": "commonjs", + "target": "es6", + "skipLibCheck": true, + "sourceMap": false, + "strict": true, + "useUnknownInCatchVariables": false, + "resolveJsonModule": true, + "esModuleInterop": true, + "outDir": "dist", + "types": [ + "node" + ], + }, + "exclude": [ + "node_modules" + ], + "main": "generate/index" +} \ No newline at end of file