diff --git a/Dockerfile b/Dockerfile index 2d89598..0c49b53 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,6 +25,7 @@ COPY --from=builder /install /usr/local COPY backend ./backend COPY frontend ./frontend COPY config.yaml . +COPY VERSION . COPY plugins ./plugins COPY themes ./themes COPY generate_password.py . diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..26b5dec --- /dev/null +++ b/VERSION @@ -0,0 +1,2 @@ +0.4.0 + diff --git a/backend/main.py b/backend/main.py index 17ac833..4b0e2c1 100644 --- a/backend/main.py +++ b/backend/main.py @@ -43,6 +43,14 @@ config_path = Path(__file__).parent.parent / "config.yaml" with open(config_path, 'r', encoding='utf-8') as f: config = yaml.safe_load(f) +# Load version from VERSION file (single source of truth) +version_path = Path(__file__).parent.parent / "VERSION" +if not version_path.exists(): + raise FileNotFoundError("VERSION file not found. Please create it with the current version number.") +with open(version_path, 'r', encoding='utf-8') as f: + version = f.read().strip() + config['app']['version'] = version + # Initialize app app = FastAPI( title=config['app']['name'], diff --git a/config.yaml b/config.yaml index 0b5c941..6d0f215 100644 --- a/config.yaml +++ b/config.yaml @@ -4,7 +4,6 @@ app: name: "NoteDiscovery" tagline: "Your Self-Hosted Knowledge Base" - version: "1.0.0" server: host: "0.0.0.0" diff --git a/frontend/app.js b/frontend/app.js index 028d3ef..10a2f36 100644 --- a/frontend/app.js +++ b/frontend/app.js @@ -35,6 +35,7 @@ function noteApp() { // App state appName: 'NoteDiscovery', appTagline: 'Your Self-Hosted Knowledge Base', + appVersion: '0.0.0', notes: [], currentNote: '', currentNoteName: '', @@ -394,6 +395,7 @@ function noteApp() { const config = await response.json(); this.appName = config.name; this.appTagline = config.tagline; + this.appVersion = config.version || '0.0.0'; } catch (error) { console.error('Failed to load config:', error); } diff --git a/frontend/index.html b/frontend/index.html index 49f7bd2..224c607 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -995,6 +995,8 @@