beyondcode / beyondcode/polyscope-community

[Bug] Worktree creation generates broken Nginx config for Herd

未关闭
#80 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
没有语言数据
星标
20
派生
0
PR 合并指标
30 天内没有已合并 PR

描述

## Description

When Polyscope creates a worktree, it appears to register a new site in Laravel Herd's Nginx configuration. However, the generated config file contains empty replacement strings, which causes Nginx to fail to start entirely.

## Version

- Polyscope: **0.14.0**
- Laravel Herd (macOS)

## Steps to reproduce

1. Use Polyscope to create a worktree (e.g. for a PR)
2. Herd's Nginx server crashes and fails to restart

## Root cause

The generated Nginx site config (in `~/Library/Application Support/Herd/config/valet/Nginx/`) contains empty strings where paths should be:

```nginx
location / {
rewrite ^ "" last; # ← empty replacement, invalid in Nginx
}

error_page 404 ""; # ← empty
fastcgi_index ""; # ← empty
fastcgi_param SCRIPT_FILENAME ""; # ← empty
```

Nginx throws:
```
[emerg] empty replacement in .../config/valet/Nginx/jolly-newt.test:28
nginx: configuration file ... test failed
```

This prevents **all** Herd sites from working, not just the Polyscope worktree site.

## Expected behavior

The generated Nginx config should contain valid paths pointing to the worktree directory, or the site should not be registered in Herd if the paths are unavailable.

## Workaround

Manually delete the broken config file from `~/Library/Application Support/Herd/config/valet/Nginx/` and restart Herd.

贡献指南

这个仓库没有索引到贡献指南

调研方向

Start by reproducing worktree creation for a PR and inspect the generated file in ~/Library/Application Support/Herd/config/valet/Nginx/. Trace the worktree-to-Herd registration entry point and determine why the rewrite, error_page, fastcgi_index, and SCRIPT_FILENAME values are empty. Done means the generated site has valid worktree paths, or is not registered when paths are unavailable, and Herd's Nginx configuration starts successfully.

由索引模型根据 Issue 内容生成。

评估

技术栈
laravel, nginx
领域
devops, infrastructure
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
冷清
描述清晰度
基本清楚
新手友好度
48/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。