Skip to content

Deploy to production #2177

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jul 28, 2025
4 changes: 2 additions & 2 deletions locales/core.ftl
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
-security-at-rust-lang-org-anchor = { EMAIL("[email protected]") }
-rust-security-team-key-href =
/static/keys/rust-security-team-key.gpg.ascii
-rust-pgp-key-mit-keyserver-href =
https://pgp.mit.edu/pks/lookup?op=vindex&search=0xEFB9860AE7520DAC"
-wikipedia-rfpolicy-href =
https://en.wikipedia.org/wiki/RFPolicy

Expand All @@ -20,6 +18,8 @@
https://groups.google.com/forum/#!forum/rustlang-security-announcements
-rust-security-announcements-mailing-list-href =
https://groups.google.com/group/rustlang-security-announcements/subscribe
-rust-security-supported-channels-href =
https://doc.rust-lang.org/book/appendix-07-nightly-rust.html
-rustlang-security-announcements-subscribe-anchor =
<a href="mailto:[email protected]">[email protected]</a>
-distros-openwall-email-anchor =
Expand Down
21 changes: 10 additions & 11 deletions locales/en-US/security.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ policies-security-page-title = Security policy

security-reporting-heading = Reporting
security-reporting-link = email { ENGLISH("[email protected]") }
security-reporting-description--2022-01 =
security-reporting-description--2025-07 =
<p>Safety is one of the core principles of Rust, and to that end, we would like to ensure that Rust has a secure implementation. Thank you for taking the time to responsibly disclose any issues you find.</p>
<p>All security bugs in the Rust distribution should be reported by email to { -security-at-rust-lang-org-anchor }. This list is delivered to a small security team. Your email will be acknowledged within 24 hours, and you’ll receive a more detailed response to your email within 48 hours indicating the next steps in handling your report. If you would like, you can encrypt your report using <a href="{ -rust-security-team-key-href }">our public key</a>. This key is also <a href="{ -rust-pgp-key-mit-keyserver-href }">On MIT’s keyserver</a> and <a href="#security-pgp-key">reproduced below</a>.</p>
<p>All security bugs in the Rust distribution should be reported by email to { -security-at-rust-lang-org-anchor }. This list is delivered to a small security team. Your email will be acknowledged within 24 hours, and you’ll receive a more detailed response to your email within 48 hours indicating the next steps in handling your report.</p>
<p>This email address receives a large amount of spam, so be sure to use a descriptive subject line to avoid having your report be missed. After the initial reply to your report, the security team will endeavor to keep you informed of the progress being made towards a fix and full announcement. As recommended by <a href="{ -wikipedia-rfpolicy-href }">RFPolicy</a>, these updates will be sent at least every five days. In reality, this is more likely to be every 24-48 hours.</p>
<p>If you have not received a reply to your email within 48 hours, or have not heard from the security team for the past five days, there are a few steps you can take (in order):</p>
<ul>
Expand Down Expand Up @@ -63,20 +63,19 @@ security-scope--2025-04 =
<p>If you have doubts on whether something falls within our scope, <a href="mailto:[email protected]">please reach out</a> and we will provide guidance.</p>

security-disclosure-heading = Disclosure policy
security-disclosure-description =
security-disclosure-description--2025-07 =
<p>The Rust project has a 5 step disclosure process.</p>
<ol>
<li>The security report is received and is assigned a primary handler. This person will coordinate the fix and release process.</li>
<li>The problem is confirmed and a list of all affected versions is determined.</li>
<li>The problem is confirmed, the affected versions are identified, and relevant domain experts from relevant Rust teams are involved.</li>
<li>Code is audited to find any potential similar problems.</li>
<li>Fixes are prepared for all releases which are still under maintenance. These fixes are not committed to the public repository but rather held locally pending the announcement.</li>
<li>On the embargo date, the <a href="{ -rustlang-security-announcements-google-groups-forum-href }"> Rust security mailing list</a> is sent a copy of the announcement. The changes are pushed to the public repository and new builds are deployed to rust-lang.org. Within 6 hours of the mailing list being notified, a copy of the advisory will be published on the Rust blog.</li>
<li>Fixes are prepared for all supported release branches, and a CVE number is reserved. These fixes are not committed to the public repository but rather held in private repositories pending the announcement. These fixes are reviewed privately using the same review process of public changes.</li>
<li>On the embargo date, a copy of the announcement is sent to the <a href="{ -rustlang-security-announcements-google-groups-forum-href }"> Rust security mailing list</a> and posted on the Rust blog. The changes are pushed to the public repository and the release process is started. Within an hour, full details are published in the CVE database</li>
</ol>
<p>This process can take some time, especially when coordination is required with maintainers of other projects. Every effort will be made to handle the bug in as timely a manner as possible, however it’s important that we follow the release process above to ensure that the disclosure is handled in a consistent manner.</p>

