├── .github ├── ISSUE_TEMPLATE │ └── bug_report.md ├── auto_assign.yml └── workflows │ ├── cache.yml │ ├── integration-test.yml │ ├── main-charts.yml │ ├── main-docker.yml │ ├── main-docs.yml │ ├── main-proto.yml │ ├── main-slack.yml │ ├── pr-close-docs.yml │ ├── pr-update-docs.yml │ ├── semantic-tags.yml │ ├── stale.yml │ └── test.yml ├── .gitignore ├── .golangci.yml ├── .mockery.yaml ├── .mockery_uncommitted.yaml ├── .vscode └── settings.json ├── CODE_OF_CONDUCT.md ├── LICENSE ├── README.md ├── build └── package │ ├── Dockerfile │ ├── Dockerfile.dockerignore │ ├── Dockerfile.local │ ├── docs │ ├── Dockerfile │ ├── Dockerfile.dockerignore │ └── nginx.conf │ ├── goreleaser │ ├── Dockerfile │ ├── goreleaser.yml │ ├── rig-proxy.Dockerfile │ └── rig.Dockerfile │ ├── proxy │ ├── Dockerfile │ ├── Dockerfile.dockerignore │ └── Dockerfile.local │ └── rig │ ├── Dockerfile │ └── Dockerfile.dockerignore ├── cmd ├── common │ ├── cdmexec.go │ ├── cli_group_ids.go │ ├── completion.go │ ├── flags.go │ ├── format.go │ ├── git.go │ ├── notifier.go │ ├── pipeline.go │ ├── prompt.go │ ├── prompt │ │ ├── prompt.go │ │ └── validate.go │ ├── setup.go │ ├── tview_yaml.go │ ├── tview_yaml_test.go │ ├── useridentifier.go │ ├── utils.go │ └── utils_test.go ├── rig-operator │ ├── apichecker │ │ └── apichecker.go │ ├── certgen │ │ ├── certgen.go │ │ ├── create.go │ │ ├── k8s.go │ │ └── patch.go │ ├── log │ │ └── log.go │ ├── main.go │ └── plugin.go ├── rig-ops │ ├── cmd │ │ ├── base │ │ │ ├── flags.go │ │ │ ├── operator_client.go │ │ │ └── register.go │ │ ├── migrate │ │ │ ├── capsule_name.go │ │ │ ├── current_resources.go │ │ │ ├── export.go │ │ │ ├── helm.go │ │ │ ├── migrate.go │ │ │ ├── plugins.go │ │ │ ├── reporting.go │ │ │ ├── setup.go │ │ │ └── warning.go │ │ ├── plugins │ │ │ ├── check.go │ │ │ ├── computeConfig.go │ │ │ ├── dryrun.go │ │ │ ├── list.go │ │ │ └── setup.go │ │ └── root.go │ └── main.go ├── rig-proto-gen │ └── main.go ├── rig-proxy │ ├── main.go │ ├── root.go │ └── tunnel │ │ └── tunnel.go └── rig │ ├── cmd │ ├── activity │ │ └── setup.go │ ├── auth │ │ ├── activate_service_account.go │ │ ├── get.go │ │ ├── login.go │ │ └── setup.go │ ├── capsule │ │ ├── common.go │ │ ├── deploy │ │ │ ├── deploy.go │ │ │ ├── deploy_set.go │ │ │ ├── deploy_test.go │ │ │ └── setup.go │ │ ├── dry_run.go │ │ ├── image │ │ │ ├── common.go │ │ │ ├── create_image.go │ │ │ ├── list.go │ │ │ └── setup.go │ │ ├── instance │ │ │ ├── exec.go │ │ │ ├── get.go │ │ │ ├── list.go │ │ │ ├── logs.go │ │ │ ├── monitor_size.go │ │ │ ├── monitor_size_windows.go │ │ │ ├── restart.go │ │ │ ├── setup.go │ │ │ └── tty.go │ │ ├── jobs │ │ │ ├── add.go │ │ │ ├── executions.go │ │ │ ├── list.go │ │ │ └── setup.go │ │ ├── pipeline │ │ │ ├── abort.go │ │ │ ├── get.go │ │ │ ├── list.go │ │ │ ├── promote.go │ │ │ ├── setup.go │ │ │ └── start.go │ │ ├── rollout │ │ │ ├── list.go │ │ │ ├── rollback.go │ │ │ └── setup.go │ │ ├── root │ │ │ ├── create.go │ │ │ ├── delete.go │ │ │ ├── get.go │ │ │ ├── list.go │ │ │ ├── list_proposals.go │ │ │ ├── logs.go │ │ │ ├── port-forward.go │ │ │ ├── promote.go │ │ │ ├── setup.go │ │ │ ├── status.go │ │ │ ├── status_utils.go │ │ │ ├── stop.go │ │ │ └── update.go │ │ └── scale │ │ │ ├── get.go │ │ │ ├── horizontal.go │ │ │ ├── horizontal_test.go │ │ │ ├── setup.go │ │ │ └── vertical.go │ ├── cluster │ │ ├── getconfig.go │ │ ├── list.go │ │ └── setup.go │ ├── cmdconfig │ │ ├── config.go │ │ └── context.go │ ├── completions │ │ └── completions.go │ ├── config │ │ ├── current_context.go │ │ ├── delete.go │ │ ├── edit.go │ │ ├── init.go │ │ ├── list_contexts.go │ │ ├── setup.go │ │ ├── use_context.go │ │ ├── use_environment.go │ │ ├── use_project.go │ │ └── view_config.go │ ├── dev │ │ ├── host.go │ │ ├── host_tunnel.go │ │ ├── kind │ │ │ ├── config.yaml │ │ │ ├── create.go │ │ │ ├── registry.yaml │ │ │ └── setup.go │ │ ├── remote.go │ │ └── setup.go │ ├── environment │ │ ├── create.go │ │ ├── delete.go │ │ ├── list.go │ │ ├── listnamespaces.go │ │ ├── remove_project.go │ │ ├── setup.go │ │ └── update.go │ ├── flags │ │ └── flags.go │ ├── git │ │ ├── setup.go │ │ └── status.go │ ├── group │ │ ├── add_member.go │ │ ├── create.go │ │ ├── delete.go │ │ ├── list.go │ │ ├── list_groups_for_member.go │ │ ├── list_members.go │ │ ├── remove_member.go │ │ ├── setup.go │ │ └── update.go │ ├── issue │ │ └── setup.go │ ├── noop │ │ └── setup.go │ ├── project │ │ ├── create.go │ │ ├── delete.go │ │ ├── list.go │ │ ├── setup.go │ │ └── update.go │ ├── role │ │ ├── assign.go │ │ ├── create.go │ │ ├── delete.go │ │ ├── get.go │ │ ├── list.go │ │ ├── list_for_group.go │ │ ├── list_for_role.go │ │ ├── revoke.go │ │ ├── setup.go │ │ └── update.go │ ├── root.go │ ├── serviceaccount │ │ ├── create.go │ │ ├── delete.go │ │ ├── list.go │ │ └── setup.go │ ├── settings │ │ ├── configuration.go │ │ ├── get.go │ │ ├── setup.go │ │ └── update.go │ ├── testing │ │ └── some_test.go │ └── user │ │ ├── create.go │ │ ├── delete.go │ │ ├── get.go │ │ ├── list.go │ │ ├── list_sessions.go │ │ ├── setup.go │ │ └── update.go │ ├── main.go │ └── services │ └── auth │ └── service.go ├── configs └── rig-operator-config.yaml ├── deploy ├── charts │ ├── rig-operator │ │ ├── .helmignore │ │ ├── Chart.yaml │ │ ├── templates │ │ │ ├── _config.tpl │ │ │ ├── _helpers.tpl │ │ │ ├── apicheck │ │ │ │ ├── job.yaml │ │ │ │ ├── rbac.yaml │ │ │ │ └── serviceaccount.yaml │ │ │ ├── certgen │ │ │ │ ├── create-job.yaml │ │ │ │ ├── patch-job.yaml │ │ │ │ ├── rbac.yaml │ │ │ │ └── serviceaccount.yaml │ │ │ ├── certificate.yaml │ │ │ ├── clusterrole.yaml │ │ │ ├── clusterrole_platform.yaml │ │ │ ├── clusterrolebinding.yaml │ │ │ ├── clusterrolebinding_platform.yaml │ │ │ ├── crd.yaml │ │ │ ├── deployment.yaml │ │ │ ├── role.yaml │ │ │ ├── rolebinding.yaml │ │ │ ├── secret.yaml │ │ │ ├── secret_platform.yaml │ │ │ ├── service.yaml │ │ │ ├── serviceaccount.yaml │ │ │ ├── serviceaccount_platform.yaml │ │ │ ├── servicemonitor.yaml │ │ │ └── webhookconfiguration.yaml │ │ └── values.yaml │ └── rig-platform │ │ ├── .helmignore │ │ ├── Chart.yaml │ │ ├── templates │ │ ├── NOTES.txt │ │ ├── _config.tpl │ │ ├── _helpers.tpl │ │ ├── capsule.yaml │ │ ├── clusterrole.yaml │ │ ├── clusterrolebinding.yaml │ │ ├── configmap.yaml │ │ ├── postgres │ │ │ ├── secret.yaml │ │ │ ├── service.yaml │ │ │ └── statefulset.yaml │ │ ├── secret.yaml │ │ ├── service.yaml │ │ ├── serviceaccount.yaml │ │ └── tests │ │ │ └── test-connection.yaml │ │ └── values.yaml └── kind │ └── create.sh ├── docs ├── .env ├── .gitignore ├── README.md ├── api-ref-docs │ └── templates │ │ └── service.tmpl ├── babel.config.js ├── crd-ref-docs │ ├── config.yaml │ ├── platform.yaml │ ├── templates │ │ ├── gv_details.tpl │ │ ├── gv_list.tpl │ │ ├── type.tpl │ │ └── type_members.tpl │ └── v1alpha2-config.yaml ├── docs │ ├── additional-links.mdx │ ├── api.mdx │ ├── api │ │ ├── config │ │ │ └── v1alpha1.md │ │ ├── platform-api.md │ │ ├── platformv1.md │ │ ├── v1alpha1.md │ │ └── v1alpha2.md │ ├── cluster.mdx │ ├── cluster │ │ ├── access-admin-cli.mdx │ │ └── manage-admin-users.mdx │ ├── configuration.mdx │ ├── homepage.mdx │ ├── operator-manual │ │ ├── capsule-spec.mdx │ │ ├── ci-cd.mdx │ │ ├── cli.mdx │ │ ├── crd-operator.mdx │ │ ├── environments.mdx │ │ ├── gitops.mdx │ │ ├── migration.mdx │ │ ├── plugins │ │ │ ├── builtin.mdx │ │ │ ├── builtin │ │ │ │ ├── annotations.mdx │ │ │ │ ├── argo_rollout.mdx │ │ │ │ ├── datadog.mdx │ │ │ │ ├── env_mapping.mdx │ │ │ │ ├── envvar_csi.mdx │ │ │ │ ├── google_cloud_sql_auth_proxy.mdx │ │ │ │ ├── init_container.mdx │ │ │ │ ├── object_create.mdx │ │ │ │ ├── object_template.mdx │ │ │ │ ├── placement.mdx │ │ │ │ ├── sidecar.mdx │ │ │ │ └── statefulset.mdx │ │ │ ├── capsulesteps.mdx │ │ │ ├── capsulesteps │ │ │ │ ├── cron_jobs.mdx │ │ │ │ ├── deployment.mdx │ │ │ │ ├── ingress_routes.mdx │ │ │ │ ├── service_account.mdx │ │ │ │ ├── service_monitor.mdx │ │ │ │ └── vpa.mdx │ │ │ ├── examples.mdx │ │ │ ├── plugins.mdx │ │ │ └── thirdparty.mdx │ │ ├── review.mdx │ │ ├── setup-guide.mdx │ │ └── setup-guide │ │ │ ├── operator.mdx │ │ │ ├── operator │ │ │ ├── autoscaler.mdx │ │ │ ├── configuration-secrets.mdx │ │ │ ├── networking.mdx │ │ │ └── plugins.mdx │ │ │ ├── platform.mdx │ │ │ └── platform │ │ │ ├── container-registries.mdx │ │ │ ├── database.mdx │ │ │ ├── multicluster.mdx │ │ │ ├── network.mdx │ │ │ ├── notifications.mdx │ │ │ └── sso.mdx │ ├── overview │ │ ├── architecture.mdx │ │ ├── guides.mdx │ │ └── guides │ │ │ ├── argocd.mdx │ │ │ ├── aws.mdx │ │ │ ├── ci-cd.mdx │ │ │ ├── customising-podspecs.mdx │ │ │ ├── declarative-deployment.mdx │ │ │ ├── getting-started.mdx │ │ │ ├── helm.mdx │ │ │ └── installation.mdx │ ├── platform │ │ ├── capsules.mdx │ │ ├── config-files.mdx │ │ ├── container-settings.mdx │ │ ├── cronjobs.mdx │ │ ├── custom-metrics-example.mdx │ │ ├── custom-metrics.mdx │ │ ├── extensions.mdx │ │ ├── instance-overview.mdx │ │ ├── network-interfaces.mdx │ │ ├── rbac.mdx │ │ ├── rollouts-and-rollbacks.mdx │ │ ├── scale.mdx │ │ └── service-accounts.mdx │ └── usage.mdx ├── docusaurus.config.js ├── menu.js ├── package-lock.json ├── package.json ├── plugin-ref-docs │ ├── config.yaml │ └── templates │ │ ├── gv_details.tpl │ │ ├── gv_list.tpl │ │ ├── type.tpl │ │ └── type_members.tpl ├── src │ ├── components │ │ ├── Button │ │ │ └── index.tsx │ │ ├── DynamicBiIcon │ │ │ └── index.js │ │ ├── Feedback │ │ │ └── index.jsx │ │ ├── HomepageFeatures │ │ │ ├── index.js │ │ │ └── styles.module.css │ │ └── IconBox │ │ │ └── index.tsx │ ├── constants │ │ └── versions.ts │ ├── css │ │ └── custom.css │ ├── markdown │ │ ├── examples │ │ │ └── examples.mdx │ │ ├── prerequisites │ │ │ ├── create-credential.md │ │ │ ├── getting-started.md │ │ │ ├── install-rig.md │ │ │ ├── setup-cli.md │ │ │ └── setup-sdk.md │ │ └── sdk │ │ │ └── sdks.mdx │ ├── providers │ │ ├── User │ │ │ └── index.tsx │ │ └── sidebar │ │ │ └── index.tsx │ └── theme │ │ ├── Admonition │ │ ├── index.js │ │ └── styles.module.css │ │ ├── CodeBlock │ │ └── index.tsx │ │ ├── DocCard │ │ ├── index.js │ │ └── styles.module.css │ │ ├── DocCardList │ │ └── index.js │ │ ├── DocItem │ │ ├── Content │ │ │ └── index.js │ │ ├── Footer │ │ │ ├── index.js │ │ │ └── styles.module.css │ │ ├── Layout │ │ │ ├── index.js │ │ │ └── styles.module.css │ │ ├── Metadata │ │ │ └── index.js │ │ ├── Paginator │ │ │ └── index.js │ │ ├── TOC │ │ │ ├── Desktop │ │ │ │ └── index.js │ │ │ └── Mobile │ │ │ │ ├── index.js │ │ │ │ └── styles.module.css │ │ └── index.js │ │ ├── DocRoot │ │ └── Layout │ │ │ ├── Main │ │ │ ├── index.js │ │ │ └── styles.module.css │ │ │ ├── Sidebar │ │ │ ├── ExpandButton │ │ │ │ ├── index.js │ │ │ │ └── styles.module.css │ │ │ ├── index.js │ │ │ └── styles.module.css │ │ │ ├── index.js │ │ │ └── styles.module.css │ │ ├── DocSidebarItem │ │ ├── Category │ │ │ └── index.js │ │ ├── Html │ │ │ ├── index.js │ │ │ └── styles.module.css │ │ ├── Link │ │ │ ├── index.js │ │ │ └── styles.module.css │ │ └── index.js │ │ ├── EditThisPage │ │ └── index.js │ │ ├── Footer │ │ ├── Logo │ │ │ ├── index.js │ │ │ └── styles.module.css │ │ └── index.js │ │ ├── Icon │ │ └── Arrow │ │ │ └── index.js │ │ ├── LastUpdated │ │ └── index.js │ │ ├── Navbar │ │ ├── ColorModeToggle │ │ │ ├── index.js │ │ │ └── styles.module.css │ │ ├── Content │ │ │ ├── index.js │ │ │ └── styles.module.css │ │ ├── Layout │ │ │ ├── index.js │ │ │ └── styles.module.css │ │ ├── Logo │ │ │ └── index.js │ │ ├── MobileSidebar │ │ │ ├── Header │ │ │ │ └── index.js │ │ │ ├── Layout │ │ │ │ └── index.js │ │ │ ├── PrimaryMenu │ │ │ │ └── index.js │ │ │ ├── SecondaryMenu │ │ │ │ └── index.js │ │ │ ├── Toggle │ │ │ │ └── index.js │ │ │ └── index.js │ │ ├── Search │ │ │ ├── index.js │ │ │ └── styles.module.css │ │ └── index.js │ │ ├── Tabs │ │ ├── index.js │ │ └── styles.module.css │ │ └── ThemedImage │ │ ├── index.js │ │ └── styles.module.css └── static │ ├── .nojekyll │ ├── img │ ├── banners │ │ ├── authentication-banner.png │ │ ├── banner.png │ │ ├── capsules-banner.png │ │ ├── database-banner.png │ │ ├── docs-banner.png │ │ ├── helm-migration.png │ │ ├── kubernetes.png │ │ ├── local-machine.png │ │ ├── rig-argo.png │ │ ├── storage-banner.png │ │ └── users-banner.png │ ├── cli │ │ └── capsule │ │ │ ├── capsule-status.png │ │ │ └── deploy-image.png │ ├── dashboard │ │ └── platform │ │ │ ├── capsule-config │ │ │ ├── autoscaler.png │ │ │ ├── config-file.png │ │ │ ├── config-overview.png │ │ │ ├── kubernetes-diff.png │ │ │ ├── network-interface.png │ │ │ ├── nginx-image.png │ │ │ ├── platform-diff.png │ │ │ ├── scale.png │ │ │ └── vertical-scaling.png │ │ │ ├── capsule-status │ │ │ └── capsule-status.png │ │ │ ├── capsule │ │ │ ├── create.png │ │ │ └── overview.png │ │ │ ├── container-registries │ │ │ └── add-registry.png │ │ │ ├── container-settings │ │ │ ├── advanced.png │ │ │ └── env-vars.png │ │ │ ├── cronjobs │ │ │ ├── create.png │ │ │ └── list-executions.png │ │ │ ├── instance │ │ │ ├── collective-logs.png │ │ │ ├── logs.png │ │ │ ├── overview.png │ │ │ ├── shell.png │ │ │ ├── status.png │ │ │ └── terminated-overview.png │ │ │ ├── network │ │ │ ├── edit-host.png │ │ │ ├── edit-path.png │ │ │ └── interface-and-healthchecks.png │ │ │ ├── project │ │ │ └── create.png │ │ │ ├── rbac │ │ │ ├── add-member.png │ │ │ └── assign-role.png │ │ │ ├── rollout │ │ │ ├── rollback.png │ │ │ └── stages.png │ │ │ └── service-accounts │ │ │ ├── create.png │ │ │ └── list.png │ ├── favicon.ico │ ├── guides │ │ ├── argo_new_app.png │ │ ├── argo_repo.png │ │ ├── argo_rig_deploy.gif │ │ ├── argo_sync.png │ │ ├── aws │ │ │ ├── aws1.png │ │ │ ├── aws2.png │ │ │ ├── aws3.png │ │ │ ├── step1.png │ │ │ ├── step10.png │ │ │ ├── step11.png │ │ │ ├── step2.png │ │ │ ├── step3.png │ │ │ ├── step4.png │ │ │ ├── step5.png │ │ │ ├── step6.png │ │ │ ├── step7.png │ │ │ ├── step8.png │ │ │ └── step9.png │ │ └── landingpage.png │ ├── logo-dark.png │ ├── logo.png │ ├── operator-manual │ │ ├── capsule-spec-translation.png │ │ ├── environment │ │ │ ├── multi-cluster.png │ │ │ └── topology.png │ │ ├── google-oauth-client.png │ │ ├── migrate-apply.png │ │ ├── migrate-deployments.png │ │ ├── migrate-diff.png │ │ ├── migrate-parts.png │ │ └── plugin_pipeline.png │ ├── overview │ │ ├── cluster_architecture.svg │ │ └── platform_architecture_bg.svg │ └── platform │ │ ├── capsule-extensions-arch.svg │ │ ├── capsule-extensions-ui.png │ │ ├── prometheus.png │ │ ├── scale.svg │ │ ├── slack-create-app.png │ │ └── update-global-notifiers.png │ └── js │ └── segment.js ├── examples └── simple-plugin │ ├── Dockerfile │ ├── go.mod │ ├── go.sum │ ├── main.go │ └── plugin_test.go ├── gen └── mocks │ ├── k8s.io │ └── client-go │ │ └── discovery │ │ └── mock_DiscoveryInterface.go │ └── sigs.k8s.io │ └── controller-runtime │ └── pkg │ └── client │ └── mock_Client.go ├── go.mod ├── go.sum ├── go.work ├── pkg ├── api │ ├── config │ │ └── v1alpha1 │ │ │ ├── groupversion_info.go │ │ │ ├── operator_config_types.go │ │ │ ├── platform_config_types.go │ │ │ ├── platform_config_validate.go │ │ │ ├── platform_test.go │ │ │ └── zz_generated.deepcopy.go │ ├── platform │ │ └── v1 │ │ │ ├── conversion.go │ │ │ ├── conversion_test.go │ │ │ ├── decode.go │ │ │ ├── decode_test.go │ │ │ ├── dev_types.go │ │ │ ├── types.go │ │ │ └── zz_generated.deepcopy.go │ ├── v1alpha1 │ │ ├── capsule_conversion.go │ │ ├── capsule_types.go │ │ ├── capsule_webhook.go │ │ ├── groupversion_info.go │ │ └── zz_generated.deepcopy.go │ └── v1alpha2 │ │ ├── capsule_conversion.go │ │ ├── capsule_types.go │ │ ├── capsule_webhook.go │ │ ├── capsule_webhook_test.go │ │ ├── groupversion_info.go │ │ ├── projectenv_types.go │ │ └── zz_generated.deepcopy.go ├── apichecker │ └── apichecker.go ├── build │ └── build.go ├── cli │ ├── client.go │ ├── common.go │ ├── module.go │ ├── scope │ │ └── scope.go │ ├── test_module.go │ └── version │ │ └── version.go ├── controller │ ├── capsule_controller.go │ ├── plugin │ │ ├── external_plugin.go │ │ ├── heap.go │ │ ├── helpers.go │ │ ├── helpers_test.go │ │ ├── manager.go │ │ ├── server.go │ │ ├── step.go │ │ ├── step_test.go │ │ └── watcher.go │ └── project_controller.go ├── errors │ ├── errors.go │ └── grpc_test.go ├── field │ ├── apply.go │ ├── apply_test.go │ ├── change.go │ ├── compare.go │ ├── compare_test.go │ └── value.go ├── handler │ └── api │ │ ├── capabilities │ │ └── handler.go │ │ ├── cluster │ │ └── handler.go │ │ └── pipeline │ │ ├── dry_run.go │ │ ├── handler.go │ │ └── watch_object_status.go ├── hash │ ├── hash.go │ └── hash_test.go ├── license │ └── limits.go ├── manager │ └── manager.go ├── obj │ ├── comparison.go │ ├── comparison_test.go │ ├── decode.go │ ├── decode_test.go │ ├── dump.go │ ├── dump_test.go │ ├── encode.go │ ├── merge.go │ ├── merge_test.go │ └── new.go ├── pipeline │ ├── capsule_request.go │ ├── capsule_request_test.go │ ├── helpers.go │ ├── owners.go │ ├── pipeline.go │ ├── projectenv_request.go │ ├── request.go │ ├── step.go │ └── types.go ├── ptr │ └── ptr.go ├── rbac │ ├── actions.go │ ├── permissions.go │ └── resources.go ├── roclient │ ├── layered_reader.go │ ├── layered_reader_test.go │ └── reader.go ├── scheme │ ├── scheme.go │ └── version_mapper.go ├── service │ ├── capabilities │ │ ├── capabilities.go │ │ └── capabilities_test.go │ ├── cluster │ │ └── service.go │ ├── config │ │ ├── config.go │ │ └── config_test.go │ ├── objectstatus │ │ ├── service.go │ │ └── watcher.go │ └── pipeline │ │ ├── capsule_extension_step.go │ │ ├── default_pipeline.go │ │ └── service.go ├── tunnel │ ├── buffer.go │ └── tunnel.go ├── utils │ ├── defaults.go │ ├── docker.go │ ├── path_validate.go │ ├── path_validate_test.go │ ├── retry.go │ ├── test_helper.go │ ├── users_helpers.go │ ├── wrap.go │ └── wrap_test.go └── uuid │ └── uuid.go ├── plugins ├── allplugins │ └── all.go ├── builtin │ ├── annotations │ │ ├── README.md │ │ ├── plugin.go │ │ └── plugin_test.go │ ├── argo_rollout │ │ ├── README.md │ │ ├── plugin.go │ │ ├── plugiun_test.go │ │ └── watcher.go │ ├── datadog │ │ ├── README.md │ │ ├── plugin.go │ │ └── plugin_test.go │ ├── env_mapping │ │ ├── README.md │ │ └── plugin.go │ ├── envvar_csi │ │ ├── README.md │ │ ├── plugin.go │ │ └── watcher.go │ ├── google_cloud_sql_auth_proxy │ │ ├── README.md │ │ ├── plugin.go │ │ └── plugin_test.go │ ├── init_container │ │ ├── README.md │ │ └── plugin.go │ ├── object_create │ │ ├── README.md │ │ ├── plugin.go │ │ └── plugin_test.go │ ├── object_template │ │ ├── README.md │ │ ├── plugin.go │ │ └── plugin_test.go │ ├── placement │ │ ├── README.md │ │ ├── plugin.go │ │ └── plugin_test.go │ └── sidecar │ │ ├── README.md │ │ └── plugin.go └── capsulesteps │ ├── cron_jobs │ ├── README.md │ ├── plugin.go │ └── watcher.go │ ├── deployment │ ├── README.md │ ├── plugin.go │ ├── watcher.go │ └── watcher_test.go │ ├── ingress_routes │ ├── README.md │ ├── plugin.go │ └── watcher.go │ ├── service_account │ ├── README.md │ └── plugin.go │ ├── service_monitor │ ├── README.md │ └── plugin.go │ └── vpa │ ├── README.md │ ├── plugin.go │ └── watcher.go ├── proto ├── .clang-format ├── buf.gen.publish.yaml ├── buf.gen.yaml ├── buf.work.yaml └── rig │ ├── api │ └── v1 │ │ ├── activity │ │ ├── activity.proto │ │ └── service.proto │ │ ├── authentication │ │ ├── service.proto │ │ └── user.proto │ │ ├── capsule │ │ ├── capsule.proto │ │ ├── change.proto │ │ ├── event.proto │ │ ├── field.proto │ │ ├── image.proto │ │ ├── instance.proto │ │ ├── instance │ │ │ └── status.proto │ │ ├── job.proto │ │ ├── log.proto │ │ ├── pipeline │ │ │ └── status.proto │ │ ├── revision.proto │ │ ├── rollout.proto │ │ ├── rollout │ │ │ └── status.proto │ │ ├── service.proto │ │ ├── sidecar.proto │ │ └── status.proto │ │ ├── cluster │ │ ├── cluster.proto │ │ └── service.proto │ │ ├── environment │ │ ├── environment.proto │ │ ├── revision.proto │ │ └── service.proto │ │ ├── group │ │ ├── group.proto │ │ └── service.proto │ │ ├── image │ │ └── service.proto │ │ ├── issue │ │ ├── issue.proto │ │ └── service.proto │ │ ├── metrics │ │ ├── metrics.proto │ │ └── service.proto │ │ ├── project │ │ ├── project.proto │ │ ├── revision.proto │ │ ├── service.proto │ │ └── settings │ │ │ ├── service.proto │ │ │ └── settings.proto │ │ ├── role │ │ ├── role.proto │ │ └── service.proto │ │ ├── service_account │ │ ├── service.proto │ │ └── service_account.proto │ │ ├── settings │ │ ├── configuration.proto │ │ ├── service.proto │ │ └── settings.proto │ │ ├── tunnel │ │ └── service.proto │ │ └── user │ │ ├── service.proto │ │ ├── settings │ │ ├── service.proto │ │ └── settings.proto │ │ └── user.proto │ ├── buf.md │ ├── buf.yaml │ ├── config │ └── v1alpha1 │ │ └── generated.proto │ ├── k8s.io │ ├── api │ │ └── autoscaling │ │ │ └── v2 │ │ │ └── generated.proto │ └── apimachinery │ │ └── pkg │ │ ├── api │ │ └── resource │ │ │ └── generated.proto │ │ └── apis │ │ └── meta │ │ └── v1 │ │ └── generated.proto │ ├── model │ ├── auth.proto │ ├── author.proto │ ├── common.proto │ ├── credentials.proto │ ├── environment.proto │ ├── git.proto │ ├── id.proto │ ├── metadata.proto │ ├── metrics.proto │ ├── notification.proto │ ├── pipeline.proto │ ├── revision.proto │ └── user.proto │ ├── operator │ └── api │ │ └── v1 │ │ ├── capabilities │ │ └── service.proto │ │ ├── cluster │ │ └── service.proto │ │ ├── pipeline │ │ ├── object_status.proto │ │ └── service.proto │ │ └── plugin │ │ └── service.proto │ └── platform │ └── v1 │ └── generated.proto ├── scripts └── crdcopy.py ├── taskfile.yaml ├── test └── integration │ └── k8s │ ├── capsule_controller_test.go │ ├── capsule_validation_test.go │ ├── cert-manager.crds.yaml │ ├── pipeline_plugin_test.go │ ├── plugin_suite_test.go │ ├── service-monitor.crds.yaml │ ├── suite_test.go │ └── vpa.crds.yaml └── tools ├── go.mod ├── go.sum ├── go.work ├── readme_truncate.py ├── taskfile.yaml └── tools.go /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | --- 8 | 9 | #### Describe the bug 10 | 11 | A clear and concise description of what the bug is. 12 | 13 | #### To Reproduce 14 | 15 | Steps to reproduce the behavior: 16 | 1. Go to '...' 17 | 2. Click on '....' 18 | 3. Scroll down to '....' 19 | 4. See error 20 | 21 | #### Expected behavior 22 | 23 | A clear and concise description of what you expected to happen. 24 | 25 | #### Screenshots 26 | 27 | If applicable, add screenshots to help explain your problem. 28 | 29 | #### Additional contextual information 30 | 31 | - OS: [e.g. macOS Ventura 13.4.1] 32 | - Browser incl. version [e.g. firefox 117.0.1, chrome 117.0.5938.62, safari 16.5.1] 33 | - Rig Version [e.g. 1.1.3] 34 | - Cluster Type and version [e.g docker 24.0.2, k8s 1.27.3 (gke, eks, aks)] 35 | -------------------------------------------------------------------------------- /.github/auto_assign.yml: -------------------------------------------------------------------------------- 1 | # Set to true to add reviewers to pull requests 2 | addReviewers: true 3 | 4 | # Set to true to add assignees to pull requests 5 | addAssignees: true 6 | 7 | # A list of reviewers to be added to pull requests (GitHub user name) 8 | reviewers: 9 | - andersjohnsen 10 | - Munklinde96 11 | - MatiasFrank 12 | 13 | # A list of keywords to be skipped the process that add reviewers if pull requests include it 14 | skipKeywords: 15 | - wip 16 | 17 | # A number of reviewers added to the pull request 18 | # Set 0 to add all the reviewers (default: 0) 19 | numberOfReviewers: 0 20 | -------------------------------------------------------------------------------- /.github/workflows/cache.yml: -------------------------------------------------------------------------------- 1 | name: Cache 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | 8 | jobs: 9 | cache: 10 | runs-on: ubuntu 11 | steps: 12 | - uses: actions/checkout@v3 13 | 14 | - name: Set up Go 15 | uses: actions/setup-go@v4 16 | with: 17 | go-version: 1.23 18 | 19 | - name: Install Task 20 | uses: arduino/setup-task@v1 21 | with: 22 | version: 3.x 23 | repo-token: ${{ secrets.GITHUB_TOKEN }} 24 | 25 | - name: Cache tools 26 | uses: actions/cache@v3 27 | with: 28 | path: | 29 | tools/bin 30 | key: ${{ runner.os }}-tools-${{ hashFiles('tools/go.sum') }} 31 | restore-keys: | 32 | ${{ runner.os }}-tools- 33 | 34 | - name: Populate tool cache 35 | run: task tools:ci 36 | 37 | - name: Populate go cache 38 | run: task build mocks 39 | -------------------------------------------------------------------------------- /.github/workflows/pr-close-docs.yml: -------------------------------------------------------------------------------- 1 | name: PR Close docs 2 | 3 | on: 4 | workflow_dispatch: 5 | pull_request: 6 | branches: 7 | - main 8 | types: 9 | - closed 10 | 11 | jobs: 12 | close: 13 | runs-on: ubuntu 14 | steps: 15 | - name: Checkout 16 | uses: actions/checkout@v3 17 | 18 | - name: Setup rig 19 | uses: rigdev/setup-rig@v1 20 | with: 21 | host: ${{ vars.RIG_HOST }} 22 | client-id: ${{ vars.RIG_CLIENT_ID }} 23 | client-secret: ${{ secrets.RIG_CLIENT_SECRET }} 24 | 25 | - name: Delete Environment 26 | run: | 27 | rig env delete "docs-pr-${{ github.event.number }}" -f 28 | -------------------------------------------------------------------------------- /.github/workflows/stale.yml: -------------------------------------------------------------------------------- 1 | name: "Close stale issues and PRs" 2 | on: 3 | schedule: 4 | - cron: "30 1 * * *" 5 | 6 | jobs: 7 | stale: 8 | runs-on: ubuntu 9 | steps: 10 | - uses: actions/stale@v8 11 | with: 12 | days-before-stale: 30 13 | days-before-close: 7 14 | stale-issue-message: "This issue is stale because it has been waiting for more information for 30 days with no activity. Remove stale label or comment or this will be closed in 7 days. If the issue has been clarified, remove the needs-more-info label." 15 | stale-pr-message: "This pr is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days." 16 | any-of-issue-labels: needs-more-info 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # binaries 2 | /bin 3 | /tools/bin 4 | /dist 5 | 6 | # generated code 7 | /gen/* 8 | !/gen/mocks 9 | 10 | # test results 11 | /test-result.xml 12 | /cover.out 13 | 14 | # dependencies 15 | go.work.sum 16 | 17 | # helm charts 18 | deploy/charts/*/Chart.lock 19 | deploy/charts/*/charts 20 | 21 | # at some point we might want to commit this so that rig can be installed via 22 | # kustomize 23 | /deploy/kustomize 24 | 25 | # editor specifics 26 | .vscode 27 | !/.vscode/settings.json 28 | 29 | # task cache 30 | /.task 31 | 32 | gen/uncommittedmocks 33 | -------------------------------------------------------------------------------- /.golangci.yml: -------------------------------------------------------------------------------- 1 | run: 2 | skip-dirs: 3 | - docs 4 | - gen 5 | linters: 6 | enable: 7 | - revive 8 | - lll 9 | issues: 10 | exclude-rules: 11 | - linters: 12 | - lll 13 | source: '^//\+kubebuilder' 14 | - linters: 15 | - revive 16 | text: "empty-block: this block is empty, you can remove it" 17 | -------------------------------------------------------------------------------- /.mockery.yaml: -------------------------------------------------------------------------------- 1 | with-expecter: true 2 | dir: "gen/mocks/{{.PackagePath}}" 3 | packages: 4 | github.com/rigdev/rig/pkg/service/config: 5 | interfaces: 6 | Service: {} 7 | sigs.k8s.io/controller-runtime/pkg/client: 8 | interfaces: 9 | Client: {} 10 | k8s.io/client-go/discovery: 11 | interfaces: 12 | DiscoveryInterface: {} 13 | -------------------------------------------------------------------------------- /.mockery_uncommitted.yaml: -------------------------------------------------------------------------------- 1 | with-expecter: true 2 | dir: "gen/uncommittedmocks/{{.PackagePath}}" 3 | packages: 4 | github.com/rigdev/rig-go-sdk: 5 | interfaces: 6 | Client: {} 7 | github.com/rigdev/rig/cmd/common: 8 | interfaces: 9 | Prompter: {} 10 | github.com/rigdev/rig-go-api/api/v1/authentication/authenticationconnect: 11 | interfaces: 12 | ServiceClient: {} 13 | github.com/rigdev/rig-go-api/api/v1/project/projectconnect: 14 | interfaces: 15 | ServiceClient: {} 16 | github.com/rigdev/rig-go-api/api/v1/environment/environmentconnect: 17 | interfaces: 18 | ServiceClient: {} 19 | github.com/rigdev/rig-go-api/api/v1/capsule/capsuleconnect: 20 | interfaces: 21 | ServiceClient: {} 22 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "protoc": { 3 | "options": ["--proto_path=proto/rig"] 4 | } 5 | } -------------------------------------------------------------------------------- /build/package/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:1.23-alpine3.20 AS builder 2 | 3 | ENV CGO_ENABLED=0 4 | 5 | WORKDIR /app 6 | 7 | RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories && \ 8 | apk add --no-cache ca-certificates go-task git clang-extra-tools && \ 9 | addgroup -g 1000 nonroot && \ 10 | adduser -u 1000 -G nonroot -D nonroot 11 | 12 | COPY go.mod go.sum taskfile.yaml ./ 13 | COPY tools tools 14 | RUN --mount=type=cache,target=/go/pkg/mod \ 15 | --mount=type=cache,target=/root/.cache/go-build \ 16 | go-task tools:buf \ 17 | tools:protoc-gen-go \ 18 | tools:protoc-gen-connect-go \ 19 | tools:protoc-gen-go-grpc \ 20 | tools:protoc-gen-doc && \ 21 | go mod download # && go mod verify 22 | 23 | COPY . . 24 | 25 | RUN --mount=type=cache,target=/go/pkg/mod \ 26 | --mount=type=cache,target=/root/.cache/go-build \ 27 | GOFLAGS='-ldflags=-s' go-task proto build-rig-operator 28 | 29 | FROM alpine:3 30 | 31 | RUN apk add --no-cache curl 32 | COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ 33 | COPY --from=builder /app/bin/rig-operator /usr/local/bin/ 34 | COPY --from=builder /etc/passwd /etc/passwd 35 | 36 | USER 1000 37 | 38 | CMD ["rig-operator"] 39 | -------------------------------------------------------------------------------- /build/package/Dockerfile.dockerignore: -------------------------------------------------------------------------------- 1 | * 2 | !/docs/api-ref-docs/templates/service.tmpl 3 | !/go.mod 4 | !/go.sum 5 | !/go.work 6 | !/go.work.sum 7 | !/taskfile.yaml 8 | !/tools/go.mod 9 | !/tools/go.sum 10 | !/tools/taskfile.yaml 11 | !/proto 12 | !/cmd 13 | !/pkg 14 | !/internal 15 | !/plugins 16 | -------------------------------------------------------------------------------- /build/package/Dockerfile.local: -------------------------------------------------------------------------------- 1 | FROM alpine:3 2 | 3 | RUN apk add --no-cache ca-certificates curl 4 | 5 | COPY ./bin/rig-operator /usr/local/bin/ 6 | 7 | USER 1000 8 | 9 | CMD ["rig-operator"] 10 | -------------------------------------------------------------------------------- /build/package/docs/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM --platform=$BUILDPLATFORM node:21.7.1-alpine3.18 AS builder 2 | 3 | WORKDIR /app 4 | 5 | COPY docs/package.json docs/package-lock.json ./ 6 | RUN npm ci 7 | 8 | COPY docs . 9 | RUN npm run build 10 | 11 | FROM nginx:1.25.4-alpine3.18 12 | 13 | COPY build/package/docs/nginx.conf /etc/nginx/conf.d/default.conf 14 | COPY --from=builder /app/build /usr/share/nginx/html 15 | -------------------------------------------------------------------------------- /build/package/docs/Dockerfile.dockerignore: -------------------------------------------------------------------------------- 1 | * 2 | !/build/package/docs/nginx.conf 3 | !/docs/babel.config.js 4 | !/docs/docs 5 | !/docs/docusaurus.config.js 6 | !/docs/menu.js 7 | !/docs/package-lock.json 8 | !/docs/package.json 9 | !/docs/src 10 | !/docs/static 11 | -------------------------------------------------------------------------------- /build/package/docs/nginx.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80; 3 | server_name localhost; 4 | 5 | location / { 6 | root /usr/share/nginx/html; 7 | index index.html index.htm; 8 | } 9 | 10 | error_page 500 502 503 504 /50x.html; 11 | location = /50x.html { 12 | root /usr/share/nginx/html; 13 | } 14 | 15 | gzip on; 16 | gzip_vary on; 17 | gzip_proxied any; 18 | gzip_comp_level 6; 19 | gzip_min_length 256; 20 | gzip_types 21 | text/plain 22 | text/html 23 | text/css 24 | application/javascript; 25 | } 26 | -------------------------------------------------------------------------------- /build/package/goreleaser/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine AS builder 2 | 3 | RUN apk add --no-cache ca-certificates && \ 4 | addgroup -g 1000 nonroot && \ 5 | adduser -u 1000 -G nonroot -D nonroot 6 | 7 | FROM alpine:3 8 | RUN apk add --no-cache curl 9 | 10 | COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ 11 | COPY rig-operator /usr/local/bin/ 12 | COPY --from=builder /etc/passwd /etc/passwd 13 | 14 | USER 1000 15 | 16 | CMD ["rig-operator"] 17 | -------------------------------------------------------------------------------- /build/package/goreleaser/rig-proxy.Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:3.19.1 AS builder 2 | 3 | RUN apk add --no-cache ca-certificates && \ 4 | addgroup -g 1000 nonroot && \ 5 | adduser -u 1000 -G nonroot -D nonroot 6 | 7 | COPY rig-proxy /usr/local/bin/ 8 | 9 | USER 1000 10 | 11 | CMD ["rig-proxy"] 12 | -------------------------------------------------------------------------------- /build/package/goreleaser/rig.Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:3.19.1 AS builder 2 | 3 | RUN apk add --no-cache ca-certificates && \ 4 | addgroup -g 1000 nonroot && \ 5 | adduser -u 1000 -G nonroot -D nonroot 6 | 7 | COPY rig /usr/local/bin/ 8 | 9 | USER 1000 10 | 11 | CMD ["rig"] 12 | -------------------------------------------------------------------------------- /build/package/proxy/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:1.23-alpine3.20 AS builder 2 | 3 | ENV CGO_ENABLED=0 4 | 5 | WORKDIR /app 6 | 7 | RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories && \ 8 | apk add --no-cache ca-certificates go-task git clang-extra-tools && \ 9 | addgroup -g 1000 nonroot && \ 10 | adduser -u 1000 -G nonroot -D nonroot 11 | 12 | COPY go.mod go.sum taskfile.yaml ./ 13 | COPY tools tools 14 | RUN --mount=type=cache,target=/go/pkg/mod \ 15 | --mount=type=cache,target=/root/.cache/go-build \ 16 | go-task tools:buf \ 17 | tools:protoc-gen-go \ 18 | tools:protoc-gen-connect-go \ 19 | tools:protoc-gen-go-grpc \ 20 | tools:protoc-gen-doc && \ 21 | go mod download # && go mod verify 22 | 23 | COPY . . 24 | 25 | RUN --mount=type=cache,target=/go/pkg/mod \ 26 | --mount=type=cache,target=/root/.cache/go-build \ 27 | GOFLAGS='-ldflags=-s' go-task proto build-rig-proxy 28 | 29 | FROM alpine:3 30 | 31 | RUN apk add --no-cache curl 32 | 33 | COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ 34 | COPY --from=builder /app/bin/rig-proxy /usr/local/bin/ 35 | COPY --from=builder /etc/passwd /etc/passwd 36 | 37 | USER 1000 38 | 39 | CMD ["rig-proxy"] 40 | -------------------------------------------------------------------------------- /build/package/proxy/Dockerfile.dockerignore: -------------------------------------------------------------------------------- 1 | * 2 | !/docs/api-ref-docs/templates/service.tmpl 3 | !/go.mod 4 | !/go.sum 5 | !/go.work 6 | !/go.work.sum 7 | !/taskfile.yaml 8 | !/tools/go.mod 9 | !/tools/go.sum 10 | !/tools/taskfile.yaml 11 | !/proto 12 | !/cmd 13 | !/pkg 14 | !/internal 15 | !/plugins 16 | -------------------------------------------------------------------------------- /build/package/proxy/Dockerfile.local: -------------------------------------------------------------------------------- 1 | FROM alpine:3 AS builder 2 | 3 | RUN apk add --no-cache ca-certificates curl 4 | 5 | FROM scratch 6 | 7 | COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ 8 | COPY ./bin/rig-proxy /usr/local/bin/ 9 | 10 | CMD ["rig-proxy"] 11 | -------------------------------------------------------------------------------- /build/package/rig/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:1.23-alpine3.20 AS builder 2 | 3 | ENV CGO_ENABLED=0 4 | 5 | WORKDIR /app 6 | 7 | RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories && \ 8 | apk add --no-cache ca-certificates go-task git clang-extra-tools && \ 9 | addgroup -g 1000 nonroot && \ 10 | adduser -u 1000 -G nonroot -D nonroot 11 | 12 | COPY go.mod go.sum taskfile.yaml ./ 13 | COPY tools tools 14 | RUN --mount=type=cache,target=/go/pkg/mod \ 15 | --mount=type=cache,target=/root/.cache/go-build \ 16 | go-task tools:buf \ 17 | tools:protoc-gen-go \ 18 | tools:protoc-gen-connect-go \ 19 | tools:protoc-gen-go-grpc \ 20 | tools:protoc-gen-doc && \ 21 | go mod download # && go mod verify 22 | 23 | COPY . . 24 | 25 | RUN --mount=type=cache,target=/go/pkg/mod \ 26 | --mount=type=cache,target=/root/.cache/go-build \ 27 | GOFLAGS='-ldflags=-s' go-task proto build-rig 28 | 29 | FROM alpine:3 30 | 31 | RUN apk add --no-cache curl 32 | COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ 33 | COPY --from=builder /app/bin/rig /usr/local/bin/ 34 | COPY --from=builder /etc/passwd /etc/passwd 35 | 36 | USER 1000 37 | 38 | CMD ["rig"] 39 | -------------------------------------------------------------------------------- /build/package/rig/Dockerfile.dockerignore: -------------------------------------------------------------------------------- 1 | * 2 | !/docs/api-ref-docs/templates/service.tmpl 3 | !/go.mod 4 | !/go.sum 5 | !/go.work 6 | !/go.work.sum 7 | !/taskfile.yaml 8 | !/tools/go.mod 9 | !/tools/go.sum 10 | !/tools/taskfile.yaml 11 | !/proto 12 | !/cmd 13 | !/pkg 14 | !/internal 15 | !/plugins 16 | -------------------------------------------------------------------------------- /cmd/common/cli_group_ids.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | const ( 4 | AuthGroupID = "auth" 5 | OtherGroupID = "other" 6 | CapsuleGroupID = "capsule" 7 | ManagementGroupID = "management" 8 | ) 9 | 10 | const ( 11 | AuthGroupTitle = "Authentication Commands - Manage access to Rig" 12 | OtherGroupTitle = "Other Commands" 13 | CapsuleGroupTitle = "Capsule Commands - Capsules and their deployments" 14 | ManagementGroupTitle = "Management Commands - Manage everything around capsules" 15 | ) 16 | -------------------------------------------------------------------------------- /cmd/common/prompt/prompt.go: -------------------------------------------------------------------------------- 1 | package prompt 2 | -------------------------------------------------------------------------------- /cmd/common/prompt/validate.go: -------------------------------------------------------------------------------- 1 | package prompt 2 | -------------------------------------------------------------------------------- /cmd/rig-operator/log/log.go: -------------------------------------------------------------------------------- 1 | package log 2 | 3 | import ( 4 | "github.com/go-logr/logr" 5 | "sigs.k8s.io/controller-runtime/pkg/log/zap" 6 | ) 7 | 8 | func New(devMode bool) logr.Logger { 9 | return zap.New(zap.UseDevMode(devMode)) 10 | } 11 | -------------------------------------------------------------------------------- /cmd/rig-operator/plugin.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/rigdev/rig/pkg/controller/plugin" 7 | "github.com/rigdev/rig/plugins/allplugins" 8 | "github.com/spf13/cobra" 9 | ) 10 | 11 | func pluginSetup(parent *cobra.Command) { 12 | pluginCmd := &cobra.Command{ 13 | Use: "plugin", 14 | Short: "Execute a builtin plugin", 15 | Args: cobra.ExactArgs(1), 16 | RunE: runPlugin, 17 | } 18 | parent.AddCommand(pluginCmd) 19 | } 20 | 21 | func runPlugin(_ *cobra.Command, args []string) error { 22 | pluginName := args[0] 23 | p, ok := allplugins.Plugins[pluginName] 24 | if !ok { 25 | return fmt.Errorf("unknown plugin name %s", pluginName) 26 | } 27 | plugin.StartPlugin(pluginName, p) 28 | return nil 29 | } 30 | -------------------------------------------------------------------------------- /cmd/rig-ops/cmd/base/flags.go: -------------------------------------------------------------------------------- 1 | package base 2 | 3 | import "github.com/rigdev/rig/cmd/common" 4 | 5 | type FlagsStruct struct { 6 | KubeContext string 7 | KubeConfig string 8 | RigConfig string 9 | RigContext string 10 | Namespace string 11 | Project string 12 | Environment string 13 | KubeFile string 14 | KubeDir string 15 | OperatorConfig string 16 | OutputType common.OutputType 17 | } 18 | 19 | var Flags = FlagsStruct{ 20 | OutputType: common.OutputTypePretty, 21 | } 22 | -------------------------------------------------------------------------------- /cmd/rig-ops/cmd/migrate/capsule_name.go: -------------------------------------------------------------------------------- 1 | package migrate 2 | 3 | import "github.com/rigdev/rig/pkg/errors" 4 | 5 | type CapsuleName string 6 | 7 | // String is used both by fmt.Print and by Cobra in help text 8 | func (c *CapsuleName) String() string { 9 | return string(*c) 10 | } 11 | 12 | // Set must have pointer receiver so it doesn't change the value of a copy 13 | func (c *CapsuleName) Set(v string) error { 14 | switch v { 15 | case string(CapsuleNameService), string(CapsuleNameDeployment), string(CapsuleNameInput): 16 | *c = CapsuleName(v) 17 | return nil 18 | default: 19 | return errors.New(`must be one of "service", "deployment", or "input"`) 20 | } 21 | } 22 | 23 | // Type is only used in help text 24 | func (c *CapsuleName) Type() string { 25 | return "service,deployment,input" 26 | } 27 | 28 | const ( 29 | CapsuleNameService CapsuleName = "service" 30 | CapsuleNameDeployment CapsuleName = "deployment" 31 | CapsuleNameInput CapsuleName = "input" 32 | ) 33 | -------------------------------------------------------------------------------- /cmd/rig-ops/cmd/migrate/export.go: -------------------------------------------------------------------------------- 1 | package migrate 2 | 3 | import ( 4 | "os" 5 | 6 | platformv1 "github.com/rigdev/rig-go-api/platform/v1" 7 | "github.com/rigdev/rig/cmd/common" 8 | ) 9 | 10 | func exportCapsule(capsule *platformv1.Capsule, path string) error { 11 | str, err := common.Format(capsule, common.OutputTypeYAML) 12 | if err != nil { 13 | return err 14 | } 15 | 16 | return os.WriteFile(path, []byte(str), 0644) 17 | } 18 | -------------------------------------------------------------------------------- /cmd/rig-ops/cmd/migrate/warning.go: -------------------------------------------------------------------------------- 1 | package migrate 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | type Warning struct { 8 | Kind string 9 | Name string 10 | Field string 11 | Warning string 12 | Suggestion string 13 | } 14 | 15 | func (w *Warning) String() string { 16 | str := fmt.Sprintf("%s/%s", w.Kind, w.Name) 17 | 18 | if w.Field != "" { 19 | str += fmt.Sprintf(".%s", w.Field) 20 | } 21 | 22 | str += fmt.Sprintf(":\nWarning: %s", w.Warning) 23 | 24 | if w.Suggestion != "" { 25 | str += fmt.Sprintf("\nSugggestion: %s", w.Suggestion) 26 | } 27 | 28 | return str + "\n-----------" 29 | } 30 | -------------------------------------------------------------------------------- /cmd/rig-ops/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | 7 | "github.com/rigdev/rig/cmd/rig-ops/cmd" 8 | "github.com/rigdev/rig/pkg/cli" 9 | "github.com/rigdev/rig/pkg/errors" 10 | "go.uber.org/dig" 11 | ) 12 | 13 | func main() { 14 | if err := cmd.Run(cli.StandardSetupContext); err != nil { 15 | fmt.Println(errors.MessageOf(dig.RootCause(err))) 16 | os.Exit(1) 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /cmd/rig-proxy/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | ) 7 | 8 | func main() { 9 | rootCmd := createRootCMD() 10 | if err := rootCmd.Execute(); err != nil { 11 | fmt.Println(err) 12 | os.Exit(1) 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /cmd/rig/cmd/auth/get.go: -------------------------------------------------------------------------------- 1 | package auth 2 | 3 | import ( 4 | "context" 5 | "time" 6 | 7 | "connectrpc.com/connect" 8 | "github.com/jedib0t/go-pretty/v6/table" 9 | "github.com/rigdev/rig-go-api/api/v1/authentication" 10 | "github.com/rigdev/rig/cmd/common" 11 | "github.com/rigdev/rig/cmd/rig/cmd/flags" 12 | "github.com/spf13/cobra" 13 | ) 14 | 15 | func (c *Cmd) get(ctx context.Context, cmd *cobra.Command, _ []string) error { 16 | res, err := c.Rig.Authentication().Get(ctx, &connect.Request[authentication.GetRequest]{ 17 | Msg: &authentication.GetRequest{}, 18 | }) 19 | if err != nil { 20 | return err 21 | } 22 | 23 | if flags.Flags.OutputType != common.OutputTypePretty { 24 | return common.FormatPrint(res.Msg, flags.Flags.OutputType) 25 | } 26 | 27 | ui := res.Msg.GetUserInfo() 28 | 29 | t := table.NewWriter() 30 | t.AppendHeader(table.Row{"Entry", "Value"}) 31 | t.AppendRow(table.Row{"ID", res.Msg.GetUserId()}) 32 | t.AppendRow(table.Row{"Username", ui.GetUsername()}) 33 | t.AppendRow(table.Row{"Email", ui.GetEmail()}) 34 | t.AppendRow(table.Row{"Phone number", ui.GetPhoneNumber()}) 35 | t.AppendRow(table.Row{"Created at", ui.GetCreatedAt().AsTime().Format(time.RFC3339)}) 36 | 37 | cmd.Println(t.Render()) 38 | 39 | return nil 40 | } 41 | -------------------------------------------------------------------------------- /cmd/rig/cmd/capsule/instance/monitor_size.go: -------------------------------------------------------------------------------- 1 | //go:build !windows 2 | // +build !windows 3 | 4 | package instance 5 | 6 | import ( 7 | "os" 8 | "os/signal" 9 | "syscall" 10 | ) 11 | 12 | func (tty *Tty) MonitorSize() error { 13 | go func() { 14 | sigChan := make(chan os.Signal, 1) 15 | signal.Notify(sigChan, syscall.SIGWINCH) 16 | defer func() { 17 | signal.Stop(sigChan) 18 | close(sigChan) 19 | }() 20 | 21 | for range sigChan { 22 | w, h := tty.GetTtySize() 23 | tty.resizeChan <- sizeMsg{ 24 | width: w, 25 | height: h, 26 | } 27 | } 28 | }() 29 | 30 | return nil 31 | } 32 | -------------------------------------------------------------------------------- /cmd/rig/cmd/capsule/instance/monitor_size_windows.go: -------------------------------------------------------------------------------- 1 | package instance 2 | 3 | import ( 4 | "time" 5 | ) 6 | 7 | func (tty *Tty) MonitorSize() error { 8 | go func() { 9 | prevH, prevW := tty.GetTtySize() 10 | for { 11 | time.Sleep(time.Millisecond * 250) 12 | h, w := tty.GetTtySize() 13 | 14 | if prevW != w || prevH != h { 15 | tty.resizeChan <- sizeMsg{ 16 | width: w, 17 | height: h, 18 | } 19 | } 20 | prevH = h 21 | prevW = w 22 | } 23 | }() 24 | 25 | return nil 26 | } 27 | -------------------------------------------------------------------------------- /cmd/rig/cmd/capsule/instance/restart.go: -------------------------------------------------------------------------------- 1 | package instance 2 | 3 | import ( 4 | "context" 5 | 6 | "connectrpc.com/connect" 7 | "github.com/rigdev/rig-go-api/api/v1/capsule" 8 | capsule_cmd "github.com/rigdev/rig/cmd/rig/cmd/capsule" 9 | "github.com/spf13/cobra" 10 | ) 11 | 12 | func (c *Cmd) restart(ctx context.Context, cmd *cobra.Command, args []string) error { 13 | arg := "" 14 | if len(args) > 1 { 15 | arg = args[1] 16 | } 17 | 18 | instanceID, err := c.provideInstanceID(ctx, capsule_cmd.CapsuleID, arg, cmd.ArgsLenAtDash()) 19 | if err != nil { 20 | return err 21 | } 22 | 23 | if _, err := c.Rig.Capsule().RestartInstance(ctx, &connect.Request[capsule.RestartInstanceRequest]{ 24 | Msg: &capsule.RestartInstanceRequest{ 25 | CapsuleId: capsule_cmd.CapsuleID, 26 | InstanceId: instanceID, 27 | ProjectId: c.Scope.GetCurrentContext().GetProject(), 28 | EnvironmentId: c.Scope.GetCurrentContext().GetEnvironment(), 29 | }, 30 | }); err != nil { 31 | return err 32 | } 33 | 34 | cmd.Println("Instance restarted") 35 | 36 | return nil 37 | } 38 | -------------------------------------------------------------------------------- /cmd/rig/cmd/capsule/pipeline/abort.go: -------------------------------------------------------------------------------- 1 | package pipeline 2 | 3 | import ( 4 | "context" 5 | "strconv" 6 | 7 | "connectrpc.com/connect" 8 | capsule_api "github.com/rigdev/rig-go-api/api/v1/capsule" 9 | "github.com/rigdev/rig/pkg/errors" 10 | "github.com/spf13/cobra" 11 | ) 12 | 13 | func (c *Cmd) abort(ctx context.Context, cmd *cobra.Command, args []string) error { 14 | pipelineIDStr := "" 15 | var err error 16 | if len(args) == 0 { 17 | if !c.Scope.IsInteractive() { 18 | return errors.InvalidArgumentErrorf("missing pipeline execution id") 19 | } 20 | 21 | pipelineIDStr, err = c.promptForPipelineID(ctx) 22 | if err != nil { 23 | return err 24 | } 25 | } else { 26 | pipelineIDStr = args[0] 27 | } 28 | 29 | pipelineID, err := strconv.ParseUint(pipelineIDStr, 10, 64) 30 | if err != nil { 31 | return err 32 | } 33 | 34 | _, err = c.Rig.Capsule().AbortPipeline(ctx, connect.NewRequest(&capsule_api.AbortPipelineRequest{ 35 | ExecutionId: pipelineID, 36 | })) 37 | if err != nil { 38 | return err 39 | } 40 | 41 | cmd.Printf("pipeline %v aborted\n", pipelineID) 42 | return nil 43 | } 44 | -------------------------------------------------------------------------------- /cmd/rig/cmd/capsule/pipeline/start.go: -------------------------------------------------------------------------------- 1 | package pipeline 2 | 3 | import ( 4 | "context" 5 | 6 | "connectrpc.com/connect" 7 | capsule_api "github.com/rigdev/rig-go-api/api/v1/capsule" 8 | capsule_cmd "github.com/rigdev/rig/cmd/rig/cmd/capsule" 9 | "github.com/rigdev/rig/pkg/errors" 10 | "github.com/spf13/cobra" 11 | ) 12 | 13 | func (c *Cmd) start(ctx context.Context, cmd *cobra.Command, args []string) error { 14 | pipelineName := "" 15 | var err error 16 | if len(args) < 2 { 17 | if !c.Scope.IsInteractive() { 18 | return errors.InvalidArgumentErrorf("missing pipeline name") 19 | } 20 | 21 | pipelineName, err = c.promptForPipelineName(ctx) 22 | if err != nil { 23 | return err 24 | } 25 | } else { 26 | pipelineName = args[1] 27 | } 28 | 29 | resp, err := c.Rig.Capsule().StartPipeline(ctx, connect.NewRequest(&capsule_api.StartPipelineRequest{ 30 | ProjectId: c.Scope.GetCurrentContext().GetProject(), 31 | CapsuleId: capsule_cmd.CapsuleID, 32 | PipelineName: pipelineName, 33 | })) 34 | if err != nil { 35 | return err 36 | } 37 | 38 | cmd.Printf("pipeline %v started with execution id %v\n", pipelineName, resp.Msg.Status.GetExecutionId()) 39 | 40 | return nil 41 | } 42 | -------------------------------------------------------------------------------- /cmd/rig/cmd/capsule/root/create.go: -------------------------------------------------------------------------------- 1 | package root 2 | 3 | import ( 4 | "context" 5 | 6 | "connectrpc.com/connect" 7 | "github.com/rigdev/rig-go-api/api/v1/capsule" 8 | "github.com/rigdev/rig/cmd/common" 9 | capsule_cmd "github.com/rigdev/rig/cmd/rig/cmd/capsule" 10 | "github.com/spf13/cobra" 11 | ) 12 | 13 | func (c *Cmd) create(ctx context.Context, cmd *cobra.Command, args []string) error { 14 | var err error 15 | if len(args) == 0 { 16 | capsule_cmd.CapsuleID, err = c.Prompter.Input("Capsule name:", common.ValidateSystemNameOpt) 17 | if err != nil { 18 | return err 19 | } 20 | } else { 21 | capsule_cmd.CapsuleID = args[0] 22 | } 23 | 24 | res, err := c.Rig.Capsule().Create(ctx, &connect.Request[capsule.CreateRequest]{ 25 | Msg: &capsule.CreateRequest{ 26 | Name: capsule_cmd.CapsuleID, 27 | ProjectId: c.Scope.GetCurrentContext().GetProject(), 28 | }, 29 | }) 30 | if err != nil { 31 | return err 32 | } 33 | 34 | cmd.Printf("Created new capsule '%v'\n", res.Msg.GetCapsuleId()) 35 | return nil 36 | } 37 | -------------------------------------------------------------------------------- /cmd/rig/cmd/capsule/root/delete.go: -------------------------------------------------------------------------------- 1 | package root 2 | 3 | import ( 4 | "context" 5 | 6 | "connectrpc.com/connect" 7 | "github.com/rigdev/rig-go-api/api/v1/capsule" 8 | capsule_cmd "github.com/rigdev/rig/cmd/rig/cmd/capsule" 9 | "github.com/spf13/cobra" 10 | ) 11 | 12 | func (c *Cmd) delete(ctx context.Context, cmd *cobra.Command, _ []string) error { 13 | if _, err := c.Rig.Capsule().Delete(ctx, &connect.Request[capsule.DeleteRequest]{ 14 | Msg: &capsule.DeleteRequest{ 15 | CapsuleId: capsule_cmd.CapsuleID, 16 | ProjectId: c.Scope.GetCurrentContext().GetProject(), 17 | }, 18 | }); err != nil { 19 | return err 20 | } 21 | 22 | cmd.Println("Delete capsule", capsule_cmd.CapsuleID) 23 | return nil 24 | } 25 | -------------------------------------------------------------------------------- /cmd/rig/cmd/capsule/root/logs.go: -------------------------------------------------------------------------------- 1 | package root 2 | 3 | import ( 4 | "context" 5 | "time" 6 | 7 | "connectrpc.com/connect" 8 | "github.com/rigdev/rig-go-api/api/v1/capsule" 9 | capsule_cmd "github.com/rigdev/rig/cmd/rig/cmd/capsule" 10 | "github.com/spf13/cobra" 11 | "google.golang.org/protobuf/types/known/durationpb" 12 | ) 13 | 14 | func (c *Cmd) logs(ctx context.Context, _ *cobra.Command, _ []string) error { 15 | request := &capsule.LogsRequest{ 16 | CapsuleId: capsule_cmd.CapsuleID, 17 | Follow: follow, 18 | ProjectId: c.Scope.GetCurrentContext().GetProject(), 19 | EnvironmentId: c.Scope.GetCurrentContext().GetEnvironment(), 20 | PreviousContainers: previousContainers, 21 | } 22 | 23 | if since != "" { 24 | duration, err := time.ParseDuration(since) 25 | if err != nil { 26 | return err 27 | } 28 | request.Since = durationpb.New(duration) 29 | } 30 | 31 | stream, err := c.Rig.Capsule().Logs(ctx, connect.NewRequest(request)) 32 | if err != nil { 33 | return err 34 | } 35 | 36 | return capsule_cmd.PrintLogs(stream) 37 | } 38 | -------------------------------------------------------------------------------- /cmd/rig/cmd/capsule/root/stop.go: -------------------------------------------------------------------------------- 1 | package root 2 | 3 | import ( 4 | "context" 5 | 6 | "connectrpc.com/connect" 7 | "github.com/rigdev/rig-go-api/api/v1/capsule" 8 | capsule_cmd "github.com/rigdev/rig/cmd/rig/cmd/capsule" 9 | "github.com/spf13/cobra" 10 | ) 11 | 12 | func (c *Cmd) stop(ctx context.Context, cmd *cobra.Command, _ []string) error { 13 | currentRollout, err := capsule_cmd.GetCurrentRollout(ctx, c.Rig, c.Scope) 14 | if err != nil { 15 | return err 16 | } 17 | 18 | if _, err := c.Rig.Capsule().StopRollout(ctx, &connect.Request[capsule.StopRolloutRequest]{ 19 | Msg: &capsule.StopRolloutRequest{ 20 | CapsuleId: capsule_cmd.CapsuleID, 21 | RolloutId: currentRollout.GetRolloutId(), 22 | ProjectId: c.Scope.GetCurrentContext().GetProject(), 23 | }, 24 | }); err != nil { 25 | return err 26 | } 27 | 28 | cmd.Println("rollout stopped") 29 | 30 | return nil 31 | } 32 | -------------------------------------------------------------------------------- /cmd/rig/cmd/cluster/getconfig.go: -------------------------------------------------------------------------------- 1 | package cluster 2 | 3 | import ( 4 | "context" 5 | "fmt" 6 | 7 | "connectrpc.com/connect" 8 | "github.com/rigdev/rig-go-api/api/v1/cluster" 9 | "github.com/rigdev/rig/cmd/common" 10 | "github.com/rigdev/rig/cmd/rig/cmd/flags" 11 | "github.com/spf13/cobra" 12 | "gopkg.in/yaml.v3" 13 | ) 14 | 15 | func (c *Cmd) get(ctx context.Context, _ *cobra.Command, _ []string) error { 16 | resp, err := c.Rig.Cluster().GetConfig(ctx, connect.NewRequest(&cluster.GetConfigRequest{ 17 | EnvironmentId: c.Scope.GetCurrentContext().GetEnvironment(), 18 | })) 19 | if err != nil { 20 | return err 21 | } 22 | config := resp.Msg 23 | 24 | if flags.Flags.OutputType != common.OutputTypePretty { 25 | return common.FormatPrint(config, flags.Flags.OutputType) 26 | } 27 | 28 | // Yes, pretty-printing is also just yaml for this one 29 | bytes, err := yaml.Marshal(config) 30 | if err != nil { 31 | return err 32 | } 33 | 34 | fmt.Println(string(bytes)) 35 | 36 | return nil 37 | } 38 | -------------------------------------------------------------------------------- /cmd/rig/cmd/cluster/list.go: -------------------------------------------------------------------------------- 1 | package cluster 2 | 3 | import ( 4 | "context" 5 | "fmt" 6 | 7 | "connectrpc.com/connect" 8 | "github.com/rigdev/rig-go-api/api/v1/cluster" 9 | "github.com/rigdev/rig/cmd/common" 10 | "github.com/rigdev/rig/cmd/rig/cmd/flags" 11 | "github.com/spf13/cobra" 12 | "gopkg.in/yaml.v3" 13 | ) 14 | 15 | func (c *Cmd) list(ctx context.Context, _ *cobra.Command, _ []string) error { 16 | resp, err := c.Rig.Cluster().List(ctx, connect.NewRequest(&cluster.ListRequest{})) 17 | if err != nil { 18 | return err 19 | } 20 | 21 | var clusters []string 22 | for _, c := range resp.Msg.GetClusters() { 23 | clusters = append(clusters, c.GetClusterId()) 24 | } 25 | 26 | if flags.Flags.OutputType != common.OutputTypePretty { 27 | return common.FormatPrint(clusters, flags.Flags.OutputType) 28 | } 29 | 30 | // Yes, pretty-printing is also just yaml for this one 31 | bytes, err := yaml.Marshal(clusters) 32 | if err != nil { 33 | return err 34 | } 35 | 36 | fmt.Println(string(bytes)) 37 | 38 | return nil 39 | } 40 | -------------------------------------------------------------------------------- /cmd/rig/cmd/config/current_context.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | import "github.com/spf13/cobra" 4 | 5 | func (c *CmdWScope) currentContext(cmd *cobra.Command, _ []string) error { 6 | cmd.Println(c.Scope.GetCurrentContext().Name) 7 | return nil 8 | } 9 | -------------------------------------------------------------------------------- /cmd/rig/cmd/config/delete.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | import ( 4 | "github.com/rigdev/rig/pkg/errors" 5 | "github.com/spf13/cobra" 6 | ) 7 | 8 | func (c *CmdNoScope) delete(cmd *cobra.Command, args []string) error { 9 | var ctx string 10 | var err error 11 | if len(args) == 0 { 12 | ctx, err = c.Cfg.PromptForContext() 13 | if err != nil { 14 | return err 15 | } 16 | } else { 17 | ctx = args[0] 18 | } 19 | 20 | deleted := c.Cfg.DeleteContext(ctx) 21 | if !deleted { 22 | return errors.NotFoundErrorf("context %s not found", ctx) 23 | } 24 | err = c.Cfg.Save() 25 | if err != nil { 26 | return err 27 | } 28 | cmd.Println("Context deleted") 29 | return nil 30 | } 31 | -------------------------------------------------------------------------------- /cmd/rig/cmd/config/init.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | import ( 4 | "github.com/rigdev/rig/cmd/rig/cmd/flags" 5 | "github.com/spf13/cobra" 6 | ) 7 | 8 | func (c *CmdNoScope) init(_ *cobra.Command, _ []string) error { 9 | if c.PromptInfo.ContextCreation { 10 | return nil 11 | } 12 | 13 | return c.Cfg.CreateContextAndSave(contextName, flags.Flags.Host, bool(c.Interactive)) 14 | } 15 | -------------------------------------------------------------------------------- /cmd/rig/cmd/config/use_context.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | import ( 4 | "github.com/spf13/cobra" 5 | ) 6 | 7 | func (c *CmdNoScope) useContext(_ *cobra.Command, args []string) error { 8 | if len(args) > 0 { 9 | return c.Cfg.UseContext(args[0]) 10 | } 11 | return c.Cfg.SelectContext() 12 | } 13 | -------------------------------------------------------------------------------- /cmd/rig/cmd/config/view_config.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | import ( 4 | "github.com/rigdev/rig/cmd/common" 5 | "github.com/rigdev/rig/cmd/rig/cmd/flags" 6 | "github.com/spf13/cobra" 7 | ) 8 | 9 | func (c *CmdNoScope) viewConfig(cmd *cobra.Command, _ []string) error { 10 | var outputType common.OutputType 11 | if flags.Flags.OutputType == common.OutputTypePretty { 12 | outputType = common.OutputTypeYAML 13 | } else { 14 | outputType = flags.Flags.OutputType 15 | } 16 | 17 | var toPrint string 18 | var err error 19 | if minify { 20 | toPrint, err = common.Format(c.Cfg.Minify(), outputType) 21 | if err != nil { 22 | return err 23 | } 24 | } else { 25 | toPrint, err = common.Format(c.Cfg, outputType) 26 | if err != nil { 27 | return err 28 | } 29 | } 30 | 31 | cmd.Println(toPrint) 32 | return nil 33 | } 34 | -------------------------------------------------------------------------------- /cmd/rig/cmd/dev/kind/config.yaml: -------------------------------------------------------------------------------- 1 | kind: Cluster 2 | apiVersion: kind.x-k8s.io/v1alpha4 3 | nodes: 4 | - role: control-plane 5 | extraPortMappings: 6 | - containerPort: 30000 7 | hostPort: 30000 8 | listenAddress: "127.0.0.1" 9 | protocol: TCP 10 | - containerPort: 30047 11 | hostPort: 4747 12 | listenAddress: "127.0.0.1" 13 | protocol: TCP 14 | -------------------------------------------------------------------------------- /cmd/rig/cmd/dev/kind/registry.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | labels: 5 | run: registry 6 | name: registry 7 | namespace: rig-system 8 | spec: 9 | replicas: 1 10 | selector: 11 | matchLabels: 12 | run: registry 13 | template: 14 | metadata: 15 | labels: 16 | run: registry 17 | spec: 18 | containers: 19 | - name: registry 20 | image: registry:2 21 | ports: 22 | - containerPort: 5000 23 | --- 24 | apiVersion: v1 25 | kind: Service 26 | metadata: 27 | name: registry 28 | namespace: rig-system 29 | spec: 30 | type: NodePort 31 | selector: 32 | run: registry 33 | ports: 34 | - name: registry-tcp 35 | nodePort: 30000 36 | protocol: TCP 37 | port: 5000 38 | targetPort: 5000 39 | -------------------------------------------------------------------------------- /cmd/rig/cmd/environment/delete.go: -------------------------------------------------------------------------------- 1 | package environment 2 | 3 | import ( 4 | "context" 5 | 6 | "connectrpc.com/connect" 7 | "github.com/rigdev/rig-go-api/api/v1/environment" 8 | "github.com/spf13/cobra" 9 | ) 10 | 11 | func (c *Cmd) delete(ctx context.Context, cmd *cobra.Command, args []string) error { 12 | environmentID := args[0] 13 | 14 | req := &environment.DeleteRequest{ 15 | EnvironmentId: environmentID, 16 | Force: force, 17 | } 18 | 19 | _, err := c.Rig.Environment().Delete(ctx, &connect.Request[environment.DeleteRequest]{Msg: req}) 20 | if err != nil { 21 | return err 22 | } 23 | 24 | cmd.Printf("Successfully deleted environment '%s'\n", environmentID) 25 | return nil 26 | } 27 | -------------------------------------------------------------------------------- /cmd/rig/cmd/environment/remove_project.go: -------------------------------------------------------------------------------- 1 | package environment 2 | 3 | import ( 4 | "context" 5 | 6 | "connectrpc.com/connect" 7 | "github.com/rigdev/rig-go-api/api/v1/environment" 8 | "github.com/spf13/cobra" 9 | ) 10 | 11 | func (c *Cmd) removeProject(ctx context.Context, cmd *cobra.Command, args []string) error { 12 | environmentID := args[0] 13 | projectID := args[1] 14 | 15 | req := &environment.UpdateRequest{ 16 | EnvironmentId: environmentID, 17 | Updates: []*environment.Update{ 18 | { 19 | Field: &environment.Update_RemoveProject{ 20 | RemoveProject: projectID, 21 | }, 22 | }, 23 | }, 24 | } 25 | 26 | _, err := c.Rig.Environment().Update(ctx, connect.NewRequest(req)) 27 | if err != nil { 28 | return err 29 | } 30 | 31 | cmd.Printf("Successfully removed project %s from environment '%s'\n", projectID, environmentID) 32 | return nil 33 | } 34 | -------------------------------------------------------------------------------- /cmd/rig/cmd/flags/flags.go: -------------------------------------------------------------------------------- 1 | package flags 2 | 3 | import ( 4 | "os" 5 | 6 | "github.com/rigdev/rig/cmd/common" 7 | ) 8 | 9 | //nolint:revive 10 | type FlagsStruct struct { 11 | OutputType common.OutputType 12 | NonInteractive bool 13 | Environment string 14 | Project string 15 | BasicAuth bool 16 | Host string 17 | Context string 18 | } 19 | 20 | var Flags FlagsStruct 21 | 22 | func InitFlags() { 23 | Flags = FlagsStruct{ 24 | OutputType: common.OutputTypePretty, 25 | NonInteractive: false, 26 | Environment: os.Getenv("RIG_ENVIRONMENT"), 27 | Project: os.Getenv("RIG_PROJECT"), 28 | BasicAuth: false, 29 | Host: os.Getenv("RIG_HOST"), 30 | Context: "", 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /cmd/rig/cmd/git/setup.go: -------------------------------------------------------------------------------- 1 | package git 2 | 3 | import ( 4 | "github.com/rigdev/rig-go-sdk" 5 | "github.com/rigdev/rig/cmd/common" 6 | "github.com/rigdev/rig/cmd/rig/services/auth" 7 | "github.com/rigdev/rig/pkg/cli" 8 | "github.com/spf13/cobra" 9 | "go.uber.org/fx" 10 | ) 11 | 12 | type Cmd struct { 13 | fx.In 14 | 15 | Rig rig.Client 16 | Prompter common.Prompter 17 | } 18 | 19 | var cmd Cmd 20 | 21 | func initCmd(c Cmd) { 22 | cmd.Rig = c.Rig 23 | cmd.Prompter = c.Prompter 24 | } 25 | 26 | func Setup(parent *cobra.Command, s *cli.SetupContext) { 27 | git := &cobra.Command{ 28 | Use: "git", 29 | Short: "Manage git backing of capsules", 30 | Annotations: map[string]string{ 31 | auth.OmitProject: "", 32 | auth.OmitEnvironment: "", 33 | auth.OmitUser: "", 34 | }, 35 | PersistentPreRunE: s.MakeInvokePreRunE(initCmd), 36 | GroupID: common.ManagementGroupID, 37 | } 38 | 39 | status := &cobra.Command{ 40 | Use: "status", 41 | Short: "Get the status of the git backing", 42 | Annotations: map[string]string{ 43 | auth.OmitProject: "", 44 | auth.OmitEnvironment: "", 45 | auth.OmitUser: "", 46 | }, 47 | RunE: cli.CtxWrap(cmd.status), 48 | } 49 | git.AddCommand(status) 50 | 51 | parent.AddCommand(git) 52 | } 53 | -------------------------------------------------------------------------------- /cmd/rig/cmd/group/create.go: -------------------------------------------------------------------------------- 1 | package group 2 | 3 | import ( 4 | "context" 5 | 6 | "connectrpc.com/connect" 7 | "github.com/rigdev/rig-go-api/api/v1/group" 8 | "github.com/rigdev/rig/cmd/common" 9 | "github.com/spf13/cobra" 10 | ) 11 | 12 | func (c *Cmd) create(ctx context.Context, cmd *cobra.Command, args []string) error { 13 | var err error 14 | groupID := "" 15 | if len(args) == 0 { 16 | groupID, err = c.Prompter.Input("Group ID:", common.ValidateNonEmptyOpt) 17 | if err != nil { 18 | return err 19 | } 20 | } else { 21 | groupID = args[0] 22 | } 23 | 24 | updates := []*group.Update{ 25 | { 26 | Field: &group.Update_GroupId{ 27 | GroupId: groupID, 28 | }, 29 | }, 30 | } 31 | 32 | res, err := c.Rig.Group().Create(ctx, &connect.Request[group.CreateRequest]{ 33 | Msg: &group.CreateRequest{ 34 | Initializers: updates, 35 | }, 36 | }) 37 | if err != nil { 38 | return err 39 | } 40 | 41 | cmd.Println("Created group", res.Msg.GetGroup().GetGroupId()) 42 | return nil 43 | } 44 | -------------------------------------------------------------------------------- /cmd/rig/cmd/group/delete.go: -------------------------------------------------------------------------------- 1 | package group 2 | 3 | import ( 4 | "context" 5 | 6 | "connectrpc.com/connect" 7 | "github.com/rigdev/rig-go-api/api/v1/group" 8 | "github.com/rigdev/rig/cmd/common" 9 | "github.com/spf13/cobra" 10 | ) 11 | 12 | func (c *Cmd) delete(ctx context.Context, cmd *cobra.Command, args []string) error { 13 | identifier := "" 14 | if len(args) > 0 { 15 | identifier = args[0] 16 | } 17 | 18 | g, uid, err := common.GetGroup(ctx, identifier, c.Rig, c.Prompter) 19 | if err != nil { 20 | return err 21 | } 22 | 23 | _, err = c.Rig.Group().Delete(ctx, &connect.Request[group.DeleteRequest]{ 24 | Msg: &group.DeleteRequest{ 25 | GroupId: uid, 26 | }, 27 | }) 28 | if err != nil { 29 | return err 30 | } 31 | 32 | cmd.Printf("Group %s deleted\n", g.GetGroupId()) 33 | return nil 34 | } 35 | -------------------------------------------------------------------------------- /cmd/rig/cmd/project/create.go: -------------------------------------------------------------------------------- 1 | package project 2 | 3 | import ( 4 | "context" 5 | 6 | "github.com/spf13/cobra" 7 | ) 8 | 9 | func (c *Cmd) create(ctx context.Context, _ *cobra.Command, args []string) error { 10 | var id string 11 | if len(args) > 0 { 12 | id = args[0] 13 | } 14 | return c.Auth.CreateProject(ctx, id, &useProject) 15 | } 16 | -------------------------------------------------------------------------------- /cmd/rig/cmd/project/delete.go: -------------------------------------------------------------------------------- 1 | package project 2 | 3 | import ( 4 | "context" 5 | 6 | "connectrpc.com/connect" 7 | "github.com/rigdev/rig-go-api/api/v1/project" 8 | "github.com/spf13/cobra" 9 | ) 10 | 11 | func (c *Cmd) delete(ctx context.Context, cmd *cobra.Command, args []string) error { 12 | var projectID string 13 | if len(args) > 0 { 14 | projectID = args[0] 15 | } else { 16 | projectID = c.Scope.GetCurrentContext().GetProject() 17 | } 18 | 19 | req := &project.DeleteRequest{ 20 | ProjectId: projectID, 21 | } 22 | 23 | _, err := c.Rig.Project().Delete(ctx, &connect.Request[project.DeleteRequest]{Msg: req}) 24 | if err != nil { 25 | return err 26 | } 27 | 28 | cmd.Println("Successfully deleted project") 29 | return nil 30 | } 31 | -------------------------------------------------------------------------------- /cmd/rig/cmd/project/list.go: -------------------------------------------------------------------------------- 1 | package project 2 | 3 | import ( 4 | "context" 5 | "fmt" 6 | 7 | "connectrpc.com/connect" 8 | "github.com/jedib0t/go-pretty/v6/table" 9 | "github.com/rigdev/rig-go-api/api/v1/project" 10 | "github.com/rigdev/rig-go-api/model" 11 | "github.com/rigdev/rig/cmd/common" 12 | "github.com/rigdev/rig/cmd/rig/cmd/flags" 13 | "github.com/spf13/cobra" 14 | ) 15 | 16 | func (c *Cmd) list(ctx context.Context, cmd *cobra.Command, _ []string) error { 17 | req := &project.ListRequest{ 18 | Pagination: &model.Pagination{ 19 | Offset: uint32(offset), 20 | Limit: uint32(limit), 21 | }, 22 | } 23 | 24 | resp, err := c.Rig.Project().List(ctx, &connect.Request[project.ListRequest]{Msg: req}) 25 | if err != nil { 26 | return err 27 | } 28 | 29 | if flags.Flags.OutputType != common.OutputTypePretty { 30 | return common.FormatPrint(resp.Msg.GetProjects(), flags.Flags.OutputType) 31 | } 32 | 33 | t := table.NewWriter() 34 | t.AppendHeader(table.Row{fmt.Sprintf("Projects (%d)", resp.Msg.GetTotal()), "ID", "Created At"}) 35 | for i, p := range resp.Msg.GetProjects() { 36 | t.AppendRow(table.Row{i + 1, p.GetProjectId(), p.GetCreatedAt().AsTime().Format("2006-01-02 15:04:05")}) 37 | } 38 | cmd.Println(t.Render()) 39 | return nil 40 | } 41 | -------------------------------------------------------------------------------- /cmd/rig/cmd/role/delete.go: -------------------------------------------------------------------------------- 1 | package role 2 | 3 | import ( 4 | "context" 5 | 6 | "connectrpc.com/connect" 7 | "github.com/rigdev/rig-go-api/api/v1/role" 8 | "github.com/spf13/cobra" 9 | ) 10 | 11 | func (c *Cmd) delete(ctx context.Context, cmd *cobra.Command, args []string) error { 12 | roleID := "" 13 | if len(args) > 0 { 14 | roleID = args[0] 15 | } else { 16 | resp, err := c.Rig.Role().List(ctx, connect.NewRequest(&role.ListRequest{})) 17 | if err != nil { 18 | return err 19 | } 20 | 21 | var roleIDs []string 22 | for _, r := range resp.Msg.GetRoles() { 23 | roleIDs = append(roleIDs, r.GetRoleId()) 24 | } 25 | 26 | _, roleID, err = c.Prompter.Select("Select role to delete", roleIDs) 27 | if err != nil { 28 | return err 29 | } 30 | } 31 | 32 | if _, err := c.Rig.Role().Delete(ctx, connect.NewRequest(&role.DeleteRequest{ 33 | RoleId: roleID, 34 | })); err != nil { 35 | return err 36 | } 37 | 38 | cmd.Println("Deleted role:", roleID) 39 | return nil 40 | } 41 | -------------------------------------------------------------------------------- /cmd/rig/cmd/serviceaccount/create.go: -------------------------------------------------------------------------------- 1 | package serviceaccount 2 | 3 | import ( 4 | "context" 5 | 6 | "connectrpc.com/connect" 7 | "github.com/rigdev/rig-go-api/api/v1/service_account" 8 | "github.com/rigdev/rig/cmd/common" 9 | "github.com/spf13/cobra" 10 | ) 11 | 12 | func (c *Cmd) create(ctx context.Context, cmd *cobra.Command, args []string) error { 13 | var name string 14 | var err error 15 | if len(args) < 1 { 16 | name, err = c.Prompter.Input("Name:", common.ValidateNonEmptyOpt) 17 | if err != nil { 18 | return err 19 | } 20 | } else { 21 | name = args[0] 22 | } 23 | 24 | if role == "" { 25 | _, role, err = c.Prompter.Select("What is the role of the user?", 26 | []string{"admin", "owner", "developer", "viewer"}) 27 | if err != nil { 28 | return err 29 | } 30 | } 31 | 32 | resp, err := c.Rig.ServiceAccount().Create(ctx, &connect.Request[service_account.CreateRequest]{ 33 | Msg: &service_account.CreateRequest{ 34 | Name: name, 35 | InitialGroupId: role, 36 | }, 37 | }) 38 | if err != nil { 39 | return err 40 | } 41 | 42 | cmd.Print("Service Account created\n") 43 | cmd.Printf("ID: %s\n", resp.Msg.GetClientId()) 44 | cmd.Printf("Secret: %s\n", resp.Msg.GetClientSecret()) 45 | 46 | return nil 47 | } 48 | -------------------------------------------------------------------------------- /cmd/rig/cmd/serviceaccount/delete.go: -------------------------------------------------------------------------------- 1 | package serviceaccount 2 | 3 | import ( 4 | "context" 5 | 6 | "connectrpc.com/connect" 7 | "github.com/rigdev/rig-go-api/api/v1/service_account" 8 | "github.com/rigdev/rig/cmd/common" 9 | "github.com/rigdev/rig/pkg/uuid" 10 | "github.com/spf13/cobra" 11 | ) 12 | 13 | func (c *Cmd) delete(ctx context.Context, cmd *cobra.Command, args []string) error { 14 | var serviceAccountID string 15 | var err error 16 | 17 | if len(args) > 0 { 18 | serviceAccountID = args[0] 19 | } 20 | 21 | if serviceAccountID == "" { 22 | serviceAccountID, err = c.Prompter.Input("Service Account ID:", common.ValidateNonEmptyOpt) 23 | if err != nil { 24 | return err 25 | } 26 | } 27 | 28 | _, err = uuid.Parse(serviceAccountID) 29 | if err != nil { 30 | return err 31 | } 32 | 33 | _, err = c.Rig.ServiceAccount().Delete(ctx, &connect.Request[service_account.DeleteRequest]{ 34 | Msg: &service_account.DeleteRequest{ 35 | ServiceAccountId: serviceAccountID, 36 | }, 37 | }) 38 | if err != nil { 39 | return err 40 | } 41 | 42 | cmd.Println("Credential deleted") 43 | return nil 44 | } 45 | -------------------------------------------------------------------------------- /cmd/rig/cmd/serviceaccount/list.go: -------------------------------------------------------------------------------- 1 | package serviceaccount 2 | 3 | import ( 4 | "context" 5 | 6 | "connectrpc.com/connect" 7 | "github.com/jedib0t/go-pretty/v6/table" 8 | "github.com/rigdev/rig-go-api/api/v1/service_account" 9 | "github.com/rigdev/rig/cmd/common" 10 | "github.com/rigdev/rig/cmd/rig/cmd/flags" 11 | "github.com/spf13/cobra" 12 | ) 13 | 14 | func (c *Cmd) list(ctx context.Context, cmd *cobra.Command, _ []string) error { 15 | resp, err := c.Rig.ServiceAccount().List(ctx, &connect.Request[service_account.ListRequest]{ 16 | Msg: &service_account.ListRequest{}, 17 | }) 18 | if err != nil { 19 | return err 20 | } 21 | 22 | serviceAccounts := resp.Msg.GetServiceAccounts() 23 | 24 | if flags.Flags.OutputType != common.OutputTypePretty { 25 | return common.FormatPrint(serviceAccounts, flags.Flags.OutputType) 26 | } 27 | 28 | t := table.NewWriter() 29 | t.AppendHeader(table.Row{"Service Accounts", "Name", "ID", "ClientID"}) 30 | for i, cred := range serviceAccounts { 31 | t.AppendRow(table.Row{i + 1, cred.GetName(), cred.GetServiceAccountId(), cred.GetClientId()}) 32 | } 33 | 34 | cmd.Println(t.Render()) 35 | 36 | return nil 37 | } 38 | -------------------------------------------------------------------------------- /cmd/rig/cmd/settings/configuration.go: -------------------------------------------------------------------------------- 1 | package settings 2 | 3 | import ( 4 | "context" 5 | 6 | "connectrpc.com/connect" 7 | settings_api "github.com/rigdev/rig-go-api/api/v1/settings" 8 | "github.com/rigdev/rig/cmd/common" 9 | "github.com/rigdev/rig/cmd/rig/cmd/flags" 10 | "github.com/spf13/cobra" 11 | ) 12 | 13 | func (c *Cmd) configuration(ctx context.Context, _ *cobra.Command, _ []string) error { 14 | resp, err := c.Rig.Settings().GetConfiguration(ctx, connect.NewRequest(&settings_api.GetConfigurationRequest{})) 15 | if err != nil { 16 | return err 17 | } 18 | 19 | if flags.Flags.OutputType != common.OutputTypePretty { 20 | return common.FormatPrint(resp.Msg.GetConfiguration(), flags.Flags.OutputType) 21 | } 22 | 23 | return common.FormatPrint(resp.Msg.GetConfiguration(), common.OutputTypeYAML) 24 | } 25 | -------------------------------------------------------------------------------- /cmd/rig/cmd/settings/get.go: -------------------------------------------------------------------------------- 1 | package settings 2 | 3 | import ( 4 | "context" 5 | 6 | "connectrpc.com/connect" 7 | settings_api "github.com/rigdev/rig-go-api/api/v1/settings" 8 | "github.com/rigdev/rig/cmd/common" 9 | "github.com/rigdev/rig/cmd/rig/cmd/flags" 10 | "github.com/spf13/cobra" 11 | ) 12 | 13 | func (c *Cmd) get(ctx context.Context, cmd *cobra.Command, _ []string) error { 14 | resp, err := c.Rig.Settings().GetSettings(ctx, connect.NewRequest(&settings_api.GetSettingsRequest{})) 15 | if err != nil { 16 | return err 17 | } 18 | 19 | if resp.Msg.GetSettings() == nil { 20 | cmd.Println("No settings set") 21 | return nil 22 | } 23 | 24 | if flags.Flags.OutputType != common.OutputTypePretty { 25 | return common.FormatPrint(resp.Msg.GetSettings(), flags.Flags.OutputType) 26 | } 27 | 28 | return common.FormatPrint(resp.Msg.GetSettings(), common.OutputTypeYAML) 29 | } 30 | -------------------------------------------------------------------------------- /cmd/rig/cmd/user/delete.go: -------------------------------------------------------------------------------- 1 | package user 2 | 3 | import ( 4 | "context" 5 | 6 | "connectrpc.com/connect" 7 | "github.com/rigdev/rig-go-api/api/v1/user" 8 | "github.com/rigdev/rig/cmd/common" 9 | "github.com/spf13/cobra" 10 | ) 11 | 12 | func (c *Cmd) delete(ctx context.Context, cmd *cobra.Command, args []string) error { 13 | identifier := "" 14 | if len(args) > 0 { 15 | identifier = args[0] 16 | } 17 | _, id, err := common.GetUser(ctx, identifier, c.Rig, c.Prompter) 18 | if err != nil { 19 | return err 20 | } 21 | 22 | _, err = c.Rig.User().Delete(ctx, connect.NewRequest(&user.DeleteRequest{ 23 | UserId: id, 24 | })) 25 | if err != nil { 26 | return err 27 | } 28 | 29 | cmd.Printf("User deleted\n") 30 | return nil 31 | } 32 | -------------------------------------------------------------------------------- /cmd/rig/cmd/user/list.go: -------------------------------------------------------------------------------- 1 | package user 2 | 3 | import ( 4 | "context" 5 | "fmt" 6 | 7 | "connectrpc.com/connect" 8 | "github.com/jedib0t/go-pretty/v6/table" 9 | "github.com/rigdev/rig-go-api/api/v1/user" 10 | "github.com/rigdev/rig-go-api/model" 11 | "github.com/rigdev/rig/cmd/common" 12 | "github.com/rigdev/rig/cmd/rig/cmd/flags" 13 | "github.com/spf13/cobra" 14 | ) 15 | 16 | func (c *Cmd) list(ctx context.Context, cmd *cobra.Command, _ []string) error { 17 | req := &user.ListRequest{ 18 | Pagination: &model.Pagination{ 19 | Offset: uint32(offset), 20 | Limit: uint32(limit), 21 | }, 22 | } 23 | resp, err := c.Rig.User().List(ctx, &connect.Request[user.ListRequest]{Msg: req}) 24 | if err != nil { 25 | return err 26 | } 27 | 28 | if flags.Flags.OutputType != common.OutputTypePretty { 29 | return common.FormatPrint(resp.Msg.GetUsers(), flags.Flags.OutputType) 30 | } 31 | 32 | t := table.NewWriter() 33 | t.AppendHeader(table.Row{fmt.Sprintf("Users (%d)", resp.Msg.GetTotal()), "Identifier", "ID"}) 34 | for i, u := range resp.Msg.GetUsers() { 35 | t.AppendRow(table.Row{i + 1, u.GetPrintableName(), u.GetUserId()}) 36 | } 37 | cmd.Println(t.Render()) 38 | return nil 39 | } 40 | -------------------------------------------------------------------------------- /cmd/rig/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | 7 | "github.com/rigdev/rig/cmd/rig/cmd" 8 | "github.com/rigdev/rig/pkg/cli" 9 | "github.com/rigdev/rig/pkg/errors" 10 | "go.uber.org/dig" 11 | ) 12 | 13 | func main() { 14 | if err := cmd.Run(cli.StandardSetupContext); err != nil { 15 | fmt.Println(errors.MessageOf(dig.RootCause(err))) 16 | os.Exit(1) 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /configs/rig-operator-config.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: config.rig.dev/v1alpha1 2 | kind: OperatorConfig 3 | 4 | webhooksEnabled: true 5 | devModeEnabled: false 6 | leaderElectionEnabled: true 7 | -------------------------------------------------------------------------------- /deploy/charts/rig-operator/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *.orig 18 | *~ 19 | # Various IDEs 20 | .project 21 | .idea/ 22 | *.tmproj 23 | .vscode/ 24 | -------------------------------------------------------------------------------- /deploy/charts/rig-operator/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v2 2 | name: rig-operator 3 | description: rig-operator implements the controller logic for the Rig CRDs 4 | 5 | # A chart can be either an 'application' or a 'library' chart. 6 | # 7 | # Application charts are a collection of templates that can be packaged into versioned archives 8 | # to be deployed. 9 | # 10 | # Library charts provide useful utilities or functions for the chart developer. They're included as 11 | # a dependency of application charts to inject those utilities and functions into the rendering 12 | # pipeline. Library charts do not define any templates and therefore cannot be deployed. 13 | type: application 14 | 15 | # This is the chart version. This version number should be incremented each time you make changes 16 | # to the chart and its templates, including the app version. 17 | # Versions are expected to follow Semantic Versioning (https://semver.org/) 18 | version: 1.0.44 19 | 20 | # This is the version number of the application being deployed. This version number should be 21 | # incremented each time you make changes to the application. Versions are not expected to 22 | # follow Semantic Versioning. They should reflect the version the application is using. 23 | # It is recommended to use it with quotes. 24 | appVersion: "1.12.7" 25 | -------------------------------------------------------------------------------- /deploy/charts/rig-operator/templates/_config.tpl: -------------------------------------------------------------------------------- 1 | {{/* 2 | Render configfile 3 | */}} 4 | {{- define "rig-operator.config" -}} 5 | apiVersion: config.rig.dev/v1alpha1 6 | kind: OperatorConfig 7 | {{ .Values.config | toYaml }} 8 | {{- end }} 9 | -------------------------------------------------------------------------------- /deploy/charts/rig-operator/templates/apicheck/rbac.yaml: -------------------------------------------------------------------------------- 1 | {{- if and .Values.config.webhooksEnabled .Values.rbac.create -}} 2 | apiVersion: rbac.authorization.k8s.io/v1 3 | kind: Role 4 | metadata: 5 | name: {{ include "rig-operator.apicheck.fullname" . }} 6 | labels: {{ include "rig-operator.labels" . | nindent 4 }} 7 | annotations: 8 | helm.sh/hook: post-install,post-upgrade 9 | helm.sh/hook-delete-policy: before-hook-creation,hook-succeeded 10 | rules: 11 | - apiGroups: ["rig.dev"] 12 | resources: ["capsules"] 13 | verbs: ["create"] 14 | --- 15 | apiVersion: rbac.authorization.k8s.io/v1 16 | kind: RoleBinding 17 | metadata: 18 | name: {{ include "rig-operator.apicheck.fullname" . }} 19 | labels: {{ include "rig-operator.labels" . | nindent 4 }} 20 | annotations: 21 | helm.sh/hook: post-install,post-upgrade 22 | helm.sh/hook-delete-policy: before-hook-creation,hook-succeeded 23 | roleRef: 24 | apiGroup: rbac.authorization.k8s.io 25 | kind: Role 26 | name: {{ include "rig-operator.apicheck.fullname" . }} 27 | subjects: 28 | - kind: ServiceAccount 29 | name: {{ include "rig-operator.apicheck.serviceAccountName" . }} 30 | namespace: {{ .Release.Namespace }} 31 | {{- end -}} 32 | -------------------------------------------------------------------------------- /deploy/charts/rig-operator/templates/apicheck/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | {{- if and .Values.config.webhooksEnabled .Values.apicheck.serviceAccount.create -}} 2 | apiVersion: v1 3 | kind: ServiceAccount 4 | metadata: 5 | name: {{ include "rig-operator.apicheck.serviceAccountName" . }} 6 | labels: {{ include "rig-operator.labels" . | nindent 4 }} 7 | annotations: 8 | helm.sh/hook: post-install,post-upgrade 9 | helm.sh/hook-delete-policy: before-hook-creation,hook-succeeded 10 | {{- end -}} 11 | -------------------------------------------------------------------------------- /deploy/charts/rig-operator/templates/certgen/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | {{- if and .Values.config.webhooksEnabled .Values.certgen.serviceAccount.create (not .Values.certManager.enabled) -}} 2 | apiVersion: v1 3 | kind: ServiceAccount 4 | metadata: 5 | name: {{ include "rig-operator.certgen.serviceAccountName" . }} 6 | labels: {{ include "rig-operator.labels" . | nindent 4 }} 7 | annotations: 8 | helm.sh/hook: pre-install,pre-upgrade,post-install,post-upgrade 9 | helm.sh/hook-delete-policy: before-hook-creation,hook-succeeded 10 | {{- end -}} 11 | -------------------------------------------------------------------------------- /deploy/charts/rig-operator/templates/certificate.yaml: -------------------------------------------------------------------------------- 1 | {{- if and .Values.config.webhooksEnabled .Values.certManager.enabled -}} 2 | apiVersion: cert-manager.io/v1 3 | kind: Issuer 4 | metadata: 5 | name: {{ include "rig-operator.fullname" . }}-webhook 6 | labels: {{ include "rig-operator.labels" . | nindent 4 }} 7 | spec: 8 | selfSigned: {} 9 | --- 10 | apiVersion: cert-manager.io/v1 11 | kind: Certificate 12 | metadata: 13 | name: {{ include "rig-operator.fullname" . }}-webhook 14 | labels: {{ include "rig-operator.labels" . | nindent 4 }} 15 | spec: 16 | dnsNames: 17 | - {{ include "rig-operator.fullname" . }}.{{ .Release.Namespace }}.svc 18 | - {{ include "rig-operator.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local 19 | issuerRef: 20 | kind: Issuer 21 | name: {{ include "rig-operator.fullname" . }}-webhook 22 | secretName: {{ include "rig-operator.fullname" . }}-webhook-tls 23 | {{- end -}} 24 | -------------------------------------------------------------------------------- /deploy/charts/rig-operator/templates/clusterrolebinding.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.rbac.create -}} 2 | apiVersion: rbac.authorization.k8s.io/v1 3 | kind: ClusterRoleBinding 4 | metadata: 5 | name: {{ include "rig-operator.fullname" . }} 6 | labels: {{ include "rig-operator.labels" . | nindent 4 }} 7 | subjects: 8 | - kind: ServiceAccount 9 | name: {{ include "rig-operator.serviceAccountName" . }} 10 | namespace: {{ .Release.Namespace }} 11 | roleRef: 12 | kind: ClusterRole 13 | name: {{ include "rig-operator.fullname" . }} 14 | apiGroup: rbac.authorization.k8s.io 15 | {{- end -}} 16 | -------------------------------------------------------------------------------- /deploy/charts/rig-operator/templates/clusterrolebinding_platform.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.rbac.platform.create_token -}} 2 | apiVersion: rbac.authorization.k8s.io/v1 3 | kind: ClusterRoleBinding 4 | metadata: 5 | name: {{ .Values.rbac.platform.service_account }} 6 | labels: {{ include "rig-operator.labels" . | nindent 4 }} 7 | subjects: 8 | - kind: ServiceAccount 9 | name: {{ .Values.rbac.platform.service_account }} 10 | namespace: {{ .Release.Namespace }} 11 | roleRef: 12 | kind: ClusterRole 13 | name: {{ .Values.rbac.platform.service_account }} 14 | apiGroup: rbac.authorization.k8s.io 15 | {{- end -}} 16 | -------------------------------------------------------------------------------- /deploy/charts/rig-operator/templates/role.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.rbac.create -}} 2 | apiVersion: rbac.authorization.k8s.io/v1 3 | kind: Role 4 | metadata: 5 | name: {{ include "rig-operator.fullname" . }} 6 | labels: {{ include "rig-operator.labels" . | nindent 4 }} 7 | rules: 8 | - apiGroups: 9 | - coordination.k8s.io 10 | resources: 11 | - leases 12 | verbs: 13 | - "*" 14 | - apiGroups: 15 | - "" 16 | resources: 17 | - events 18 | verbs: 19 | - create 20 | - patch 21 | {{- end }} 22 | -------------------------------------------------------------------------------- /deploy/charts/rig-operator/templates/rolebinding.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.rbac.create -}} 2 | apiVersion: rbac.authorization.k8s.io/v1 3 | kind: RoleBinding 4 | metadata: 5 | name: {{ include "rig-operator.fullname" . }} 6 | labels: {{ include "rig-operator.labels" . | nindent 4 }} 7 | subjects: 8 | - kind: ServiceAccount 9 | name: {{ include "rig-operator.serviceAccountName" . }} 10 | namespace: {{ .Release.Namespace }} 11 | roleRef: 12 | kind: Role 13 | name: {{ include "rig-operator.fullname" . }} 14 | apiGroup: rbac.authorization.k8s.io 15 | {{- end -}} 16 | -------------------------------------------------------------------------------- /deploy/charts/rig-operator/templates/secret.yaml: -------------------------------------------------------------------------------- 1 | {{- if not .Values.secretName -}} 2 | apiVersion: v1 3 | kind: Secret 4 | metadata: 5 | name: {{ include "rig-operator.fullname" . }} 6 | labels: {{ include "rig-operator.labels" . | nindent 4 }} 7 | data: 8 | config.yaml: {{ include "rig-operator.config" . | b64enc }} 9 | {{- end -}} 10 | -------------------------------------------------------------------------------- /deploy/charts/rig-operator/templates/secret_platform.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.rbac.platform.create_token -}} 2 | apiVersion: v1 3 | kind: Secret 4 | metadata: 5 | name: {{ .Values.rbac.platform.service_account }} 6 | labels: {{ include "rig-operator.labels" . | nindent 4 }} 7 | annotations: 8 | kubernetes.io/service-account.name: {{ .Values.rbac.platform.service_account }} 9 | type: kubernetes.io/service-account-token 10 | {{- end -}} 11 | -------------------------------------------------------------------------------- /deploy/charts/rig-operator/templates/service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: {{ include "rig-operator.fullname" . }} 5 | labels: {{ include "rig-operator.labels" . | nindent 4 }} 6 | spec: 7 | type: ClusterIP 8 | ports: 9 | {{- if .Values.config.webhooksEnabled }} 10 | - name: webhooks 11 | port: 9443 12 | targetPort: webhooks 13 | protocol: TCP 14 | {{- end }} 15 | - name: grpc 16 | port: 9000 17 | targetPort: grpc 18 | protocol: TCP 19 | - name: metrics 20 | port: 8080 21 | targetPort: metrics 22 | protocol: TCP 23 | selector: {{ include "rig-operator.selectorLabels" . | nindent 4 }} 24 | -------------------------------------------------------------------------------- /deploy/charts/rig-operator/templates/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.serviceAccount.create -}} 2 | apiVersion: v1 3 | kind: ServiceAccount 4 | metadata: 5 | name: {{ include "rig-operator.serviceAccountName" . }} 6 | labels: {{ include "rig-operator.labels" . | nindent 4 }} 7 | {{- end }} 8 | -------------------------------------------------------------------------------- /deploy/charts/rig-operator/templates/serviceaccount_platform.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.rbac.platform.create_token -}} 2 | apiVersion: v1 3 | kind: ServiceAccount 4 | metadata: 5 | name: {{ .Values.rbac.platform.service_account }} 6 | labels: {{ include "rig-operator.labels" . | nindent 4 }} 7 | {{- end }} 8 | -------------------------------------------------------------------------------- /deploy/charts/rig-operator/templates/servicemonitor.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.serviceMonitor.enabled }} 2 | apiVersion: monitoring.coreos.com/v1 3 | kind: ServiceMonitor 4 | metadata: 5 | name: {{ include "rig-operator.fullname" . }} 6 | labels: 7 | {{- include "rig-operator.labels" . | nindent 4 }} 8 | {{- if .Values.serviceMonitor.labels }} 9 | {{ .Values.serviceMonitor.labels | toYaml }} 10 | {{- end }} 11 | spec: 12 | selector: 13 | matchLabels: {{- include "rig-operator.selectorLabels" . | nindent 6 }} 14 | endpoints: 15 | - port: metrics 16 | {{- end }} 17 | -------------------------------------------------------------------------------- /deploy/charts/rig-platform/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *.orig 18 | *~ 19 | # Various IDEs 20 | .project 21 | .idea/ 22 | *.tmproj 23 | .vscode/ 24 | -------------------------------------------------------------------------------- /deploy/charts/rig-platform/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v2 2 | name: rig-platform 3 | description: Rig application platform for Kubernetes. 4 | home: https://github.com/rigdev/rig 5 | 6 | # A chart can be either an 'application' or a 'library' chart. 7 | # 8 | # Application charts are a collection of templates that can be packaged into versioned archives 9 | # to be deployed. 10 | # 11 | # Library charts provide useful utilities or functions for the chart developer. They're included as 12 | # a dependency of application charts to inject those utilities and functions into the rendering 13 | # pipeline. Library charts do not define any templates and therefore cannot be deployed. 14 | type: application 15 | 16 | # This is the chart version. This version number should be incremented each time you make changes 17 | # to the chart and its templates, including the app version. 18 | # Versions are expected to follow Semantic Versioning (https://semver.org/) 19 | version: 1.0.70 20 | 21 | # This is the version number of the application being deployed. This version number should be 22 | # incremented each time you make changes to the application. Versions are not expected to 23 | # follow Semantic Versioning. They should reflect the version the application is using. 24 | # It is recommended to use it with quotes. 25 | appVersion: "1.6.26" 26 | -------------------------------------------------------------------------------- /deploy/charts/rig-platform/templates/NOTES.txt: -------------------------------------------------------------------------------- 1 | Rig installed and can be accessed by 2 | 3 | {{- if .Values.ingress.host }} 4 | Public URL: 5 | visit https://{{ .Values.ingress.host}} 6 | {{- end }} 7 | 8 | {{- if .Values.loadBalancer.enabled }} 9 | Kind: 10 | visit http://localhost:4747 11 | {{- else }} 12 | Port-forward: 13 | kubectl -n {{ .Release.Namespace }} port-forward svc/{{ include "rig-platform.fullname" . }} 4747 14 | visit http://localhost:4747 15 | {{- end }} 16 | 17 | -------------------------------------------------------------------------------- /deploy/charts/rig-platform/templates/clusterrolebinding.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.rbac.create -}} 2 | apiVersion: rbac.authorization.k8s.io/v1 3 | kind: ClusterRoleBinding 4 | metadata: 5 | name: {{ include "rig-platform.fullname" . }} 6 | labels: {{ include "rig-platform.labels" . | nindent 4 }} 7 | subjects: 8 | - kind: ServiceAccount 9 | name: {{ include "rig-platform.serviceAccountName" . }} 10 | namespace: {{ .Release.Namespace }} 11 | roleRef: 12 | kind: ClusterRole 13 | name: {{ include "rig-platform.fullname" . }} 14 | apiGroup: rbac.authorization.k8s.io 15 | {{- end -}} 16 | -------------------------------------------------------------------------------- /deploy/charts/rig-platform/templates/configmap.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: {{ include "rig-platform.fullname" . }}-config 5 | labels: {{ include "rig-platform.labels" . | nindent 4 }} 6 | data: 7 | config.yaml: | {{ include "rig-platform.config" . | nindent 4 }} 8 | -------------------------------------------------------------------------------- /deploy/charts/rig-platform/templates/postgres/secret.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.postgres.enabled -}} 2 | apiVersion: v1 3 | kind: Secret 4 | metadata: 5 | name: {{ include "rig-platform.fullname" . }}-postgres 6 | labels: {{ include "rig-platform.postgres.labels" . | nindent 4 }} 7 | data: 8 | POSTGRES_USER: {{ "postgres" | b64enc }} 9 | POSTGRES_PASSWORD: {{ "postgres" | b64enc }} 10 | POSTGRES_DB: {{ "rig" | b64enc }} 11 | {{- end -}} 12 | -------------------------------------------------------------------------------- /deploy/charts/rig-platform/templates/postgres/service.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.postgres.enabled }} 2 | apiVersion: v1 3 | kind: Service 4 | metadata: 5 | name: {{ include "rig-platform.fullname" . }}-postgres 6 | labels: {{ include "rig-platform.postgres.labels" . | nindent 4 }} 7 | spec: 8 | ports: 9 | - port: 5432 10 | targetPort: postgres 11 | protocol: TCP 12 | name: postgres 13 | selector: {{ include "rig-platform.postgres.selectorLabels" . | nindent 4 }} 14 | --- 15 | apiVersion: v1 16 | kind: Service 17 | metadata: 18 | name: {{ include "rig-platform.fullname" . }}-postgres-headless 19 | labels: {{ include "rig-platform.postgres.labels" . | nindent 4 }} 20 | spec: 21 | clusterIP: None 22 | ports: 23 | - port: 5432 24 | targetPort: postgres 25 | protocol: TCP 26 | name: postgres 27 | selector: {{ include "rig-platform.postgres.selectorLabels" . | nindent 4 }} 28 | {{- end }} 29 | -------------------------------------------------------------------------------- /deploy/charts/rig-platform/templates/service.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.loadBalancer.enabled -}} 2 | apiVersion: v1 3 | kind: Service 4 | metadata: 5 | name: rig-platform-load-balancer 6 | spec: 7 | type: NodePort 8 | selector: 9 | rig.dev/capsule: rig-platform 10 | ports: 11 | - name: http 12 | port: {{ .Values.port }} 13 | nodePort: {{ .Values.loadBalancer.nodePort }} 14 | targetPort: http 15 | {{- end }} 16 | -------------------------------------------------------------------------------- /deploy/charts/rig-platform/templates/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.serviceAccount.create -}} 2 | apiVersion: v1 3 | kind: ServiceAccount 4 | metadata: 5 | name: {{ include "rig-platform.serviceAccountName" . }} 6 | labels: {{ include "rig-platform.labels" . | nindent 4 }} 7 | {{- end }} 8 | -------------------------------------------------------------------------------- /deploy/charts/rig-platform/templates/tests/test-connection.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: "{{ include "rig-platform.fullname" . }}-test-connection" 5 | labels: 6 | {{- include "rig-platform.labels" . | nindent 4 }} 7 | annotations: 8 | "helm.sh/hook": test 9 | spec: 10 | containers: 11 | - name: wget 12 | image: busybox 13 | command: ['wget'] 14 | args: ['{{ include "rig-platform.fullname" . }}:{{ .Values.port }}'] 15 | restartPolicy: Never 16 | -------------------------------------------------------------------------------- /docs/.env: -------------------------------------------------------------------------------- 1 | SEGMENT_API_KEY=6hg2Pns6KKDV7j7xCmc9hlg8mroLjYYD -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | # Dependencies 2 | /node_modules 3 | 4 | # Production 5 | /build 6 | 7 | # Generated files 8 | .docusaurus 9 | .cache-loader 10 | 11 | # Misc 12 | .DS_Store 13 | .env.local 14 | .env.development.local 15 | .env.test.local 16 | .env.production.local 17 | 18 | npm-debug.log* 19 | yarn-debug.log* 20 | yarn-error.log* 21 | .vercel 22 | .vscode -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | # Website 2 | 3 | This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator. 4 | 5 | ### Installation 6 | 7 | ``` 8 | $ npm install 9 | ``` 10 | 11 | ### Local Development 12 | 13 | ``` 14 | $ npm run start 15 | ``` 16 | 17 | This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server. 18 | 19 | ### Build 20 | 21 | ``` 22 | $ npm run build 23 | ``` 24 | 25 | This command generates static content into the `build` directory and can be served using any static contents hosting service. 26 | 27 | ### Deployment 28 | Deploy to Vercel by pushing your commit or running: 29 | 30 | ``` 31 | vercel 32 | ``` -------------------------------------------------------------------------------- /docs/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [require.resolve('@docusaurus/core/lib/babel/preset')], 3 | }; 4 | -------------------------------------------------------------------------------- /docs/crd-ref-docs/config.yaml: -------------------------------------------------------------------------------- 1 | processor: 2 | # RE2 regular expressions describing types that should be excluded from the generated documentation. 3 | ignoreTypes: 4 | - "Capsule(List|Scale)$" 5 | - "(Capsule|Deployment)Status$" 6 | - "OwnedResource$" 7 | # RE2 regular expressions describing type fields that should be excluded from the generated documentation. 8 | ignoreFields: 9 | - "status$" 10 | - "scale$" 11 | - "TypeMeta$" 12 | 13 | render: 14 | # Version of Kubernetes to use when generating links to Kubernetes API documentation. 15 | kubernetesVersion: 1.28 16 | -------------------------------------------------------------------------------- /docs/crd-ref-docs/platform.yaml: -------------------------------------------------------------------------------- 1 | processor: {} 2 | # RE2 regular expressions describing types that should be excluded from the generated documentation. 3 | # ignoreTypes: 4 | # - "Capsule(List|Scale)$" 5 | # - "(Capsule|Deployment)Status$" 6 | # - "OwnedResource$" 7 | # # RE2 regular expressions describing type fields that should be excluded from the generated documentation. 8 | # ignoreFields: 9 | # - "status$" 10 | # - "scale$" 11 | # - "TypeMeta$" 12 | 13 | render: 14 | # Version of Kubernetes to use when generating links to Kubernetes API documentation. 15 | kubernetesVersion: 1.28 16 | -------------------------------------------------------------------------------- /docs/crd-ref-docs/templates/gv_details.tpl: -------------------------------------------------------------------------------- 1 | {{- define "gvDetails" -}} 2 | {{- $gv := . -}} 3 | 4 | # {{ $gv.GroupVersionString }} 5 | 6 | {{ $gv.Doc }} 7 | 8 | {{- if $gv.Kinds }} 9 | ## Resource Types 10 | {{- range $gv.SortedKinds }} 11 | - {{ $gv.TypeForKind . | markdownRenderTypeLink }} 12 | {{- end }} 13 | {{ end }} 14 | 15 | {{ range $gv.SortedTypes }} 16 | {{ template "type" . }} 17 | {{ end }} 18 | 19 | {{- end -}} 20 | -------------------------------------------------------------------------------- /docs/crd-ref-docs/templates/gv_list.tpl: -------------------------------------------------------------------------------- 1 | {{- define "gvList" -}} 2 | {{- $groupVersions := . -}} 3 | --- 4 | custom_edit_url: null 5 | --- 6 | 7 | {{ range $groupVersions }} 8 | {{ template "gvDetails" . }} 9 | {{ end }} 10 | 11 |
12 | 13 | 14 | :::info generated from source code 15 | This page is generated based on go source code. If you have suggestions for 16 | improvements for this page, please open an issue at 17 | [github.com/rigdev/rig](https://github.com/rigdev/rig/issues/new), or a pull 18 | request with changes to [the go source 19 | files](https://github.com/rigdev/rig/tree/main/pkg/api). 20 | ::: 21 | 22 | {{- end -}} 23 | -------------------------------------------------------------------------------- /docs/crd-ref-docs/templates/type.tpl: -------------------------------------------------------------------------------- 1 | {{- define "type" -}} 2 | {{- $type := . -}} 3 | {{- if markdownShouldRenderType $type -}} 4 | 5 | ### {{ $type.Name }} 6 | 7 | {{ if $type.IsAlias }}_Underlying type:_ _{{ markdownRenderTypeLink $type.UnderlyingType }}_{{ end }} 8 | 9 | {{ $type.Doc }} 10 | 11 | {{ if $type.References -}} 12 | _Appears in:_ 13 | {{- range $type.SortedReferences }} 14 | - {{ markdownRenderTypeLink . }} 15 | {{- end }} 16 | {{- end }} 17 | 18 | {{ if $type.Members -}} 19 | | Field | Description | 20 | | --- | --- | 21 | {{ if $type.GVK -}} 22 | | `apiVersion` _string_ | `{{ $type.GVK.Group }}/{{ $type.GVK.Version }}` 23 | | `kind` _string_ | `{{ $type.GVK.Kind }}` 24 | {{ end -}} 25 | 26 | {{ range $type.Members -}} 27 | | `{{ .Name }}` _{{ markdownRenderType .Type }}_ | {{ template "type_members" . }} | 28 | {{ end -}} 29 | 30 | {{ end -}} 31 | 32 | {{- end -}} 33 | {{- end -}} 34 | -------------------------------------------------------------------------------- /docs/crd-ref-docs/templates/type_members.tpl: -------------------------------------------------------------------------------- 1 | {{- define "type_members" -}} 2 | {{- $field := . -}} 3 | {{- if eq $field.Name "metadata" -}} 4 | Refer to Kubernetes API documentation for fields of `metadata`. 5 | {{- else -}} 6 | {{ markdownRenderFieldDoc $field.Doc }} 7 | {{- end -}} 8 | {{- end -}} 9 | -------------------------------------------------------------------------------- /docs/crd-ref-docs/v1alpha2-config.yaml: -------------------------------------------------------------------------------- 1 | processor: 2 | # RE2 regular expressions describing types that should be excluded from the generated documentation. 3 | ignoreTypes: 4 | - "(Capsule)List$" 5 | - "(Capsule|Deployment)Status$" 6 | - "OwnedResource$" 7 | # RE2 regular expressions describing type fields that should be excluded from the generated documentation. 8 | ignoreFields: 9 | - "status$" 10 | - "TypeMeta$" 11 | 12 | render: 13 | # Version of Kubernetes to use when generating links to Kubernetes API documentation. 14 | kubernetesVersion: 1.28 15 | -------------------------------------------------------------------------------- /docs/docs/additional-links.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | hide_table_of_contents: false 3 | show_last_update_author: false 4 | --- 5 | 6 | # Additional Links 7 | 8 | | Link | 9 | | ------------------------------ | 10 | | [API Reference of Rig Platform](https://buf.build/rigdev/rig) | 11 | 12 | -------------------------------------------------------------------------------- /docs/docs/api.mdx: -------------------------------------------------------------------------------- 1 | # API Reference 2 | 3 | For reference of each of our api groups see their documentation: 4 | - [config.rig.dev/v1alpha1](/api/config/v1alpha1) 5 | - [OperatorConfig](/api/config/v1alpha1#operatorconfig) 6 | - [PlatformConfig](/api/config/v1alpha1#platformconfig) 7 | - [platform.rig.dev/v1](/api/platformv1) 8 | - [Capsule](/api/platformv1#capsule) 9 | - [rig.dev/v1alpha1](/api/v1alpha1) 10 | - [Capsule](/api/v1alpha1#capsule) 11 | - [rig.dev/v1alpha2](/api/v1alpha2) 12 | - [Capsule](/api/v1alpha2#capsule) 13 | -------------------------------------------------------------------------------- /docs/docs/cluster.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 1 3 | hide_table_of_contents: true 4 | --- 5 | 6 | import GettingStarted from "../src/markdown/prerequisites/getting-started.md"; 7 | import Tabs from "@theme/Tabs"; 8 | import TabItem from "@theme/TabItem"; 9 | 10 | # Cluster Management 11 | 12 | Rig is most effective when combined with the [Rig CLI](/overview/guides/getting-started#install-the-rig-cli) for managing modules and infrastructure. 13 | To access the CLI, login is required, and to perform the login, admin users must be created first. 14 | In these docs, you will find information about how to execute admin commands to manage admin users. 15 | 16 | 17 | -------------------------------------------------------------------------------- /docs/docs/operator-manual/plugins/builtin.mdx: -------------------------------------------------------------------------------- 1 | # Builtin Plugins 2 | 3 | We have a list of builtin plugins which are always available in the operator. You can see a list of them here 4 | - [rigdev.annotations](builtin/annotations) 5 | - [rigdev.datadog](builtin/datadog) 6 | - [rigdev.env_mapping](builtin/env_mapping) 7 | - [rigdev.google_cloud_sql_auth_proxy](builtin/google_cloud_sql_auth_proxy) 8 | - [rigdev.init_container](builtin/init_container) 9 | - [rigdev.object_template](builtin/object_template) 10 | - [rigdev.object_create](builtin/object_create) 11 | - [rigdev.placement](builtin/placement) 12 | - [rigdev.sidecar](builtin/sidecar) 13 | -------------------------------------------------------------------------------- /docs/docs/operator-manual/plugins/builtin/argo_rollout.mdx: -------------------------------------------------------------------------------- 1 | # Argo Rollout Plugin 2 | 3 | TBD 4 | 5 | 6 | ## Config 7 | 8 | 9 | 10 | Configuration for the argo_rollout plugin 11 | 12 | | Field | Description | 13 | | --- | --- | 14 | | `strategy` _[RolloutStrategy](#rolloutstrategy)_ | | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /docs/docs/operator-manual/plugins/builtin/env_mapping.mdx: -------------------------------------------------------------------------------- 1 | ## Config 2 | -------------------------------------------------------------------------------- /docs/docs/operator-manual/plugins/builtin/init_container.mdx: -------------------------------------------------------------------------------- 1 | # Init Container Plugin 2 | 3 | The `rigdev.init_container` plugin adds an init container to the Capsule's deployment. 4 | 5 | The config can be templated with standard Go templating and has 6 | 7 | ``` 8 | .capsule 9 | ``` 10 | 11 | as its templating context. 12 | 13 | ## Example 14 | 15 | Config: 16 | 17 | ```yaml title="Helm values - Operator" 18 | config: 19 | pipeline: 20 | steps: 21 | - plugins: 22 | - plugin: rigdev.init_container 23 | config: | 24 | container: 25 | name: my-initcontainer 26 | image: my-container-image:v1.1 27 | ``` 28 | 29 | The resulting Deployment resource of the Capsule 30 | 31 | ``` 32 | kind: Deployment 33 | ... 34 | spec: 35 | template: 36 | spec: 37 | initContainers: 38 | - name: my-initcontainer 39 | image: my-container-image:v1.1 40 | ... 41 | ``` 42 | 43 | ## Config 44 | 45 | 46 | 47 | Configuration for the init_container plugin 48 | 49 | | Field | Description | 50 | | --- | --- | 51 | | `container` _[Container](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#container-v1-core)_ | Container holds the configuration for the init container | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /docs/docs/operator-manual/plugins/builtin/statefulset.mdx: -------------------------------------------------------------------------------- 1 | # Argo Rollout Plugin 2 | 3 | TBD 4 | 5 | 6 | ## Config 7 | 8 | 9 | 10 | Configuration for the argo_rollout plugin 11 | 12 | | Field | Description | 13 | | --- | --- | 14 | | `storageClass` _string_ | | 15 | | `size` _string_ | | 16 | | `mountPath` _string_ | | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /docs/docs/operator-manual/plugins/capsulesteps/cron_jobs.mdx: -------------------------------------------------------------------------------- 1 | # Cron Jobs Plugin 2 | 3 | The `rigdev.cron_jobs` plugin is the default plugin for handling the jobs specified in the `capsule spec` in the reconcilliation pipeline. For each job specified in the capsule spec, if the job is specified by a command, the plugin will create a cron job based on the container of the capsule deployment. Alternatively, if the job is specified by a URL, the plugin will create a cron job that will curl the URL. 4 | 5 | ## Config 6 | 7 | 8 | 9 | Configuration for the deployment plugin 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /docs/docs/operator-manual/plugins/capsulesteps/deployment.mdx: -------------------------------------------------------------------------------- 1 | # Deployment Plugin 2 | 3 | Default plugin for handling deployments in the reconcilliation pipeline. Another plugin can be specified in the `deploymentStep` in the pipeline in the operator config. 4 | The `rigdev.deployment` plugin will create a deployment for the capsule, and a service if the the capsule has interfaces defined. 5 | 6 | 7 | 8 | 9 | ## Config 10 | 11 | 12 | 13 | Configuration for the deployment plugin 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /docs/docs/operator-manual/plugins/capsulesteps/service_account.mdx: -------------------------------------------------------------------------------- 1 | # Service Account Plugin 2 | The `rigdev.service_account` plugin provides the default way of handling service accounts in the reconcilliation pipeline. It will create a service account with the name and namespace of the capsule. 3 | 4 | ## Config 5 | 6 | 7 | 8 | Configuration for the deployment plugin 9 | 10 | | Field | Description | 11 | | --- | --- | 12 | | `name` _string_ | Name of the service-account to generated. Supports templating, e.g.
`\{\{ .capsule.metadata.name \}\}-svcacc` | 13 | | `useExisting` _boolean_ | UseExisting will, if enabled, skip the creation of the service-account but
instead use an existing one, if it exists. | 14 | | `annotations` _object (keys:string, values:string)_ | Annotations to be added to all service accounts created. | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /docs/docs/operator-manual/plugins/capsulesteps/service_monitor.mdx: -------------------------------------------------------------------------------- 1 | # Service Monitor Plugin 2 | The `rigdev.service_monitor` plugin spawns a Prometheus ServiceMonitor per capsule 3 | for use with a Prometheus Operator stack. The service monitor will monitor services with the same name as the capsule and will use the endpoint specified by the `path` and `portName` fields in the configuration. 4 | 5 | ## Example 6 | Config: 7 | ```yaml title="Helm values - Operator" 8 | config: 9 | pipeline: 10 | serviceMonitorStep: 11 | plugin: "rigdev.service_monitor" 12 | config: | 13 | path: metrics 14 | portName: metricsport 15 | ``` 16 | 17 | ## Config 18 | 19 | 20 | 21 | Configuration for the deployment plugin 22 | 23 | | Field | Description | 24 | | --- | --- | 25 | | `Path` _string_ | | 26 | | `PortName` _string_ | | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /docs/docs/operator-manual/plugins/capsulesteps/vpa.mdx: -------------------------------------------------------------------------------- 1 | ## Vertical Pod Autoscaler Plugin 2 | BETA 3 | 4 | ## Config 5 | 6 | 7 | 8 | Configuration for the deployment plugin 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/docs/operator-manual/plugins/plugins.mdx: -------------------------------------------------------------------------------- 1 | # Plugins 2 | 3 | Plugins inject custom logic into the operator and is our way of extending the capability of a capsule with functionality not expressable throug the Capsule CRD. 4 | See [here](/operator-manual/setup-guide/operator/plugins) for how to configure the operator to execute plugins. 5 | 6 | Rig supplies a list of builtin plugins always available to the rig administrator. See [here](builtin) for a catalog. 7 | 8 | If none of the builtin plugins fit your needs, it is possible to write your own third-party plugins and inject them into the operator. You can find a guide for that [here](/operator-manual/plugins/thirdparty). 9 | -------------------------------------------------------------------------------- /docs/docs/operator-manual/setup-guide/platform/network.mdx: -------------------------------------------------------------------------------- 1 | # Networking 2 | 3 | You can configure the platform to spin up an Ingress resource so it can be reached from outside the cluster. This can be done through the `ingress` section of the [Helm values](https://github.com/rigdev/rig/blob/main/deploy/charts/rig-platform/values.yaml) of the platform. 4 | 5 | ```yaml title="Helm values - Platform" 6 | ingress: 7 | enabled: true 8 | host: rig.example.com 9 | ```` 10 | -------------------------------------------------------------------------------- /docs/docs/platform/config-files.mdx: -------------------------------------------------------------------------------- 1 | # Config Files 2 | 3 | Config Files are a convenient way of mapping plain-text files into the Container, at the given path. 4 | 5 | In the Kubernetes cluster, a Config File is mapped to a ConfigMap, that is read-only mounted into the Container at the path given. 6 | 7 | The Config File does not support hot-swapping - changes to a Config File results in new resources being generated and Capsule instances being restarted. 8 | 9 | ### Secrets 10 | 11 | If a Config File is marked as a secret, it will be created as a Secret in Kubernetes, rather than a ConfigMap. 12 | -------------------------------------------------------------------------------- /docs/docs/platform/custom-metrics.mdx: -------------------------------------------------------------------------------- 1 | # Custom Metrics Autoscaling 2 | 3 | The [Kubernetes Horizontal Pod Autoscaler](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/) also supports custom metrics and Rig can use that as well. 4 | Rig currently supports *Pod Metrics* and *Object Metrics*. Within the Rig ecosystem we call pod metrics for *Instance Metrics*. 5 | 6 | To use custom metrics, you need an observability stack installed in your Kubernetes cluster. See the [operator manual](/operator-manual/setup-guide/operator/autoscaler) for details. 7 | -------------------------------------------------------------------------------- /docs/plugin-ref-docs/config.yaml: -------------------------------------------------------------------------------- 1 | render: 2 | # Version of Kubernetes to use when generating links to Kubernetes API documentation. 3 | kubernetesVersion: 1.28 4 | -------------------------------------------------------------------------------- /docs/plugin-ref-docs/templates/gv_details.tpl: -------------------------------------------------------------------------------- 1 | {{- define "gvDetails" -}} 2 | {{- $gv := . -}} 3 | {{ range $gv.SortedTypes }} 4 | {{ template "type" . }} 5 | {{ end }} 6 | {{- end -}} 7 | -------------------------------------------------------------------------------- /docs/plugin-ref-docs/templates/gv_list.tpl: -------------------------------------------------------------------------------- 1 | {{- define "gvList" -}} 2 | ## Config 3 | {{ $groupVersions := . -}} 4 | {{- range $groupVersions -}} 5 | {{- template "gvDetails" . -}} 6 | {{- end -}} 7 | {{- end -}} 8 | -------------------------------------------------------------------------------- /docs/plugin-ref-docs/templates/type.tpl: -------------------------------------------------------------------------------- 1 | {{- define "type" -}} 2 | {{- $type := . -}} 3 | {{- if markdownShouldRenderType $type -}} 4 | {{- if ne $type.Name "Config" }} 5 | ### {{ $type.Name }} 6 | {{- end }} 7 | {{ if $type.IsAlias }}_Underlying type:_ _{{ markdownRenderTypeLink $type.UnderlyingType }}_{{ end }} 8 | {{ $type.Doc }} 9 | 10 | {{ if $type.Members -}} 11 | | Field | Description | 12 | | --- | --- | 13 | {{ range $type.Members -}} 14 | | `{{ .Name }}` _{{ markdownRenderType .Type }}_ | {{ template "type_members" . }} | 15 | {{ end -}} 16 | 17 | {{ end -}} 18 | 19 | {{- end -}} 20 | {{- end -}} 21 | -------------------------------------------------------------------------------- /docs/plugin-ref-docs/templates/type_members.tpl: -------------------------------------------------------------------------------- 1 | {{- define "type_members" -}} 2 | {{- $field := . -}} 3 | {{ markdownRenderFieldDoc $field.Doc }} 4 | {{- end -}} 5 | -------------------------------------------------------------------------------- /docs/src/components/DynamicBiIcon/index.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | import * as Icons from "react-icons/bi"; 4 | import * as SimpleIcons from "react-icons/si"; 5 | import * as TablerIcons from "react-icons/tb"; 6 | import * as AWSIcons from "react-icons/fa"; 7 | 8 | /* Your icon name from database data can now be passed as prop */ 9 | const DynamicBiIcon = ({ name, size }) => { 10 | let IconComponent = Icons[name]; 11 | if (!IconComponent) { 12 | IconComponent = SimpleIcons[name]; 13 | } 14 | if (!IconComponent) { 15 | IconComponent = TablerIcons[name]; 16 | } 17 | if (!IconComponent) { 18 | IconComponent = AWSIcons[name]; 19 | } 20 | if (!IconComponent) { 21 | // Return a default one 22 | return ; 23 | } 24 | 25 | return ; 26 | }; 27 | 28 | export default DynamicBiIcon; 29 | -------------------------------------------------------------------------------- /docs/src/components/HomepageFeatures/styles.module.css: -------------------------------------------------------------------------------- 1 | .features { 2 | display: flex; 3 | align-items: center; 4 | padding: 2rem 0; 5 | width: 100%; 6 | } 7 | 8 | .featureSvg { 9 | height: 200px; 10 | width: 200px; 11 | } 12 | -------------------------------------------------------------------------------- /docs/src/constants/versions.ts: -------------------------------------------------------------------------------- 1 | export const RIG_VERSION = "1.12.7"; 2 | export const RIG_OPERATOR_CHART_VERSION = "1.0.44"; 3 | export const RIG_PLATFORM_CHART_VERSION = "1.0.70"; 4 | -------------------------------------------------------------------------------- /docs/src/markdown/examples/examples.mdx: -------------------------------------------------------------------------------- 1 | import DocCardList from '@theme/DocCardList'; 2 | 3 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /docs/src/markdown/prerequisites/create-credential.md: -------------------------------------------------------------------------------- 1 | ### Create Credential 2 | Before proceeding, it is assumed that you have created your Rig Credential, which will be used for authentication purposes. If you haven't created your Rig Credential yet, please refer to the [Create Credential Guide](/service-accounts) for detailed instructions. -------------------------------------------------------------------------------- /docs/src/markdown/prerequisites/getting-started.md: -------------------------------------------------------------------------------- 1 | :::info Prerequisites 2 | Make sure that you have followed the steps to setup Rig through [the getting started guide](/overview/guides/getting-started). 3 | ::: -------------------------------------------------------------------------------- /docs/src/markdown/prerequisites/install-rig.md: -------------------------------------------------------------------------------- 1 | ### Install Rig 2 | To proceed with the instructions provided, it is assumed that you have already installed and set up a Rig backend. If you haven't done so yet, you can refer to the self-hosting guide, which provides step-by-step instructions for installing Rig on either [Docker](/docker) or [Kubernetes](/kubernetes). 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /docs/src/markdown/prerequisites/setup-cli.md: -------------------------------------------------------------------------------- 1 | ### Setup the CLI 2 | This section contains code snippets that demonstrate how to send requests to your Rig backend using Rig's CLI. If you intend to use the CLI examples, it is assumed that you have already installed [Rig’s CLI installed](/cli) and logged in using your dashboard user credentials. 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /docs/src/markdown/prerequisites/setup-sdk.md: -------------------------------------------------------------------------------- 1 | ### Setup the SDK 2 | This section provides code snippets that demonstrate how to send requests to your Rig backend using Rig's SDK. It is assumed that if you follow the SDK code blocks, you have already installed [Rig’s SDK](/sdks) and created a client instance. -------------------------------------------------------------------------------- /docs/src/markdown/sdk/sdks.mdx: -------------------------------------------------------------------------------- 1 | import DocCardList from "@theme/DocCardList"; 2 | 3 | 27 | -------------------------------------------------------------------------------- /docs/src/theme/Admonition/styles.module.css: -------------------------------------------------------------------------------- 1 | .admonition { 2 | margin-bottom: 1em; 3 | background-color: var(--ifm-color-emphasis-100); 4 | } 5 | 6 | .admonition a { 7 | color: var(--ifm-color-emphasis-700); 8 | } 9 | 10 | .admonitionHeading { 11 | font: var(--ifm-heading-font-weight) var(--ifm-h5-font-size) / 12 | var(--ifm-heading-line-height) var(--ifm-heading-font-family); 13 | text-transform: uppercase; 14 | margin-bottom: 0.3rem; 15 | color: var(--ifm-color-emphasis-900); 16 | } 17 | 18 | .admonitionHeading code { 19 | text-transform: none; 20 | } 21 | 22 | .admonitionIcon { 23 | display: inline-block; 24 | vertical-align: middle; 25 | margin-right: 0.4em; 26 | } 27 | 28 | .admonitionIcon svg { 29 | display: inline-block; 30 | height: 1.6em; 31 | width: 1.6em; 32 | fill: var(--ifm-alert-foreground-color); 33 | } 34 | 35 | .admonitionContent > :last-child { 36 | margin-bottom: 0; 37 | color: var(--ifm-color-emphasis-700); 38 | } 39 | -------------------------------------------------------------------------------- /docs/src/theme/CodeBlock/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import CodeBlock from '@theme-original/CodeBlock'; 3 | import type CodeBlockType from '@theme/CodeBlock'; 4 | import type {WrapperProps} from '@docusaurus/types'; 5 | 6 | type Props = WrapperProps; 7 | 8 | export default function CodeBlockWrapper(props: Props): JSX.Element { 9 | return ( 10 | <> 11 | 12 | 13 | ); 14 | } 15 | -------------------------------------------------------------------------------- /docs/src/theme/DocCard/styles.module.css: -------------------------------------------------------------------------------- 1 | .cardContainer { 2 | --ifm-link-color: var(--ifm-color-emphasis-800); 3 | --ifm-link-hover-color: var(--ifm-color-emphasis-700); 4 | --ifm-link-hover-decoration: none; 5 | 6 | box-shadow: none; 7 | border: 1px solid var(--ifm-color-emphasis-200); 8 | 9 | background-color: var(--ifm-color-emphasis-100); 10 | 11 | margin-right: 0; 12 | margin-left: 0; 13 | 14 | 15 | box-shadow: 0 1.5px 3px 0 rgb(0 0 0 / 15%); 16 | border: 1px solid var(--ifm-color-emphasis-200); 17 | transition: all var(--ifm-transition-fast) ease; 18 | transition-property: border, box-shadow; 19 | } 20 | 21 | .cardContainer:hover { 22 | border-color: var(--ifm-color-emphasis-600); 23 | box-shadow: 0 3px 6px 0 rgb(0 0 0 / 20%); 24 | } 25 | 26 | .cardContainer *:last-child { 27 | margin-bottom: 0; 28 | } 29 | 30 | .cardTitle { 31 | font-weight: 00 !important; 32 | font-size: 16px !important; 33 | color: var(--ifm-color-primary); 34 | } 35 | 36 | .cardDescription { 37 | font-weight: 400 !important; 38 | font-size: 14px !important; 39 | color: var(--ifm-color-emphasis-600); 40 | } 41 | 42 | .cardIcon { 43 | margin-bottom: 10px; 44 | } 45 | -------------------------------------------------------------------------------- /docs/src/theme/DocCardList/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import clsx from 'clsx'; 3 | import { 4 | useCurrentSidebarCategory, 5 | filterDocCardListItems, 6 | } from '@docusaurus/plugin-content-docs/client'; 7 | import DocCard from '@theme/DocCard'; 8 | function DocCardListForCurrentSidebarCategory({className}) { 9 | const category = useCurrentSidebarCategory(); 10 | return ; 11 | } 12 | export default function DocCardList(props) { 13 | const {items, className} = props; 14 | if (!items) { 15 | return ; 16 | } 17 | const filteredItems = filterDocCardListItems(items); 18 | return ( 19 |
20 | {filteredItems.map((item, index) => ( 21 |
22 | 23 |
24 | ))} 25 |
26 | ); 27 | } 28 | -------------------------------------------------------------------------------- /docs/src/theme/DocItem/Footer/styles.module.css: -------------------------------------------------------------------------------- 1 | .lastUpdated { 2 | margin-top: 0.2rem; 3 | font-style: italic; 4 | font-size: smaller; 5 | } 6 | 7 | @media (min-width: 997px) { 8 | .lastUpdated { 9 | text-align: right; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /docs/src/theme/DocItem/Layout/styles.module.css: -------------------------------------------------------------------------------- 1 | .docItemContainer header + *, 2 | .docItemContainer article > *:first-child { 3 | margin-top: 0; 4 | } 5 | 6 | @media (min-width: 997px) { 7 | .docItemCol { 8 | max-width: 75% !important; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /docs/src/theme/DocItem/Metadata/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {PageMetadata} from '@docusaurus/theme-common'; 3 | import {useDoc} from '@docusaurus/plugin-content-docs/client'; 4 | export default function DocItemMetadata() { 5 | const {metadata, frontMatter, assets} = useDoc(); 6 | return ( 7 | 13 | ); 14 | } 15 | -------------------------------------------------------------------------------- /docs/src/theme/DocItem/Paginator/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {useDoc} from '@docusaurus/plugin-content-docs/client'; 3 | import DocPaginator from '@theme/DocPaginator'; 4 | /** 5 | * This extra component is needed, because should remain generic. 6 | * DocPaginator is used in non-docs contexts too: generated-index pages... 7 | */ 8 | export default function DocItemPaginator() { 9 | const {metadata} = useDoc(); 10 | return ; 11 | } 12 | -------------------------------------------------------------------------------- /docs/src/theme/DocItem/TOC/Desktop/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {ThemeClassNames} from '@docusaurus/theme-common'; 3 | import {useDoc} from '@docusaurus/plugin-content-docs/client'; 4 | import TOC from '@theme/TOC'; 5 | export default function DocItemTOCDesktop() { 6 | const {toc, frontMatter} = useDoc(); 7 | return ( 8 | 14 | ); 15 | } 16 | -------------------------------------------------------------------------------- /docs/src/theme/DocItem/TOC/Mobile/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import clsx from 'clsx'; 3 | import {ThemeClassNames} from '@docusaurus/theme-common'; 4 | import {useDoc} from '@docusaurus/plugin-content-docs/client'; 5 | import TOCCollapsible from '@theme/TOCCollapsible'; 6 | import styles from './styles.module.css'; 7 | export default function DocItemTOCMobile() { 8 | const {toc, frontMatter} = useDoc(); 9 | return ( 10 | 16 | ); 17 | } 18 | -------------------------------------------------------------------------------- /docs/src/theme/DocItem/TOC/Mobile/styles.module.css: -------------------------------------------------------------------------------- 1 | @media (min-width: 997px) { 2 | /* Prevent hydration FOUC, as the mobile TOC needs to be server-rendered */ 3 | .tocMobile { 4 | display: none; 5 | } 6 | } 7 | 8 | @media print { 9 | .tocMobile { 10 | display: none; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /docs/src/theme/DocItem/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {HtmlClassNameProvider} from '@docusaurus/theme-common'; 3 | import {DocProvider} from '@docusaurus/plugin-content-docs/client'; 4 | import DocItemMetadata from '@theme/DocItem/Metadata'; 5 | import DocItemLayout from '@theme/DocItem/Layout'; 6 | export default function DocItem(props) { 7 | const docHtmlClassName = `docs-doc-id-${props.content.metadata.id}`; 8 | const MDXComponent = props.content; 9 | return ( 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | ); 19 | } 20 | -------------------------------------------------------------------------------- /docs/src/theme/DocRoot/Layout/Main/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import clsx from 'clsx'; 3 | import {useDocsSidebar} from '@docusaurus/plugin-content-docs/client'; 4 | import styles from './styles.module.css'; 5 | export default function DocRootLayoutMain({hiddenSidebarContainer, children}) { 6 | const sidebar = useDocsSidebar(); 7 | return ( 8 |
13 |
19 | {children} 20 |
21 |
22 | ); 23 | } 24 | -------------------------------------------------------------------------------- /docs/src/theme/DocRoot/Layout/Main/styles.module.css: -------------------------------------------------------------------------------- 1 | .docMainContainer { 2 | display: flex; 3 | max-width: var(--doc-content-width); 4 | } 5 | 6 | @media (min-width: 1400px) { 7 | .docMainContainer { 8 | flex-grow: 1; 9 | width: calc(var(--doc-content-width) - var(--doc-sidebar-width)); 10 | } 11 | 12 | .docMainContainerEnhanced { 13 | width: calc(var(--doc-content-width) - var(--doc-sidebar-hidden-width)); 14 | } 15 | 16 | .docItemWrapperEnhanced { 17 | width: calc( 18 | var(--ifm-container-width) + var(--doc-sidebar-width) 19 | ) !important; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /docs/src/theme/DocRoot/Layout/Sidebar/ExpandButton/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {translate} from '@docusaurus/Translate'; 3 | import IconArrow from '@theme/Icon/Arrow'; 4 | import styles from './styles.module.css'; 5 | export default function DocRootLayoutSidebarExpandButton({toggleSidebar}) { 6 | return ( 7 |
25 | 26 |
27 | ); 28 | } 29 | -------------------------------------------------------------------------------- /docs/src/theme/DocRoot/Layout/Sidebar/ExpandButton/styles.module.css: -------------------------------------------------------------------------------- 1 | @media (min-width: 997px) { 2 | .expandButton { 3 | position: absolute; 4 | top: 0; 5 | right: 0; 6 | width: 100%; 7 | height: 100%; 8 | display: flex; 9 | align-items: center; 10 | justify-content: center; 11 | transition: background-color var(--ifm-transition-fast) ease; 12 | background-color: var(--docusaurus-collapse-button-bg); 13 | } 14 | 15 | .expandButton:hover, 16 | .expandButton:focus { 17 | background-color: var(--docusaurus-collapse-button-bg-hover); 18 | } 19 | 20 | .expandButtonIcon { 21 | transform: rotate(0); 22 | } 23 | 24 | [dir='rtl'] .expandButtonIcon { 25 | transform: rotate(180deg); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /docs/src/theme/DocRoot/Layout/Sidebar/styles.module.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --doc-sidebar-width: 300px; 3 | --doc-content-width: 1400px; 4 | --doc-sidebar-hidden-width: 30px; 5 | } 6 | 7 | .docSidebarContainer { 8 | display: none; 9 | } 10 | 11 | @media (min-width: 997px) { 12 | .docSidebarContainer { 13 | display: block; 14 | width: var(--doc-sidebar-width); 15 | margin-top: calc(-1 * var(--ifm-navbar-height)); 16 | border-right: 1px solid var(--ifm-toc-border-color); 17 | will-change: width; 18 | transition: width var(--ifm-transition-fast) ease; 19 | clip-path: inset(0); 20 | } 21 | 22 | .docSidebarContainerHidden { 23 | width: var(--doc-sidebar-hidden-width); 24 | cursor: pointer; 25 | } 26 | 27 | .sidebarViewport { 28 | top: 0; 29 | position: sticky; 30 | height: 100%; 31 | max-height: 100vh; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /docs/src/theme/DocRoot/Layout/index.js: -------------------------------------------------------------------------------- 1 | import React, {useState} from 'react'; 2 | import {useDocsSidebar} from '@docusaurus/plugin-content-docs/client'; 3 | import BackToTopButton from '@theme/BackToTopButton'; 4 | import DocRootLayoutSidebar from '@theme/DocRoot/Layout/Sidebar'; 5 | import DocRootLayoutMain from '@theme/DocRoot/Layout/Main'; 6 | import styles from './styles.module.css'; 7 | export default function DocRootLayout({children}) { 8 | const sidebar = useDocsSidebar(); 9 | const [hiddenSidebarContainer, setHiddenSidebarContainer] = useState(false); 10 | return ( 11 |
12 | 13 |
14 | {sidebar && ( 15 | 20 | )} 21 | 22 | {children} 23 | 24 |
25 |
26 | ); 27 | } 28 | -------------------------------------------------------------------------------- /docs/src/theme/DocRoot/Layout/styles.module.css: -------------------------------------------------------------------------------- 1 | .docRoot { 2 | display: flex; 3 | width: 100%; 4 | } 5 | 6 | .docsWrapper { 7 | display: inline-block; 8 | flex: 1 0 auto; 9 | margin: 0 auto; 10 | } 11 | -------------------------------------------------------------------------------- /docs/src/theme/DocSidebarItem/Html/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import clsx from 'clsx'; 3 | import {ThemeClassNames} from '@docusaurus/theme-common'; 4 | import styles from './styles.module.css'; 5 | export default function DocSidebarItemHtml({item, level, index}) { 6 | const {value, defaultStyle, className} = item; 7 | return ( 8 |
  • 19 | ); 20 | } 21 | -------------------------------------------------------------------------------- /docs/src/theme/DocSidebarItem/Html/styles.module.css: -------------------------------------------------------------------------------- 1 | @media (min-width: 997px) { 2 | .menuHtmlItem { 3 | padding: var(--ifm-menu-link-padding-vertical) 4 | var(--ifm-menu-link-padding-horizontal); 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /docs/src/theme/DocSidebarItem/Link/styles.module.css: -------------------------------------------------------------------------------- 1 | .menuExternalLink { 2 | align-items: center; 3 | } 4 | -------------------------------------------------------------------------------- /docs/src/theme/DocSidebarItem/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import DocSidebarItemCategory from '@theme/DocSidebarItem/Category'; 3 | import DocSidebarItemLink from '@theme/DocSidebarItem/Link'; 4 | import DocSidebarItemHtml from '@theme/DocSidebarItem/Html'; 5 | export default function DocSidebarItem({item, ...props}) { 6 | switch (item.type) { 7 | case 'category': 8 | return ; 9 | case 'html': 10 | return ; 11 | case 'link': 12 | default: 13 | return ; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /docs/src/theme/EditThisPage/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {ThemeClassNames} from '@docusaurus/theme-common'; 3 | import Button from '../../components/Button'; 4 | export default function EditThisPage({editUrl}) { 5 | return ( 6 | 11 | 16 | 17 | ); 18 | } 19 | -------------------------------------------------------------------------------- /docs/src/theme/Footer/Logo/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import clsx from 'clsx'; 3 | import Link from '@docusaurus/Link'; 4 | import {useBaseUrlUtils} from '@docusaurus/useBaseUrl'; 5 | import ThemedImage from '@theme/ThemedImage'; 6 | import styles from './styles.module.css'; 7 | function LogoImage({logo}) { 8 | const {withBaseUrl} = useBaseUrlUtils(); 9 | const sources = { 10 | light: withBaseUrl(logo.src), 11 | dark: withBaseUrl(logo.srcDark ?? logo.src), 12 | }; 13 | return ( 14 | 22 | ); 23 | } 24 | export default function FooterLogo({logo}) { 25 | return logo.href ? ( 26 | 30 | 31 | 32 | ) : ( 33 | 34 | ); 35 | } 36 | -------------------------------------------------------------------------------- /docs/src/theme/Footer/Logo/styles.module.css: -------------------------------------------------------------------------------- 1 | .footerLogoLink { 2 | opacity: 0.5; 3 | transition: opacity var(--ifm-transition-fast) 4 | var(--ifm-transition-timing-default); 5 | } 6 | 7 | .footerLogoLink:hover { 8 | opacity: 1; 9 | } 10 | -------------------------------------------------------------------------------- /docs/src/theme/Footer/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Footer from '@theme-original/Footer'; 3 | 4 | export default function FooterWrapper(props) { 5 | return ( 6 | <> 7 |