### Start MinIO Console Server Source: https://github.com/minio/object-browser/wiki/how-does-one-test-portal-ui-src--changes-locally? Navigates to the console directory, installs necessary components, and starts the console server. This is typically done after the MinIO server is running. ```sh cd ~/console make install ~/go/bin/console server ``` -------------------------------- ### Start React UI for MinIO Console Source: https://github.com/minio/object-browser/wiki/How-to-test-console-server-directly-from-ghcr.io Builds and starts the local React UI for the MinIO console. This involves installing dependencies, building the project, and running the development server. ```javascript cd ~/console/portal-ui yarn install yarn build yarn run start ``` -------------------------------- ### Start MinIO Server Source: https://github.com/minio/object-browser/wiki/how-does-one-test-portal-ui-src--changes-locally? Launches the MinIO server with specified root user credentials and data directories. It also configures the address for the server and the console. ```sh MINIO_ROOT_USER=minio MINIO_ROOT_PASSWORD=minio123 minio server /Volumes/data{1...4} --address :9000 --console-address :9001 ``` -------------------------------- ### Run UI/React Application Source: https://github.com/minio/object-browser/wiki/how-does-one-test-portal-ui-src--changes-locally? Installs dependencies, builds the React application, and starts the development server using Yarn. Changes to React/JS files will reflect immediately without recompilation. ```sh cd ~/console/portal-ui yarn install yarn build yarn run start ``` -------------------------------- ### Run MinIO Server with Docker Source: https://github.com/minio/object-browser/wiki/How-to-test-console-server-directly-from-ghcr.io Starts a MinIO server instance using Docker. It creates a network, mounts data volumes, and exposes the necessary ports for the server and console. ```sh docker network create mynet123 docker run -v /data1 -v /data2 -v /data3 -v /data4 \ --net=mynet123 -d --name minio --rm -p 9000:9000 -p 9001:9001 \ "quay.io/minio/minio:latest" server /data{1...4} --console-address ':9001' ``` -------------------------------- ### Start MinIO Console Service Source: https://github.com/minio/object-browser/blob/master/README.md This section details the environment variables required to start the MinIO Console service and the command to launch it. It includes variables for JWT encryption and the MinIO server endpoint. ```bash # Salt to encrypt JWT payload export CONSOLE_PBKDF_PASSPHRASE=SECRET # Required to encrypt JWT payload export CONSOLE_PBKDF_SALT=SECRET # MinIO Endpoint export CONSOLE_MINIO_SERVER=http://localhost:9000 ./console server ``` -------------------------------- ### Install PostgreSQL Helm Chart Source: https://github.com/minio/object-browser/wiki/How-to-add-λ-PostgreSQL-Notification-using-k8s Command to install the Bitnami PostgreSQL Helm chart, linking it to the created PersistentVolumeClaim and enabling volume permissions. It's deployed in the 'tenant-lite' namespace for MinIO communication. ```sh helm install --namespace tenant-lite psql-test bitnami/postgresql --set persistence.existingClaim=postgresql-pv-claim --set volumePermissions.enable=true ``` -------------------------------- ### Start MinIO Console Service with TLS Source: https://github.com/minio/object-browser/blob/master/README.md This describes how to start the MinIO Console service when TLS is enabled. It requires placing TLS certificates in a specific directory structure and then running the console server command. The console will then be accessible via HTTPS. ```bash ./console server ``` -------------------------------- ### List MinIO Buckets API Request Source: https://github.com/minio/object-browser/wiki/how-does-one-test-portal-ui-src--changes-locally? An example `curl` command to interact with the MinIO API to retrieve a list of buckets. It includes necessary headers for authentication and specifying the request details. ```APIDOC curl 'http://localhost:5005/api/v1/buckets' \ -H 'Accept: */*' \ -H 'Accept-Language: en-CA,en-GB;q=0.9,en-US;q=0.8,en;q=0.7' \ -H 'Connection: keep-alive' \ -H 'Cookie: token=AbYulJ6iItfkaldj2FcfjjjdXJQM1d2qTbnzqIBXCvR+irB5Y2NcCJteHhZ537xzUcsAP6qXO61PjMZxYSH4gqSNpoJI58FMPoz2RkPO1O+doZOf/9mYri15ytd7ertGFD7nPG89736weVuu1Mo4mM54g2Yk/T+mxutbuXU/Mr1f2MpdstSZExaFPKtgDtBwzFvHX9uc+EKNrtodxuMgIeS1kzepZM7R0AWofh1UXNUW4G3ENE/NZd2Nh7FXGGkn9iU6xo7OEyxWhKyjmJFlvYoXGQ1N8Bajcn6ck3dcLJ8LKvdLonGyVHwamcVCjrS6kIuLqRtBaYkdbzMK/DNk4qTDA7ERnMyJL1butj+oygSHtbM/a8NIuNuzq1+jw1HhGucDGDZXOaLFOiY+N/w1p62xZaiKXj/tUZw/0w4yZJ7Ch+0rI6FAWOVAtDYSdGOH5ZjGVqJ47RZhUphqJiKynducU8y/9U8z2Vlujy18NgmVgGf3uiIJPqRq0y5HFigZYjRJZEL+rjSh4P3Fg0kJ1j0Qh2U/V8OXuOh29DoUTHI=' \ -H 'Referer: http://localhost:5005/buckets' \ -H 'Sec-Fetch-Dest: empty' \ -H 'Sec-Fetch-Mode: cors' \ -H 'Sec-Fetch-Site: same-origin' \ -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36' \ -H 'sec-ch-ua: " Not A;Brand";v="99", "Chromium";v="100", "Google Chrome";v="100"' \ -H 'sec-ch-ua-mobile: ?0' \ -H 'sec-ch-ua-platform: "macOS"' \ --compressed ``` -------------------------------- ### Start MinIO Console Server Source: https://github.com/minio/object-browser/blob/master/DEVELOPMENT.md Starts the MinIO Console server in development mode. Requires setting environment variables for access keys, MinIO server endpoint, and enabling dev mode. ```shell CONSOLE_ACCESS_KEY= CONSOLE_SECRET_KEY= CONSOLE_MINIO_SERVER= CONSOLE_DEV_MODE=on ./console server ``` -------------------------------- ### Start MinIO Server Source: https://github.com/minio/object-browser/wiki/How-to-add-a-notification Starts the MinIO server with specified data directories and addresses. It also provides details on accessing the API, Console, and MinIO Client. ```sh minio server /Volumes/data{1...4} --address localhost:9000 --console-address localhost:9001 ``` -------------------------------- ### Run Integration Tests Source: https://github.com/minio/object-browser/wiki/How-to-configure-our-GoLang-Server-to-use-any-port Navigates to the integration test directory and executes the Go test suite to verify the Minio setup. ```bash cd ~/console/integration go test ``` -------------------------------- ### Start Development Server Source: https://github.com/minio/object-browser/blob/master/web-app/README.md Runs the React application in development mode, typically accessible at http://localhost:3000. The browser will automatically reload on code changes, and linting errors will be displayed in the console. Ensure dependencies are installed with `yarn install` if necessary. ```bash yarn start ``` -------------------------------- ### Download and Prepare MinIO Binary Source: https://github.com/minio/object-browser/wiki/How-to-create-a-custom-MinIO-image-for-testing-purposes This snippet shows how to download the MinIO binary for a specific architecture (linux-amd64) and make it executable. This is a prerequisite for customizing the MinIO Docker image. ```sh wget https://dl.min.io/server/minio/release/linux-amd64/minio chmod +x minio ``` -------------------------------- ### Run MinIO Console with Docker Source: https://github.com/minio/object-browser/wiki/How-to-test-console-server-directly-from-ghcr.io Launches the MinIO Console UI by pulling a specific version and connecting it to the running MinIO server. It maps the console's port and uses the same Docker network. ```sh docker pull ghcr.io/minio/console:pr-1789 docker run -e CONSOLE_MINIO_SERVER=http://minio:9000 \ -p 9090:9090 --network mynet123 ghcr.io/minio/console:pr-1789 server ``` -------------------------------- ### Run Unit Tests Source: https://github.com/minio/object-browser/blob/master/CONTRIBUTING.md Executes the unit tests for the API handlers. ```go go test ./api ``` -------------------------------- ### Custom MinIO Dockerfile Source: https://github.com/minio/object-browser/wiki/How-to-create-a-custom-MinIO-image-for-testing-purposes This Dockerfile demonstrates how to customize a MinIO image. It copies a pre-downloaded MinIO binary and a modified entrypoint script into the image, and changes the default command to 'ls'. ```dockerfile FROM minio/minio:latest ENV PATH=/opt/bin:$PATH COPY ./minio /opt/bin/minio COPY dockerscripts/docker-entrypoint.sh /usr/bin/docker-entrypoint.sh ENTRYPOINT ["/usr/bin/docker-entrypoint.sh"] VOLUME ["/data"] CMD ["ls"] ``` -------------------------------- ### MinIO Docker Container Setup Source: https://github.com/minio/object-browser/wiki/How-to-configure-our-GoLang-Server-to-use-any-port Demonstrates how to run a MinIO Docker container, exposing API and console ports. It highlights the use of port mapping and environment variables for configuration. ```sh docker run \ -v /data1 \ -v /data2 \ -v /data3 \ -v /data4 \ --net=mynet123 \ -d \ --name minio \ --rm \ -p 9000:9000 -p 9001:9001 \ -e MINIO_KMS_SECRET_KEY=my-minio-key:OSMM+vkKUTCvQs9YL/CVMIMt43HFhkUpqJxTmGl6rYw= \ "quay.io/minio/minio:latest" server /data{1...4} --address :9000 --console-address :9001 ``` -------------------------------- ### Enable MinIO Console Service on Boot Source: https://github.com/minio/object-browser/blob/master/systemd/README.md Enables the MinIO Console systemd service to start automatically on system boot. ```sh systemctl enable minio-console.service ``` -------------------------------- ### Run MinIO Console with LDAP Enabled Source: https://github.com/minio/object-browser/blob/master/DEVELOPMENT.md Starts the MinIO Console server with LDAP authentication enabled by setting the CONSOLE_LDAP_ENABLED environment variable. ```shell export CONSOLE_LDAP_ENABLED=on ./console server ``` -------------------------------- ### Managing Multiple MinIO Containers Source: https://github.com/minio/object-browser/wiki/How-to-configure-our-GoLang-Server-to-use-any-port Provides commands for stopping existing MinIO containers, removing networks, and preparing for the setup of multiple MinIO instances in a test environment. ```sh # 1st kill all existing containers docker stop minio docker stop minio2 docker stop minio3 docker stop minio4 brew services stop postgresql docker stop pgsqlcontainer docker network rm mynet123 ``` -------------------------------- ### Modified MinIO Docker Entrypoint Script Source: https://github.com/minio/object-browser/wiki/How-to-create-a-custom-MinIO-image-for-testing-purposes This is a modified version of the MinIO Docker entrypoint script. The section that prepends 'minio' to the command is commented out, allowing the CMD instruction in the Dockerfile to take effect. ```sh #!/bin/sh # # If command starts with an option, prepend minio. # if [ "${1}" != "minio" ]; then # if [ -n "${1}" ]; then # set -- minio "$@" # fi # fi # su-exec to requested user, if service cannot run exec will fail. docker_switch_user() { if [ -n "${MINIO_USERNAME}" ] && [ -n "${MINIO_GROUPNAME}" ]; then if [ -n "${MINIO_UID}" ] && [ -n "${MINIO_GID}" ]; then groupadd -g "$MINIO_GID" "$MINIO_GROUPNAME" && \ useradd -u "$MINIO_UID" -g "$MINIO_GROUPNAME" "$MINIO_USERNAME" else groupadd "$MINIO_GROUPNAME" && \ useradd -g "$MINIO_GROUPNAME" "$MINIO_USERNAME" fi exec setpriv --reuid="${MINIO_USERNAME}" \ --regid="${MINIO_GROUPNAME}" --keep-groups "$@" else uname -m echo "$@" # minio ls exec "$@" fi } ## Switch to user if applicable. docker_switch_user "$@" ``` -------------------------------- ### Build Custom MinIO Docker Image Source: https://github.com/minio/object-browser/wiki/How-to-create-a-custom-MinIO-image-for-testing-purposes This command builds a Docker image using the custom Dockerfile. It specifies the output type, platform, tag, and the Dockerfile to use. This command will create an image that runs 'ls' on startup. ```sh docker buildx build --output=type=docker --platform linux/amd64 -t cesar-tag . -f Dockerfile ``` -------------------------------- ### Generate Server Code from Swagger Source: https://github.com/minio/object-browser/blob/master/CONTRIBUTING.md Generates the necessary server code based on the updated swagger.yml file. ```bash make swagger-gen ``` -------------------------------- ### Add Go Dependency Source: https://github.com/minio/object-browser/blob/master/CONTRIBUTING.md Adds a new dependency to the go.mod file. ```go go get foo/bar ``` -------------------------------- ### Run MinIO Server with LDAP Configuration Source: https://github.com/minio/object-browser/blob/master/DEVELOPMENT.md Starts the MinIO server with LDAP authentication enabled. It sets environment variables for MinIO access keys, LDAP server address, username format, search filter, and TLS settings. ```shell export MINIO_ACCESS_KEY=minio export MINIO_SECRET_KEY=minio123 export MINIO_IDENTITY_LDAP_SERVER_ADDR='localhost:389' export MINIO_IDENTITY_LDAP_USERNAME_FORMAT='uid=%s,dc=example,dc=org' export MINIO_IDENTITY_LDAP_USERNAME_SEARCH_FILTER='(|(objectclass=posixAccount)(uid=%s))' export MINIO_IDENTITY_LDAP_TLS_SKIP_VERIFY=on export MINIO_IDENTITY_LDAP_SERVER_INSECURE=on ./minio server ~/Data ``` -------------------------------- ### Run MinIO Server with OIDC Configuration Source: https://github.com/minio/object-browser/wiki/How-to-test-MinIO-SSO Starts a MinIO server instance with OIDC authentication enabled, pointing to the Keycloak server for identity brokering. Requires Keycloak to be running and accessible. ```sh MINIO_IDENTITY_OPENID_CLIENT_SECRET=9ca8236f-4f21-4356-9498-97c76d196c77 MINIO_ROOT_USER=minio MINIO_ROOT_PASSWORD=minio123 minio server /Volumes/data{1...4} --address :9000 --console-address :9001 ``` -------------------------------- ### Clone MinIO Repository Source: https://github.com/minio/object-browser/wiki/How-to-create-a-custom-MinIO-image-for-testing-purposes This command clones the official MinIO repository, which is necessary for accessing and modifying the Dockerfile and other related scripts. ```sh git clone git@github.com:minio/minio.git ``` -------------------------------- ### MinIO Docker Container Setup (Custom Ports) Source: https://github.com/minio/object-browser/wiki/How-to-configure-our-GoLang-Server-to-use-any-port Illustrates running a MinIO Docker container with custom ports (6000 for API, 6001 for Console). This demonstrates flexibility in port assignment for MinIO instances. ```sh docker run \ -v /data1 \ -v /data2 \ -v /data3 \ -v /data4 \ --net=mynet123 \ -d \ --name minio \ --rm \ -p 6000:6000 -p 6001:6001 \ -e MINIO_KMS_SECRET_KEY=my-minio-key:OSMM+vkKUTCvQs9YL/CVMIMt43HFhkUpqJxTmGl6rYw= \ "quay.io/minio/minio:latest" server /data{1...4} --address :6000 --console-address :6001 ``` -------------------------------- ### Run OpenLDAP Container Source: https://github.com/minio/object-browser/blob/master/DEVELOPMENT.md Starts an OpenLDAP server using a Docker container. It maps ports 389 and 636 and names the container 'my-openldap-container'. ```shell docker run --rm -p 389:389 -p 636:636 --name my-openldap-container --detach osixia/openldap:1.3.0 ``` -------------------------------- ### Connect Console to Minio with TLS Source: https://github.com/minio/object-browser/blob/master/README.md This snippet shows how to configure the console to connect to a Minio server using TLS and a self-signed certificate. It involves copying the MinIO `ca.crt` file and setting the `CONSOLE_MINIO_SERVER` environment variable before starting the console server. ```sh export CONSOLE_MINIO_SERVER=https://localhost:9000 ./console server ``` -------------------------------- ### MinIO API Response for Buckets Source: https://github.com/minio/object-browser/wiki/how-does-one-test-portal-ui-src--changes-locally? The JSON response received after successfully calling the MinIO API to list buckets. It contains an array of bucket objects, each with details like creation date, name, object count, and access permissions. ```json { "buckets": [ { "creation_date": "2022-04-07T12:44:24-04:00", "details": { "quota": {}, "versioning": true }, "name": "bucket", "objects": 2, "rw_access": { "read": true, "write": true }, "size": 7815 }, { "creation_date": "2022-04-11T17:28:14-04:00", "details": { "quota": {} }, "name": "bucket1", "rw_access": { "read": true, "write": true } }, { "creation_date": "2022-04-11T17:40:52-04:00", "details": { "quota": {} }, "name": "bucket2", "objects": 1, "rw_access": { "read": true, "write": true }, "size": 7031 }, { "creation_date": "2022-04-11T17:56:37-04:00", "details": { "quota": {} }, "name": "cesar", "objects": 1, "rw_access": { "read": true, "write": true }, "size": 2412 }, { "creation_date": "2022-04-07T13:36:53-04:00", "details": { "quota": {}, "versioning": true }, "name": "cmee", "rw_access": { "read": true, "write": true } }, { "creation_date": "2022-04-11T18:04:24-04:00", "details": { "quota": {} }, "name": "f234432", "objects": 2, "rw_access": { "read": true, "write": true }, "size": 37820 }, { "creation_date": "2022-04-24T20:31:11Z", "details": { "quota": {} }, "name": "test", "objects": 2, "rw_access": { "read": true, "write": true }, "size": 708726 }, { "creation_date": "2022-04-24T20:31:11Z", "details": { "quota": {} }, "name": "test2", "rw_access": { "read": true, "write": true } }, { "creation_date": "2022-04-24T20:31:11Z", "details": { "quota": {} }, "name": "testbucket", "objects": 1, "rw_access": { "read": true, "write": true }, "size": 41731 }, { "creation_date": "2022-04-11T18:40:02-04:00", "details": { "quota": {} }, "name": "user1", "objects": 1, "rw_access": { "read": true, "write": true }, "size": 1916 }, { "creation_date": "2022-04-07T08:15:24-04:00", "details": { "quota": {}, "versioning": true }, "name": "versionedbucket", "rw_access": { "read": true, "write": true } }, { "creation_date": "2022-04-07T11:29:17-04:00", "details": { "quota": {} }, "name": "versions", "rw_access": { "read": true, "write": true } }, { "creation_date": "2022-04-07T11:29:25-04:00", "details": { "quota": {}, "versioning": true }, "name": "versions2", "objects": 1, "rw_access": { "read": true, "write": true }, "size": 77680 } ], "total": 13 } ``` -------------------------------- ### Kind Cluster and MinIO Operator Deployment Source: https://github.com/minio/object-browser/wiki/How-to-add-λ-PostgreSQL-Notification-using-k8s Commands to create a Kind Kubernetes cluster, apply MinIO operator resources, and deploy a tenant-lite configuration. This sets up the foundational MinIO environment. ```sh kind get clusters kind delete clusters kind kind create cluster --config ~/operator/testing/kind-config.yaml kubectl apply -k ~/operator/resources kubectl apply -k ~/operator/examples/kustomization/tenant-lite ``` -------------------------------- ### Commit Changes Source: https://github.com/minio/object-browser/blob/master/CONTRIBUTING.md Commits staged changes with an informative message. ```git git commit -am 'Add some feature' ``` -------------------------------- ### Push Changes to Remote Source: https://github.com/minio/object-browser/blob/master/CONTRIBUTING.md Pushes local commits to the remote origin. ```git git push origin my-new-feature ``` -------------------------------- ### Remove Go Dependency Source: https://github.com/minio/object-browser/blob/master/CONTRIBUTING.md Removes an unused dependency from the go.mod file. ```go go mod tidy ``` -------------------------------- ### Run Keycloak Server Source: https://github.com/minio/object-browser/wiki/How-to-test-MinIO-SSO Builds a Keycloak Docker image and runs a Keycloak server instance. This is the first step in setting up OIDC authentication. ```sh git clone git@github.com:keycloak/keycloak-containers.git cd keycloak-containers/server git checkout 12.0.4 docker build -t jboss/keycloak:12.0.4 . docker run --rm -p 9080:8080 -e KEYCLOAK_USER=admin -e KEYCLOAK_PASSWORD=admin jboss/keycloak:12.0.4 ``` -------------------------------- ### Use Sync External Store Shim with Selector Production Source: https://github.com/minio/object-browser/blob/master/web-app/build/static/js/main.68c6b8a2.js.LICENSE.txt Production build of the use-sync-external-store shim with selector support, enabling optimized subscriptions to external stores. Includes copyright and license information. ```javascript /** * @license React * use-sync-external-store-shim/with-selector.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ ``` -------------------------------- ### Validate Swagger YAML Source: https://github.com/minio/object-browser/blob/master/CONTRIBUTING.md Validates the swagger.yml file to ensure it conforms to the Swagger specification. ```bash swagger validate ./swagger.yml ``` -------------------------------- ### Build for Production Source: https://github.com/minio/object-browser/blob/master/web-app/README.md Builds the React application for production, optimizing it for performance. The output is placed in the `build` folder, with minified code and hashed filenames. This prepares the application for deployment. ```bash yarn build ``` -------------------------------- ### Build MinIO Console Server Source: https://github.com/minio/object-browser/blob/master/DEVELOPMENT.md Builds the MinIO Console server from the main folder. It may require running 'go mod tidy' first if it's the initial build. ```shell make ``` -------------------------------- ### Run PostgreSQL Container Source: https://github.com/minio/object-browser/wiki/How-to-configure-our-GoLang-Server-to-use-any-port Launches a PostgreSQL container within the created network, exposing the default PostgreSQL port. ```bash docker run --net=mynet123 --ip=173.18.0.3 --name pgsqlcontainer --rm -p 5432:5432 -e POSTGRES_PASSWORD=password -d postgres ``` -------------------------------- ### Build MinIO Binary Source: https://github.com/minio/object-browser/blob/master/DEVELOPMENT.md Builds the MinIO binary from the MinIO repository after updating the go.mod file. ```shell make build ``` -------------------------------- ### Connect to PostgreSQL and Create Events Table Source: https://github.com/minio/object-browser/wiki/How-to-add-λ-PostgreSQL-Notification-using-k8s This snippet shows how to retrieve the PostgreSQL password, connect to the database using `psql`, and create an 'events' table with specified columns. ```sh export POSTGRES_PASSWORD=$(kubectl get secret --namespace tenant-lite psql-test-postgresql -o jsonpath="{.data.postgres-password}" | base64 --decode) ``` ```sh kubectl run psql-test-postgresql-client --rm --tty -i --restart='Never' --namespace tenant-lite --image docker.io/bitnami/postgresql:14.2.0-debian-10-r35 --env="PGPASSWORD=$POSTGRES_PASSWORD" \ --command -- psql --host psql-test-postgresql -U postgres -d postgres -p 5432 ``` ```sql CREATE TABLE events ( key serial PRIMARY KEY, value varchar(30), event_time timestamp DEFAULT now(), event_data text ); ``` -------------------------------- ### Use Sync External Store Shim Production Source: https://github.com/minio/object-browser/blob/master/web-app/build/static/js/main.68c6b8a2.js.LICENSE.txt Production build of the use-sync-external-store shim, providing a hook for synchronizing external stores with React state. Includes copyright and license information. ```javascript /** * @license React * use-sync-external-store-shim.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ ``` -------------------------------- ### Download MinIO Console Systemd Service File Source: https://github.com/minio/object-browser/blob/master/systemd/README.md Downloads the systemd service file for MinIO Console from a GitHub repository into the systemd system directory. ```sh ( cd /etc/systemd/system/; curl -O https://raw.githubusercontent.com/minio/console/master/systemd/minio-console.service ) ``` -------------------------------- ### Initialize MinIO Console Server (Default Ports) Source: https://github.com/minio/object-browser/wiki/How-to-configure-our-GoLang-Server-to-use-any-port Shows the Go implementation of initConsoleServer for setting up the MinIO console server. It configures environment variables, API handlers, and server host/port, defaulting to port 9090 for the console. ```go func initConsoleServer() (*restapi.Server, error) { os.Setenv("CONSOLE_MINIO_SERVER", "http://localhost:9000") // This is the port we are listening on to create the server swaggerSpec, err := loads.Embedded(restapi.SwaggerJSON, restapi.FlatSwaggerJSON) if err != nil { return nil, err } noLog := func(string, ...interface{}) { // nothing to log } // Initialize MinIO loggers restapi.LogInfo = noLog restapi.LogError = noLog api := operations.NewConsoleAPI(swaggerSpec) api.Logger = noLog server := restapi.NewServer(api) // register all APIs server.ConfigureAPI() //restapi.GlobalRootCAs, restapi.GlobalPublicCerts, restapi.GlobalTLSCertsManager = globalRootCAs, globalPublicCerts, globalTLSCerts consolePort, _ := strconv.Atoi("9090") // this is the port we are providing on the service. server.Host = "0.0.0.0" server.Port = consolePort restapi.Port = "9090" restapi.Hostname = "0.0.0.0" return server, nil } ``` -------------------------------- ### Eject Configuration Source: https://github.com/minio/object-browser/blob/master/web-app/README.md This is a one-way operation that removes the single build dependency (Create React App) from the project. It copies all configuration files (Webpack, Babel, ESLint, etc.) into the project, granting full control over the build setup. Use with caution as it cannot be undone. ```bash yarn eject ``` -------------------------------- ### MinIO Configuration Parameters Source: https://github.com/minio/object-browser/blob/master/integration/sample-import-config.txt This section details various configuration parameters for MinIO, covering network settings, API behavior, call home, site information, compression, identity management, logging, auditing, and notification systems. ```APIDOC subnet: Configures subnet settings. license: Specifies the license key. api_key: API key for authentication. proxy: Proxy configuration. callhome: Controls the call home feature. enable: Enable or disable call home (on/off). frequency: Frequency of call home (e.g., 24h). site: Site-specific configurations. name: Name of the site. region: Region of the site. api: API related settings. requests_max: Maximum number of API requests. requests_deadline: Deadline for API requests. cluster_deadline: Deadline for cluster operations. cors_allow_origin: Allowed origins for CORS. remote_transport_deadline: Deadline for remote transport. list_quorum: Quorum setting for listing operations (strict). replication_priority: Replication priority (auto). transition_workers: Number of workers for transitions. stale_uploads_cleanup_interval: Interval for cleaning up stale uploads. stale_uploads_expiry: Expiry time for stale uploads. delete_cleanup_interval: Interval for delete cleanup. disable_odirect: Disable O_DIRECT. gzip_objects: Enable or disable object gzip compression. scanner: Scanner settings. speed: Speed of the scanner (default). compression: Compression settings. enable: Enable or disable compression (on/off). allow_encryption: Allow encryption during compression. extensions: File extensions to compress. mime_types: MIME types to compress. identity_openid: OpenID Connect identity provider configuration. enable: Enable OpenID Connect. display_name: Display name for OpenID. config_url: URL for OpenID configuration. client_id: OpenID client ID. client_secret: OpenID client secret. claim_name: Claim name for user identification. policy: Policy for OpenID users. claim_userinfo: Userinfo endpoint for claims. role_policy: Role policy for OpenID users. claim_prefix: Prefix for claims. redirect_uri: Redirect URI for OpenID. redirect_uri_dynamic: Dynamic redirect URI support. scopes: OpenID scopes. vendor: OpenID vendor. keycloak_realm: Keycloak realm. keycloak_admin_url: Keycloak admin URL. identity_ldap: LDAP identity provider configuration. server_addr: LDAP server address. srv_record_name: SRV record name for LDAP. user_dn_search_base_dn: Base DN for user search. user_dn_search_filter: Filter for user search. group_search_filter: Filter for group search. group_search_base_dn: Base DN for group search. tls_skip_verify: Skip TLS verification for LDAP. server_insecure: Use insecure LDAP connection. server_starttls: Use STARTTLS for LDAP. lookup_bind_dn: Bind DN for user lookup. lookup_bind_password: Bind password for user lookup. identity_tls: TLS identity configuration. skip_verify: Skip TLS certificate verification. identity_plugin: Identity plugin configuration. url: URL of the identity plugin. auth_token: Authentication token for the plugin. role_policy: Role policy for plugin users. role_id: Role ID for plugin users. policy_plugin: Policy plugin configuration. url: URL of the policy plugin. enable_http2: Enable HTTP/2 for the plugin. logger_webhook: Webhook logger configuration. enable: Enable webhook logging. endpoint: Webhook endpoint URL. auth_token: Authentication token for the webhook. client_cert: Client certificate for the webhook. client_key: Client key for the webhook. queue_size: Size of the webhook queue. audit_webhook: Webhook audit log configuration. enable: Enable webhook auditing. endpoint: Webhook endpoint URL. auth_token: Authentication token for the webhook. client_cert: Client certificate for the webhook. client_key: Client key for the webhook. queue_size: Size of the audit webhook queue. audit_kafka: Kafka audit log configuration. enable: Enable Kafka auditing. topic: Kafka topic for audit logs. brokers: Kafka brokers list. sasl_username: SASL username for Kafka. sasl_password: SASL password for Kafka. sasl_mechanism: SASL mechanism for Kafka. client_tls_cert: Client TLS certificate for Kafka. client_tls_key: Client TLS key for Kafka. tls_client_auth: TLS client authentication mode. sasl: Enable SASL authentication. tls: Enable TLS encryption. tls_skip_verify: Skip TLS verification for Kafka. version: Kafka version. notify_webhook: Webhook notification configuration. enable: Enable webhook notifications. endpoint: Webhook endpoint URL. auth_token: Authentication token for the webhook. queue_limit: Limit for the notification queue. queue_dir: Directory for the notification queue. client_cert: Client certificate for the webhook. client_key: Client key for the webhook. notify_amqp: AMQP notification configuration. enable: Enable AMQP notifications. url: AMQP broker URL. exchange: AMQP exchange name. exchange_type: AMQP exchange type. routing_key: AMQP routing key. mandatory: Mandatory flag for AMQP messages. durable: Durable flag for AMQP exchanges/queues. no_wait: No-wait flag for AMQP operations. internal: Internal flag for AMQP exchanges. auto_deleted: Auto-deleted flag for AMQP exchanges/queues. delivery_mode: Delivery mode for AMQP messages. publisher_confirms: Publisher confirms for AMQP. queue_limit: Limit for the notification queue. queue_dir: Directory for the notification queue. notify_kafka: Kafka notification configuration. enable: Enable Kafka notifications. topic: Kafka topic for notifications. brokers: Kafka brokers list. sasl_username: SASL username for Kafka. sasl_password: SASL password for Kafka. sasl_mechanism: SASL mechanism for Kafka. client_tls_cert: Client TLS certificate for Kafka. client_tls_key: Client TLS key for Kafka. tls_client_auth: TLS client authentication mode. sasl: Enable SASL authentication. tls: Enable TLS encryption. tls_skip_verify: Skip TLS verification for Kafka. queue_limit: Limit for the notification queue. queue_dir: Directory for the notification queue. version: Kafka version. notify_mqtt: MQTT notification configuration. enable: Enable MQTT notifications. broker: MQTT broker address. topic: MQTT topic. password: MQTT password. username: MQTT username. qos: MQTT Quality of Service. keep_alive_interval: Keep-alive interval for MQTT. reconnect_interval: Reconnect interval for MQTT. queue_dir: Directory for the notification queue. queue_limit: Limit for the notification queue. notify_nats: NATS notification configuration. enable: Enable NATS notifications. address: NATS server address. subject: NATS subject. username: NATS username. password: NATS password. token: NATS token. tls: Enable TLS for NATS. tls_skip_verify: Skip TLS verification for NATS. cert_authority: Certificate authority for NATS. client_cert: Client certificate for NATS. client_key: Client key for NATS. ping_interval: Ping interval for NATS. jetstream: Enable JetStream. streaming: Enable streaming. streaming_async: Enable asynchronous streaming. streaming_max_pub_acks_in_flight: Max publish acknowledgments in flight. streaming_cluster_id: JetStream cluster ID. queue_dir: Directory for the notification queue. queue_limit: Limit for the notification queue. notify_nsq: NSQ notification configuration. enable: Enable NSQ notifications. nsqd_address: NSQd address. topic: NSQ topic. tls: Enable TLS for NSQ. tls_skip_verify: Skip TLS verification for NSQ. queue_dir: Directory for the notification queue. queue_limit: Limit for the notification queue. notify_mysql: MySQL notification configuration. enable: Enable MySQL notifications. format: Notification format (namespace). dsn_string: MySQL data source name string. table: MySQL table name. queue_dir: Directory for the notification queue. queue_limit: Limit for the notification queue. max_open_connections: Maximum open connections to MySQL. notify_postgres: PostgreSQL notification configuration. enable: Enable PostgreSQL notifications. format: Notification format (namespace). connection_string: PostgreSQL connection string. table: PostgreSQL table name. queue_dir: Directory for the notification queue. queue_limit: Limit for the notification queue. max_open_connections: Maximum open connections to PostgreSQL. notify_elasticsearch: Elasticsearch notification configuration. enable: Enable Elasticsearch notifications. url: Elasticsearch URL. format: Notification format (namespace). index: Elasticsearch index name. queue_dir: Directory for the notification queue. queue_limit: Limit for the notification queue. username: Elasticsearch username. password: Elasticsearch password. notify_redis: Redis notification configuration. enable: Enable Redis notifications. format: Notification format (namespace). address: Redis server address. key: Redis key. password: Redis password. queue_dir: Directory for the notification queue. queue_limit: Limit for the notification queue. etcd: etcd configuration. endpoints: List of etcd endpoints. path_prefix: Path prefix for etcd keys. coredns_path: Path for CoreDNS configuration. client_cert: Client certificate for etcd. client_cert_key: Client certificate key for etcd. cache: Cache configuration. drives: Drives to use for caching. exclude: Exclude patterns for caching. expiry: Cache expiry time. quota: Cache quota percentage. after: Cache after time. watermark_low: Low watermark for cache cleanup. watermark_high: High watermark for cache cleanup. range: Enable range caching. commit: Commit cache changes. storage_class: Storage class definitions. standard: Standard storage class settings (e.g., RRS=EC:1). heal: Healing configuration. bitrotscan: Enable or disable bitrot scanning. max_sleep: Maximum sleep time between healing operations. max_io: Maximum IO for healing operations. ``` -------------------------------- ### Helm Repository Management Source: https://github.com/minio/object-browser/wiki/How-to-add-λ-PostgreSQL-Notification-using-k8s Commands to add the Bitnami Helm repository and update local Helm repository information. This ensures access to the PostgreSQL Helm chart. ```sh helm repo add bitnami https://charts.bitnami.com/bitnami helm repo update ``` -------------------------------- ### Run PostgreSQL Docker Container Source: https://github.com/minio/object-browser/wiki/How-to-add-a-notification Launches a PostgreSQL database instance in a Docker container, exposing the default PostgreSQL port. ```sh docker run --name pgsqlcontainer -p 5432:5432 -e POSTGRES_PASSWORD=password -d postgres ``` -------------------------------- ### Create MinIO Console Environment Configuration Source: https://github.com/minio/object-browser/blob/master/systemd/README.md Creates the environment configuration file for MinIO Console, specifying options like port, JWT encryption parameters, and the MinIO server endpoint. ```sh $ cat <> /etc/default/minio-console # Special opts CONSOLE_OPTS="--port 8443" # salt to encrypt JWT payload CONSOLE_PBKDF_PASSPHRASE=CHANGEME # required to encrypt JWT payload CONSOLE_PBKDF_SALT=CHANGEME # MinIO Endpoint CONSOLE_MINIO_SERVER=http://minio.endpoint:9000 EOT ``` -------------------------------- ### Create MinIO User with mc Source: https://github.com/minio/object-browser/blob/master/README.md This snippet demonstrates how to add a new user named 'console' to your MinIO deployment using the 'mc' command-line tool. It prompts for the access key and secret key. ```bash mc admin user add myminio/ Enter Access Key: console Enter Secret Key: xxxxxxxx ``` -------------------------------- ### React Production Source: https://github.com/minio/object-browser/blob/master/web-app/build/static/js/main.68c6b8a2.js.LICENSE.txt Production build of React, the core JavaScript library for building user interfaces. Includes copyright and license information. ```javascript /** * @license React * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ ``` -------------------------------- ### Create and Attach ConsoleAdmin Policy Source: https://github.com/minio/object-browser/blob/master/DEVELOPMENT.md Creates a JSON policy file for 'consoleAdmin' and then uses the 'mc' command-line tool to create and attach this policy to the LDAP user 'billy'. ```shell cat > consoleAdmin.json << EOF { "Version": "2012-10-17", "Statement": [ { "Action": [ "admin:*" ], "Effect": "Allow", "Sid": "" }, { "Action": [ "s3:*" ], "Effect": "Allow", "Resource": [ "arn:aws:s3:::*" ], "Sid": "" } ] } EOF $ mc admin policy create myminio consoleAdmin consoleAdmin.json $ mc admin policy attach myminio consoleAdmin --user="uid=billy,dc=example,dc=org" ``` -------------------------------- ### Create Admin Policy for Console User Source: https://github.com/minio/object-browser/blob/master/README.md This snippet shows how to create a JSON policy file named 'admin.json' that grants administrative access to all resources for a MinIO user. It then uses 'mc' to create this policy on the MinIO server. ```bash cat > admin.json << EOF { "Version": "2012-10-17", "Statement": [{ "Action": [ "admin:*" ], "Effect": "Allow", "Sid": "" }, { "Action": [ "s3:*" ], "Effect": "Allow", "Resource": [ "arn:aws:s3:::*" ], "Sid": "" } ] } EOF mc admin policy create myminio/ consoleAdmin admin.json ``` -------------------------------- ### MinIO Console Server License Information Source: https://github.com/minio/object-browser/blob/master/hack/header.go.txt This code block contains the copyright and licensing information for the MinIO Console Server project. It specifies the terms under which the software can be redistributed and modified, adhering to the GNU Affero General Public License. ```go // This file is part of MinIO Console Server // Copyright (c) 2021 MinIO, Inc. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . ``` -------------------------------- ### Add LDAP User and Group Source: https://github.com/minio/object-browser/blob/master/DEVELOPMENT.md Copies the 'billy.ldif' file into the OpenLDAP container and uses 'ldapadd' to create a user 'billy' and assign it to the 'consoleAdmin' group. ```shell docker cp console/docs/ldap/billy.ldif my-openldap-container:/container/service/slapd/assets/test/billy.ldif docker exec my-openldap-container ldapadd -x -D "cn=admin,dc=example,dc=org" -w admin -f /container/service/slapd/assets/test/billy.ldif -H ldap://localhost ```