security-receiving-heading = Receiving security updates
security-receiving-description =
<p>The best way to receive all the security announcements is to subscribe to the <a href="{ -rust-security-announcements-mailing-list-href }">Rust security announcements mailing list</a> (alternatively by sending an email to { -rustlang-security-announcements-subscribe-anchor }). The mailing list is very low traffic, and it receives the public notifications the moment the embargo is lifted.</p>
<p>We will announce vulnerabilities 72 hours before the embargo is lifted to { -distros-openwall-email-anchor }, so that Linux distributions can update their packages.</p>

security-pgp-key-heading = Plaintext PGP key
security-receiving-description--2025-07 =
<p>The best way to receive all the security announcements is to subscribe to the <a href="{ -rust-security-announcements-mailing-list-href }">Rust security announcements mailing list</a> (alternatively by sending an email to { -rustlang-security-announcements-subscribe-anchor }). The mailing list is very low traffic, and it receives the public notifications the moment the embargo is lifted. Announcements on the mailing list are signed with the <a href="{{ -rust-security-team-key-href }}">Rust's security key</a>.</p>
<p>The Rust project only provides support and security updates for the most recent stable release and the latest releases in our <a href="{ -rust-security-supported-channels-href }">beta and nightly channels</a>. As Rust releases must be built in the public, we will begin the release process as soon as the embargo lifts, and a release blog post will be published once updated binaries are available for download.</p>
<p>When a vulnerability affects software distributions, we will announce vulnerabilities 72 hours before the embargo is lifted to { -distros-openwall-email-anchor }, so that distributions can update their packages when the embargo lifts.</p>
2 changes: 1 addition & 1 deletion src/category.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ impl<'r> FromParam<'r> for Category {
if is_category(&url) {
Ok(Category { name: url })
} else {
Err(format!("No category called <{}>", url))
Err(format!("No category called <{url}>"))
}
}
}
4 changes: 2 additions & 2 deletions src/i18n.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ fn add_bundle_functions(bundle: &mut FluentBundle<&'static FluentResource>) {
Some(FluentValue::String(s)) => s,
_ => return FluentValue::None,
};
FluentValue::String(format!("<a href='mailto:{0}' lang='en-US'>{0}</a>", email).into())
FluentValue::String(format!("<a href='mailto:{email}' lang='en-US'>{email}</a>").into())
})
.expect("could not add function");

Expand All @@ -32,7 +32,7 @@ fn add_bundle_functions(bundle: &mut FluentBundle<&'static FluentResource>) {
Some(FluentValue::String(s)) => s,
_ => return FluentValue::None,
};
FluentValue::String(format!("<span lang='en-US'>{0}</span>", text).into())
FluentValue::String(format!("<span lang='en-US'>{text}</span>").into())
})
.expect("could not add function");
}
Expand Down
16 changes: 8 additions & 8 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ fn baseurl(lang: &str) -> String {
if lang == "en-US" {
String::new()
} else {
format!("/{}", lang)
format!("/{lang}")
}
}

Expand Down Expand Up @@ -274,13 +274,13 @@ fn hash_css(css: &str) -> String {
}

