Skip to content

Commit 66bfebb

Browse files
committed
🔨 add uv cache clean & OpenSSH add dev tools & Update Contributor
1 parent 4ec242d commit 66bfebb

File tree

9 files changed

+95
-75
lines changed

9 files changed

+95
-75
lines changed

doc/docs/en/contributors.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ Each team member brings unique expertise and perspective to the project, contrib
4545
We would like to express our special thanks to the following open source contributors who have made valuable contributions to the Nexent project:
4646

4747
- **kasper1995** - Code contributions and bug fixes
48-
- **feng384** - Feature development and improvements
49-
- **Cokefish9527** - Documentation and testing
50-
- **lwsinclair** - Performance optimizations
51-
- **4cos90** - UI/UX improvements
52-
- **xigongdaEricyang** - Backend enhancements
48+
- **feng384** - Code contributions and bug fixes
49+
- **Cokefish9527** - Code contributions and bug fixes
50+
- **lwsinclair** - Code contributions and bug fixes
51+
- **4cos90** - Code contributions and bug fixes
52+
- **xigongdaEricyang** - Community support and feedback
5353
- **Jenniebn** - Community support and feedback
5454

5555
## Join Our Team

doc/docs/zh/contributors.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@ Nexent 项目得益于我们核心团队成员的辛勤工作。我们想感谢
4545
我们想特别感谢以下开源贡献者,他们为 Nexent 项目做出了宝贵的贡献:
4646

4747
- **kasper1995** - 代码贡献和错误修复
48-
- **feng384** - 功能开发和改进
49-
- **Cokefish9527** - 文档和测试
50-
- **lwsinclair** - 性能优化
51-
- **4cos90** - UI/UX 改进
52-
- **xigongdaEricyang** - 后端增强
53-
- **Jenniebn** - 社区支持和反馈
48+
- **feng384** - 代码贡献和错误修复
49+
- **Cokefish9527** - 代码贡献和错误修复
50+
- **lwsinclair** - 代码贡献和错误修复
51+
- **4cos90** - 代码贡献和错误修复
52+
- **xigongdaEricyang** - 代码\Issue 贡献
53+
- **Jenniebn** - 代码\Issue 贡献
5454

5555
## 加入我们的团队
5656

docker/deploy.sh

Lines changed: 22 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -371,62 +371,24 @@ pull_required_images() {
371371
fi
372372
}
373373

