Compare commits

..

No commits in common. "dev" and "fix-ci" have entirely different histories.
dev ... fix-ci

5 changed files with 46 additions and 30 deletions

View File

@ -24,6 +24,9 @@ steps:
secrets: secrets:
- minio_access_key - minio_access_key
- minio_secret_key - minio_secret_key
when:
branch: dev
event: push
publish-rel: publish-rel:
image: 'curlimages/curl' image: 'curlimages/curl'

View File

@ -25,19 +25,3 @@ steps:
when: when:
branch: dev branch: dev
event: push event: push
release:
image: 'woodpeckerci/plugin-docker-buildx'
secrets:
- 'docker_username'
- 'docker_password'
settings:
registry: 'git.rustybever.be'
repo: 'git.rustybever.be/chewing_bever/rieter'
auto_tag: true
platforms: [ 'linux/amd64' ]
build_args_from_env:
- 'CI_COMMIT_SHA'
mtu: 1300
when:
event: tag

View File

@ -7,15 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased](https://git.rustybever.be/Chewing_Bever/rieter/src/branch/dev) ## [Unreleased](https://git.rustybever.be/Chewing_Bever/rieter/src/branch/dev)
## [0.1.0](https://git.rustybever.be/Chewing_Bever/rieter/src/tag/0.1.0)
### Added ### Added
* Functional repository server * Server
* Supports any number of repositories, grouped into distros, each * Functional repository server
supporting any number of architectures * Serve packages from any number of repositories & architectures
* Publish packages to and delete packages from repositories using HTTP
requests
* Packages of architecture "any" are part of every architecture's
database
* Bearer authentication for private routes
* REST API
* Repository & package information available using JSON REST API * Repository & package information available using JSON REST API
* Queueing system with configurable number of workers for resilient
concurrency
* TOML configuration file
* SQLite & Postgres support

View File

@ -24,8 +24,7 @@ COPY . .
RUN curl \ RUN curl \
--fail \ --fail \
-o rieterd \ -o rieterd \
"https://s3.rustybever.be/rieter/commits/${CI_COMMIT_SHA}/rieterd-$(echo "${TARGETPLATFORM}" | sed 's:/:-:g')" && \ "https://s3.rustybever.be/rieter/commits/${CI_COMMIT_SHA}/rieterd-$(echo "${TARGETPLATFORM}" | sed 's:/:-:g')"
chmod +x rieterd
FROM alpine:3.19 FROM alpine:3.19

View File

@ -5,7 +5,7 @@ use axum::{
extract::{Path, State}, extract::{Path, State},
http::{Request, StatusCode}, http::{Request, StatusCode},
response::IntoResponse, response::IntoResponse,
routing::{delete, get, post}, routing::{delete, post},
Router, Router,
}; };
use futures::TryStreamExt; use futures::TryStreamExt;
@ -27,7 +27,12 @@ pub fn router(api_key: &str) -> Router<crate::Global> {
) )
// Routes added after the layer do not get that layer applied, so the GET requests will not // Routes added after the layer do not get that layer applied, so the GET requests will not
// be authorized // be authorized
.route("/:distro/:repo/:arch/:filename", get(get_file)) .route(
"/:distro/:repo/:arch/:filename",
delete(delete_package)
.route_layer(ValidateRequestHeaderLayer::bearer(api_key))
.get(get_file),
)
} }
/// Serve the package archive files and database archives. If files are requested for an /// Serve the package archive files and database archives. If files are requested for an
@ -124,3 +129,28 @@ async fn delete_arch_repo(
Ok(StatusCode::NOT_FOUND) Ok(StatusCode::NOT_FOUND)
} }
} }
async fn delete_package(
State(_global): State<crate::Global>,
Path((_distro, _repo, _arch, _pkg_name)): Path<(String, String, String, String)>,
) -> crate::Result<StatusCode> {
Ok(StatusCode::NOT_FOUND)
//if let Some(mgr) = global.mgr.get_mgr(&distro).await {
// let pkg_removed = mgr.remove_pkg(&repo, &arch, &pkg_name).await?;
//
// if pkg_removed {
// tracing::info!(
// "Removed package '{}' ({}) from repository '{}'",
// pkg_name,
// arch,
// repo
// );
//
// Ok(StatusCode::OK)
// } else {
// Ok(StatusCode::NOT_FOUND)
// }
//} else {
// Ok(StatusCode::NOT_FOUND)
//}
}