get version from backend

This commit is contained in:
hay-kot 2021-02-07 20:46:21 -09:00
commit 2977058129
9 changed files with 35 additions and 11 deletions

View file

@ -5,7 +5,7 @@ RUN npm install
COPY ./frontend/ .
RUN npm run build
FROM python:3.8-alpine
FROM python:3.9-alpine
RUN apk add --no-cache libxml2-dev libxslt-dev libxml2
ENV ENV prod

View file

@ -56,7 +56,6 @@ This is, what I think, is a big release! Tons of new features and some great qua
!!! error "Breaking Changes"
- API endpoints have been refactored to adhear to a more consistent standard. This is a WIP and more changes are likely to occur.
- Officially Dropped MongoDB Support
- Mounting volume moved to different internal location due to development issues. New volume should be mounted as `mealie/data:/app_data/`. Volume mounts need to be changed.
- Database Breaks! We have not yet implemented a database migration service. As such, upgrades cannot be done by simply pulling the image. You must first export your recipes, update your deployment, and then import your recipes. This pattern is likely to be how upgrades take place prior to v1.0. After v1.0 migrations will be done automatically.
## v0.1.0 - Initial Beta

View file

@ -14,7 +14,7 @@ Deployment with the Docker CLI can be done with `docker run` and specify the dat
docker run \
-e db_type='sqlite' \
-p 9000:80 \
-v `pwd`:'/app_data/' \
-v `pwd`:'/app/data/' \
hkotel/mealie:latest
```
@ -35,7 +35,7 @@ services:
db_type: sqlite
TZ: America/Anchorage
volumes:
- ./mealie/data/:/app_data
- ./mealie/data/:/app/data
```

View file

@ -6,6 +6,7 @@ import themes from "./api/themes";
import migration from "./api/migration";
import myUtils from "./api/upload";
import category from "./api/category";
import meta from "./api/meta";
// import api from "../api";
@ -18,4 +19,5 @@ export default {
migrations: migration,
utils: myUtils,
categories: category,
meta: meta,
};

15
frontend/src/api/meta.js Normal file
View file

@ -0,0 +1,15 @@
import { baseURL } from "./api-utils";
import { apiReq } from "./api-utils";
const prefix = baseURL + "debug";
const debugURLs = {
version: `${prefix}/version`,
};
export default {
async get_version() {
let response = await apiReq.get(debugURLs.version);
return response.data;
},
};

View file

@ -44,6 +44,7 @@ import General from "../components/Settings/General";
import Webhooks from "../components/Settings/Webhook";
import Theme from "../components/Settings/Theme";
import Migration from "../components/Settings/Migration";
import api from "../api";
import axios from "axios";
export default {
@ -57,11 +58,13 @@ export default {
data() {
return {
latestVersion: null,
version: "v0.1.0",
version: null,
};
},
mounted() {
async mounted() {
this.getVersion();
let versionData = await api.meta.get_version();
this.version = versionData.version;
},
computed: {
newVersion() {

View file

@ -3,7 +3,7 @@ from fastapi import FastAPI
from fastapi.staticfiles import StaticFiles
# import utils.startup as startup
from app_config import CWD, DATA_DIR, PORT, PRODUCTION, WEB_PATH, docs_url, redoc_url
from app_config import APP_VERSION, PORT, PRODUCTION, WEB_PATH, docs_url, redoc_url
from routes import (
backup_routes,
debug_routes,
@ -37,7 +37,7 @@ TODO:
app = FastAPI(
title="Mealie",
description="A place for all your recipes",
version="0.0.1",
version=APP_VERSION,
docs_url=docs_url,
redoc_url=redoc_url,
)

View file

@ -98,7 +98,7 @@ def import_database(
return imported
@router.delete("/{file_name}/delete", tags=["Import / Export"], status_code=200)
@router.delete("/{file_name}/delete", status_code=200)
def delete_backup(file_name: str):
""" Removes a database backup from the file system """

View file

@ -1,7 +1,6 @@
import json
import os
from app_config import DEBUG_DIR
from app_config import APP_VERSION, DEBUG_DIR
from fastapi import APIRouter
from fastapi.responses import HTMLResponse
from utils.logger import LOGGER_FILE
@ -9,6 +8,12 @@ from utils.logger import LOGGER_FILE
router = APIRouter(prefix="/api/debug", tags=["Debug"])
@router.get("/version")
async def get_mealie_version():
""" Returns the current version of mealie"""
return {"version": APP_VERSION}
@router.get("/last-recipe-json")
async def get_last_recipe_json():
""" Doc Str """