fn compile_sass(filename: &str) -> String {
let scss_file = format!("./src/styles/{}.scss", filename);
let scss_file = format!("./src/styles/{filename}.scss");

let css = compile_file(&scss_file, Options::default())
.unwrap_or_else(|_| panic!("couldn't compile sass: {}", &scss_file));

let css_sha = format!("{}_{}", filename, hash_css(&css));
let css_file = format!("./static/styles/{}.css", css_sha);
let css_file = format!("./static/styles/{css_sha}.css");

fs::write(&css_file, css.into_bytes())
.unwrap_or_else(|_| panic!("couldn't write css file: {}", &css_file));
Expand All @@ -291,7 +291,7 @@ fn compile_sass(filename: &str) -> String {
fn concat_vendor_css(files: Vec<&str>) -> String {
let mut concatted = String::new();
for filestem in files {
let vendor_path = format!("./static/styles/{}.css", filestem);
let vendor_path = format!("./static/styles/{filestem}.css");
let contents = fs::read_to_string(vendor_path).expect("couldn't read vendor css");
concatted.push_str(&contents);
}
Expand All @@ -307,7 +307,7 @@ fn concat_vendor_css(files: Vec<&str>) -> String {
fn concat_app_js(files: Vec<&str>) -> String {
let mut concatted = String::new();
for filestem in files {
let vendor_path = format!("./static/scripts/{}.js", filestem);
let vendor_path = format!("./static/scripts/{filestem}.js");
let contents = fs::read_to_string(vendor_path).expect("couldn't read app js");
concatted.push_str(&contents);
}
Expand Down Expand Up @@ -354,7 +354,7 @@ async fn render_governance(
Ok(Template::render(page, context))
}
Err(err) => {
eprintln!("error while loading the governance page: {}", err);
eprintln!("error while loading the governance page: {err}");
Err(Status::InternalServerError)
}
}
Expand All @@ -377,7 +377,7 @@ async fn render_team(
if err.is::<teams::TeamNotFound>() {
Err(Status::NotFound)
} else {
eprintln!("error while loading the team page: {}", err);
eprintln!("error while loading the team page: {err}");
Err(Status::InternalServerError)
}
}
Expand All @@ -392,7 +392,7 @@ fn render_subject(category: Category, subject: &str, lang: String) -> Result<Tem
// To work around the problem we check whether the template exists beforehand.
let path = Path::new("templates")
.join(category.name())
.join(format!("{}.html.hbs", subject));
.join(format!("{subject}.html.hbs"));
if !path.is_file() {
return Err(Status::NotFound);
}
Expand Down
4 changes: 2 additions & 2 deletions src/redirect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,10 @@ pub(crate) fn maybe_redirect(path: Path) -> Option<Redirect> {
if let Some((_, dest)) = EXTERNAL_REDIRECTS.iter().find(|(src, _)| *src == path) {
Some(Redirect::permanent(*dest))
} else if let Some((_, dest)) = PAGE_REDIRECTS.iter().find(|(src, _)| *src == path) {
let dest = format!("/{}", dest);
let dest = format!("/{dest}");
match locale {
Locale::Present("en-US") | Locale::NotSpecified => Some(Redirect::permanent(dest)),
Locale::Present(locale) => Some(Redirect::permanent(format!("/{}{}", locale, dest))),
Locale::Present(locale) => Some(Redirect::permanent(format!("/{locale}{dest}"))),
Locale::SpecifiedButMissing => Some(Redirect::temporary(dest)),
}
} else {
Expand Down
6 changes: 3 additions & 3 deletions src/teams.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ impl Cached for RustTeams {
self.1
}
async fn fetch() -> Result<Self, Box<dyn Error + Send + Sync>> {
let resp: Teams = reqwest::get(format!("{}/teams.json", BASE_URL))
let resp: Teams = reqwest::get(format!("{BASE_URL}/teams.json"))
.await?
.error_for_status()?
.json()
Expand Down Expand Up @@ -332,8 +332,8 @@ mod tests {
],
alumni: Vec::new(),
website_data: Some(TeamWebsite {
name: format!("Team {}", name),
description: format!("Description of {}", name),
name: format!("Team {name}"),
description: format!("Description of {name}"),
page: name.into(),
email: None,
repo: None,
Expand Down
8 changes: 4 additions & 4 deletions templates/components/footer.html.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@
<h4>{{fluent "footer-social"}}</h4>
<div class="flex flex-row flex-wrap items-center">
<a rel="me" href="https://social.rust-lang.org/@rust" target="_blank"><img src="/static/images/mastodon.svg"
alt="{{fluent " mastodon"}}" title="{{fluent " mastodon"}}" /></a>
alt="{{fluent "mastodon"}}" title="{{fluent "mastodon"}}" /></a>
<a rel="me" href="https://bsky.app/profile/rust-lang.org" target="_blank"><img
src="/static/images/bluesky.svg" alt="{{fluent " bluesky"}}" title="{{fluent " bluesky"}}" /></a>
src="/static/images/bluesky.svg" alt="{{fluent "bluesky"}}" title="{{fluent "bluesky"}}" /></a>
<a href="https://www.youtube.com/channel/UCaYhcUwRBNscFNUKTjgPFiA" target="_blank"><img class="pv2"
src="/static/images/youtube.svg" alt="{{fluent " footer-alt-youtube"}}" title="YouTube" /></a>
src="/static/images/youtube.svg" alt="{{fluent "footer-alt-youtube"}}" title="YouTube" /></a>
<a href="https://github.com/rust-lang" target="_blank"><img src="/static/images/github.svg" alt="github logo"
title="{{fluent " footer-github-alt"}}" /></a>
title="{{fluent "footer-github-alt"}}" /></a>
</div>
</div>

Expand Down
Loading