{"id":13744739,"url":"https://github.com/fandoghpaas/fandogh-cli","last_synced_at":"2025-04-07T06:05:22.871Z","repository":{"id":45294868,"uuid":"131755014","full_name":"fandoghpaas/fandogh-cli","owner":"fandoghpaas","description":"Fandogh CLI","archived":false,"fork":false,"pushed_at":"2022-02-19T18:27:32.000Z","size":649,"stargazers_count":130,"open_issues_count":3,"forks_count":22,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-31T05:05:07.493Z","etag":null,"topics":["cli","docker","fandogh-cli","hacktoberfest","paas"],"latest_commit_sha":null,"homepage":"https://www.fandogh.cloud","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fandoghpaas.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}},"created_at":"2018-05-01T19:36:33.000Z","updated_at":"2024-10-22T11:09:14.000Z","dependencies_parsed_at":"2022-09-02T14:20:29.323Z","dependency_job_id":null,"html_url":"https://github.com/fandoghpaas/fandogh-cli","commit_stats":null,"previous_names":[],"tags_count":80,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fandoghpaas%2Ffandogh-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fandoghpaas%2Ffandogh-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fandoghpaas%2Ffandogh-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fandoghpaas%2Ffandogh-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fandoghpaas","download_url":"https://codeload.github.com/fandoghpaas/fandogh-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247601447,"owners_count":20964864,"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","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":["cli","docker","fandogh-cli","hacktoberfest","paas"],"created_at":"2024-08-03T05:01:15.158Z","updated_at":"2025-04-07T06:05:22.846Z","avatar_url":"https://github.com/fandoghpaas.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":" [![PyPI version](https://badge.fury.io/py/fandogh-cli.svg)](https://badge.fury.io/py/fandogh-cli)\n[![Downloads](http://pepy.tech/badge/fandogh-cli)](http://pepy.tech/project/fandogh-cli)\n[![Build Status](https://travis-ci.org/fandoghpaas/fandogh-cli.svg?branch=master)](https://travis-ci.org/fandoghpaas/fandogh-cli)\n\n\nFandogh-CLI\n======\n\nfandogh-cli is the official CLI of [Fandogh PaaS](http://fandogh.cloud). \nOne with the current version of the CLI can create new images on Fandogh and publish the versions and deploy them as service.\n\n### How to install the CLI\n\n\u003cb\u003ePlease note that\u003c/b\u003e Fandogh-cli is a python based application which needs the python 3.5 or higher. \nRun the following command to install the CLI:\n\n`pip install fandogh-cli`  \n\nOnce it's installed run the following command to see the installation has been done successfully.\n\n`fandogh --version`\n\nIf the output of the above command is the version of the Fandogh CLI... then congratulations you can now enjoy the taste of the Fandogh.\n\u003cb\u003eOtherwise\u003c/b\u003e please create an issue here with the output of the command to help us fixing the issues ASAP.\n\n### How to login\n\nAfter you install the CLI, run the following command to log in with your Fandogh account credentials:\n\n`fandogh login` \n\nWhen you run `fandogh login` it wil prompt for username and password which will be used to obtain a token. The token will be stored in $HOME/.fandogh/credentials and later will be used by all other fandogh commands.\n\n### How to create a new Image\n\nIn order to create a new image in Fandogh you need to change your current directory to the directory of your application, \nthen you can run the following command:\n\n```bash\n$ cd ~/your-app-directory\n$ fandogh image init\n$ image name: test-application\nImage created successfully\n```\n\nNow it's time to publish the first version of your image. An image in fandogh consists of a Dockerfile and the files which are necessary (a.k.a context) to build the docker image. For the time being your Dockerfile should be in the root of your application directory.\nRun the following command to publish your image version:\n\n```bash\n$ fandogh image publish \n$ image version: v1\nImage Version created successfully\n```\n\n### How to deploy a service\n\nDeploying a service on Fandogh is easy as pie. Let's say you have an image with name `hello-world` \nwhich has a version named `v1` in state `BUILT`.\n\nRun the following command to deploy your service:\n```bash\n$ fandogh service deploy  --image hello-world --version v1 --name hello-world\nYour service deployed successfully.\nThe service is accessible via following link:\nhttp://hello-world.fandogh.cloud\n```\nThe above command will deploy a \u003cb\u003eservice\u003c/b\u003e with name \u003cb\u003ehello-world\u003c/b\u003e from docker image hello-world:v1.\nYou can also use the following options when running deploy command:  \n\n- --port or -p: to specify which port of of container should be exposed\n- --internal: to indicate that this service is an internal service and the port should only be accessible within the private network\n- --env or -e: to specify environment variables to set in the container.you can use this option as many as you need, for example `fandogh service deploy  --image hello-world --version v1 --name hello-world --env some_variable=some_value --env another_variable=another_value`\n\n\n\n### How to shutdown a service\n\nReleasing the resources is your friend to manage your cost. In cloud you can easily free the resource and not to pay for it anymore.\nTo do so via fandogh-cli it's even simpler than deploying a service. Let's say we want to destroy the service we deployed in the previous section.\n \n```bash\n$ fandogh service destroy  --name hello\nService destroyed successfully.\n```\n\n## Managed Services\n\nFandogh Platform provides a set of production ready managed services that you can deploy in seconds and use them via your services. \nThe following list consist of the managed services we already support.\n\n### MySQL Service\n\nThe MySQL Managed Service on Fandogh consist of Mysql RDBMS itself and Web UI (PHPMyAdmin) that let you to manage your DBMS.\nIn order to log into the Web UI you can use the root user credentials.\n \nUsername: root\n\npassword: root (can be changed through config options)\n\nYou can deploy a MySQL Server in your namespace by running the following command:\n\n```bash\n$ fandogh managed-service deploy mysql 9.4\n\nYour Mysql service will be ready in a few seconds.\nYou can have access to the PHPMyAdmin via following link:\nhttp://mysql.your_namespace.fandogh.cloud\n```  \n\nFrom your services you can access to the Mysql by using `mysql:3306` address. \n\n##### Configuration\nThere are a couple of configuration that you can pass to Fandogh when you are deploying a Mysql service:\n\n* `service_name default: mysql` \n\n    The value of this field will be the name of your DBMS. as the result this name will change the URL of your phpmyadmin panel. \n    e.g. If you set `service_name=test-dbms` then the admin URL will be something like `http://test-dbms.your_namespace.fandogh.cloud`\n* `phpmyadmin_enabled default: true`  \n\n    This is a boolean field that indicates if you want to have phpmyadmin running for this RDBMS or not.\n    e.g. If you set `phpmyadmin_enabled=false` then the admin UI won't be deployed for the given DBMS.\n* `mysql_root_password default: root`\n \n    The value of this field will be the password of your mysql root password.\n    \nExample:\n```bash\n$ fandogh managed-service deploy mysql 9.4 \\\n      -c service_name=test-dbms \\\n      -c phpmyadmin_enabled=false \\\n      -c mysql_root_password=test123\n```\n\n### Postgresql Service\n\nThe Postgresql Managed Service on Fandogh consist of Postgresql RDBMS itself and Web UI (Adminer) that let you to manage your DBMS as easy as possible.\nIn order to log into the Adminer UI you can use the `postgres` user credentials.\n \nUsername: postgres\n\npassword: postgres (can be changed through config options)\n\nYou can deploy a Postgresql Server in your namespace by running the following command:\n\n```bash\n$ fandogh managed-service deploy postgresql 10.4\n\nYour Postgresql service will be ready in a few seconds.\nYou can have access to the Adminer via following link:\nhttp://postgresql.your_namespace.fandogh.cloud\n```  \n\nFrom your services you can access to the service by using `postgresql:5432` address. \n\n##### Configuration\nThere are a couple of configuration that you can pass to Fandogh when you are deploying a Postgresql service:\n\n* `service_name default: postgresql` \n\n    The value of this field will be the name of your DBMS. as the result this name will change the URL of your phpmyadmin panel. \n    e.g. If you set `service_name=test-dbms` then the admin URL will be something like `http://test-dbms.your_namespace.fandogh.cloud`\n* `adminer_enabled default: true`  \n\n    This is a boolean field that indicates if you want to have adminer running for this RDBMS or not.\n    e.g. If you set `adminer_enabled=false` then the adminer panel won't be deployed for the given DBMS.\n    \n* `postgres_password default: postgres`\n \n    The value of this field will be the password of user `postgres`.\n    \nExample:\n```bash\n$ fandogh managed-service deploy postgresql 10.4 \\\n       -c service_name=test-dbms \\ \n       -c adminer_enabled=false \\\n       -c postgres_password=test123\n```\n\n\n## Custom domain\nNormally your external services is accessible via `service-name-namespace.fandogh.cloud` on HTTP and HTTPS,\nbut you might like to use your custom domain name, like somedomain.com.\nIn order to do this you need to submit and verify your domain in fandogh, it's easy :\n1. first run `fandogh domain add --name=somedomain.com`\n2. if you're adding a subdomain of a verified domain you don't need verification, for example if you already verified `tehran.myservice.com` then `api.tehran.myservice.com` doesn't need verification, you just need to add it.\n3. if your domain needs verification, it will stop and show you a *key*, you need to create a TXT record in your domain with the *key* value.\n4. after you added the record, press **y** and enter so fandogh server verify your TXT record.\n5. Now we route all traffic with `somedomain.com` in Host header to your service, you just need to add a CNAME record\npointing your domain to actual service address, for example `service-name-namespace.fandogh.cloud`\nif everything goes well, you should be able to use your domain to access your service.\n\n**Tip: If you verify a domain, all subdomains of that domain will not require verification, but you should add them before using them**    \n**Remember**, if you use a domain like `api.somedomain.com`, then you should set TXT record on `api.somedomain.com` not `somedomain.com`.\n\n## Table of exit status codes\n \n| Status code   | Reason                            |\n| ------------- |:----------------------------------|\n| 101           | Command parameter exception       |\n| 102           | Fandogh API exception             |\n| 103           | Authentication error              |\n| 104           | Request exception                 |\n| 201           | State of the image is FAILED      |\n| 301           | Invalid image name                |\n| 302           | Couldn't get service details      |\n| 303           | Service details has unknown state |\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffandoghpaas%2Ffandogh-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffandoghpaas%2Ffandogh-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffandoghpaas%2Ffandogh-cli/lists"}