diff --git a/.dockerignore b/.dockerignore index f759d8859..4bc49f0ec 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,4 +1,5 @@ mongo_data/* certs/* data/* -logs/* \ No newline at end of file +logs/* +YYeTsFE/node_modules/* \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 44fe89cc0..c227281e6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,10 +14,12 @@ RUN apk update && apk add --no-cache libressl jpeg-dev openjpeg-dev libimagequan FROM node:alpine as nodebuilder WORKDIR /YYeTsBot/YYeTsFE/ +RUN apk add git COPY YYeTsFE/package.json /YYeTsBot/YYeTsFE/ COPY YYeTsFE/yarn.lock /YYeTsBot/YYeTsFE/ RUN yarn -COPY YYeTsFE /YYeTsBot/YYeTsFE/ +COPY . /YYeTsBot/ +RUN echo "gitdir: $(pwd)/../.git/modules/YYeTsFE" > .git RUN yarn run release diff --git a/YYeTsFE b/YYeTsFE index 5c072ab67..60c497bd0 160000 --- a/YYeTsFE +++ b/YYeTsFE @@ -1 +1 @@ -Subproject commit 5c072ab67e1e9fb94fd73a5f93dd1dfcb64de0b0 +Subproject commit 60c497bd0fd4c76c7530f82b2a31ca23d482e047 diff --git a/yyetsweb/Mongo.py b/yyetsweb/Mongo.py index c2c1bc98a..2adb7213b 100644 --- a/yyetsweb/Mongo.py +++ b/yyetsweb/Mongo.py @@ -137,7 +137,7 @@ def get_comment(self, resource_id: int, page: int, size: int, **kwargs) -> dict: count = self.db["comment"].count_documents(condition) data = self.db["comment"].find(condition, projection={"ip": False}) \ - .sort("id", pymongo.DESCENDING).limit(size).skip((page - 1) * size) + .sort("_id", pymongo.DESCENDING).limit(size).skip((page - 1) * size) return { "data": self.convert_objectid(list(data)), "count": count, @@ -150,7 +150,7 @@ def add_comment(self, captcha: str, captcha_id: int, content: str, resource_id: verify_result = CaptchaResource().verify_code(captcha, captcha_id) if not verify_result["status"]: returned["status_code"] = HTTPStatus.BAD_REQUEST - returned["message"] = verify_result + returned["message"] = verify_result["message"] return returned exists = self.db["yyets"].find_one({"data.info.id": resource_id})