mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-09-18 18:54:03 +00:00
Compare commits
1 Commits
MickLesk-p
...
fix-plane-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
441255fd14 |
@@ -43,34 +43,61 @@ $STD rabbitmqctl add_user plane "${RABBITMQ_PASS}"
|
|||||||
$STD rabbitmqctl set_permissions -p plane plane ".*" ".*" ".*"
|
$STD rabbitmqctl set_permissions -p plane plane ".*" ".*" ".*"
|
||||||
msg_ok "Configured RabbitMQ"
|
msg_ok "Configured RabbitMQ"
|
||||||
|
|
||||||
msg_info "Installing MinIO"
|
msg_info "Installing Garage"
|
||||||
curl -fsSL https://dl.min.io/server/minio/release/linux-$(arch_resolve)/minio -o /usr/local/bin/minio
|
ensure_dependencies jq
|
||||||
chmod +x /usr/local/bin/minio
|
GARAGE_RELEASE=$(curl -fsSL https://api.github.com/repos/deuxfleurs-org/garage/tags | jq -r '.[0].name')
|
||||||
mkdir -p /opt/minio/data
|
curl -fsSL "https://garagehq.deuxfleurs.fr/_releases/${GARAGE_RELEASE}/$(arch_resolve "x86_64" "aarch64")-unknown-linux-musl/garage" -o /usr/local/bin/garage
|
||||||
MINIO_ACCESS_KEY=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c16)
|
chmod +x /usr/local/bin/garage
|
||||||
MINIO_SECRET_KEY=$(openssl rand -base64 36 | tr -dc 'a-zA-Z0-9' | head -c32)
|
mkdir -p /var/lib/garage/{data,meta,snapshots}
|
||||||
cat <<EOF >/etc/default/minio
|
S3_ACCESS_KEY="GK$(openssl rand -hex 16)"
|
||||||
MINIO_ROOT_USER="${MINIO_ACCESS_KEY}"
|
S3_SECRET_KEY=$(openssl rand -hex 32)
|
||||||
MINIO_ROOT_PASSWORD="${MINIO_SECRET_KEY}"
|
GARAGE_RPC_SECRET=$(openssl rand -hex 32)
|
||||||
MINIO_VOLUMES="/opt/minio/data"
|
cat <<EOF >/etc/garage.toml
|
||||||
|
metadata_dir = "/var/lib/garage/meta"
|
||||||
|
data_dir = "/var/lib/garage/data"
|
||||||
|
db_engine = "sqlite"
|
||||||
|
replication_factor = 1
|
||||||
|
|
||||||
|
rpc_bind_addr = "127.0.0.1:3901"
|
||||||
|
rpc_public_addr = "127.0.0.1:3901"
|
||||||
|
rpc_secret = "${GARAGE_RPC_SECRET}"
|
||||||
|
|
||||||
|
[s3_api]
|
||||||
|
s3_region = "us-east-1"
|
||||||
|
api_bind_addr = "127.0.0.1:3900"
|
||||||
EOF
|
EOF
|
||||||
cat <<EOF >/etc/systemd/system/minio.service
|
cat <<EOF >/etc/default/garage
|
||||||
|
GARAGE_DEFAULT_ACCESS_KEY=${S3_ACCESS_KEY}
|
||||||
|
GARAGE_DEFAULT_SECRET_KEY=${S3_SECRET_KEY}
|
||||||
|
GARAGE_DEFAULT_BUCKET=uploads
|
||||||
|
EOF
|
||||||
|
cat <<EOF >/etc/systemd/system/garage.service
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=MinIO Object Storage
|
Description=Garage Object Storage
|
||||||
After=network.target
|
After=network-online.target
|
||||||
|
Wants=network-online.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
EnvironmentFile=/etc/default/minio
|
EnvironmentFile=/etc/default/garage
|
||||||
ExecStart=/usr/local/bin/minio server \$MINIO_VOLUMES --console-address ":9090"
|
ExecStart=/usr/local/bin/garage -c /etc/garage.toml server --single-node --default-bucket
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
RestartSec=5
|
RestartSec=5
|
||||||
|
LimitNOFILE=65536
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
EOF
|
EOF
|
||||||
systemctl enable -q --now minio
|
systemctl enable -q --now garage
|
||||||
msg_ok "Installed MinIO"
|
for i in {1..30}; do
|
||||||
|
curl -s -o /dev/null "http://127.0.0.1:3900" && break
|
||||||
|
if [[ $i -eq 30 ]]; then
|
||||||
|
msg_error "Garage did not become ready"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
msg_ok "Installed Garage"
|
||||||
|
|
||||||
fetch_and_deploy_gh_release "plane" "makeplane/plane" "tarball"
|
fetch_and_deploy_gh_release "plane" "makeplane/plane" "tarball"
|
||||||
|
|
||||||
@@ -129,9 +156,9 @@ RABBITMQ_VHOST=plane
|
|||||||
AMQP_URL=amqp://plane:${RABBITMQ_PASS}@localhost:5672/plane
|
AMQP_URL=amqp://plane:${RABBITMQ_PASS}@localhost:5672/plane
|
||||||
|
|
||||||
AWS_REGION=us-east-1
|
AWS_REGION=us-east-1
|
||||||
AWS_ACCESS_KEY_ID=${MINIO_ACCESS_KEY}
|
AWS_ACCESS_KEY_ID=${S3_ACCESS_KEY}
|
||||||
AWS_SECRET_ACCESS_KEY=${MINIO_SECRET_KEY}
|
AWS_SECRET_ACCESS_KEY=${S3_SECRET_KEY}
|
||||||
AWS_S3_ENDPOINT_URL=http://localhost:9000
|
AWS_S3_ENDPOINT_URL=http://localhost:3900
|
||||||
AWS_S3_BUCKET_NAME=uploads
|
AWS_S3_BUCKET_NAME=uploads
|
||||||
FILE_SIZE_LIMIT=104857600
|
FILE_SIZE_LIMIT=104857600
|
||||||
|
|
||||||
@@ -175,17 +202,11 @@ $STD /opt/plane-venv/bin/python manage.py configure_instance
|
|||||||
$STD /opt/plane-venv/bin/python manage.py register_instance "${MACHINE_SIG}"
|
$STD /opt/plane-venv/bin/python manage.py register_instance "${MACHINE_SIG}"
|
||||||
msg_ok "Ran Database Migrations"
|
msg_ok "Ran Database Migrations"
|
||||||
|
|
||||||
msg_info "Creating Services and MinIO Bucket"
|
msg_info "Creating Services"
|
||||||
curl -fsSL https://dl.min.io/client/mc/release/linux-$(arch_resolve)/mc -o /usr/local/bin/mcli
|
|
||||||
chmod +x /usr/local/bin/mcli
|
|
||||||
$STD /usr/local/bin/mcli alias set plane http://localhost:9000 "${MINIO_ACCESS_KEY}" "${MINIO_SECRET_KEY}"
|
|
||||||
$STD /usr/local/bin/mcli mb plane/uploads --ignore-existing
|
|
||||||
$STD /usr/local/bin/mcli anonymous set download plane/uploads
|
|
||||||
|
|
||||||
cat <<EOF >/etc/systemd/system/plane-api.service
|
cat <<EOF >/etc/systemd/system/plane-api.service
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Plane API
|
Description=Plane API
|
||||||
After=network.target postgresql.service redis-server.service rabbitmq-server.service minio.service
|
After=network.target postgresql.service redis-server.service rabbitmq-server.service garage.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
@@ -274,12 +295,12 @@ systemctl enable -q --now plane-api plane-worker plane-beat plane-live plane-spa
|
|||||||
cat <<EOF >~/plane.creds
|
cat <<EOF >~/plane.creds
|
||||||
RabbitMQ User: plane
|
RabbitMQ User: plane
|
||||||
RabbitMQ Password: ${RABBITMQ_PASS}
|
RabbitMQ Password: ${RABBITMQ_PASS}
|
||||||
MinIO Access Key: ${MINIO_ACCESS_KEY}
|
S3 Access Key: ${S3_ACCESS_KEY}
|
||||||
MinIO Secret Key: ${MINIO_SECRET_KEY}
|
S3 Secret Key: ${S3_SECRET_KEY}
|
||||||
Secret Key: ${SECRET_KEY}
|
Secret Key: ${SECRET_KEY}
|
||||||
Config: /opt/plane/apps/api/.env
|
Config: /opt/plane/apps/api/.env
|
||||||
EOF
|
EOF
|
||||||
msg_ok "Created Services and MinIO Bucket"
|
msg_ok "Created Services"
|
||||||
|
|
||||||
msg_info "Configuring Nginx"
|
msg_info "Configuring Nginx"
|
||||||
cat <<'EOF' >/etc/nginx/sites-available/plane.conf
|
cat <<'EOF' >/etc/nginx/sites-available/plane.conf
|
||||||
@@ -295,8 +316,8 @@ upstream plane-space {
|
|||||||
server 127.0.0.1:3002;
|
server 127.0.0.1:3002;
|
||||||
}
|
}
|
||||||
|
|
||||||
upstream plane-minio {
|
upstream plane-garage {
|
||||||
server 127.0.0.1:9000;
|
server 127.0.0.1:3900;
|
||||||
}
|
}
|
||||||
|
|
||||||
server {
|
server {
|
||||||
@@ -336,14 +357,14 @@ server {
|
|||||||
}
|
}
|
||||||
|
|
||||||
location = /uploads {
|
location = /uploads {
|
||||||
proxy_pass http://plane-minio;
|
proxy_pass http://plane-garage;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
}
|
}
|
||||||
|
|
||||||
location /uploads/ {
|
location /uploads/ {
|
||||||
proxy_pass http://plane-minio;
|
proxy_pass http://plane-garage;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
|||||||
Reference in New Issue
Block a user