{"id":13580057,"url":"https://github.com/mirego/killswitch","last_synced_at":"2025-04-06T00:30:42.905Z","repository":{"id":40008521,"uuid":"452755408","full_name":"mirego/killswitch","owner":"mirego","description":"🪆 Killswitch is a clever control panel that allows mobile developers to apply runtime version-specific behaviors to their iOS or Android application.","archived":false,"fork":false,"pushed_at":"2025-04-03T13:36:17.000Z","size":600,"stargazers_count":45,"open_issues_count":3,"forks_count":0,"subscribers_count":25,"default_branch":"main","last_synced_at":"2025-04-03T14:35:39.729Z","etag":null,"topics":["killswitch","rails"],"latest_commit_sha":null,"homepage":"https://open.mirego.com","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mirego.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-27T16:21:00.000Z","updated_at":"2025-04-03T13:35:52.000Z","dependencies_parsed_at":"2023-02-18T19:01:07.851Z","dependency_job_id":"83d72bc7-4761-4634-9c3a-a53fae1f0990","html_url":"https://github.com/mirego/killswitch","commit_stats":null,"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mirego%2Fkillswitch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mirego%2Fkillswitch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mirego%2Fkillswitch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mirego%2Fkillswitch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mirego","download_url":"https://codeload.github.com/mirego/killswitch/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247419597,"owners_count":20936009,"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":["killswitch","rails"],"created_at":"2024-08-01T15:01:46.686Z","updated_at":"2025-04-06T00:30:41.646Z","avatar_url":"https://github.com/mirego.png","language":"Ruby","funding_links":[],"categories":["Ruby"],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://user-images.githubusercontent.com/11348/151395659-3ebe29b6-b1d6-44fa-bb44-c42146c7e99a.png\" width=\"563\" /\u003e\n  \u003cp\u003e\u003cstrong\u003eKillswitch\u003c/strong\u003e is a clever control panel built by \u003ca href=\"https://www.mirego.com\"\u003eMirego\u003c/a\u003e that allows mobile developers to apply\u003cbr /\u003e runtime version-specific behaviors to their iOS or Android application.\u003c/p\u003e\n  \u003ca href=\"https://github.com/mirego/killswitch/actions/workflows/ci.yaml\"\u003e\u003cimg src=\"https://github.com/mirego/killswitch/actions/workflows/ci.yaml/badge.svg\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/mirego/killswitch/tags\"\u003e\u003cimg src=\"https://img.shields.io/github/v/tag/mirego/killswitch.svg\"\u003e\u003c/a\u003e\u003cbr /\u003e\u003cbr /\u003e\n\u003c/div\u003e\n\n\u003ctable\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003cimg width=\"1244\" alt=\"Screenshot of Killswitch showing the logged out homepage\" src=\"https://user-images.githubusercontent.com/11348/216764468-e0ffc9d3-4b3a-4eea-8703-275357b21ac6.png\"\u003e\n\u003ctd\u003e\u003cimg width=\"1233\" alt=\"Screenshot of Killswitch showing the logged in homepage\" src=\"https://user-images.githubusercontent.com/11348/216764471-f873faee-5d7d-4a2a-ae88-913f972765c9.png\"\u003e\n\u003ctd\u003e\u003cimg width=\"1417\" alt=\"Screenshot of Killswitch showing a project page\" src=\"https://user-images.githubusercontent.com/11348/216764485-66682516-55ed-4696-92da-009817291b21.png\"\u003e\n\u003ctr\u003e\n\u003c/table\u003e\n\u003cbr\u003e\n\n| Section                                 | Description                                            |\n| --------------------------------------- | ------------------------------------------------------ |\n| [🚧 Dependencies](#-dependencies)       | Technical dependencies and how to install them         |\n| [🏎 Kickstart](#-kickstart)              | Details on how to kickstart development on the project |\n| [🏇 Usage](#-usage)                     | Details on how to use the application                  |\n| [🚑 Troubleshooting](#-troubleshooting) | Recurring problems and proven solutions                |\n| [🚀 Deploy](#-deploy)                   | Deployment instructions                                |\n\n## 🚧 Dependencies\n\nEvery runtime dependencies are defined in the `.tool-versions` file. These external dependencies are also required:\n\n- PostgreSQL (`~\u003e 10.0`)\n\n## 🏎 Kickstart\n\n### Environment variables\n\nAll required environment variables are documented in [`.env.dev`](./.env.dev).\n\nWhen running `rails`, `rake` or `make` commands, it is important that these variables are present in the environment. There are several ways to achieve this. Using [`nv`](https://github.com/jcouture/nv) is recommended since it works out of the box with `.env.*` files.\n\n### Initial setup\n\n1. Create both `.env.dev.local` and `.env.test.local` from empty values in [`.env.dev`](./.env.dev) and [`.env.test`](./.env.test)\n2. Install Ruby and NPM dependencies with `make dependencies`\n3. Generate values for mandatory secrets in [`.env.dev`](./.env.dev) with `rake secret`\n\nThen, with variables from `.env.dev` and `.env.dev.local` present in the environment:\n\n4. Create and migrate the database with `rake db:setup`\n5. Start the Rails server with `rails s`\n\n### Sample data\n\nYou can use the `sample_data:create` Rake task to create an organization, an admin user and a few applications.\n\n```shell-session\n$ KILLSWITCH_SAMPLE_DATA_EMAIL=foo@example.com KILLSWITCH_SAMPLE_DATA_PASSWORD=p@ssw0rd rake sample_data:create\n```\n\n### `make` commands\n\nA `Makefile` is present at the root and expose common tasks. The list of these commands is available with `make help`.\n\n### Tests\n\nTests can be ran with `make test`.\n\n### Linting\n\nSeveral linting and formatting tools can be ran to ensure coding style consistency:\n\n- `make lint` ensures code follows our guidelines and best practices\n- `make format` formats files using Prettier\n\n### Continuous integration\n\nThe `.github/workflows/ci.yaml` workflow ensures that the codebase is in good shape on each pull request and branch push.\n\n## 🏇 Usage\n\n### HTTP requests\n\n#### Request a behavior\n\n```\nGET /killswitch\n```\n\n##### Parameters\n\n| Field     | Type   | Description                                                                                  |\n| --------- | ------ | -------------------------------------------------------------------------------------------- |\n| `key`     | String | The API key (eg. `\"f206934e29160b43924308251b88\"`)                                           |\n| `version` | String | The version of the application to test against (see _Conventions → Version numbers_ section) |\n\n##### Headers\n\n| Header            | Description                                                                                                |\n| ----------------- | ---------------------------------------------------------------------------------------------------------- |\n| `Accept-Language` | The application language (the API will return localized messages, if available (eg. `Accept-Language: fr`) |\n\n##### Possible erroneous responses\n\n| Status | Code        | Reason                                                |\n| ------ | ----------- | ----------------------------------------------------- |\n| `400`  | Bad Request | Parameters are malformed or missing                   |\n| `404`  | Not Found   | The API key is not for a valid project or application |\n\n##### Possible successful responses\n\n| Status | Code         | Message                                                                                                         |\n| ------ | ------------ | --------------------------------------------------------------------------------------------------------------- |\n| `200`  | OK           | Everything is under control, yay                                                                                |\n| `304`  | Not Modified | If an `If-None-Match` header is passed and a cached response exist, a `304` will be returned with an empty body |\n\n### Conventions\n\n#### Version numbers\n\nVersion numbers supported by Killswitch must match the following regular expression:\n\n```\n/^\\d+(\\.\\d+)?(\\.\\d+)?(\\.\\w+)?$/\n```\n\nHere are some valid and invalid version number examples:\n\n| Version number | Valid              |\n| -------------- | ------------------ |\n| `1`            | :white_check_mark: |\n| `1.2`          | :white_check_mark: |\n| `1.2.3`        | :white_check_mark: |\n| `1.2.3.4`      | :white_check_mark: |\n| `1.2.3.foo`    | :white_check_mark: |\n| `foo`          | :x:                |\n| `1.`           | :x:                |\n| `1.2.`         | :x:                |\n| `1.2.3.4.5`    | :x:                |\n\n### Behaviors JSON representations\n\n#### Root element\n\n| Key       | Type   | Description                                                               |\n| --------- | ------ | ------------------------------------------------------------------------- |\n| `action`  | String | The action the application should enforce (`\"ok\"`, `\"alert\"` or `\"kill\"`) |\n| `message` | String | A message to display to the user                                          |\n| `buttons` | Array  | An array of buttons to show to the user                                   |\n\n##### Buttons\n\n| Key     | Type   | Description                                                                                    |\n| ------- | ------ | ---------------------------------------------------------------------------------------------- |\n| `type`  | String | The type of button (`\"cancel`, `\"url\"` or `\"reload\"`), defaults to `\"cancel\"` if not specified |\n| `label` | String | The button label                                                                               |\n| `url`   | String | The button URL, if the type is `\"url\"`                                                         |\n\n#### Examples\n\n##### OK\n\n```json\n{\n  \"action\": \"ok\",\n  \"buttons\": []\n}\n```\n\n##### Alert\n\n```json\n{\n  \"action\": \"alert\",\n  \"message\": \"SUP?\",\n  \"buttons\": [\n    {\n      \"type\": \"cancel\",\n      \"label\": \"Nothing\"\n    }\n  ]\n}\n```\n\n##### Kill\n\n```json\n{\n  \"action\": \"kill\",\n  \"message\": \"The app will be killed now. Please upgrade to the latest version.\",\n  \"buttons\": [\n    {\n      \"type\": \"url\",\n      \"label\": \"Upgrade\",\n      \"url\": \"itms://foo\"\n    },\n    {\n      \"type\": \"cancel\",\n      \"label\": \"I don’t want to.\"\n    }\n  ]\n}\n```\n\n## 🚑 Troubleshooting\n\n### System readiness\n\nThe project exposes a `GET /ping` route that sends an HTTP `200 OK` response as soon as the server is ready to accept requests. The response also contains the project version for debugging purpose.\n\n### System health\n\nThe project exposes a `GET /health` route that contains checks to make sure the application and its external dependencies are healthy.\n\n| Name       | Description                                |\n| ---------- | ------------------------------------------ |\n| `noop`     | This check is always healthy               |\n| `database` | Check if the database connection is active |\n\n## 🚀 Deploy\n\n### Container\n\nA Docker image can be created with `make build` and pushed to a registry with `make push`.\n\n[Official Docker images](https://github.com/mirego/killswitch/pkgs/container/killswitch) can be pulled from GitHub Container registry. For example, to get the latest `main` image:\n\n```shell-session\n$ docker pull ghcr.io/mirego/killswitch:latest\n```\n\n## License\n\nKillswitch is © 2013-2022 [Mirego](https://www.mirego.com) and may be freely distributed under the [New BSD license](http://opensource.org/licenses/BSD-3-Clause). See the [`LICENSE.md`](https://github.com/mirego/killswitch/blob/main/LICENSE.md) file.\n\nThe shield logo is based on [this lovely icon by Kimmi Studio](https://thenounproject.com/icon/shield-1055246/), from The Noun Project. Used under a [Creative Commons BY 3.0](http://creativecommons.org/licenses/by/3.0/) license.\n\n## About Mirego\n\n[Mirego](https://www.mirego.com) is a team of passionate people who believe that work is a place where you can innovate and have fun. We’re a team of [talented people](https://life.mirego.com) who imagine and build beautiful Web and mobile applications. We come together to share ideas and [change the world](http://www.mirego.org).\n\nWe also [love open-source software](https://open.mirego.com) and we try to give back to the community as much as we can.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmirego%2Fkillswitch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmirego%2Fkillswitch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmirego%2Fkillswitch/lists"}