374-
# Function to setup SSH timeout configuration using custom-init
375-
setup_ssh_timeout_config() {
376-
echo "📝 Setting up SSH timeout configuration..."
377-
mkdir -p "openssh-server/config/custom-cont-init.d"
378-
if [ ! -f "openssh-server/config/custom-cont-init.d/99-sshd-timeout-config" ]; then
379-
cat > "openssh-server/config/custom-cont-init.d/99-sshd-timeout-config" << 'EOF'
380-
#!/usr/bin/with-contenv bash
381-
382-
# Configure SSH timeout settings for nexent terminal tool
383-
echo "Configuring SSH timeout settings (60 minutes)..."
384-
385-
# Fix SSH host key permissions (must be 600 for private keys)
386-
echo "Fixing SSH host key permissions..."
387-
find /config -name "*_key" -type f -exec chmod 600 {} \; 2>/dev/null || true
388-
find /config/ssh_host_keys -name "*_key" -type f -exec chmod 600 {} \; 2>/dev/null || true
389-
echo "SSH host key permissions fixed"
390-
391-
# Append timeout configuration to sshd_config
392-
cat >> /config/sshd/sshd_config << 'SSHD_EOF'
393-
394-
# Nexent Terminal Tool - Session timeout configuration (60 minutes = 3600 seconds)
395-
ClientAliveInterval 300
396-
ClientAliveCountMax 12
397-
SSHD_EOF
398-
399-
echo "SSH timeout configuration applied successfully"
400-
EOF
401-
chmod +x "openssh-server/config/custom-cont-init.d/99-sshd-timeout-config"
402-
echo "✅ SSH timeout configuration script created"
403-
else
404-
echo "🔄 SSH timeout configuration script already exists, updating..."
405-
# Always recreate the script to ensure it has the latest configuration
406-
cat > "openssh-server/config/custom-cont-init.d/99-sshd-timeout-config" << 'EOF'
407-
#!/usr/bin/with-contenv bash
408-
409-
# Configure SSH timeout settings for nexent terminal tool
410-
echo "Configuring SSH timeout settings (60 minutes)..."
411-
412-
# Fix SSH host key permissions (must be 600 for private keys)
413-
echo "Fixing SSH host key permissions..."
414-
find /config -name "*_key" -type f -exec chmod 600 {} \; 2>/dev/null || true
415-
find /config/ssh_host_keys -name "*_key" -type f -exec chmod 600 {} \; 2>/dev/null || true
416-
echo "SSH host key permissions fixed"
417-
418-
# Append timeout configuration to sshd_config
419-
cat >> /config/sshd/sshd_config << 'SSHD_EOF'
420-
421-
# Nexent Terminal Tool - Session timeout configuration (60 minutes = 3600 seconds)
422-
ClientAliveInterval 300
423-
ClientAliveCountMax 12
424-
SSHD_EOF
425-
426-
echo "SSH timeout configuration applied successfully"
427-
EOF
428-
chmod +x "openssh-server/config/custom-cont-init.d/99-sshd-timeout-config"
429-
echo "✅ SSH timeout configuration script updated"
374+
375+
376+
# Function to setup package installation script
377+
setup_package_install_script() {
378+
if [ "$ENABLE_TERMINAL_TOOL" = "true" ]; then
379+
echo "📝 Setting up package installation script..."
380+
mkdir -p "openssh-server/config/custom-cont-init.d"
381+
382+
# Copy the fixed installation script
383+
if [ -f "openssh-install-script.sh" ]; then
384+
cp "openssh-install-script.sh" "openssh-server/config/custom-cont-init.d/openssh-start-script"
385+
chmod +x "openssh-server/config/custom-cont-init.d/openssh-start-script"
386+
echo "✅ Package installation script created/updated"
387+
else
388+
echo "❌ ERROR openssh-install-script.sh not found"
389+
ERROR_OCCURRED=1
390+
return 1
391+
fi
430392
fi
431393
}
432394

@@ -559,8 +521,8 @@ generate_ssh_keys() {
559521
cp "openssh-server/ssh-keys/openssh_server_key.pub" "openssh-server/config/authorized_keys"
560522
chmod 644 "openssh-server/config/authorized_keys"
561523

562-
# Setup SSH timeout configuration
563-
setup_ssh_timeout_config
524+
# Setup package installation script
525+
setup_package_install_script
564526

565527
# Set SSH key path in environment
566528
SSH_PRIVATE_KEY_PATH="$(pwd)/openssh-server/ssh-keys/openssh_server_key"
@@ -630,8 +592,8 @@ generate_ssh_keys() {
630592
cp "openssh-server/ssh-keys/openssh_server_key.pub" "openssh-server/config/authorized_keys"
631593
chmod 644 "openssh-server/config/authorized_keys"
632594

633-
# Setup SSH timeout configuration
634-
setup_ssh_timeout_config
595+
# Setup package installation script
596+
setup_package_install_script
635597

636598
# Set SSH key path in environment
637599
SSH_PRIVATE_KEY_PATH="$(pwd)/openssh-server/ssh-keys/openssh_server_key"

docker/docker-compose.prod.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,8 @@ services:
210210
SUDO_ACCESS: "true"
211211
PASSWORD_ACCESS: "false"
212212
LOG_STDOUT: "true"
213+
DOCKER_MODS: linuxserver/mods:universal-package-install
214+
INSTALL_PACKAGES: git|make|curl|vim|wget
213215
volumes:
214216
- ${ROOT_DIR}/openssh-server/config:/config
215217
- ${ROOT_DIR}/openssh-server/config/custom-cont-init.d:/custom-cont-init.d:ro

docker/docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,8 @@ services:
225225
SUDO_ACCESS: "true"
226226
PASSWORD_ACCESS: "false"
227227
LOG_STDOUT: "true"
228+
DOCKER_MODS: linuxserver/mods:universal-package-install
229+
INSTALL_PACKAGES: git|make|curl|vim|wget
228230
ports:
229231
- "2222:2222" # SSH port
230232
volumes:

docker/generate_env.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,20 @@ update_env_file() {
219219
echo "REDIS_BACKEND_URL=redis://localhost:6379/1" >> ../.env
220220
fi
221221

222+
# POSTGRES_HOST
223+
if grep -q "^POSTGRES_HOST=" ../.env; then
224+
sed -i.bak "s~^POSTGRES_HOST=.*~POSTGRES_HOST=localhost~" ../.env
225+
else
226+
echo "POSTGRES_HOST=localhost" >> ../.env
227+
fi
228+
229+
# POSTGRES_PORT
230+
if grep -q "^POSTGRES_PORT=" ../.env; then
231+
sed -i.bak "s~^POSTGRES_PORT=.*~POSTGRES_PORT=5434~" ../.env
232+
else
233+
echo "POSTGRES_PORT=5434" >> ../.env
234+
fi
235+
222236
# Remove backup file
223237
rm -f ../.env.bak
224238

docker/openssh-install-script.sh

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/usr/bin/with-contenv bash
2+
3+
# Set error handling
4+
set -e
5+
6+
# Install required packages
7+
echo "Installing required packages..."
8+
apk update
9+
apk add --no-cache \
10+
python3 \
11+
py3-pip \
12+
py3-virtualenv \
13+
curl \
14+
vim \
15+
git \
16+
wget
17+
18+
echo "Package installation completed successfully!"
19+
20+
# Configure SSH timeout settings for nexent terminal tool
21+
echo "Configuring SSH timeout settings (60 minutes)..."
22+
23+
# Fix SSH host key permissions (must be 600 for private keys)
24+
echo "Fixing SSH host key permissions..."
25+
find /config -name "*_key" -type f -exec chmod 600 {} \; 2>/dev/null || true
26+
find /config/ssh_host_keys -name "*_key" -type f -exec chmod 600 {} \; 2>/dev/null || true
27+
echo "SSH host key permissions fixed"
28+
29+
# Append timeout configuration to sshd_config
30+
cat >> /config/sshd/sshd_config << 'SSHD_EOF'
31+
32+
# Nexent Terminal Tool - Session timeout configuration (60 minutes = 3600 seconds)
33+
ClientAliveInterval 300
34+
ClientAliveCountMax 12
35+
SSHD_EOF
36+
37+
echo "SSH timeout configuration applied successfully"

make/data_process/Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,11 @@ COPY model-assets/nltk_data /opt/models/nltk_data
3131
WORKDIR /opt/backend
3232
# Layer 1: install base dependencies
3333
COPY backend/pyproject.toml /opt/backend/pyproject.toml
34-
RUN uv sync --extra data-process $(test -n "$MIRROR" && echo "-i $MIRROR")
34+
RUN uv sync --no-cache-dir --extra data-process $(test -n "$MIRROR" && echo "-i $MIRROR") && \
35+
uv cache clean
3536
# Layer 2: install sdk in link mode
3637
COPY sdk /opt/sdk
37-
RUN uv pip install /opt/sdk $(test -n "$MIRROR" && echo "-i $MIRROR") && \
38+
RUN uv pip install --no-cache-dir /opt/sdk $(test -n "$MIRROR" && echo "-i $MIRROR") && \
3839
uv cache clean
3940
# Layer 3: copy backend code
4041
COPY backend /opt/backend

make/main/Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@ WORKDIR /opt/backend
1818

1919
# Layer 0: install base dependencies
2020
COPY backend/pyproject.toml /opt/backend/pyproject.toml
21-
RUN uv sync $(test -n "$MIRROR" && echo "-i $MIRROR")
21+
RUN uv sync --no-cache-dir $(test -n "$MIRROR" && echo "-i $MIRROR") && \
22+
uv cache clean
2223
# Layer 1: install sdk in link mode
2324
COPY sdk /opt/sdk
24-
RUN uv pip install /opt/sdk $(test -n "$MIRROR" && echo "-i $MIRROR")
25+
RUN uv pip install --no-cache-dir /opt/sdk $(test -n "$MIRROR" && echo "-i $MIRROR") && \
26+
uv cache clean
2527
# Layer 2: copy backend code
2628
COPY backend /opt/backend
2729

0 commit comments

Comments
 (0)