first commit
This commit is contained in:
114
README.md
Normal file
114
README.md
Normal file
@@ -0,0 +1,114 @@
|
||||
# NPM + Angie Auto Installer
|
||||
|
||||
Minimal, repeatable setup for **Nginx Proxy Manager (NPM)** on **Angie** (Debian 13).
|
||||
The installer configures Angie, deploys NPM (frontend + backend), fixes common pitfalls (PID tests, logrotate)
|
||||
---
|
||||
|
||||
## Repository
|
||||
Base URL: **https://gitea.linuxiarz.pl/gru/npm-angie-auto-install**
|
||||
|
||||
> On Gitea, the raw file URL usually looks like:
|
||||
> `https://gitea.linuxiarz.pl/gru/npm-angie-auto-install/raw/branch/main/install.py`
|
||||
|
||||
---
|
||||
|
||||
## Requirements
|
||||
- Debian 13 (root privileges).
|
||||
- `curl`, `python3`, `systemd`.
|
||||
- Network access to fetch packages and Node/Yarn artifacts.
|
||||
- ~2 GB RAM (recommended) or add 2 GB swap for safer frontend builds.
|
||||
|
||||
---
|
||||
|
||||
## Quick Start (one-liner)
|
||||
```bash
|
||||
curl -fsSL https://gitea.linuxiarz.pl/gru/npm-angie-auto-install/raw/branch/master/npm_install.py -o install.py && sudo python3 install.py --dark-mode
|
||||
```
|
||||
|
||||
> If you keep a patched version, replace `install.py` with your file name (e.g. `install_fixed.py`).
|
||||
|
||||
---
|
||||
|
||||
## Manual Download & Run
|
||||
```bash
|
||||
# 1) Download
|
||||
curl -L https://gitea.linuxiarz.pl/gru/npm-angie-auto-install/raw/branch/master/npm_install.py -o install.py
|
||||
|
||||
# 2) Verify (optional)
|
||||
python3 -m pyflakes install.py || true
|
||||
|
||||
# 3) Run
|
||||
sudo python3 install.py --dark-mode
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## What the Installer Does
|
||||
- Creates **/etc/nginx -> /etc/angie** symlink (idempotent).
|
||||
- Installs **Angie** and config templates; provides an **nginx wrapper** that makes config tests safe:
|
||||
- `nginx -t` automatically uses `-g "pid /tmp/angie-test.pid; error_log off;"` and strips other `-g` flags.
|
||||
- Prepares **/run/angie/angie.pid** with sane permissions.
|
||||
- Configures **logrotate** for `/data/logs/*.log` (daily, rotate 7, compress) and provides a **logrotate-npm** helper that uses a writable state file at `/opt/npm/var/logrotate.state`.
|
||||
- Deploys NPM (frontend + backend) and for building the legacy frontend.
|
||||
|
||||
|
||||
---
|
||||
|
||||
## Options
|
||||
- IPv6 keep/strip (resolver & conf).
|
||||
- Theme.Park stylesheet injection (optional).
|
||||
- Update-only mode (rebuild without reconfiguring Angie).
|
||||
|
||||
Check `--help` in the script for all flags.
|
||||
|
||||
---
|
||||
|
||||
## Post-Install
|
||||
```bash
|
||||
# Status
|
||||
systemctl status angie.service --no-pager
|
||||
systemctl status npm.service --no-pager
|
||||
|
||||
# NPM UI
|
||||
# Default: http(s)://<your-host> (see summary printed by installer)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Troubleshooting
|
||||
**1) Frontend build killed (SIGKILL) / high RAM usage**
|
||||
- The script forces **Yarn Classic (1.22.x)** and reduces concurrency.
|
||||
- If memory is tight, add swap:
|
||||
```bash
|
||||
sudo fallocate -l 2G /swapfile && sudo chmod 600 /swapfile
|
||||
sudo mkswap /swapfile && sudo swapon /swapfile
|
||||
```
|
||||
|
||||
**2) Permission denied: `/var/lib/logrotate/status`**
|
||||
- Use `/usr/local/bin/logrotate-npm` (created by the installer), which keeps its own writable state file.
|
||||
|
||||
**3) Config test fails on PID**
|
||||
- The **nginx wrapper** ensures `nginx -t` writes test PID to `/tmp`, not to `/run/angie/angie.pid`.
|
||||
|
||||
**4) `/etc/nginx` not pointing to Angie**
|
||||
- The installer ensures `/etc/nginx -> /etc/angie`. To fix manually:
|
||||
```bash
|
||||
sudo mv /etc/nginx /etc/nginx.bak # if it is a dir/file
|
||||
sudo ln -sfn /etc/angie /etc/nginx
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Uninstall (manual)
|
||||
```bash
|
||||
sudo systemctl disable --now npm.service angie.service || true
|
||||
sudo rm -f /usr/sbin/nginx /usr/local/bin/logrotate-npm || true
|
||||
# restore backups if you created any; remove /opt/npm, configs, etc. with care
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## License
|
||||
MIT (unless your repo specifies otherwise).
|
||||
|
||||
## Author linuxiarz.pl, Mateusz Gruszczyński
|
||||
Reference in New Issue
Block a user