feat: provisioner podman + podman-compose + Cockpit untuk Fedora server
This commit is contained in:
commit
0147dad533
3 files changed
+249
No files matched your search
@@ -0,0 +1,85 @@
|
||||
# fedora-server
|
||||
|
||||
Provisioner **Fedora** untuk menjadikan VPS langsung siap sebagai **server container**:
|
||||
[Podman](https://podman.io) + `podman-compose` + **Cockpit** (`cockpit-podman`) + pendukung.
|
||||
|
||||
Satu perintah:
|
||||
|
||||
```bash
|
||||
curl -fsSL https://gitea.oxpoe.qzz.io/oxpoe/fedora-server/raw/branch/main/install.sh | sudo bash
|
||||
```
|
||||
|
||||
## Yang dipasang
|
||||
|
||||
| Kategori | Paket |
|
||||
|---|---|
|
||||
| Container engine | `podman`, `podman-compose`, `buildah`, `skopeo` |
|
||||
| Manajemen web | `cockpit`, `cockpit-podman`, `cockpit-storaged`, `cockpit-networkmanager` |
|
||||
| Util | `git`, `jq` |
|
||||
| SELinux tooling | `policycoreutils-python-utils` |
|
||||
|
||||
Service yang diaktifkan:
|
||||
- `podman.socket` — API socket (untuk Cockpit/klien remote).
|
||||
- `podman-restart.service` — **container ber-`restart:` policy naik otomatis saat boot**.
|
||||
- `cockpit.socket` — web UI di `https://<ip>:9090`.
|
||||
|
||||
## Opsi
|
||||
|
||||
```bash
|
||||
install.sh [opsi]
|
||||
|
||||
--update jalankan `dnf upgrade` dulu (default: tidak)
|
||||
--with-docker-shim pasang podman-docker (perintah `docker` -> podman)
|
||||
--with-tui pasang podman-tui (TUI di terminal)
|
||||
--no-cockpit tanpa Cockpit (podman saja)
|
||||
--admin-user NAME buat user (grup wheel) untuk login Cockpit
|
||||
--uninstall lepas paket & service yang dipasang skrip ini
|
||||
```
|
||||
|
||||
Contoh:
|
||||
|
||||
```bash
|
||||
# podman saja, tanpa Cockpit
|
||||
curl -fsSL .../install.sh | sudo bash -s -- --no-cockpit
|
||||
|
||||
# lengkap + shim docker + user admin
|
||||
curl -fsSL .../install.sh | sudo bash -s -- --with-docker-shim --admin-user admin
|
||||
```
|
||||
|
||||
Skrip **idempotent** — aman dijalankan ulang.
|
||||
|
||||
## Setelah selesai
|
||||
|
||||
```bash
|
||||
podman run --rm docker.io/alpine echo "podman jalan"
|
||||
podman compose up -d # di folder berisi compose.yaml
|
||||
```
|
||||
|
||||
**Cockpit**: buka `https://<ip-vps>:9090`, login pakai user Linux + password.
|
||||
> Cloud image biasanya *key-only* (root tanpa password) → buat user dulu:
|
||||
> `useradd -m admin && passwd admin`, lalu login `admin`.
|
||||
|
||||
## Catatan penting
|
||||
|
||||
- **Rootful** secara default (paling cocok untuk server & VPN/tun/host-network). Untuk
|
||||
rootless, buat user non-root (subuid/subgid dibuat otomatis di Fedora) dan pakai
|
||||
`systemctl --user enable podman-restart.service`.
|
||||
- **SELinux** (kalau `Enforcing`): bind mount ke path host butuh relabel — tambahkan
|
||||
`:z` (shared) atau `:Z` (private) di compose/volume, cth `- ./data:/data:Z`.
|
||||
Tanpa itu bisa muncul "Permission denied" padahal file ada.
|
||||
- **Autostart container** mengandalkan `podman-restart.service` (sudah di-enable). Urutan
|
||||
antar-service tidak dijamin; untuk itu pakai **Quadlet**.
|
||||
- **firewalld**: kalau aktif, service `cockpit` dibuka otomatis. Podman mengatur aturan
|
||||
port container-nya sendiri via integrasi firewalld.
|
||||
|
||||
## Uninstall
|
||||
|
||||
```bash
|
||||
curl -fsSL .../install.sh | sudo bash -s -- --uninstall
|
||||
```
|
||||
|
||||
`podman` dan data container (`/var/lib/containers`) tidak dihapus otomatis.
|
||||
|
||||
## Lisensi
|
||||
|
||||
MIT — lihat [LICENSE](LICENSE).
|
||||
Reference in new issue
Block a user