Access
- ブラウザを開いて次の URL にアクセスしてください :
https://<SERVER_IP> - ブラウザに SSL 警告が表示されることがあります(自己署名証明書のため)
- 認証が必要です(Basic Auth ポップアップ)
- 認証方式:HTTP Basic Auth
- 認証情報の保存場所:
/root/.cloudzy-creds
主要ファイルとディレクトリ
- Install directory:
/opt/glance - Docker Compose:
/opt/glance/docker-compose.yml - Environment file:
/opt/glance/.env - Config directory:
/opt/glance/config - Home config:
/opt/glance/config/home.yml - Main config:
/opt/glance/config/glance.yml - Assets directory:
/opt/glance/assets - Custom CSS:
/opt/glance/assets/user.css - Nginx config:
/etc/nginx/sites-available/glance.conf - SSL certificates:
/etc/nginx/ssl - Auth file:
/etc/nginx/auth/.glance-htpasswd - Credentials file:
/root/.glance-credentials
スタックを管理する
インストールディレクトリへ Go:
cd /opt/glance
よく使う Docker Compose コマンド:
# Check status
docker compose ps
# View logs (follow live)
docker compose logs -f
# Restart all services
docker compose restart
# Stop services
docker compose down
# Start again
docker compose up -d
Nginx の HTTP Basic Auth を無効にする(任意)
Nginx サイト設定ファイルを編集する: /etc/nginx/sites-available/glance.conf
以下の行を削除またはコメントアウトする:
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/auth/.glance-htpasswd;
Reload Nginx:
systemctl restart nginx
ドメインを使った SSL の有効化
1. ドメインをサーバーのIPアドレスに向けてください。
2. Nginx の設定ファイルを開き、以下の両方を置き換えてください server_name <IP>; ドメイン(<your-domain>) は HTTP (ポート 80) と HTTPS (ポート 443) の両ブロックに適用されます:
vim /etc/nginx/sites-available/glance.conf
3. Install Certbot:
apt install -y certbot python3-certbot-nginx
4. 以下のコマンドを実行して、有効な Let's Encrypt 証明書を生成します:
certbot certonly --nginx --non-interactive --agree-tos --email [email protected] -d yourdomain.com
5. Nginx の設定ファイルで SSL のパスを置き換える:
vim /etc/nginx/sites-available/glance.conf
# Before:
# ssl_certificate /etc/nginx/ssl/fullchain.pem;
# ssl_certificate_key /etc/nginx/ssl/privkey.pem;
# After:
# ssl_certificate /etc/letsencrypt/live/yourdomain.com/fullchain.pem;
# ssl_certificate_key /etc/letsencrypt/live/yourdomain.com/privkey.pem;
6. 変更を反映するために、Nginxを再起動します。
systemctl restart nginx
7. ブラウザを開いて、次のURLにアクセスしてください: https://yourdomain.com