Skip to content

Commit

Permalink
consolidate asset hosts
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Dec 11, 2023
1 parent 7a38020 commit 02f69ff
Show file tree
Hide file tree
Showing 13 changed files with 32 additions and 33 deletions.
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ finch run -ti --rm ubuntu
apt update -y
apt install -y gpg sudo wget curl
sudo install -dm 755 /etc/apt/keyrings
wget -qO - https://rtx.pub/gpg-key.pub | gpg --dearmor | sudo tee /etc/apt/keyrings/rtx-archive-keyring.gpg 1> /dev/null
echo "deb [signed-by=/etc/apt/keyrings/rtx-archive-keyring.gpg arch=arm64] https://rtx.pub/deb stable main" | sudo tee /etc/apt/sources.list.d/rtx.list
wget -qO - https://rtx.jdx.dev/gpg-key.pub | gpg --dearmor | sudo tee /etc/apt/keyrings/rtx-archive-keyring.gpg 1> /dev/null
echo "deb [signed-by=/etc/apt/keyrings/rtx-archive-keyring.gpg arch=arm64] https://rtx.jdx.dev/deb stable main" | sudo tee /etc/apt/sources.list.d/rtx.list
apt update
apt install -y rtx
rtx -V
Expand All @@ -127,7 +127,7 @@ rtx -V
```shell
finch run -ti --rm amazonlinux
yum install -y yum-utils
yum-config-manager --add-repo https://rtx.pub/rpm/rtx.repo
yum-config-manager --add-repo https://rtx.jdx.dev/rpm/rtx.repo
yum install -y rtx
rtx -v
```
Expand All @@ -137,7 +137,7 @@ rtx -v
```shell
finch run -ti --rm fedora
dnf install -y dnf-plugins-core
dnf config-manager --add-repo https://rtx.pub/rpm/rtx.repo
dnf config-manager --add-repo https://rtx.jdx.dev/rpm/rtx.repo
dnf install -y rtx
rtx -v
```
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Note that calling `which node` gives us a real path to node, not a shim.
Install rtx on macOS (other methods [here](#installation)):

```sh-session
$ curl https://rtx.pub/rtx-latest-macos-arm64 > ~/bin/rtx
$ curl https://rtx.jdx.dev/rtx-latest-macos-arm64 > ~/bin/rtx
$ chmod +x ~/bin/rtx
$ rtx --version
rtx 2023.12.21
Expand Down Expand Up @@ -252,22 +252,22 @@ Note that it isn't necessary for `rtx` to be on `PATH`. If you run the activate
file, rtx will automatically add itself to `PATH`.

```
curl https://rtx.pub/install.sh | sh
curl https://rtx.jdx.dev/install.sh | sh
```

If you want to verify the install script hasn't been tampered with:

```
gpg --keyserver hkps://keyserver.ubuntu.com --recv-keys 0x29DDE9E0
curl https://rtx.pub/install.sh.sig | gpg --decrypt > install.sh
curl https://rtx.jdx.dev/install.sh.sig | gpg --decrypt > install.sh
# ensure the above is signed with the rtx release key
sh ./install.sh
```

or if you're allergic to `| sh`:

```
curl https://rtx.pub/rtx-latest-macos-arm64 > /usr/local/bin/rtx
curl https://rtx.jdx.dev/rtx-latest-macos-arm64 > /usr/local/bin/rtx
```

It doesn't matter where you put it. So use `~/bin`, `/usr/local/bin`, `~/.local/share/rtx/bin/rtx`
Expand Down Expand Up @@ -367,8 +367,8 @@ For installation on Ubuntu/Debian:

```
sudo install -dm 755 /etc/apt/keyrings
wget -qO - https://rtx.pub/gpg-key.pub | gpg --dearmor | sudo tee /etc/apt/keyrings/rtx-archive-keyring.gpg 1> /dev/null
echo "deb [signed-by=/etc/apt/keyrings/rtx-archive-keyring.gpg arch=amd64] https://rtx.pub/deb stable main" | sudo tee /etc/apt/sources.list.d/rtx.list
wget -qO - https://rtx.jdx.dev/gpg-key.pub | gpg --dearmor | sudo tee /etc/apt/keyrings/rtx-archive-keyring.gpg 1> /dev/null
echo "deb [signed-by=/etc/apt/keyrings/rtx-archive-keyring.gpg arch=amd64] https://rtx.jdx.dev/deb stable main" | sudo tee /etc/apt/sources.list.d/rtx.list
sudo apt update
sudo apt install -y rtx
```
Expand All @@ -378,7 +378,7 @@ sudo apt install -y rtx
> If you're on arm64 you'll need to run the following:
>
> ```
> echo "deb [signed-by=/etc/apt/keyrings/rtx-archive-keyring.gpg arch=arm64] https://rtx.pub/deb stable main" | sudo tee /etc/apt/sources.list.d/rtx.list
> echo "deb [signed-by=/etc/apt/keyrings/rtx-archive-keyring.gpg arch=arm64] https://rtx.jdx.dev/deb stable main" | sudo tee /etc/apt/sources.list.d/rtx.list
> ```
</details>
Expand All @@ -389,7 +389,7 @@ For Fedora, CentOS, Amazon Linux, RHEL and other dnf-based distributions:
```
dnf install -y dnf-plugins-core
dnf config-manager --add-repo https://rtx.pub/rpm/rtx.repo
dnf config-manager --add-repo https://rtx.jdx.dev/rpm/rtx.repo
dnf install -y rtx
```
Expand All @@ -399,7 +399,7 @@ dnf install -y rtx
```
yum install -y yum-utils
yum-config-manager --add-repo https://rtx.pub/rpm/rtx.repo
yum-config-manager --add-repo https://rtx.jdx.dev/rpm/rtx.repo
yum install -y rtx
```
Expand Down Expand Up @@ -1500,7 +1500,7 @@ jobs:
build:
steps:
- run: |
curl https://rtx.pub/install.sh | sh
curl https://rtx.jdx.dev/install.sh | sh
echo "$HOME/.local/share/rtx/bin" >> $GITHUB_PATH
echo "$HOME/.local/share/rtx/shims" >> $GITHUB_PATH
```
Expand Down
9 changes: 4 additions & 5 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@ the project. I only select dependencies with broad usage across the Rust communi
I'm open to PRs or suggestions on reducing dependency count even at the cost of functionality because it will make
rtx more secure.

## rtx.pub
## rtx.jdx.dev

rtx.pub is the asset host for rtx. It's used to host precompiled rtx CLI binaries, and hosts a "[VERSION](https://rtx.pub/VERSION)"
which rtx uses to occasionally check for a new version being released. Currently this is hosted with a mix
of 3 different vendors for CDN, assets, and domain registration. This will be brought down to a single vendor
to reduce the surface area for security reasons.
rtx.jdx.dev is the asset host for rtx. It's used to host precompiled rtx CLI binaries, and hosts a "[VERSION](https://rtx.jdx.dev/VERSION)"
which rtx uses to occasionally check for a new version being released. Everything hosted there uses a single
vendor to reduce surface area.

## rtx plugins

Expand Down
2 changes: 1 addition & 1 deletion docs/demo.tape
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Set Width 1200
Set Height 600
Set Padding 10

Type "http rtx.pub/rtx-latest-macos-arm64 > ~/bin/rtx" Enter Sleep 2s
Type "http rtx.jdx.dev/rtx-latest-macos-arm64 > ~/bin/rtx" Enter Sleep 2s
Type "chmod +x ~/bin/rtx" Sleep 1s Enter Sleep 1s
Type "rtx -v" Sleep 1s Enter Sleep 1s
Type 'eval "$(rtx activate bash)"' Sleep 1s Enter Sleep 2s
Expand Down
8 changes: 4 additions & 4 deletions packaging/homebrew/homebrew.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@ class Rtx < Formula

on_macos do
if Hardware::CPU.intel?
url "https://rtx.pub/v$RTX_VERSION/rtx-v$RTX_VERSION-macos-x64.tar.xz"
url "https://rtx.jdx.dev/v$RTX_VERSION/rtx-v$RTX_VERSION-macos-x64.tar.xz"
sha256 "$RTX_CHECKSUM_MACOS_X86_64"
end
if Hardware::CPU.arm?
url "https://rtx.pub/v$RTX_VERSION/rtx-v$RTX_VERSION-macos-arm64.tar.xz"
url "https://rtx.jdx.dev/v$RTX_VERSION/rtx-v$RTX_VERSION-macos-arm64.tar.xz"
sha256 "$RTX_CHECKSUM_MACOS_ARM64"
end
end

on_linux do
if Hardware::CPU.arm? && Hardware::CPU.is_64_bit?
url "https://rtx.pub/v$RTX_VERSION/rtx-v$RTX_VERSION-linux-arm64.tar.xz"
url "https://rtx.jdx.dev/v$RTX_VERSION/rtx-v$RTX_VERSION-linux-arm64.tar.xz"
sha256 "$RTX_CHECKSUM_LINUX_ARM64"
end
if Hardware::CPU.intel?
url "https://rtx.pub/v$RTX_VERSION/rtx-v$RTX_VERSION-linux-x64.tar.xz"
url "https://rtx.jdx.dev/v$RTX_VERSION/rtx-v$RTX_VERSION-linux-x64.tar.xz"
sha256 "$RTX_CHECKSUM_LINUX_X86_64"
end
end
Expand Down
4 changes: 2 additions & 2 deletions packaging/rpm/rtx.repo
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[rtx-repo]
name=RTX Repo
baseurl=https://rtx.pub/rpm
baseurl=https://rtx.jdx.dev/rpm
enabled=1
gpgcheck=1
gpgkey=http://rtx.pub/gpg-key.pub
gpgkey=http://rtx.jdx.dev/gpg-key.pub
2 changes: 1 addition & 1 deletion schema/rtx.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://rtx.pub/schema/rtx.json",
"$id": "https://rtx.jdx.dev/schema/rtx.json",
"title": "rtx",
"description": "config file for rtx version manager (.rtx.toml)",
"type": "object",
Expand Down
2 changes: 1 addition & 1 deletion schema/rtx.plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://rtx.pub/schema/rtx.plugin.json",
"$id": "https://rtx.jdx.dev/schema/rtx.plugin.json",
"title": "rtx-plugin",
"description": "config file for an rtx plugin",
"type": "object",
Expand Down
2 changes: 1 addition & 1 deletion scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ gpg -u 408B88DB29DDE9E0 --output "$RELEASE_DIR"/install.sh.sig --sign "$RELEASE_
if [[ "$DRY_RUN" != 1 ]]; then
NPM_PREFIX=@jdxcode/rtx ./rtx/scripts/release-npm.sh
NPM_PREFIX=rtx-cli ./rtx/scripts/release-npm.sh
#AWS_S3_BUCKET=rtx.pub ./rtx/scripts/publish-s3.sh
#AWS_S3_BUCKET=rtx.jdx.dev ./rtx/scripts/publish-s3.sh
./rtx/scripts/publish-r2.sh
fi

Expand Down
2 changes: 1 addition & 1 deletion src/cli/doctor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ impl Doctor {

if !config.is_activated() && !shims_on_path() {
let cmd = style("rtx help activate").yellow().for_stderr();
let url = style("https://rtx.pub").underlined().for_stderr();
let url = style("https://rtx.jdx.dev").underlined().for_stderr();
let shims = style(dirs::SHIMS.display()).cyan().for_stderr();
checks.push(formatdoc!(
r#"rtx is not activated, run {cmd} or
Expand Down
2 changes: 1 addition & 1 deletion src/cli/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ fn get_latest_version_call() -> Option<String> {
#[cfg(not(test))]
fn get_latest_version_call() -> Option<String> {
let timeout = Duration::from_secs(3);
const URL: &str = "http://rtx.pub/VERSION";
const URL: &str = "http://rtx.jdx.dev/VERSION";
debug!("checking rtx version from {}", URL);
let client = crate::http::Client::new_with_timeout(timeout).ok()?;
match client.get_text(URL) {
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/core/java.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ impl JavaPlugin {

fn download_java_metadata(&self, release_type: &str) -> Result<Vec<JavaMetadata>> {
let url = format!(
"https://java.rtx.pub/metadata/{}/{}/{}.json",
"https://rtx-java-metadata.jdx.dev/metadata/{}/{}/{}.json",
release_type,
os(),
arch()
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/core/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ impl NodePlugin {
fn fetch_remote_versions_from_rtx(&self) -> Result<Vec<String>> {
let versions = self
.http
.get_text("http://metadata.rtx.pub/versions/node")?
.get_text("http://rtx-versions.jdx.dev/node")?
.lines()
.map(|v| v.trim().to_string())
.filter(|v| !v.is_empty())
Expand Down

0 comments on commit 02f69ff

Please sign in to comment.