GithubHelp home page GithubHelp logo

isabella232 / simpleinfra Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rust-lang/simpleinfra

0.0 0.0 0.0 1.28 MB

Rust Infrastructure automation

License: MIT License

Shell 5.64% Rust 3.53% Dockerfile 0.07% Python 11.65% HCL 74.77% JavaScript 4.34%

simpleinfra's Introduction

Simpleinfra

This repository containing the tools and automation written by the Rust infrastructure team to manage our services. Using some of the tools in this repo require privileges only infra team members have.

The contents of this repository are released under the MIT license.

restart-rcs

The restart-rcs.sh script redeploys rust-central-station by pulling the latest container image and recreating the container on the server. You need to have SSH access to the server (the script tries to log into the rcs.rust-lang.org host) and AWS credentials locally to pull the image from ECR.

setup-deploy-keys

Using Personal Access Tokens to upload to GitHub pages from CI is not great from a security point of view, as it's not possible to scope those access tokens to just that repository. Deploy keys are properly scoped, but it can be an hassle to generate and configure them.

The setup-deploy-keys tool automates most of that process. You need to setup your GitHub token in the GITHUB_TOKEN environment variable, and then run:

cargo run --bin setup-deploy-keys org-name/repo-name

The tool will generate a key, upload it to GitHub and then print an environment variable GITHUB_DEPLOY_KEY containing an encoded representation of the private key. It will also try to add the key to Travis CI if you have the TRAVIS_TOKEN variable set to your Travis CI API token.

To use the key the easiest way is to cd into the directory you want to deploy, download this rust program, compile and run it (with the GITHUB_DEPLOY_KEY variable set). There are importable configuration snippets available for Azure Pipelines and Travis CI.

By default the tool generates ed25519 keys, but some libraries (like git2) don't support them yet. In those cases you can generate RSA keys by passing the --rsa flag:

cargo run --bin setup-deploy-keys org-name/repo-name --rsa

with-rust-key

The with-rust-key.sh script executes a command inside a gpg environment configured to use the Rust release signing key, without actually storing the key on disk. The key is fetched at runtime from the 1password sensitive vault, and you need to have jq and the 1password CLI installed.

For example, to create a git tag for the Rust 2.0.0 release you can use:

./with-rust-key.sh gpg tag -u FA1BE5FE 2.0.0 stable

The script is designed to leave no traces of the key on the host system after it finishes, but a program with your user's privileges can still interact with the key as long as the script is running.

simpleinfra's People

Contributors

aidanhs avatar alexcrichton avatar dependabot[bot] avatar gnzlbg avatar mark-simulacrum avatar mat1g3r avatar nellshamrell avatar pepoviola avatar pietroalbini avatar quietmisdreavus avatar smarnach avatar technetos avatar xampprocky avatar xanewok avatar zexbe avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.