GoAdmio

bucket

Create a MinIO bucket, make it public or private, or create an S3 access key

On this page: Overview · Quick start · Syntax · Options · Output · Examples · Troubleshooting · Details · See also


Overview

/go/bucket manages buckets and access keys on the MinIO server installed by GoAdmio. It can:

It connects to MinIO with the root credentials saved by minio, so MinIO must be installed first.


Quick start

# Create a bucket
/go/bucket mybucket

# Make it public
/go/bucket mybucket public

Syntax

/go/bucket <bucket>
/go/bucket <bucket> public
/go/bucket <bucket> private
/go/bucket <access-key> <secret-key>

The command picks what to do from the number and value of the arguments.


Options

Form What it does
/go/bucket <bucket> Creates the bucket.
/go/bucket <bucket> public Allows anonymous (public) access to the bucket.
/go/bucket <bucket> private Removes anonymous access from the bucket.
/go/bucket <access-key> <secret-key> Creates an S3 access key with the values you give.

Rules

Item Rule
public and private Lowercase only. Public is not recognized.
Access key More than 10 characters.
Secret key More than 20 characters.
Bucket name Use lowercase letters, numbers, hyphens, and dots, 3 to 63 characters long.

If the second argument is not public or private and the key lengths are too short, the command does nothing and prints no error. With no arguments, or more than two, it also does nothing.


Output

The command prints the messages of the MinIO client. Every run starts with the confirmation that the myminio alias was set. The rest depends on the action:

Action Output
Create a bucket A confirmation that the bucket was created.
Public or private A confirmation of the new access policy.
Create an access key The new key pair.
MinIO not installed Please Setup MinIO: and a link to the minio page.

The command exits with status 1 after every action, including on success. Do not use its exit status to detect errors.

Each run also adds a line to /var/log/go/bucket.log (see Security).


Examples

# Create a bucket
/go/bucket backups
# Make the bucket public, then private again
/go/bucket backups public
/go/bucket backups private
# Create an access key (access key > 10 characters, secret key > 20 characters)
/go/bucket AKIAEXAMPLEKEY123 'S3cr3tKeyWithMoreThan20Chars'

Troubleshooting

Symptom Likely cause Fix
Please Setup MinIO: /usr/local/goadmio/minio/minio.conf does not exist. Install MinIO with minio.
Nothing happens after the alias message The arguments match none of the forms. For example, the keys are too short, or Public was typed with a capital letter. Check Rules.
Connection error from mc MinIO is stopped, or the port or domain is not reachable. Check that MinIO is running and the firewall allows its port.
Certificate error The MinIO domain has no valid SSL certificate. Install one with miniossl.
mc: command not found The MinIO client is not installed. Reinstall MinIO with minio.
Bucket name rejected The name breaks the S3 naming rules. Use a lowercase name of 3 to 63 characters.

Details

How it connects

The command reads MINIO_ROOT_USER, MINIO_ROOT_PASSWORD, and MINIO_DOMAIN from /usr/local/goadmio/minio/minio.conf and saves an mc alias named myminio:

Condition Address used
minio.conf contains :3333 http://<server-ip>:3333 (no SSL)
Otherwise https://<MINIO_DOMAIN>

Access keys

An access key is created as a MinIO service account under the root user. By default, a service account has the same permissions as its parent, so the key can reach all buckets, not only one.

Security

[!WARNING] The arguments of every run are written to /var/log/go/bucket.log. When you create an access key, the secret key is saved in plain text in that log, and it can also appear in your shell history and the process list. Remove the entry from the log after creating a key.

The root username and password are also passed on the command line to mc alias set, so they can be visible in the process list while the command runs.

What it does, in order

  1. Logs the run to /var/log/go/bucket.log.
  2. Gets the server's public IPv4 address.
  3. Reads the MinIO settings, or prints the setup message and exits.
  4. Sets the myminio alias for the right address.
  5. Runs the action that matches the arguments, then exits with status 1.

See also

Command Description
minio Install MinIO on a GoAdmio server
miniossl Install an SSL certificate for MinIO
s3 Mount an S3 bucket on a GoAdmio server
storage Auto-mount the /storage folder on boot using rclone