{"id":17361460,"url":"https://github.com/oldium/subregsim","last_synced_at":"2025-06-14T23:35:20.038Z","repository":{"id":76090974,"uuid":"133980856","full_name":"oldium/subregsim","owner":"oldium","description":"Simple Subreg.cz API simulator","archived":false,"fork":false,"pushed_at":"2022-10-21T19:30:18.000Z","size":34,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-01T20:26:28.178Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oldium.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2018-05-18T16:48:47.000Z","updated_at":"2022-10-21T19:30:23.000Z","dependencies_parsed_at":"2023-05-22T11:00:19.157Z","dependency_job_id":null,"html_url":"https://github.com/oldium/subregsim","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oldium%2Fsubregsim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oldium%2Fsubregsim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oldium%2Fsubregsim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oldium%2Fsubregsim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oldium","download_url":"https://codeload.github.com/oldium/subregsim/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245887156,"owners_count":20688801,"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-10-15T19:33:33.448Z","updated_at":"2025-03-27T16:44:25.441Z","avatar_url":"https://github.com/oldium.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simple Subreg.cz API simulator\r\n\r\nThe simulator of the Subreg.cz API implements just few methods fulfilling\r\nneeds of the Python [lexicon][lexicon] library.\r\n\r\nThe home page of the project is [here][subregsim-home].\r\n\r\n[lexicon]: https://github.com/AnalogJ/lexicon\r\n[subregsim-home]: https://github.com/oldium/subregsim\r\n\r\n## Installation\r\n\r\nFetch the sources:\r\n\r\n```\r\ngit clone -q https://github.com/oldium/subregsim.git\r\ncd subregsim\r\n```\r\n\r\nInstall dependencies:\r\n\r\n```\r\npip install -r requirements.txt\r\n```\r\n\r\nInstall subregsim Python package, including the `subregsim` binary (like in\r\n`Dockerfile`):\r\n\r\n```\r\npip install .\r\n```\r\n\r\nor in editable mode (like in `Dockerfile.development`):\r\n\r\n```\r\npip install -e .\r\n```\r\n\r\n\r\n## Configuration\r\n\r\n### Basic Setup\r\n\r\nThe configuration can be supplied in two ways:\r\n\r\n1. See `subregsim.conf.sample`, copy it to `subregsim.conf` and change it to\r\n   suite your needs. Use `-c subregsim.conf` argument to `subregsim`.\r\n\r\n2. All configuration options can be supplied on command-line.\r\n\r\n### SSL Setup\r\n\r\n#### Local Certificate Authority\r\n\r\nGenerate self-signed certificate for your Certificate Authority (use your own\r\n`subj` string):\r\n\r\n```\r\nopenssl req -x509 -newkey rsa:4096 -nodes -keyout test-ca.key -sha256 -days 1825 -subj \"/C=GB/ST=London/L=London/O=Global Security/OU=IT Department/CN=Test System CA\" -out test-ca.csr\r\n```\r\n\r\nNow you have file `test-ca.key` with private key of Certificate Authority and\r\n`test-ca.crt` with self-signed certificate. You can now import the `test-ca.crt`\r\nfile into your test system.\r\n\r\n#### Domain Certificate\r\n\r\nNow generate domain certificate, replace `example.com` with your domain (and use\r\nyour own `subj` string):\r\n\r\n```\r\nopenssl req -newkey rsa:4096 -nodes -keyout server-certificate.key -subj \"/C=GB/ST=London/L=London/O=Global Security/OU=IT Department/CN=example.com\" -out server-certificate.csr\r\n```\r\n\r\nThe file `server-certificate.key` is the private key, the file\r\n`server-certificate.csr` is certificate signing request.\r\n\r\n#### Signed Domain Certificate\r\n\r\nNow sign the request with your Certificate Authority:\r\n\r\n```\r\nopenssl x509 -req -in server-certificate.csr -CA test-ca.crt -CAkey test-ca.key -CAcreateserial -out server-certificate.crt -days 1825 -sha256\r\n```\r\n\r\nThe file `server-certificate.crt` (together with `server-certificate.key`) can now be used by the test server.\r\n\r\n## Docker\r\n\r\n### Production image\r\n\r\nBuild from sources (optional step - you can use official image):\r\n\r\n```\r\ndocker build -t subregsim:latest .\r\n```\r\n\r\nRun as (uses `subregsim.conf` and generated certificates):\r\n\r\n```\r\ndocker run --rm -it -v $PWD/server-certificate.crt:/config/server-certificate.crt -v $PWD/server-certificate.key:/config/server-certificate.key -v $PWD/subregsim.conf:/config/subregsim.conf subregsim:latest -c /config/subregsim.conf\r\n```\r\n\r\n### Development image\r\n\r\nBuild from sources:\r\n\r\n```\r\ndocker build -t subregsim:develop-latest -f Dockerfile.development .\r\n```\r\n\r\nRun as (uses `subregsim.conf` and generated certificates):\r\n\r\n```\r\ndocker run --rm -it -v $PWD/server-certificate.crt:/config/server-certificate.crt -v $PWD/server-certificate.key:/config/server-certificate.key -v $PWD/subregsim.conf:/config/subregsim.conf -v $PWD/.:/source subregsim:develop-latest -c /config/subregsim.conf\r\n```\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foldium%2Fsubregsim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foldium%2Fsubregsim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foldium%2Fsubregsim/lists"}