Giter Club home page Giter Club logo

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.

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.

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).

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.

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.