Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ REST_API_PORT=8212
# External backup retention policy.
BACKUP_RETENTION_DAYS=14
BACKUP_MAX_COUNT=168

# Interface language: auto, zh_CN, en_US, or ja_JP.
PALDSMS_LANG=auto
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,13 @@ jobs:
run: sudo apt-get update && sudo apt-get install -y shellcheck

- name: Check shell syntax
run: bash -n palworld-manager.sh && sh -n helper.sh
run: bash -n palworld-manager.sh locales/*.sh tests/*.sh && sh -n helper.sh

- name: Run ShellCheck
run: shellcheck palworld-manager.sh helper.sh
run: shellcheck palworld-manager.sh helper.sh locales/*.sh tests/*.sh

- name: Test Chinese, English, and Japanese interfaces
run: bash tests/i18n-smoke.sh

- name: Validate Compose model
run: cp .env.example .env && docker compose config --quiet
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 2.0.1 - 2026-07-14

- Added complete Simplified Chinese, English, and Japanese CLI localization.
- Added system-locale auto-detection plus `--lang`, `PALDSMS_LANG`, and `.env` overrides.
- Localized menus, prompts, validation errors, diagnostics, backup/restore messages, and updates.
- Added full English, Simplified Chinese, and Japanese README and v1 migration guides.
- Added CI smoke tests that verify language selection and catalog parity.

## 2.0.0 - 2026-07-14

- Rebuilt the project around Pocketpair's official Palworld server image.
Expand Down
6 changes: 4 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ support are welcome.
3. Do not add bundled credentials, save data, backups, or unreviewed executables.
4. Keep the REST API loopback-only by default.
5. Update the README and changelog when user-visible behavior changes.
6. Add every user-facing CLI string to all three locale catalogs and keep their key sets identical.

Run the same checks used by CI:

```bash
bash -n palworld-manager.sh
bash -n palworld-manager.sh locales/*.sh tests/*.sh
sh -n helper.sh
shellcheck palworld-manager.sh helper.sh
shellcheck palworld-manager.sh helper.sh locales/*.sh tests/*.sh
bash tests/i18n-smoke.sh
cp .env.example .env
docker compose config --quiet
```
Expand Down
252 changes: 252 additions & 0 deletions README.ja-JP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,252 @@
# PalDSMS — Palworld Docker サーバー管理ツール

[English](README.md) | [简体中文](README.zh-CN.md) | **日本語**

[![Latest release](https://img.shields.io/github/v/release/AlanBacker/PalWorld-Docker-Server-Management-System-Script?display_name=tag&sort=semver)](https://github.com/AlanBacker/PalWorld-Docker-Server-Management-System-Script/releases/latest)
[![Downloads](https://img.shields.io/github/downloads/AlanBacker/PalWorld-Docker-Server-Management-System-Script/total)](https://github.com/AlanBacker/PalWorld-Docker-Server-Management-System-Script/releases)
[![CI](https://github.com/AlanBacker/PalWorld-Docker-Server-Management-System-Script/actions/workflows/ci.yml/badge.svg)](https://github.com/AlanBacker/PalWorld-Docker-Server-Management-System-Script/actions/workflows/ci.yml)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
[![Palworld server](https://img.shields.io/badge/Palworld_Server-1.0.0-38bdf8)](https://docs.palworldgame.com/)

Linux 上で Palworld 専用サーバーをデプロイ、管理、バックアップ、復元、安全に更新するためのツールです。

PalDSMS v2 は Pocketpair 公式イメージと公式 REST API を使用します。旧 v1.1 パッケージの
サードパーティ製イメージや同梱 `mcrcon` バイナリには依存しません。

**[最新版をダウンロード](https://github.com/AlanBacker/PalWorld-Docker-Server-Management-System-Script/releases/latest)** ·
**[公式サーバードキュメント](https://docs.palworldgame.com/)** ·
**[v1.1 から移行](docs/MIGRATION-v1.ja-JP.md)**

> [!IMPORTANT]
> v1.1 はサードパーティ製イメージを使用しているため、上書きアップグレードはできません。
> セーブデータをバックアップし、[移行ガイド](docs/MIGRATION-v1.ja-JP.md)に従ってください。
> `legacy/` 内の v1.1 ZIP は履歴保存専用です。

## 対応状況

| 項目 | 対応内容 |
|---|---|
| Pocketpair サーバードキュメント | 1.0.0 系列 |
| 既定の公式イメージ | `ghcr.io/pocketpairjp/palserver:v1.0.0.100427` |
| ゲームポート | 既定 `8211/udp`、変更可能 |
| 管理 API | 公式 REST API、ホストのループバックのみにバインド |
| 対象ホスト | x86_64 Debian/Ubuntu、Docker Compose v2+ |
| セーブデータ | `./Saved`、直接参照・移行可能 |
| 自動化 | 毎時バックアップと毎日の更新確認を行う systemd timer |
| UI 言語 | 日本語、英語、簡体字中国語 |

## 主な機能

- Pocketpair 公式 Compose ファイルで公開されたイメージタグを取得します。
- 更新前に検証済みバックアップを作成し、起動失敗時は以前のタグへ戻します。
- 停止やバックアップの前に公式 REST API でセーブの書き込みを要求します。
- REST API は `127.0.0.1` のみに公開し、インターネットには公開しません。
- 復元前に `tar.gz` のパスとリンクを検証し、危険なアーカイブを拒否します。
- 復元前にもバックアップを作成し、復元後の起動失敗時は元のデータへ戻します。
- ゲーム内ローテーションバックアップ `bIsUseBackupSaveData=True` を有効にします。
- crontab を書き換え続けず、systemd timer で定期処理を管理します。
- 設定、セーブ、バックアップを通常のディレクトリに保存します。
- メニュー、入力案内、検証エラー、診断、更新表示のすべてが日英中の三言語に対応します。

## 必要環境

- x86_64 Linux(Debian または Ubuntu を推奨)
- 4 コア以上の CPU
- 16 GiB 以上のメモリ。大規模サーバーでは 32 GiB 以上を推奨
- SSD と 20 GiB 以上の空き容量
- ホストのファイアウォール、クラウドのセキュリティグループ、ルーターで `8211/udp` を許可

最初に環境チェックを実行してください。

```bash
./palworld-manager.sh --lang ja_JP doctor
```

## ダウンロード

[最新リリース](https://github.com/AlanBacker/PalWorld-Docker-Server-Management-System-Script/releases/latest)から
`PalDSMS-v2.0.1.zip` と `SHA256SUMS.txt` をダウンロードし、検証します。

```bash
sha256sum -c SHA256SUMS.txt
```

今後 `git pull` で更新したい場合は、リポジトリを直接クローンする方法も利用できます。

## クイックスタート

```bash
git clone https://github.com/AlanBacker/PalWorld-Docker-Server-Management-System-Script.git
cd PalWorld-Docker-Server-Management-System-Script
chmod +x palworld-manager.sh helper.sh tests/i18n-smoke.sh
cp .env.example .env

# Docker Engine と Compose v2 がすでにある場合は省略できます。
sudo ./palworld-manager.sh --lang ja_JP install-docker

# 公式サーバーをデプロイします。
sudo ./palworld-manager.sh --lang ja_JP deploy

# 管理者パスワード、ローカル REST API、ゲーム内バックアップを設定します。
sudo ./palworld-manager.sh --lang ja_JP set-password
```

日本語の対話メニューを開きます。

```bash
sudo ./palworld-manager.sh --lang ja_JP
```

プレイヤーは既定で `サーバーの公開 IP:8211` に接続します。初回のダウンロードと初期化には
数分かかる場合があります。`sudo ./palworld-manager.sh logs` で進行状況を確認できます。

## 言語の選択

PalDSMS は `LC_ALL`、`LC_MESSAGES`、`LANG` から言語を自動判定します。次の優先順位で
明示的に上書きできます。

```bash
# 1. このコマンドだけに指定
./palworld-manager.sh --lang ja_JP help

# 2. 環境変数で指定
PALDSMS_LANG=zh_CN ./palworld-manager.sh help

# 3. .env に保存
PALDSMS_LANG=en_US
```

`zh_CN` / `zh`、`en_US` / `en`、`ja_JP` / `ja` が使用できます。`.env` に `auto` を指定すると
自動判定を維持します。優先順位は `--lang` → 環境変数 → `.env` → システムロケールです。

## コマンド

| コマンド | 用途 |
|---|---|
| `doctor` | CPU、メモリ、ディスク、Docker、重要設定を確認 |
| `install-docker` | Debian/Ubuntu に Docker Engine と Compose v2 を導入 |
| `deploy` | 公式イメージを取得してサーバーをデプロイ |
| `set-password` | 管理者パスワード、ローカル REST API、バックアップを設定 |
| `config` | `PalWorldSettings.ini` を編集して再起動 |
| `start` / `stop` / `restart` | サーバーの起動、停止、再起動 |
| `status` / `logs` | 状態表示またはリアルタイムログ追跡 |
| `backup` | セーブを書き込んで検証済み外部バックアップを作成 |
| `restore <ファイル>` | 失敗時の自動ロールバック付きで安全に復元 |
| `check-update` | 現在のイメージと Pocketpair 公式タグを比較 |
| `update` | バックアップ後に更新し、失敗時はロールバック |
| `install-maintenance` | 自動バックアップ・更新用 systemd timer を設定 |
| `remove-maintenance` | セーブを削除せず自動メンテナンスを削除 |

完全なヘルプは `./palworld-manager.sh --lang ja_JP help` で表示できます。

## 設定

デプロイ設定は `.env` で変更します。

```dotenv
PALWORLD_IMAGE_REPOSITORY=ghcr.io/pocketpairjp/palserver
PALWORLD_IMAGE=ghcr.io/pocketpairjp/palserver:v1.0.0.100427
PALWORLD_PORT=8211
PALWORLD_BIND_IP=0.0.0.0
REST_API_PORT=8212
BACKUP_RETENTION_DAYS=14
BACKUP_MAX_COUNT=168
PALDSMS_LANG=auto
```

信頼できるミラーが必要な場合だけ `PALWORLD_IMAGE_REPOSITORY` を変更してください。タグは
引き続き Pocketpair 公式リポジトリから取得し、指定したミラーから同じタグを取得します。

ゲームルールを編集するには次を実行します。

```bash
sudo ./palworld-manager.sh config
```

設定ファイルは `Saved/Config/LinuxServer/PalWorldSettings.ini` です。公式の
`DefaultPalWorldSettings.ini` から作成されます。イメージ内の既定ファイルを直接編集しても反映されません。

## 自動メンテナンス

```bash
sudo ./palworld-manager.sh install-maintenance
systemctl list-timers 'paldsms-*'
```

既定では毎時バックアップし、毎日 04:15 以降に最大 30 分のランダム遅延を加えて公式タグを
確認します。新しいタグが見つかった場合だけプレイヤーへ通知してコンテナを再作成します。

```bash
journalctl -u paldsms-backup.service
journalctl -u paldsms-update.service
```

## 既存の v2 を更新

```bash
git pull --ff-only
sudo ./palworld-manager.sh check-update
sudo ./palworld-manager.sh update
```

実行中のサーバーはバックアップ後に更新されます。停止中のサーバーはイメージタグだけ更新され、
勝手に起動しません。新しいコンテナが準備完了にならない場合は以前のタグへ戻します。

## セキュリティ

- 公開するのはゲーム用 UDP ポートだけです。`8212/tcp` をインターネットへ公開しないでください。
- Compose は REST API をホストの `127.0.0.1` に固定します。
- 管理者パスワードは `.paldsms-admin-password` にモード `0600` で保存され、Git の対象外です。
- 大型更新、設定変更、復元の前には別の場所にもバックアップを保存してください。
- 実行中の `Saved/` と `backups/` を低速または信頼できないネットワークストレージに置かないでください。

脆弱性の報告方法は [SECURITY.md](SECURITY.md) を参照してください。

## v1.1 からの移行

旧コンテナを上書きしないでください。旧サーバーを停止して `palworld_saved` ボリュームを v2 の
`Saved/` にコピーし、ワールド、キャラクター、接続を確認してから旧リソースを削除します。詳しくは
[v1.1 移行ガイド](docs/MIGRATION-v1.ja-JP.md)を参照してください。

## トラブルシューティング

**コンテナは動作中だが接続できない:** クラウドのセキュリティグループ、ホストのファイアウォール、
ルーターが TCP ではなく UDP を転送していることを確認してください。

**`status`、`backup`、アナウンスで REST API エラーになる:**
`sudo ./palworld-manager.sh set-password` を実行し、`RESTAPIEnabled=True` を確認してください。
トラブルシューティングのために API ポートを公開してはいけません。

**メモリ不足で終了する:** `doctor` を実行してください。公式最低要件は 16 GiB で、大規模サーバーは
32 GiB 以上を推奨します。

**GHCR や自動更新へ接続できない:** まずホストのネットワークを修正してください。信頼できるミラーが
必要な場合だけ `PALWORLD_IMAGE_REPOSITORY` を変更します。

## プロジェクト構成

```text
.
├── locales/ # zh_CN、en_US、ja_JP メッセージカタログ
├── tests/ # 多言語スモークテスト
├── docs/ # 三言語の移行ガイド
├── compose.yaml # 公式イメージ用 Compose 定義
├── helper.sh # 公式エントリーポイント互換ヘルパー
├── palworld-manager.sh # 管理ツール本体
├── .env.example # 実行設定テンプレート
├── CHANGELOG.md # 変更履歴
├── SECURITY.md # セキュリティポリシー
├── CONTRIBUTING.md # コントリビューションガイド
└── legacy/ # v1.1 履歴パッケージ
```

## 参考資料

- [Pocketpair Palworld Server Guide](https://docs.palworldgame.com/)
- [Pocketpair official dedicated-server Docker image](https://github.com/pocketpairjp/palworld-dedicated-server-docker)
- [Configuration parameters](https://docs.palworldgame.com/settings-and-operation/configuration/)
- [Server startup arguments](https://docs.palworldgame.com/settings-and-operation/arguments/)

## ライセンス

[MIT License](LICENSE) © AlanBacker
Loading