From e42936e300bf92d413d6b68adaaa34f2000b21bb Mon Sep 17 00:00:00 2001 From: kangfenmao Date: Fri, 8 Dec 2023 16:54:18 +0800 Subject: [PATCH] fix: update port number from 7701 to 10060 --- Dockerfile | 2 +- README.md | 6 +++--- backend/config/const.go | 10 +++++++--- docker-compose.yml | 2 +- frontend/src/config/http.ts | 2 +- frontend/vite.config.ts | 2 +- 6 files changed, 14 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9a04ce6..e3bd838 100644 --- a/Dockerfile +++ b/Dockerfile @@ -31,5 +31,5 @@ RUN go build -tags netgo -o vortexnotes FROM alpine:latest COPY --from=builder /app/vortexnotes /app/vortexnotes -EXPOSE 7701 +EXPOSE 10060 CMD ["/app/vortexnotes"] diff --git a/README.md b/README.md index e47a61b..ac82b74 100644 --- a/README.md +++ b/README.md @@ -43,10 +43,10 @@ services: container_name: vortexnotes image: kangfenmao/vortexnotes:latest ports: - - "7701:7701" + - "10060:10060" volumes: - - ./app/data/notes:/data/notes - - ./app/data/vortexnotes:/data/vortexnotes + - ./app/data/notes:/app/data/notes + - ./app/data/vortexnotes:/app/data/vortexnotes ``` Private access with passcode: diff --git a/backend/config/const.go b/backend/config/const.go index abcf243..3f1f2cb 100644 --- a/backend/config/const.go +++ b/backend/config/const.go @@ -1,12 +1,16 @@ package config -import "os" +import ( + "os" + "path/filepath" +) -var basePath, _ = os.Getwd() +var exePath, _ = os.Executable() +var basePath = filepath.Dir(exePath) var LocalNotePath = basePath + "/data/notes/" var AppDataPath = basePath + "/data/vortexnotes/" var AppDbPath = AppDataPath + "app.db" var IndexPath = AppDataPath + "notes.bleve" const ApiHost = "0.0.0.0" -const ApiPort = "7701" +const ApiPort = "10060" diff --git a/docker-compose.yml b/docker-compose.yml index e1cd828..a9f309f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,7 +8,7 @@ services: VORTEXNOTES_PASSCODE: 123456 VORTEXNOTES_AUTH_SCOPE: create,edit,delete ports: - - "0.0.0.0:7701:7701" + - "0.0.0.0:10060:10060" volumes: - ./app/data/notes:/data/notes - ./app/data/vortexnotes:/data/vortexnotes diff --git a/frontend/src/config/http.ts b/frontend/src/config/http.ts index 339f6c8..2603ab7 100644 --- a/frontend/src/config/http.ts +++ b/frontend/src/config/http.ts @@ -2,7 +2,7 @@ import axios from 'axios' export const getAxiosInstance = () => { const instance = axios.create({ - baseURL: location.origin.replace('7702', '7701') + '/api/', + baseURL: location.origin.replace('10061', '10060') + '/api/', headers: { Authorization: localStorage.vortexnotes_passcode ? 'Bearer ' + localStorage.vortexnotes_passcode diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index e0417e2..46dbaf5 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -5,7 +5,7 @@ import { fileURLToPath } from 'node:url' // https://vitejs.dev/config/ export default defineConfig({ server: { - port: 7702, + port: 10061, host: '0.0.0.0' }, resolve: {