From d720a7812ad7a4ea7d15b54400f2050d14ccfd8b Mon Sep 17 00:00:00 2001 From: nitnelave Date: Fri, 12 May 2023 20:06:06 +0900 Subject: [PATCH] cargo: set metadata for publishing crates (#577) --- .github/workflows/Dockerfile.ci.alpine | 14 +++++----- .github/workflows/Dockerfile.ci.debian | 14 +++++----- .github/workflows/docker-build-static.yml | 20 ++++++------- Cargo.lock | 34 +++++++++++------------ Dockerfile | 6 ++-- README.md | 2 +- app/Cargo.toml | 8 ++++-- auth/Cargo.toml | 8 ++++-- migration-tool/Cargo.toml | 10 +++++-- server/Cargo.toml | 8 +++++- set-password/Cargo.toml | 9 ++++-- 11 files changed, 78 insertions(+), 55 deletions(-) diff --git a/.github/workflows/Dockerfile.ci.alpine b/.github/workflows/Dockerfile.ci.alpine index f57a2f7..3f90d11 100644 --- a/.github/workflows/Dockerfile.ci.alpine +++ b/.github/workflows/Dockerfile.ci.alpine @@ -11,10 +11,10 @@ RUN mkdir -p /lldap/app RUN if [ "${TARGETPLATFORM}" = "linux/amd64" ]; then \ mv bin/x86_64-unknown-linux-musl-lldap-bin/lldap target/lldap && \ - mv bin/x86_64-unknown-linux-musl-migration-tool-bin/migration-tool target/migration-tool && \ + mv bin/x86_64-unknown-linux-musl-lldap_migration_tool-bin/lldap_migration_tool target/lldap_migration_tool && \ mv bin/x86_64-unknown-linux-musl-lldap_set_password-bin/lldap_set_password target/lldap_set_password && \ chmod +x target/lldap && \ - chmod +x target/migration-tool && \ + chmod +x target/lldap_migration_tool && \ chmod +x target/lldap_set_password && \ ls -la target/ . && \ pwd \ @@ -22,10 +22,10 @@ RUN if [ "${TARGETPLATFORM}" = "linux/amd64" ]; then \ RUN if [ "${TARGETPLATFORM}" = "linux/arm64" ]; then \ mv bin/aarch64-unknown-linux-musl-lldap-bin/lldap target/lldap && \ - mv bin/aarch64-unknown-linux-musl-migration-tool-bin/migration-tool target/migration-tool && \ + mv bin/aarch64-unknown-linux-musl-lldap_migration_tool-bin/lldap_migration_tool target/lldap_migration_tool && \ mv bin/aarch64-unknown-linux-musl-lldap_set_password-bin/lldap_set_password target/lldap_set_password && \ chmod +x target/lldap && \ - chmod +x target/migration-tool && \ + chmod +x target/lldap_migration_tool && \ chmod +x target/lldap_set_password && \ ls -la target/ . && \ pwd \ @@ -33,10 +33,10 @@ RUN if [ "${TARGETPLATFORM}" = "linux/arm64" ]; then \ RUN if [ "${TARGETPLATFORM}" = "linux/arm/v7" ]; then \ mv bin/armv7-unknown-linux-gnueabihf-lldap-bin/lldap target/lldap && \ - mv bin/armv7-unknown-linux-gnueabihf-migration-tool-bin/migration-tool target/migration-tool && \ + mv bin/armv7-unknown-linux-gnueabihf-lldap_migration_tool-bin/lldap_migration_tool target/lldap_migration_tool && \ mv bin/armv7-unknown-linux-gnueabihf-lldap_set_password-bin/lldap_set_password target/lldap_set_password && \ chmod +x target/lldap && \ - chmod +x target/migration-tool && \ + chmod +x target/lldap_migration_tool && \ chmod +x target/lldap_set_password && \ ls -la target/ . && \ pwd \ @@ -47,7 +47,7 @@ COPY docker-entrypoint.sh /docker-entrypoint.sh COPY lldap_config.docker_template.toml /lldap/ COPY web/index_local.html web/index.html RUN cp target/lldap /lldap/ && \ - cp target/migration-tool /lldap/ && \ + cp target/lldap_migration_tool /lldap/ && \ cp target/lldap_set_password /lldap/ && \ cp -R web/index.html \ web/pkg \ diff --git a/.github/workflows/Dockerfile.ci.debian b/.github/workflows/Dockerfile.ci.debian index fa274b0..75af975 100644 --- a/.github/workflows/Dockerfile.ci.debian +++ b/.github/workflows/Dockerfile.ci.debian @@ -11,10 +11,10 @@ RUN mkdir -p /lldap/app RUN if [ "${TARGETPLATFORM}" = "linux/amd64" ]; then \ mv bin/x86_64-unknown-linux-musl-lldap-bin/lldap target/lldap && \ - mv bin/x86_64-unknown-linux-musl-migration-tool-bin/migration-tool target/migration-tool && \ + mv bin/x86_64-unknown-linux-musl-lldap_migration_tool-bin/lldap_migration_tool target/lldap_migration_tool && \ mv bin/x86_64-unknown-linux-musl-lldap_set_password-bin/lldap_set_password target/lldap_set_password && \ chmod +x target/lldap && \ - chmod +x target/migration-tool && \ + chmod +x target/lldap_migration_tool && \ chmod +x target/lldap_set_password && \ ls -la target/ . && \ pwd \ @@ -22,10 +22,10 @@ RUN if [ "${TARGETPLATFORM}" = "linux/amd64" ]; then \ RUN if [ "${TARGETPLATFORM}" = "linux/arm64" ]; then \ mv bin/aarch64-unknown-linux-musl-lldap-bin/lldap target/lldap && \ - mv bin/aarch64-unknown-linux-musl-migration-tool-bin/migration-tool target/migration-tool && \ + mv bin/aarch64-unknown-linux-musl-lldap_migration_tool-bin/lldap_migration_tool target/lldap_migration_tool && \ mv bin/aarch64-unknown-linux-musl-lldap_set_password-bin/lldap_set_password target/lldap_set_password && \ chmod +x target/lldap && \ - chmod +x target/migration-tool && \ + chmod +x target/lldap_migration_tool && \ chmod +x target/lldap_set_password && \ ls -la target/ . && \ pwd \ @@ -33,10 +33,10 @@ RUN if [ "${TARGETPLATFORM}" = "linux/arm64" ]; then \ RUN if [ "${TARGETPLATFORM}" = "linux/arm/v7" ]; then \ mv bin/armv7-unknown-linux-gnueabihf-lldap-bin/lldap target/lldap && \ - mv bin/armv7-unknown-linux-gnueabihf-migration-tool-bin/migration-tool target/migration-tool && \ + mv bin/armv7-unknown-linux-gnueabihf-lldap_migration_tool-bin/lldap_migration_tool target/lldap_migration_tool && \ mv bin/armv7-unknown-linux-gnueabihf-lldap_set_password-bin/lldap_set_password target/lldap_set_password && \ chmod +x target/lldap && \ - chmod +x target/migration-tool && \ + chmod +x target/lldap_migration_tool && \ chmod +x target/lldap_set_password && \ ls -la target/ . && \ pwd \ @@ -47,7 +47,7 @@ COPY docker-entrypoint.sh /docker-entrypoint.sh COPY lldap_config.docker_template.toml /lldap/ COPY web/index_local.html web/index.html RUN cp target/lldap /lldap/ && \ - cp target/migration-tool /lldap/ && \ + cp target/lldap_migration_tool /lldap/ && \ cp target/lldap_set_password /lldap/ && \ cp -R web/index.html \ web/pkg \ diff --git a/.github/workflows/docker-build-static.yml b/.github/workflows/docker-build-static.yml index 969eb58..c373a96 100644 --- a/.github/workflows/docker-build-static.yml +++ b/.github/workflows/docker-build-static.yml @@ -151,7 +151,7 @@ jobs: restore-keys: | lldap-bin-${{ matrix.target }}- - name: Compile ${{ matrix.target }} lldap and tools - run: cargo build --target=${{ matrix.target }} --release -p lldap -p migration-tool -p lldap_set_password + run: cargo build --target=${{ matrix.target }} --release -p lldap -p lldap_migration_tool -p lldap_set_password - name: Check path run: ls -al target/release - name: Upload ${{ matrix.target}} lldap artifacts @@ -162,8 +162,8 @@ jobs: - name: Upload ${{ matrix.target }} migration tool artifacts uses: actions/upload-artifact@v3 with: - name: ${{ matrix.target }}-migration-tool-bin - path: target/${{ matrix.target }}/release/migration-tool + name: ${{ matrix.target }}-lldap_migration_tool-bin + path: target/${{ matrix.target }}/release/lldap_migration_tool - name: Upload ${{ matrix.target }} password tool artifacts uses: actions/upload-artifact@v3 with: @@ -594,14 +594,14 @@ jobs: mv bin/aarch64-unknown-linux-musl-lldap-bin/lldap bin/aarch64-lldap mv bin/x86_64-unknown-linux-musl-lldap-bin/lldap bin/amd64-lldap mv bin/armv7-unknown-linux-gnueabihf-lldap-bin/lldap bin/armhf-lldap - mv bin/aarch64-unknown-linux-musl-migration-tool-bin/migration-tool bin/aarch64-migration-tool - mv bin/x86_64-unknown-linux-musl-migration-tool-bin/migration-tool bin/amd64-migration-tool - mv bin/armv7-unknown-linux-gnueabihf-migration-tool-bin/migration-tool bin/armhf-migration-tool + mv bin/aarch64-unknown-linux-musl-lldap_migration_tool-bin/lldap_migration_tool bin/aarch64-lldap_migration_tool + mv bin/x86_64-unknown-linux-musl-lldap_migration_tool-bin/lldap_migration_tool bin/amd64-lldap_migration_tool + mv bin/armv7-unknown-linux-gnueabihf-lldap_migration_tool-bin/lldap_migration_tool bin/armhf-lldap_migration_tool mv bin/aarch64-unknown-linux-musl-lldap_set_password-bin/lldap_set_password bin/aarch64-lldap_set_password mv bin/x86_64-unknown-linux-musl-lldap_set_password-bin/lldap_set_password bin/amd64-lldap_set_password mv bin/armv7-unknown-linux-gnueabihf-lldap_set_password-bin/lldap_set_password bin/armhf-lldap_set_password chmod +x bin/*-lldap - chmod +x bin/*-migration-tool + chmod +x bin/*-lldap_migration_tool chmod +x bin/*-lldap_set_password - name: Download llap ui artifacts @@ -627,9 +627,9 @@ jobs: mv bin/aarch64-lldap aarch64-lldap/lldap mv bin/amd64-lldap amd64-lldap/lldap mv bin/armhf-lldap armhf-lldap/lldap - mv bin/aarch64-migration-tool aarch64-lldap/migration-tool - mv bin/amd64-migration-tool amd64-lldap/migration-tool - mv bin/armhf-migration-tool armhf-lldap/migration-tool + mv bin/aarch64-lldap_migration_tool aarch64-lldap/lldap_migration_tool + mv bin/amd64-lldap_migration_tool amd64-lldap/lldap_migration_tool + mv bin/armhf-lldap_migration_tool armhf-lldap/lldap_migration_tool mv bin/aarch64-lldap_set_password aarch64-lldap/lldap_set_password mv bin/amd64-lldap_set_password amd64-lldap/lldap_set_password mv bin/armhf-lldap_set_password armhf-lldap/lldap_set_password diff --git a/Cargo.lock b/Cargo.lock index b256bc5..6d9d74e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2518,6 +2518,23 @@ dependencies = [ "thiserror", ] +[[package]] +name = "lldap_migration_tool" +version = "0.4.2" +dependencies = [ + "anyhow", + "base64 0.13.1", + "graphql_client 0.11.0", + "ldap3", + "lldap_auth", + "rand 0.8.5", + "requestty", + "reqwest", + "serde", + "serde_json", + "smallvec", +] + [[package]] name = "lldap_set_password" version = "0.1.0" @@ -2613,23 +2630,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "migration-tool" -version = "0.4.2" -dependencies = [ - "anyhow", - "base64 0.13.1", - "graphql_client 0.11.0", - "ldap3", - "lldap_auth", - "rand 0.8.5", - "requestty", - "reqwest", - "serde", - "serde_json", - "smallvec", -] - [[package]] name = "mime" version = "0.3.16" diff --git a/Dockerfile b/Dockerfile index 0a78d3c..a698fbc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -31,12 +31,12 @@ FROM chef AS builder COPY --from=planner /tmp/recipe.json recipe.json RUN cargo chef cook --release -p lldap_app --target wasm32-unknown-unknown \ && cargo chef cook --release -p lldap \ - && cargo chef cook --release -p migration-tool \ + && cargo chef cook --release -p lldap_migration_tool \ && cargo chef cook --release -p lldap_set_password # Copy the source and build the app and server. COPY --chown=app:app . . -RUN cargo build --release -p lldap -p migration-tool -p lldap_set_password \ +RUN cargo build --release -p lldap -p lldap_migration_tool -p lldap_set_password \ # Build the frontend. && ./app/build.sh @@ -78,7 +78,7 @@ WORKDIR /app COPY --from=builder /app/app/index_local.html app/index.html COPY --from=builder /app/app/static app/static COPY --from=builder /app/app/pkg app/pkg -COPY --from=builder /app/target/release/lldap /app/target/release/migration-tool /app/target/release/lldap_set_password ./ +COPY --from=builder /app/target/release/lldap /app/target/release/lldap_migration_tool /app/target/release/lldap_set_password ./ COPY docker-entrypoint.sh lldap_config.docker_template.toml ./ RUN set -x \ diff --git a/README.md b/README.md index 8efaa08..907180b 100644 --- a/README.md +++ b/README.md @@ -163,7 +163,7 @@ To compile the project, you'll need: Then you can compile the server (and the migration tool if you want): ```shell -cargo build --release -p lldap -p migration-tool +cargo build --release -p lldap -p lldap_migration_tool ``` The resulting binaries will be in `./target/release/`. Alternatively, you can diff --git a/app/Cargo.toml b/app/Cargo.toml index 3b31705..254de4d 100644 --- a/app/Cargo.toml +++ b/app/Cargo.toml @@ -1,8 +1,12 @@ [package] -name = "lldap_app" -version = "0.5.0-alpha" authors = ["Valentin Tolmer "] +description = "Frontend for LLDAP" edition = "2021" +homepage = "https://github.com/lldap/lldap" +license = "GPL-3.0-only" +name = "lldap_app" +repository = "https://github.com/lldap/lldap" +version = "0.5.0-alpha" include = ["src/**/*", "queries/**/*", "Cargo.toml", "../schema.graphql"] [dependencies] diff --git a/auth/Cargo.toml b/auth/Cargo.toml index a128899..c61b376 100644 --- a/auth/Cargo.toml +++ b/auth/Cargo.toml @@ -1,8 +1,12 @@ [package] -name = "lldap_auth" -version = "0.3.0" authors = ["Valentin Tolmer "] +description = "Authentication protocol for LLDAP" edition = "2021" +homepage = "https://github.com/lldap/lldap" +license = "GPL-3.0-only" +name = "lldap_auth" +repository = "https://github.com/lldap/lldap" +version = "0.3.0" [features] default = ["opaque_server", "opaque_client"] diff --git a/migration-tool/Cargo.toml b/migration-tool/Cargo.toml index 4229a20..43b4eff 100644 --- a/migration-tool/Cargo.toml +++ b/migration-tool/Cargo.toml @@ -1,8 +1,12 @@ [package] -name = "migration-tool" -version = "0.4.2" -edition = "2021" authors = ["Valentin Tolmer "] +description = "CLI migration tool to go from OpenLDAP to LLDAP" +edition = "2021" +homepage = "https://github.com/lldap/lldap" +license = "GPL-3.0-only" +name = "lldap_migration_tool" +repository = "https://github.com/lldap/lldap" +version = "0.4.2" [dependencies] anyhow = "*" diff --git a/server/Cargo.toml b/server/Cargo.toml index 6ff1da2..e42cf4a 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -1,7 +1,13 @@ [package] authors = ["Valentin Tolmer "] +categories = ["authentication", "command-line-utilities"] +description = "Super-simple and lightweight LDAP server" edition = "2021" +homepage = "https://github.com/lldap/lldap" +keywords = ["cli", "ldap", "graphql", "server", "authentication"] +license = "GPL-3.0-only" name = "lldap" +repository = "https://github.com/lldap/lldap" version = "0.5.0-alpha" [dependencies] @@ -146,4 +152,4 @@ features = ["file_locks"] [dev-dependencies.uuid] version = "*" -features = ["v4"] \ No newline at end of file +features = ["v4"] diff --git a/set-password/Cargo.toml b/set-password/Cargo.toml index e35e8b0..57632d1 100644 --- a/set-password/Cargo.toml +++ b/set-password/Cargo.toml @@ -1,7 +1,12 @@ [package] -name = "lldap_set_password" -version = "0.1.0" +authors = ["Valentin Tolmer "] +description = "CLI tool to set a user password in LLDAP" edition = "2021" +homepage = "https://github.com/lldap/lldap" +license = "GPL-3.0-only" +name = "lldap_set_password" +repository = "https://github.com/lldap/lldap" +version = "0.1.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html