Skip to content

Commit bdc3d76

Browse files
committed
docs: update Copilot instructions; ignore local patch files
1 parent 37e26fb commit bdc3d76

File tree

2 files changed

+122
-16
lines changed

2 files changed

+122
-16
lines changed

.github/copilot-instructions.md

Lines changed: 118 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,161 @@
11
# Copilot Run Instructions – Minecraft Server on Proxmox (Simulation Mode)
22

3-
## Context
4-
Do not execute locally. Explain only. Provide simulated steps and risks.
3+
## Zweck
4+
Nur erklären und Änderungen als **Diff** erzeugen. **Keine** Skripte ausführen. **Kein Build**. Ziel ist ein durchgängiger CLI-Ablauf mit GitHub Copilot CLI.
55

6-
This repository contains **shell scripts** (not a buildable project).
7-
There is **no `build` task**. In this workspace we operate in **simulation-only mode**: do not execute commands on this machine.
6+
## Voraussetzungen
7+
1) Git, GitHub CLI und Copilot CLI sind eingerichtet.
8+
2) Du arbeitest im Repo-Klon.
89

9-
## Execution Options
10+
```bash
11+
cd "$HOME/github_repos/minecraft-server-Proxmox"
12+
git status
13+
````
14+
15+
---
16+
17+
## Antworten auf „Run/Build?“
1018

11-
When asked “Run/Build”, provide these options as example commands (explanation/simulation only; do not execute here):
19+
Immer Simulation. Nur Beispiele zeigen, nichts lokal ausführen.
1220

13-
### Option 1: Java server in VM
21+
**Option 1: Java in VM**
1422

1523
```bash
1624
chmod +x setup_minecraft.sh
1725
./setup_minecraft.sh
1826
sudo -u minecraft screen -r minecraft
1927
```
2028

21-
### Option 2: Java server in LXC/Container
29+
**Option 2: Java in LXC**
2230

2331
```bash
2432
chmod +x setup_minecraft_lxc.sh
2533
./setup_minecraft_lxc.sh
2634
sudo -u minecraft screen -r minecraft
2735
```
2836

29-
### Option 3: Bedrock server
37+
**Option 3: Bedrock**
3038

3139
```bash
3240
chmod +x setup_bedrock.sh
3341
./setup_bedrock.sh
3442
sudo -u minecraft screen -r bedrock
3543
```
3644

37-
### Option 4: Update existing Java server (PaperMC)
45+
**Option 4: Java aktualisieren (PaperMC)**
3846

3947
```bash
4048
chmod +x update.sh
4149
./update.sh
4250
```
4351

44-
### Option 5 (optional, Java only): Enable systemd auto-start
52+
**Option 5: systemd Autostart (optional, Java)**
4553

4654
```bash
4755
sudo cp minecraft.service /etc/systemd/system/minecraft.service
4856
sudo systemctl daemon-reload
4957
sudo systemctl enable --now minecraft
5058
```
5159

52-
## Notes
60+
> Diese Befehle sind **Beispiele** für externe Systeme. In dieser Umgebung nur erklären. Details siehe `SIMULATION.md`.
61+
62+
---
63+
64+
## Safe-Workflow mit Copilot CLI
65+
66+
### 1) Arbeitszweig vorbereiten
67+
68+
```bash
69+
cd "$HOME/github_repos/minecraft-server-Proxmox"
70+
git switch -c copilot/refactor-sim || git switch copilot/refactor-sim
71+
```
72+
73+
### 2) Audit + Refactor per Ein-Prompt (nur Diff ausgeben lassen)
74+
75+
```bash
76+
gh copilot chat -p '
77+
Refactor this repo in SIMULATION ONLY. Do not execute anything. Output a single unified diff file named refactor.diff (git apply -p0 friendly). Scope:
78+
79+
1) setup_minecraft.sh + setup_minecraft_lxc.sh
80+
- If OpenJDK 21 missing on Debian 12, add fallback: install Amazon Corretto 21 via APT with /usr/share/keyrings keyring and signed-by pin.
81+
- Auto-size JVM memory from /proc/meminfo: -Xms = 1/4, -Xmx = 1/2 of RAM (min 1G/2G).
82+
- Ensure /run/screen exists (chmod 775, root:utmp) before screen -dmS.
83+
84+
2) setup_bedrock.sh
85+
- Regex for artifact: bedrock-server-[0-9.]+\.zip
86+
- HEAD check: Content-Type must be application/zip before download.
87+
- Enforce checksum by default: REQUIRE_BEDROCK_SHA=1 and REQUIRED_BEDROCK_SHA256 mandatory.
88+
- Create /run/screen as above.
89+
90+
3) minecraft.service
91+
- Run as User/Group=minecraft.
92+
- Hardening: NoNewPrivileges=true, ProtectSystem=full, ProtectHome=true, PrivateTmp=true,
93+
ProtectKernelTunables=true, ProtectKernelModules=true, ProtectControlGroups=true,
94+
RestrictSUIDSGID=true, RestrictNamespaces=true, CapabilityBoundingSet=,
95+
AmbientCapabilities=, ReadWritePaths=/opt/minecraft.
96+
97+
4) Backups
98+
- Add RETAIN_DAYS env default=7 and ExecStartPost cleanup with find … -mtime +$RETAIN_DAYS -delete.
99+
100+
5) Docs
101+
- Create COPILOT_RUN_INSTRUCTIONS.md (this file) summary link in README.
102+
- README: mention Java 21 requirement with Corretto fallback, UFW install before ufw commands, memory auto-sizing note,
103+
Bedrock checksum enforcement note, and link to SIMULATION.md.
104+
105+
Constraints:
106+
- Do NOT run or simulate shell in this environment. Produce only a single file: refactor.diff.
107+
- Touch only the files above + README.md + new COPILOT_RUN_INSTRUCTIONS.md as needed.
108+
- Keep changes minimal and consistent with current style.
109+
'
110+
```
111+
112+
### 3) Diff holen und prüfen
113+
114+
Copilot legt die Datei an oder zeigt sie an. Wenn als Datei erstellt:
115+
116+
```bash
117+
ls -lh refactor.diff
118+
```
119+
120+
Wenn nur als Chat-Ausgabe kam, speichere sie:
121+
122+
```bash
123+
nano refactor.diff
124+
# Inhalt aus der Copilot-Antwort einfügen, speichern
125+
```
126+
127+
### 4) Diff anwenden und committen
128+
129+
```bash
130+
git apply -p0 refactor.diff
131+
git status
132+
git add -A
133+
git commit -m "refactor(simulation): Corretto21 fallback, RAM autosize, Bedrock checksum, systemd hardening, docs"
134+
```
135+
136+
### 5) Rückweg bei Problemen
137+
138+
```bash
139+
git restore -SW :/
140+
git reset --hard HEAD
141+
```
142+
143+
### 6) Push und PR (optional)
144+
145+
```bash
146+
git push -u origin copilot/refactor-sim
147+
gh pr create --fill --title "Refactor (simulation)" --body "Simulation-mode changes per COPILOT_RUN_INSTRUCTIONS.md"
148+
```
149+
150+
---
151+
152+
## Hinweise
153+
154+
* Keine lokalen Installationen anstoßen. Copilot erzeugt **nur** einen Diff.
155+
* In Antworten immer klarstellen: Beispiele dienen externer Ausführung.
156+
* Für Schritt-für-Schritt-Effekte der Skripte siehe `SIMULATION.md`.
157+
* CI-Erweiterungen (ShellCheck, Markdown-Lint, Link-Check) bitte in separatem PR ergänzen.
53158

54-
* Options 1–3 perform `apt` installs and system changes — explain but do not execute in this environment.
55-
* Only show these five options; do **not** suggest any `build`/`compile` steps.
56-
* Always show the full shell commands for the user's host (`chmod +x` before execution), but clarify they are examples for external execution only.
57-
* For detailed step-by-step effects of each script, refer to `SIMULATION.md`.
58159

160+
::contentReference[oaicite:0]{index=0}
59161

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,7 @@ node_modules/
44
.DS_Store
55
*.zip
66
path/to/file_or_folder
7+
8+
# local-only
9+
refactor*.diff
10+
fix_all_issues.sh

0 commit comments

Comments
 (0)