Skip to content

copilot#27

Merged
HolgerHuo merged 17 commits intolcpu-club:mainfrom
HGChuang:main
Oct 29, 2025
Merged

copilot#27
HolgerHuo merged 17 commits intolcpu-club:mainfrom
HGChuang:main

Conversation

@HGChuang
Copy link

添加了overleaf copilot功能

@HGChuang
Copy link
Author

同时修改了/develop/docker-compose.dev.yml中references和notifications端口冲突的问题

- NODE_OPTIONS=--inspect=0.0.0.0:9229
ports:
- "127.0.0.1:9230:9229"
- "0.0.0.0:9230:9229"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为什么要这么改呢?这会有一定的安全问题

develop/bin/dev Outdated
#!/usr/bin/env bash

docker-compose -f docker-compose.yml -f docker-compose.dev.yml up --no-deps --detach "$@"
docker compose -f docker-compose.yml -f docker-compose.dev.yml up --no-deps --detach "$@" No newline at end of file
Copy link
Member

@AllanChain AllanChain Sep 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是不是可以把针对开发环境 (dev) 的修改新开一个 PR?(下面还有很多也是一样的)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

像是误删?

Comment on lines 133 to 140
- ../services/llm/app.js:/overleaf/services/llm/app.js
- ../services/llm/config:/overleaf/services/llm/config
- ../services/llm/controllers:/overleaf/services/llm/controllers
- ../services/llm/models:/overleaf/services/llm/models
- ../services/llm/routes:/overleaf/services/llm/routes
- ../services/llm/services:/overleaf/services/llm/services
- ../services/llm/utils:/overleaf/services/llm/utils
- ../services/llm/package.json:/overleaf/services/llm/package.json
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

文件目录结构是不是可以改得和其他模块一样?其他模块都是只需要挂载 app/, app.js, config/,这里分太多目录是不是没有必要

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VS Code 的 config 不应该出现

@@ -1 +1 @@
module.exports = require('./Settings')
module.exports = require('./Settings') No newline at end of file
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可能是编辑器配置的问题?好多文件都是最后一行没有换行 (no newline at the end of file)?

export default async function connectDatabase() {
try {
await mongoose.connect(dbConfig.uri, dbConfig.options); // 使用 mongoose.connect
console.log('MongoDB 连接成功');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

能不能尽量用英文啊?因为原来的 Overleaf 项目都是用英文的

import mongoose from 'mongoose'; // 新增
import {MONGO_URL} from './settings.defaults.js';

// 数据库配置
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

有很多类似的无用 comment,像是 LLM 给出来的。大家都知道 dbConfig 是“数据库配置”的意思。建议清理一下(最好是能用英文注释)

@@ -0,0 +1,23 @@
import mongoose from 'mongoose'; // 新增
import {MONGO_URL} from './settings.defaults.js';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

你看其他 service 模块从来没有直接从 settings.defaults.js 里面导入的,都是用的

const Settings = require('@overleaf/settings')

这里面有一些特殊的逻辑在里面的

- ../services/llm/app.js:/overleaf/services/llm/app.js
- ../services/llm/config:/overleaf/services/llm/config
- ../services/llm/app:/overleaf/app
- ../services/llm/package.json:/overleaf/services/llm/package.json

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unnecessary because when this image is built as defined in /develop/docker-compose.yml , node_modules are already installed. No need to reimport package.json here. Also, follow the order of other services is recommended, that

  • ../services/notifications/app:/overleaf/services/notifications/app
  • ../services/notifications/app.js:/overleaf/services/notifications/app.js
  • ../services/notifications/config:/overleaf/services/notifications/config

package.json Outdated
"services/tpdsworker",
"services/web"
"services/web",
"services/llm"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider sort dependencies in alphabetical order to comply with the conventions.

@@ -0,0 +1,22 @@
FROM node:18.20.2 AS base

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider bump this version to latest lts as this service is recently written

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

English or Chinese prompt?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In other services, docker-compose.yml serves as unit test. This doesn't seem useful if there is no unit test but only depenedencies

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Necessary?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update these comments

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Frontend should be i18n compatible, or at least in English since currently deployed instance is set to use English.

@HGChuang HGChuang requested a review from HolgerHuo October 21, 2025 02:54
@HolgerHuo
Copy link

@HGChuang The service part should be OK. You should also add deployment files in ./server-ce/

Primarily:

  1. ./server-ce/config/settings.js : This contains settings in deployment environment
  2. ./server-ce/runit/ : You should add service files in this directory. The production docker image is managed by an init service called https://smarden.org/runit/ . You could follow the schema of other runit services to set it up for deployment environment.

.paraphrase-card{pointer-events:auto;width:100%;background:#071223;border-radius:12px;padding:12px;box-shadow:0 14px 40px rgba(3,8,22,0.55);border:1px solid rgba(255,255,255,0.06);color:#e6eef8}
.paraphrase-text{width:100%;min-height:88px;padding:10px;border-radius:8px;background:rgba(255,255,255,0.02);color:#e6eef8;outline:none;resize:vertical;box-sizing:border-box;white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word}
.paraphrase-footer{display:flex;justify-content:flex-end;gap:10px;margin-top:10px}
.btn{padding:8px 12px;border-radius:10px;cursor:pointer;border:1px solid rgba(255,255,255,0.06);background:linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01))}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CSS here should be scoped. Otherwise this will conflict with global style.

See:

  • Before:

    image
  • After

    image

@HolgerHuo HolgerHuo merged commit c0aef13 into lcpu-club:main Oct 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants