repos-devtools-server: gitignore .env, systemd unit template, README run modes

**Motivations:**
- Document user systemd and keep secrets out of git

**Root causes:**
- N/A

**Correctifs:**
- N/A

**Evolutions:**
- .env gitignored; systemd/user template and README

**Pages affectées:**
- services/repos-devtools-server/.gitignore
- services/repos-devtools-server/README.md
- services/repos-devtools-server/systemd/user/*
This commit is contained in:
Nicolas Cantu 2026-03-23 21:24:31 +01:00
parent 597f18f758
commit dce376f2b7
4 changed files with 36 additions and 2 deletions

View File

@ -1,2 +1,3 @@
node_modules/ node_modules/
dist/ dist/
.env

View File

@ -21,12 +21,23 @@ All endpoints require `Authorization: Bearer <REPOS_DEVTOOLS_TOKEN>`.
## Run ## Run
### One-off (foreground)
```bash ```bash
cd services/repos-devtools-server cd services/repos-devtools-server
npm install npm install
npm run build npm run build
export REPOS_DEVTOOLS_TOKEN='generate-a-long-random-secret' # Create .env (gitignored) with REPOS_DEVTOOLS_TOKEN=... and REPOS_DEVTOOLS_ROOT=/home/ncantu/code
npm start set -a && source .env && set +a && node dist/server.js
```
### systemd (user)
Copy `systemd/user/repos-devtools-server.service` to `~/.config/systemd/user/`, create `.env` beside this README, then:
```bash
systemctl --user daemon-reload
systemctl --user enable --now repos-devtools-server.service
``` ```
Use the same token in the VS Code / Cursor setting **`anythingllm.reposApiToken`**. Use the same token in the VS Code / Cursor setting **`anythingllm.reposApiToken`**.

View File

@ -0,0 +1,8 @@
# User systemd unit
1. Create `../.env` (see main README): `REPOS_DEVTOOLS_TOKEN`, `REPOS_DEVTOOLS_ROOT`.
2. `mkdir -p ~/.config/systemd/user`
3. `cp repos-devtools-server.service ~/.config/systemd/user/`
4. `systemctl --user daemon-reload && systemctl --user enable --now repos-devtools-server.service`
Adjust `WorkingDirectory`, `EnvironmentFile`, and `ExecStart` paths if the repository is not at `/home/ncantu/code/smart_ide`.

View File

@ -0,0 +1,14 @@
[Unit]
Description=4NK repos-devtools-server (git API for /home/ncantu/code)
After=network.target
[Service]
Type=simple
WorkingDirectory=/home/ncantu/code/smart_ide/services/repos-devtools-server
EnvironmentFile=/home/ncantu/code/smart_ide/services/repos-devtools-server/.env
ExecStart=/usr/bin/node dist/server.js
Restart=on-failure
RestartSec=3
[Install]
WantedBy=default.target