{"id":13547711,"url":"https://github.com/ceph/cn","last_synced_at":"2025-10-18T01:53:50.630Z","repository":{"id":51321774,"uuid":"112131383","full_name":"ceph/cn","owner":"ceph","description":"Ceph Nano - One step S3 in container with Ceph.","archived":false,"fork":false,"pushed_at":"2025-05-06T10:33:12.000Z","size":321,"stargazers_count":237,"open_issues_count":0,"forks_count":27,"subscribers_count":102,"default_branch":"master","last_synced_at":"2025-05-20T11:06:55.776Z","etag":null,"topics":["ceph","golang","rados-gateway","s3-gateway"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ceph.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-11-27T01:19:15.000Z","updated_at":"2025-05-06T10:33:16.000Z","dependencies_parsed_at":"2025-05-20T11:06:51.128Z","dependency_job_id":"7fa5f8ce-5398-4ba1-b73e-602ac3237c52","html_url":"https://github.com/ceph/cn","commit_stats":null,"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"purl":"pkg:github/ceph/cn","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ceph%2Fcn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ceph%2Fcn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ceph%2Fcn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ceph%2Fcn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ceph","download_url":"https://codeload.github.com/ceph/cn/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ceph%2Fcn/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000726,"owners_count":26082862,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ceph","golang","rados-gateway","s3-gateway"],"created_at":"2024-08-01T12:00:59.964Z","updated_at":"2025-10-08T23:10:29.622Z","avatar_url":"https://github.com/ceph.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# ⚠️ This project is no longer maintained. 😢 Feel free to fork or explore alternatives.\n\n\u003cdetails\u003e\n\u003csummary\u003eOld README\u003c/summary\u003e\n\n# cn (ceph-nano)\n\n![Ceph, the future of storage](ceph-nano-logo-vertical.jpg) \n\n## The project\n\ncn is a little program written in Go that helps you interact with the S3 API by providing a REST S3 compatible gateway. The target audience is developers building their applications on Amazon S3. It is also an exciting tool to showcase Ceph Rados Gateway S3 compatibility.\nThis is brought to you by the power of Ceph and Containers. Under the hood, cn runs a Ceph container and exposes a [Rados Gateway](http://docs.ceph.com/docs/master/radosgw/). For convenience, cn also comes with a set of commands to work with the S3 gateway. Before you ask \"why not using s3cmd instead?\", then you will be happy to read that internally cn uses `s3cmd` and act as a wrapper around the most commonly used commands.\nAlso, keep in mind that the CLI is just for convenience, and the primary use case is you developing your application directly on the S3 API.\n\n## Table of contents\n\n * [Build](#build)\n * [Installation](#installation)\n * [Get started](#get-started)\n   * [Selecting the cluster flavor](#selecting-the-cluster-flavor)\n * [Your first S3 bucket](#your-first-s3-bucket)\n * [Multi-cluster support](#multi-cluster-support)\n * [List Ceph container images available](#list-ceph-container-images-available)\n   * [Using images aliases](#using-images-aliases)\n * [Enable mgr dashboard](#enable-mgr-dashboard)\n\n## Build\n\nYou can build `cn` by using `make`.\nBe sure `dep` is installed:\n\n```\n$ go get github.com/golang/dep/cmd/dep\n```\n\nThen, add `~/go/bin` to your `$PATH`:\n\n```\n$ export PATH=$PATH:~/go/bin\n```\n\nBuild `cn`:\n\n```\n$ make\nrm -f cn cn \u0026\u003e/dev/null || true\ndep ensure\nGOOS=linux GOARCH=amd64 go build -i -ldflags=\"-X main.version=cea247c-dirty -X main.tag=devel -X main.branch=guits-doc_build\" -o cn-devel-cea247c-dirty-linux-amd64 main.go\nln -sf \"cn-devel-cea247c-dirty-linux-amd64\" cn\n```\n\nOnce the build is done, you should have a symlink `cn` pointing to the binary that just got built:\n\n```\n$ ls -l\ntotal 10692\n-rw-rw-r--. 1 guits guits    15292 20 nov.  22:03 ceph-nano-logo-vertical.jpg\ndrwxrwxr-x. 2 guits guits     4096 20 nov.  22:03 cmd\nlrwxrwxrwx. 1 guits guits       34 20 nov.  22:27 cn -\u003e cn-devel-cea247c-dirty-linux-amd64\n-rwxrwxr-x. 1 guits guits 10881196 20 nov.  22:27 cn-devel-cea247c-dirty-linux-amd64\n```\n\n## Installation\n\ncn relies on Docker so it must be installed on your machine. If you're not running a Linux workstation you can install [Docker for Mac](https://docs.docker.com/docker-for-mac/).\n\nOnce Docker is installed you're ready to start.\nOpen your terminal and download the cn binary.\n\nmacOS:\n\n```\ncurl -L https://github.com/ceph/cn/releases/download/v2.3.1/cn-v2.3.1-darwin-amd64 -o cn \u0026\u0026 chmod +x cn\n```\n\nLinux amd64:\n\n```\ncurl -L https://github.com/ceph/cn/releases/download/v2.3.1/cn-v2.3.1-linux-amd64 -o cn \u0026\u0026 chmod +x cn\n```\n\nLinux arm64:\n\n```\ncurl -L https://github.com/ceph/cn/releases/download/v2.3.1/cn-v2.3.1-linux-arm64 -o cn \u0026\u0026 chmod +x cn\n```\n\nTest it out\n\n```\n$ ./cn\nCeph Nano - One step S3 in container with Ceph.\n\n                  *(((((((((((((\n                (((((((((((((((((((\n              ((((((((*     ,(((((((*\n             ((((((             ((((((\n            *((((,               ,((((/\n            ((((,     ((((((/     *((((\n            ((((     (((((((((     ((((\n            /(((     (((((((((     ((((\n             (((.     (((((((     /(((/\n              (((                *((((\n              .(((              (((((\n         ,(((((((*             /(((\n          .(((((  ((( (/  //   (((\n                 /(((.  /(((((  /(((((\n                        .((((/ (/\n\nUsage:\n  cn [command]\n\nAvailable Commands:\n  cluster      Interact with a particular Ceph cluster\n  s3           Interact with a particular S3 object server\n  image        Interact with cn's container image(s)\n  version      Print the version of cn\n  kube         Outputs cn kubernetes template (cn kube \u003e kube-cn.yml)\n  update-check Print cn current and latest version number\n  flavors      Interact with flavors\n  completion   Generates bash completion scripts\n\nFlags:\n  -h, --help   help for cn\n\nUse \"cn [command] --help\" for more information about a command.\n```\n\n## Get started\n\nStart the program with a working directory `/tmp`, the initial start might take a few minutes since we need to download the container image:\n\n```\n$ ./cn cluster start -d /tmp my-first-cluster\nRunning ceph-nano...\nThe container image is not present, pulling it.\nThis operation can take a few minutes......................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................\n\nEndpoint: http://10.36.116.164:8000\nDashboard: http://10.36.116.164:5001\nAccess key is: 9ZU1QBYX13KPLXXDDCY2\nSecret key is: nthNG1xb7ta5IDKiJKM8626pQitqsalEo0ta7B9E\nWorking directory: /usr/share/ceph-nano\n```\n\n### Selecting the cluster flavor\nIs it possible to select the cluster flavor by using the ``-f `` option on the command line.\n\n```\n$ ./cn cluster start mycluster -f huge\n```\n\nThe full documentation of flavors can be found [here](CONFIGURATION.md)\n\n## Your first S3 bucket\n\nCreate a bucket with `cn`:\n\n```\n$ ./cn s3 mb my-first-cluster my-buc\nBucket 's3://my-buc/' created\n\n$ ./cn s3 put my-first-cluster /etc/passwd my-buc\nupload: '/tmp/passwd' -\u003e 's3://my-buc/passwd'  [1 of 1]\n 5925 of 5925   100% in    1s     4.57 kB/s  done\n ```\n\n## Multi-cluster support\n\n`cn` can manage any number of clusters on your local machine:\n\n```\n$ ./cn cluster ls\n+------+---------+-------------------------------------------------------------------------------------+----------------+--------------------------------+---------+\n| NAME | STATUS  | IMAGE                                                                               | IMAGE RELEASE  | IMAGE CREATION TIME            | FLAVOR  |\n+------+---------+-------------------------------------------------------------------------------------+----------------+--------------------------------+---------+\n| d    | running | ceph/daemon:latest                                                                  | master-77e3d8d | 2018-04-05T15:01:40.323603472Z | default |\n| b    | running | ceph/daemon@sha256:369867e450ccdea9bcea7f54e97ed8b2cb1a0437fbef658d2d01fce2b8a2c648 | master-5f44af9 | 2018-03-30T21:08:31.117367166Z | medium  |\n+------+---------+-------------------------------------------------------------------------------------+----------------+--------------------------------+---------+\n```\n\n## List Ceph container images available\n\n`cn` can list the available Ceph container images, the default output shows the 100 first images:\n\n```\n$ ./cn image ls\nceph/daemon:latest-mimic\nceph/daemon:latest-luminous\nceph/daemon:latest-master\nceph/daemon:master-0b3eb04-mimic-centos-7\nceph/daemon:master-0b3eb04-luminous-centos-7\nceph/daemon:master-0b3eb04-luminous-opensuse-42.3-x86_64\nceph/daemon:master-0b3eb04-master-centos-7-x86_64\nceph/daemon:master-0b3eb04-luminous-centos-7-x86_64\nceph/daemon:master-0b3eb04-mimic-centos-7-x86_64\n[...]\n```\n\n### Using images aliases\nThe image option (`-i`) support aliases to simply the command line.\nIt is possible to list the aliases by running the `image show-aliases` command as per below :\n\n```\n$ ./cn image show-aliases\n+----------+--------------------------------------------------+\n| ALIAS    | IMAGE_NAME                                       |\n+----------+--------------------------------------------------+\n| mimic    | ceph/daemon:latest-mimic                         |\n| luminous | ceph/daemon:latest-luminous                      |\n| redhat   | registry.access.redhat.com/rhceph/rhceph-3-rhel7 |\n+----------+--------------------------------------------------+\n```\nAliases can be use in place of the traditional image name as per the following example:\n\n```\n$ ./cn cluster start mycluster -i mimic\n```\n\nIt is also possible to create new aliases as detailed [here](CONFIGURATION.md)\n\n\n## Enable mgr dashboard\n\n### **TODO:** This is a **temporary hack** to enable the manager dashboard\n\nCurrently `cn` does not expose a port for the mgr dashboard.\nIt only exposes port 8000 for S3 API, and port 5000 for [Sree - S3 web client](https://github.com/cannium/Sree).\nTo expose also the mgr dashboard port we currently have to do some hacks.\n\nThis section will guide you how to manually commit a new image and then run a new container with the desired expose ports.\n\n### Commit a copy of the docker image:\n```\n./cn cluster start temp -d /tmp\ndocker commit ceph-nano-temp ceph-nano\n./cn cluster purge temp --yes-i-am-sure\n```\n\n### Run the container:\n```\ndocker run -dt --name cn -p 8080:8080 -p 5000:5000 -p 8000:8000 ceph-nano\n```\n\n### Enable dashboard:\n(Note: 'enable dashboard' command will cause the container to exit, so need to start it after)\n```\ndocker exec cn ceph config set mgr mgr/dashboard/ssl false\ndocker exec cn ceph config set mgr mgr/dashboard/server_addr 0.0.0.0\ndocker exec cn ceph config set mgr mgr/dashboard/server_port 8080\ndocker exec cn ceph mgr module enable dashboard\nuntil docker exec cn ceph; do docker start cn; sleep 1; done # wait for the services to start\ndocker exec cn ceph dashboard set-login-credentials nano nano\n```\n\n### Note that the Object Gateway tab in the dashboard is not enabled yet, so run the following to enable RGW dashboard:\n```\nRGW_USER=$(docker exec cn radosgw-admin user create --uid=rgw --display-name=rgw --system)\nRGW_ACCESS=$(echo $RGW_USER | awk '{ for (i=1;i\u003c=NF;++i) if ($i ~ /access_key/) { split($(i+1),a,\"\\\"\"); print a[2] } }')\nRGW_SECRET=$(echo $RGW_USER | awk '{ for (i=1;i\u003c=NF;++i) if ($i ~ /secret_key/) { split($(i+1),a,\"\\\"\"); print a[2] } }')\ndocker exec cn ceph dashboard set-rgw-api-access-key \"$RGW_ACCESS\"\ndocker exec cn ceph dashboard set-rgw-api-secret-key \"$RGW_SECRET\"\ndocker exec cn ceph dashboard set-rgw-api-host 127.0.0.1\ndocker exec cn ceph dashboard set-rgw-api-port 8000\ndocker exec cn ceph dashboard set-rgw-api-scheme http\ndocker exec cn ceph dashboard set-rgw-api-user-id rgw\n```\n\n### The dashboard should now be accessible:\n- Open http://127.0.0.1:8080\n- Login with user `nano` and password `nano`\n\n### Troubleshooting - verify that your config dump should look like this:\n```\n$ docker exec cn ceph config dump\nWHO   MASK LEVEL   OPTION                           VALUE                                                        RO \n  mgr      unknown mgr/dashboard/RGW_API_ACCESS_KEY ********************                                         *  \n  mgr      unknown mgr/dashboard/RGW_API_HOST       127.0.0.1                                                    *  \n  mgr      unknown mgr/dashboard/RGW_API_PORT       8000                                                         *  \n  mgr      unknown mgr/dashboard/RGW_API_SCHEME     http                                                         *  \n  mgr      unknown mgr/dashboard/RGW_API_SECRET_KEY ****************************************                     *  \n  mgr      unknown mgr/dashboard/RGW_API_USER_ID    rgw                                                          *  \n  mgr      unknown mgr/dashboard/password           ************************************************************ *  \n  mgr      unknown mgr/dashboard/server_addr        0.0.0.0                                                      *  \n  mgr      unknown mgr/dashboard/server_port        8080                                                         *  \n  mgr      unknown mgr/dashboard/ssl                false                                                        *  \n  mgr      unknown mgr/dashboard/username           nano                                                         *  \n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fceph%2Fcn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fceph%2Fcn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fceph%2Fcn/lists"}