{"id":20564331,"url":"https://github.com/tarantool/rws","last_synced_at":"2025-04-14T15:11:12.470Z","repository":{"id":37082481,"uuid":"338025227","full_name":"tarantool/rws","owner":"tarantool","description":"The Repository Web Service is designed to interact with the repository via HTTP.","archived":false,"fork":false,"pushed_at":"2024-10-21T12:23:05.000Z","size":101,"stargazers_count":2,"open_issues_count":23,"forks_count":2,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-03-28T04:03:37.839Z","etag":null,"topics":["deb","http","repository","rpm","s3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tarantool.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2021-02-11T12:39:40.000Z","updated_at":"2024-10-21T12:09:09.000Z","dependencies_parsed_at":"2023-09-26T12:19:53.106Z","dependency_job_id":"86dfe6c7-259d-467e-9c1b-c20e380b03fe","html_url":"https://github.com/tarantool/rws","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarantool%2Frws","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarantool%2Frws/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarantool%2Frws/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarantool%2Frws/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tarantool","download_url":"https://codeload.github.com/tarantool/rws/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248904640,"owners_count":21180835,"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":["deb","http","repository","rpm","s3"],"created_at":"2024-11-16T04:25:43.066Z","updated_at":"2025-04-14T15:11:12.445Z","avatar_url":"https://github.com/tarantool.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ca href=\"http://tarantool.org\"\u003e\n  \u003cimg src=\"https://avatars2.githubusercontent.com/u/2344919?v=2\u0026s=250\" align=\"right\"\u003e\n\u003c/a\u003e\n\n# RWS\n\nThe Repository Web Service is designed to interact with the repository via HTTP.\nCurrently, only the ability to upload packages to the repository via HTTP is\nsupported. S3 is used as storage.\n\n## Table of contents\n* [Getting started](#getting-started)\n  * [Prerequisites](#prerequisites)\n  * [Download](#download)\n  * [Install dependencies](#install-dependencies)\n  * [Run](#run)\n  * [Usage](#usage)\n* [Configuration](#configuration)\n* [Caution](#caution)\n* [Docker](#docker)\n* [Test stand](#test-stand)\n\n## Getting started\n\n### Prerequisites\n\n * [Python3](https://www.python.org/downloads/)\n * [pip](https://pypi.org/project/pip/)\n * [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)\n\nAll other dependencies will be installed using `pip`.\n\n### Download\n\nDownload service:\n``` bash\ngit clone https://github.com/tarantool/rws.git\n```\n\n### Install dependencies\n\n```bash\npip install -r requirements.txt\n```\n\n### Run\n\nSet the necessary configuration settings before run the service\n(see [Configuration](#configuration) section belows for more details).\n\nRun development server:\n``` bash\nexport FLASK_APP=app.py\nflask run\n```\n\nRun production server:\n``` bash\ngunicorn --workers 1 --timeout 0 --threads 10 app:app\n```\nThe `timeout` parameter should be set to `0`, because the worker can be checked\nby the server only after the application (`app`) has started, but the\nmetainformation synchronization of all repositories starts before the\napplication and can take a long time in some cases.\n\n### Usage\n\n* Put package to repository.\n\n  The HTTP `PUT` method is used to upload package to the repository.\n  URL describes a path to the repository in the following format:\n  `repo_kind/tarantool_series/dist/dist_ver`:\n    * `repo_kind` - kind of repository (live, release, ...).\n    * `tarantool_series` - tarantool series (1.10, 2.5, ...).\n      As special value an `enabled` can be used. In this case, the package will\n      be loaded into all tarantool series from the `enabled` section of the\n      configuration file.\n    * `dist` - distribution (fedora, ubuntu ...).\n    * `dist_ver` - destribution version (30, 31 ...).\n\n  To upload a package to the deb repository, necessary additionaly specify the\n  \"product\" form. The \"product\" form is used to place package files in\n  deb repositories\n  (`.../release/series-2/ubuntu/pool/focal/main/p/product_name/...`).\n\n  Example:\n``` bash\ncurl -u user_name:password \\\n-F 'cartridge-cli-1.8.0.0-1.el7.x86_64.rpm=@/path/to/package/cartridge-cli-1.8.0.0-1.el7.x86_64.rpm' \\\n-F 'cartridge-cli-1.8.0.0-1.el7.src.rpm=@/path/to/package/cartridge-cli-1.8.0.0-1.el7.src.rpm' \\\n--request PUT 127.0.0.1:5000/live/1.10/el/7\n\n{\"message\":\"OK\"}\n\ncurl \\\n-u login:password \\\n-F 'product=tarantool-smtp' \\\n-F 'tarantool-smtp_0.0.4.0-1_amd64.deb=@/home/leonid/Downloads/tarantool-smtp_0.0.4.0-1_amd64.deb' \\\n-F 'tarantool-smtp_0.0.4.0-1.debian.tar.xz=@/home/leonid/Downloads/tarantool-smtp_0.0.4.0-1.debian.tar.xz' \\\n-F 'tarantool-smtp_0.0.4.0-1.dsc=@/home/leonid/Downloads/tarantool-smtp_0.0.4.0-1.dsc' \\\n-F 'tarantool-smtp_0.0.4.0.orig.tar.xz=@/home/leonid/Downloads/tarantool-smtp_0.0.4.0.orig.tar.xz' \\\n--request PUT 127.0.0.1:5000/release/2.8/ubuntu/focal\n\n{\"message\":\"OK\"}\n```\n\n* Update repository metainformation without uploading a package.\n\n  The HTTP `POST` method is used to update repository metainformation\n  without uploading a package. URL describes a path to the repository\n  in the same format as the package upload.\n\n  Example:\n```bash\ncurl \\\n-u user_name:password \\\n--request POST 127.0.0.1:5000/release/2.8/ubuntu/focal\n```\n\n## Configuration\n\nThe configuration is set by the environment variables and configuration file.\nIn the case of using an environment variable, if a bool value is expected,\nall values except \"0\" and \"False\" will be interpreted as \"True\". If the\nvariable is == \"\" or is not set, the default will be used.\n\nEnvironment variables:\n* `RWS_CFG` - path to a configuration file.\n* `RWS_CREDENTIALS` - authentication credentials in JSON format\n  ('{\"name\": \"password_hash\"}').\n* `RWS_FORCE_SYNC` - skip malformed packages when synchronizing metainformation.\n  Default: `False`.\n* `GPG_SIGN_KEY_ARMORED` - gpg key in ASCII armored format to sign tarantool\n  repositories.\n* `GPG_MODULES_SIGN_KEY_ARMORED` - gpg key in ASCII armored format to sign\n  \"modules\" repository.\n  Export the key in ASCII armored format:\n  ```bash\n  gpg --armor --export-secret-keys MYKEYID \u003e mykeys.asc)\n  ```\n* `S3_URL` - URL to access S3 (https://hb.bizmrg.com).\n* `S3_REGION` - region (ru-msk, us-east-2, ...).\n* `S3_BUCKET` - bucket name.\n* `S3_BASE_PATH` - prefix path inside the bucket.\n* `S3_ACCESS_KEY` - Access Key ID for the account.\n* `S3_SECRET_KEY` - Secret Access Key for the account.\n* `S3_PUBLIC_READ`- set read-only permission on files uploaded\n  to S3 for anonymous users\n\nConfiguration file parameters(JSON, for example see `config.default`):\n\n* `common`\n  * `sync_on_start`(bool) - describes whether to synchronize the metainformation\n    of all repositories at the start.\n* `model`\n  * `supported_repos` - describes the supported repositories.\n    * `repo_kind` - kind of repository (live, release, ...).\n    * `tarantool_series` - list of the supported tarantool series.\n    * `distrs` - describes the supported versions of distributions.\n* `anchors` - list of \"anchors\" which can be used to push the package to\n  several repositories (`https://rws.service.org/anchor/el/7`).\n  \u003cdetails\u003e\u003csummary\u003eExample:\u003c/summary\u003e\n\n   config:\n   ``` json\n   \"anchors\": {\n     \"tarantool-modules\": [\n       \"release/1.10/\",\n       \"release/modules/\",\n       \"live/1.10/\"\n     ]\n   }\n   ```\n\n   URL: `https://rws.service.org/tarantool-modules/el/7`\n\n   The package will be pushed to:\n   ```\n   https://rws.service.org/release/1.10/el/7\n   https://rws.service.org/release/modules/el/7\n   https://rws.service.org/live/1.10/el/7\n   ```\n\n  \u003c/details\u003e\n\nTip (hashing password for credentials):\n```bash\npython3 -c \"from werkzeug.security import generate_password_hash; print(generate_password_hash('password'))\"\n```\n\n## Docker\n\nFor running RWS via Docker, just create an image and run a container from it.\n\n```bash\ndocker build -t rws -f docker/Dockerfile .\ndocker run \\\n    -e RWS_CFG=/app/config.default \\\n    -e RWS_CREDENTIALS='{\"user\": \"password\"}' \\\n    -e S3_ACCESS_KEY=foo \\\n    -e S3_SECRET_KEY=bar \\\n    -e S3_REGION=foobar \\\n    -e S3_URL=http://127.0.0.1:9000 \\\n    -e S3_BUCKET=barfoo \\\n    -p 5000:5000 \\\n    rws\n```\n\n### Test stand\n\nNote, that a Docker image with tag `rws` should be build first.\n\nFor setting up a test stand, `docker-compose` can be used:\n\n```bash\ndocker-compose -f docker/test/docker-compose.yml up\n```\n\nIt will run RWS and MinIO (S3 storage) in the separate Docker containers.\nRWS and MinIO will listen to `:5000` and `:9000` ports respectively.\nDefault credentials for connecting to RWS are `rws:rws`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftarantool%2Frws","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftarantool%2Frws","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftarantool%2Frws/lists"}