{"id":13401429,"url":"https://github.com/Miso-K/lxd-api-gateway","last_synced_at":"2025-03-14T07:31:39.488Z","repository":{"id":39826036,"uuid":"196363195","full_name":"Miso-K/lxd-api-gateway","owner":"Miso-K","description":"LXD API gateway that adds user management options and provide API backend for lxdmanager","archived":false,"fork":false,"pushed_at":"2023-05-01T20:15:53.000Z","size":133,"stargazers_count":16,"open_issues_count":4,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-07-31T19:29:15.009Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/Miso-K.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}},"created_at":"2019-07-11T09:27:41.000Z","updated_at":"2024-04-19T07:25:43.000Z","dependencies_parsed_at":"2024-01-13T17:11:54.577Z","dependency_job_id":"7f4650a5-fc3c-4602-bf00-aaff244e173e","html_url":"https://github.com/Miso-K/lxd-api-gateway","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Miso-K%2Flxd-api-gateway","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Miso-K%2Flxd-api-gateway/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Miso-K%2Flxd-api-gateway/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Miso-K%2Flxd-api-gateway/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Miso-K","download_url":"https://codeload.github.com/Miso-K/lxd-api-gateway/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243541997,"owners_count":20307803,"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":[],"created_at":"2024-07-30T19:01:02.566Z","updated_at":"2025-03-14T07:31:37.573Z","avatar_url":"https://github.com/Miso-K.png","language":"Python","funding_links":[],"categories":["UI"],"sub_categories":[],"readme":"lxd-api-gateway\n\nRESTful API for LXD with USER access limitations\n\nUse it with [Dashboard](https://github.com/Miso-K/lxdmanager-vue-dashboard)\n\n[![Python version](https://img.shields.io/badge/Python-3.7-blue.svg)](https://www.python.org/downloads/release/python-350/)\n\n---\n\n## Installation\n\nFor installation actual version of *lxdmanager-api-gateway* you can use *install.sh* script.\n\n``` bash\n# Download the script\ncurl https://raw.githubusercontent.com/Miso-K/lxd-api-gateway/master/install.sh \u003e install.sh\n# Set execution permissions\nchmod +x install.sh\n# Run script to install program\n./install.sh\n```\n\n### Manual installation\n```shell\ngit clone --recursive https://github.com/Miso-K/lxd-api-gateway\n```\n\n### Install requirements\n```shell\n# Installation require Redis DB for storing jwt tokens \napt install redis-server\n\n# install python dependencies\napt update\napt install python3-pip python3-dev build-essential libssl-dev libffi-dev python3-setuptools\napt install python3-venv\n\ncd lxd-api-gateway\n\n# create virtual env\npython3 -m venv lgw-env\n\n# activate env\nsource lgw-env/bin/activate\n\npip install -r requirements.txt\n```\n\n### Change secret key to unique\n``` shell\nnano config/default.py\n```\n\n### Update lxdconfig.conf\n```\nnano lxdconfig.conf\n```\n\n### Create database\n```shell\npython3 install/setup.py\n```\n\n---\n\n### LXD host settings\n\nChange \"example.com\" to your domain. * would make it accessible from everywhere.\n\n```shell\nsudo lxc config set core.https_address [::]:8443\nsudo lxc config set core.https_allowed_origin \"*.example.com\"\nsudo lxc config set core.https_allowed_methods \"GET, POST, PUT, DELETE, OPTIONS\"\nsudo lxc config set core.https_allowed_headers \"Content-Type\"\nsudo service lxd restart # sometimes is required\n```\n\n#### Generate authentication certificates (Self Signed)\n\n```\nopenssl genrsa -out lxd.key 4096 # Generate a private key.\nopenssl req -new -key lxd.key -out lxd.csr # Create a certificate request.\nopenssl x509 -req -days 3650 -in lxd.csr -signkey lxd.key -out lxd.crt # Generate an auto signed certificate.\nlxc config trust add lxd.crt # Tells LXC to use this certificate for auth.\n```\n\nCopy lxd.crt and lxd.key to installation folder and edit lxdconfig.conf settings.\n\n---\n\n### Run the server\n#### Werkzeug *(dev only)*\n```shell\npython3 run.py\n```\n\n#### Gunicorn\n```shell\ngunicorn --bind :5000 app:app\n```\n\n#### uWSGI\n```shell\nuwsgi --socket :5000 --protocol=http --wsgi app:app\n```\n\n---\n\n## Usage\n### Requests\n\nSet headers :\n\n| key             | value              |\n| :-------------- | :----------------- |\n| `Content-Type`  | `application/json` |\n| `Authorization` | `Bearer \u003ctoken\u003e`   |\n\n---\n\n## Documentation\n\n* From your browser, get the swagger doc at [http://localhost:5000/doc/](http://localhost:5000/doc/)\n\n## Configuration\nYou can store instance configuration in `instance/config.py`\n\nor\n\nSet your own env var :\n\n`export LWP_CONFIG_FILE='/path/to/config/production.py'`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMiso-K%2Flxd-api-gateway","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMiso-K%2Flxd-api-gateway","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMiso-K%2Flxd-api-gateway/lists"}