Skip to content

admin: add a new admin backend to yank and unyank crates #6811

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

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,7 @@ export SENTRY_ENV_API=local
# export TEST_S3_INDEX_REGION=http://127.0.0.1:19000
# export TEST_AWS_ACCESS_KEY=minio
# export TEST_AWS_SECRET_KEY=miniominio

# IDs of GitHub users that are admins on this instance, separated by commas.
# Whitespace will be ignored.
export GH_ADMIN_USER_IDS=
127 changes: 127 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ indicatif = "=0.17.5"
ipnetwork = "=0.20.0"
tikv-jemallocator = { version = "=0.5.0", features = ['unprefixed_malloc_on_supported_platforms', 'profiling'] }
lettre = { version = "=0.10.4", default-features = false, features = ["file-transport", "smtp-transport", "native-tls", "hostname", "builder"] }
minijinja = "=1.0.4"
minijinja = { version = "=1.0.4", features = ["loader"] }
minijinja-autoreload = "=1.0.4"
moka = { version = "=0.11.2", features = ["future"] }
oauth2 = { version = "=4.4.1", default-features = false, features = ["reqwest"] }
object_store = { version = "=0.6.1", features = ["aws"] }
Expand All @@ -75,6 +76,7 @@ rand = "=0.8.5"
reqwest = { version = "=0.11.18", features = ["blocking", "gzip", "json"] }
retry = "=2.0.0"
ring = "=0.16.20"
rust-embed = "=6.8.1"
scheduled-thread-pool = "=0.2.7"
secrecy = "=0.8.0"
semver = { version = "=1.0.17", features = ["serde"] }
Expand Down
56 changes: 56 additions & 0 deletions admin/templates/base.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>
{% block title %}

{% endblock %}:: crates.io
</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
rel="stylesheet"
integrity="sha384-KK94CHFLLe+nY2dmCWGMq91rCGa5gtU4mk92HdvYe+M/SXH301p5ILy+dN9+nJOZ"
crossorigin="anonymous" />
<link rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css"
integrity="sha384-LrVLJJYk9OiJmjNDakUBU7kS9qCT8wk1j2OU7ncpsfB3QS37UPdkCuq3ZD1MugNY"
crossorigin="anonymous" />
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
integrity="sha384-ENjdO4Dr2bkBIFxQpeoTz1HIcje39Wm4jDKdf19U8gI4ddQ3GYNS7NTKfAdVQSZe"
crossorigin="anonymous"></script>
{% block head %}

{% endblock %}
</head>

<body>
<nav class="navbar sticky-top navbar-expand-lg bg-dark"
data-bs-theme="dark">
<div class="container-fluid">
<a class="navbar-brand" href="/admin/">crates.io admin</a>
<button class="navbar-toggler"
type="button"
data-bs-toggle="collapse"
data-bs-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent"
aria-expanded="false"
aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link" href="/admin/crates/">Recent uploads</a>
</li>
</ul>
</div>
</div>
</nav>
<div class="container">
{% block content %}

{% endblock %}
</div>
</body>
</html>
Loading