diff --git a/.cargo/config.toml b/.cargo/config.toml deleted file mode 100644 index 32fdb271..00000000 --- a/.cargo/config.toml +++ /dev/null @@ -1,3 +0,0 @@ -[build] -# v0 mangling scheme provides more detailed backtraces around closures -rustflags = ["-C", "symbol-mangling-version=v0"] diff --git a/.deepsource.toml b/.deepsource.toml deleted file mode 100644 index 88713a14..00000000 --- a/.deepsource.toml +++ /dev/null @@ -1,17 +0,0 @@ -version = 1 - -[[analyzers]] -name = "javascript" - - [analyzers.meta] - plugins = ["vue"] - environment = [ - "nodejs", - "vitest" - ] - -[[analyzers]] -name = "rust" - - [analyzers.meta] - msrv = "stable" diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index 9ab1d32d..285ea3ad 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -30,10 +30,10 @@ jobs: restore-keys: | ${{ runner.os }}-bazel- - name: Build Autha - run: bazel build //autha --strip=always --compilation_mode opt + run: bazel build //api/autha --strip=always --compilation_mode opt shell: bash - name: Run tests - run: bazel test //autha:autha_test --strip=always --compilation_mode opt + run: bazel test //api/autha:autha_test --strip=always --compilation_mode opt shell: bash - name: Login to GitHub Container Registry if: ${{ github.ref == 'refs/heads/master' }} @@ -44,5 +44,5 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Push to docker.io if: ${{ github.ref == 'refs/heads/master' }} - run: bazel run //autha:push --strip=always --compilation_mode opt + run: bazel run //api/autha:push --strip=always --compilation_mode opt shell: bash diff --git a/MODULE.bazel b/MODULE.bazel index 064f1d31..c429d7cd 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -2,7 +2,7 @@ module( name = "autha", - version = "3.0", + version = "3.1", ) bazel_dep(name = "platforms", version = "0.0.8") @@ -38,14 +38,14 @@ crate = use_extension( ) crate.from_cargo( name = "crate_index", - cargo_lockfile = "//:Cargo.lock", + cargo_lockfile = "//api:Cargo.lock", manifests = [ - "//:Cargo.toml", - "//autha-limits:Cargo.toml", - "//autha:Cargo.toml", - "//crypto:Cargo.toml", - "//db:Cargo.toml", - "//image_processor:Cargo.toml", + "//api:Cargo.toml", + "//api/autha-limits:Cargo.toml", + "//api/autha:Cargo.toml", + "//api/crypto:Cargo.toml", + "//api/db:Cargo.toml", + "//api/image_processor:Cargo.toml", ], ) use_repo(crate, "crate_index") diff --git a/.rustfmt.toml b/api/.rustfmt.toml similarity index 100% rename from .rustfmt.toml rename to api/.rustfmt.toml diff --git a/api/BUILD.bazel b/api/BUILD.bazel new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/api/BUILD.bazel @@ -0,0 +1 @@ + diff --git a/Cargo.lock b/api/Cargo.lock similarity index 100% rename from Cargo.lock rename to api/Cargo.lock diff --git a/Cargo.toml b/api/Cargo.toml similarity index 100% rename from Cargo.toml rename to api/Cargo.toml diff --git a/autha-limits/BUILD.bazel b/api/autha-limits/BUILD.bazel similarity index 100% rename from autha-limits/BUILD.bazel rename to api/autha-limits/BUILD.bazel diff --git a/autha-limits/Cargo.toml b/api/autha-limits/Cargo.toml similarity index 100% rename from autha-limits/Cargo.toml rename to api/autha-limits/Cargo.toml diff --git a/autha-limits/src/lib.rs b/api/autha-limits/src/lib.rs similarity index 100% rename from autha-limits/src/lib.rs rename to api/autha-limits/src/lib.rs diff --git a/autha-limits/src/warp.rs b/api/autha-limits/src/warp.rs similarity index 100% rename from autha-limits/src/warp.rs rename to api/autha-limits/src/warp.rs diff --git a/autha/BUILD.bazel b/api/autha/BUILD.bazel similarity index 95% rename from autha/BUILD.bazel rename to api/autha/BUILD.bazel index 10ef96b7..6b39702d 100644 --- a/autha/BUILD.bazel +++ b/api/autha/BUILD.bazel @@ -14,10 +14,10 @@ proto_library( ) CUSTOM_CRATES = [ - "//autha-limits", - "//crypto", - "//db", - "//image_processor", + "//api/autha-limits", + "//api/crypto", + "//api/db", + "//api/image_processor", ":proto_build_script", ] @@ -106,6 +106,6 @@ oci_push( repository = "ghcr.io/gravitalia/autha", remote_tags = [ "latest", - "3.0.0", + "3.1.0", ] ) diff --git a/autha/Cargo.toml b/api/autha/Cargo.toml similarity index 100% rename from autha/Cargo.toml rename to api/autha/Cargo.toml diff --git a/autha/build.rs b/api/autha/build.rs similarity index 100% rename from autha/build.rs rename to api/autha/build.rs diff --git a/autha/proto/remini.proto b/api/autha/proto/remini.proto similarity index 100% rename from autha/proto/remini.proto rename to api/autha/proto/remini.proto diff --git a/autha/src/helpers/config.rs b/api/autha/src/helpers/config.rs similarity index 100% rename from autha/src/helpers/config.rs rename to api/autha/src/helpers/config.rs diff --git a/autha/src/helpers/machine_learning.rs b/api/autha/src/helpers/machine_learning.rs similarity index 100% rename from autha/src/helpers/machine_learning.rs rename to api/autha/src/helpers/machine_learning.rs diff --git a/autha/src/helpers/mod.rs b/api/autha/src/helpers/mod.rs similarity index 100% rename from autha/src/helpers/mod.rs rename to api/autha/src/helpers/mod.rs diff --git a/autha/src/helpers/queries.rs b/api/autha/src/helpers/queries.rs similarity index 100% rename from autha/src/helpers/queries.rs rename to api/autha/src/helpers/queries.rs diff --git a/autha/src/helpers/request.rs b/api/autha/src/helpers/request.rs similarity index 100% rename from autha/src/helpers/request.rs rename to api/autha/src/helpers/request.rs diff --git a/autha/src/helpers/token.rs b/api/autha/src/helpers/token.rs similarity index 100% rename from autha/src/helpers/token.rs rename to api/autha/src/helpers/token.rs diff --git a/autha/src/main.rs b/api/autha/src/main.rs similarity index 100% rename from autha/src/main.rs rename to api/autha/src/main.rs diff --git a/autha/src/model/body.rs b/api/autha/src/model/body.rs similarity index 100% rename from autha/src/model/body.rs rename to api/autha/src/model/body.rs diff --git a/autha/src/model/broker.rs b/api/autha/src/model/broker.rs similarity index 100% rename from autha/src/model/broker.rs rename to api/autha/src/model/broker.rs diff --git a/autha/src/model/config.rs b/api/autha/src/model/config.rs similarity index 100% rename from autha/src/model/config.rs rename to api/autha/src/model/config.rs diff --git a/autha/src/model/error.rs b/api/autha/src/model/error.rs similarity index 100% rename from autha/src/model/error.rs rename to api/autha/src/model/error.rs diff --git a/autha/src/model/mod.rs b/api/autha/src/model/mod.rs similarity index 100% rename from autha/src/model/mod.rs rename to api/autha/src/model/mod.rs diff --git a/autha/src/model/query.rs b/api/autha/src/model/query.rs similarity index 100% rename from autha/src/model/query.rs rename to api/autha/src/model/query.rs diff --git a/autha/src/model/response.rs b/api/autha/src/model/response.rs similarity index 100% rename from autha/src/model/response.rs rename to api/autha/src/model/response.rs diff --git a/autha/src/model/user.rs b/api/autha/src/model/user.rs similarity index 100% rename from autha/src/model/user.rs rename to api/autha/src/model/user.rs diff --git a/autha/src/router/create.rs b/api/autha/src/router/create.rs similarity index 100% rename from autha/src/router/create.rs rename to api/autha/src/router/create.rs diff --git a/autha/src/router/login.rs b/api/autha/src/router/login.rs similarity index 100% rename from autha/src/router/login.rs rename to api/autha/src/router/login.rs diff --git a/autha/src/router/mod.rs b/api/autha/src/router/mod.rs similarity index 100% rename from autha/src/router/mod.rs rename to api/autha/src/router/mod.rs diff --git a/autha/src/router/oauth/authorization_code.rs b/api/autha/src/router/oauth/authorization_code.rs similarity index 100% rename from autha/src/router/oauth/authorization_code.rs rename to api/autha/src/router/oauth/authorization_code.rs diff --git a/autha/src/router/oauth/client_credentials.rs b/api/autha/src/router/oauth/client_credentials.rs similarity index 100% rename from autha/src/router/oauth/client_credentials.rs rename to api/autha/src/router/oauth/client_credentials.rs diff --git a/autha/src/router/oauth/mod.rs b/api/autha/src/router/oauth/mod.rs similarity index 100% rename from autha/src/router/oauth/mod.rs rename to api/autha/src/router/oauth/mod.rs diff --git a/autha/src/router/oauth/refresh.rs b/api/autha/src/router/oauth/refresh.rs similarity index 100% rename from autha/src/router/oauth/refresh.rs rename to api/autha/src/router/oauth/refresh.rs diff --git a/autha/src/router/oauth/revoke.rs b/api/autha/src/router/oauth/revoke.rs similarity index 100% rename from autha/src/router/oauth/revoke.rs rename to api/autha/src/router/oauth/revoke.rs diff --git a/autha/src/router/users.rs b/api/autha/src/router/users.rs similarity index 100% rename from autha/src/router/users.rs rename to api/autha/src/router/users.rs diff --git a/autha/src/telemetry/metrics.rs b/api/autha/src/telemetry/metrics.rs similarity index 100% rename from autha/src/telemetry/metrics.rs rename to api/autha/src/telemetry/metrics.rs diff --git a/autha/src/telemetry/mod.rs b/api/autha/src/telemetry/mod.rs similarity index 100% rename from autha/src/telemetry/mod.rs rename to api/autha/src/telemetry/mod.rs diff --git a/autha/src/telemetry/tracing.rs b/api/autha/src/telemetry/tracing.rs similarity index 100% rename from autha/src/telemetry/tracing.rs rename to api/autha/src/telemetry/tracing.rs diff --git a/crypto/BUILD.bazel b/api/crypto/BUILD.bazel similarity index 100% rename from crypto/BUILD.bazel rename to api/crypto/BUILD.bazel diff --git a/crypto/Cargo.toml b/api/crypto/Cargo.toml similarity index 100% rename from crypto/Cargo.toml rename to api/crypto/Cargo.toml diff --git a/crypto/benches/encryption_benchmark.rs b/api/crypto/benches/encryption_benchmark.rs similarity index 100% rename from crypto/benches/encryption_benchmark.rs rename to api/crypto/benches/encryption_benchmark.rs diff --git a/crypto/benches/hash_benchmark.rs b/api/crypto/benches/hash_benchmark.rs similarity index 100% rename from crypto/benches/hash_benchmark.rs rename to api/crypto/benches/hash_benchmark.rs diff --git a/crypto/benches/random_benchmark.rs b/api/crypto/benches/random_benchmark.rs similarity index 100% rename from crypto/benches/random_benchmark.rs rename to api/crypto/benches/random_benchmark.rs diff --git a/crypto/src/decrypt.rs b/api/crypto/src/decrypt.rs similarity index 100% rename from crypto/src/decrypt.rs rename to api/crypto/src/decrypt.rs diff --git a/crypto/src/encrypt.rs b/api/crypto/src/encrypt.rs similarity index 100% rename from crypto/src/encrypt.rs rename to api/crypto/src/encrypt.rs diff --git a/crypto/src/hash/argon2.rs b/api/crypto/src/hash/argon2.rs similarity index 100% rename from crypto/src/hash/argon2.rs rename to api/crypto/src/hash/argon2.rs diff --git a/crypto/src/hash/mod.rs b/api/crypto/src/hash/mod.rs similarity index 100% rename from crypto/src/hash/mod.rs rename to api/crypto/src/hash/mod.rs diff --git a/crypto/src/hash/sha.rs b/api/crypto/src/hash/sha.rs similarity index 100% rename from crypto/src/hash/sha.rs rename to api/crypto/src/hash/sha.rs diff --git a/crypto/src/lib.rs b/api/crypto/src/lib.rs similarity index 100% rename from crypto/src/lib.rs rename to api/crypto/src/lib.rs diff --git a/db/BUILD.bazel b/api/db/BUILD.bazel similarity index 100% rename from db/BUILD.bazel rename to api/db/BUILD.bazel diff --git a/db/Cargo.toml b/api/db/Cargo.toml similarity index 100% rename from db/Cargo.toml rename to api/db/Cargo.toml diff --git a/db/src/broker/kafka/mod.rs b/api/db/src/broker/kafka/mod.rs similarity index 100% rename from db/src/broker/kafka/mod.rs rename to api/db/src/broker/kafka/mod.rs diff --git a/db/src/broker/kafka/pool.rs b/api/db/src/broker/kafka/pool.rs similarity index 100% rename from db/src/broker/kafka/pool.rs rename to api/db/src/broker/kafka/pool.rs diff --git a/db/src/broker/mod.rs b/api/db/src/broker/mod.rs similarity index 100% rename from db/src/broker/mod.rs rename to api/db/src/broker/mod.rs diff --git a/db/src/broker/rabbitmq/mod.rs b/api/db/src/broker/rabbitmq/mod.rs similarity index 100% rename from db/src/broker/rabbitmq/mod.rs rename to api/db/src/broker/rabbitmq/mod.rs diff --git a/db/src/broker/rabbitmq/pool.rs b/api/db/src/broker/rabbitmq/pool.rs similarity index 100% rename from db/src/broker/rabbitmq/pool.rs rename to api/db/src/broker/rabbitmq/pool.rs diff --git a/db/src/lib.rs b/api/db/src/lib.rs similarity index 100% rename from db/src/lib.rs rename to api/db/src/lib.rs diff --git a/db/src/memcache/mod.rs b/api/db/src/memcache/mod.rs similarity index 100% rename from db/src/memcache/mod.rs rename to api/db/src/memcache/mod.rs diff --git a/db/src/memcache/pool.rs b/api/db/src/memcache/pool.rs similarity index 100% rename from db/src/memcache/pool.rs rename to api/db/src/memcache/pool.rs diff --git a/db/src/scylla.rs b/api/db/src/scylla.rs similarity index 100% rename from db/src/scylla.rs rename to api/db/src/scylla.rs diff --git a/image_processor/BUILD.bazel b/api/image_processor/BUILD.bazel similarity index 92% rename from image_processor/BUILD.bazel rename to api/image_processor/BUILD.bazel index f2a4d8ae..c39e1ce4 100644 --- a/image_processor/BUILD.bazel +++ b/api/image_processor/BUILD.bazel @@ -7,7 +7,7 @@ rust_library( name = "image_processor", srcs = glob(["src/**/*.rs"]), aliases = aliases(), - deps = ["//crypto"] + all_crate_deps( + deps = ["//api/crypto"] + all_crate_deps( normal = True, ), proc_macro_deps = all_crate_deps( diff --git a/image_processor/Cargo.toml b/api/image_processor/Cargo.toml similarity index 100% rename from image_processor/Cargo.toml rename to api/image_processor/Cargo.toml diff --git a/image_processor/README.md b/api/image_processor/README.md similarity index 100% rename from image_processor/README.md rename to api/image_processor/README.md diff --git a/image_processor/benches/image.jpg b/api/image_processor/benches/image.jpg similarity index 100% rename from image_processor/benches/image.jpg rename to api/image_processor/benches/image.jpg diff --git a/image_processor/benches/image_benchmark.rs b/api/image_processor/benches/image_benchmark.rs similarity index 100% rename from image_processor/benches/image_benchmark.rs rename to api/image_processor/benches/image_benchmark.rs diff --git a/image_processor/src/host/cloudinary.rs b/api/image_processor/src/host/cloudinary.rs similarity index 100% rename from image_processor/src/host/cloudinary.rs rename to api/image_processor/src/host/cloudinary.rs diff --git a/image_processor/src/host/mod.rs b/api/image_processor/src/host/mod.rs similarity index 100% rename from image_processor/src/host/mod.rs rename to api/image_processor/src/host/mod.rs diff --git a/image_processor/src/lib.rs b/api/image_processor/src/lib.rs similarity index 100% rename from image_processor/src/lib.rs rename to api/image_processor/src/lib.rs diff --git a/image_processor/src/resizer.rs b/api/image_processor/src/resizer.rs similarity index 100% rename from image_processor/src/resizer.rs rename to api/image_processor/src/resizer.rs diff --git a/config.yaml b/docker/config.yaml similarity index 100% rename from config.yaml rename to docker/config.yaml diff --git a/docker-compose.yml b/docker/docker-compose.yml similarity index 100% rename from docker-compose.yml rename to docker/docker-compose.yml diff --git a/docs/quick_start.md b/docs/quick_start.md index 04e0e473..45c5058e 100644 --- a/docs/quick_start.md +++ b/docs/quick_start.md @@ -34,7 +34,7 @@ database: pool_size: 3 ``` -You can see more paramters on [/config.yaml](https://github.com/Gravitalia/Autha/blob/master/config.yaml). +You can see more paramters on [/config.yaml](https://github.com/Gravitalia/Autha/blob/master/docker/config.yaml). 2. Create a `docker-compose.yaml` file. Write diff --git a/flake.lock b/flake.lock deleted file mode 100644 index 92eead7b..00000000 --- a/flake.lock +++ /dev/null @@ -1,61 +0,0 @@ -{ - "nodes": { - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1701680307, - "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1703637592, - "narHash": "sha256-8MXjxU0RfFfzl57Zy3OfXCITS0qWDNLzlBAdwxGZwfY=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "cfc3698c31b1fb9cdcf10f36c9643460264d0ca8", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "root": { - "inputs": { - "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs" - } - }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/flake.nix b/flake.nix deleted file mode 100644 index 0217378e..00000000 --- a/flake.nix +++ /dev/null @@ -1,28 +0,0 @@ -{ - description = - "Set up a devShell for a Rust project with necessary dependencies."; - - inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; - flake-utils.url = "github:numtide/flake-utils"; - }; - - outputs = { self, nixpkgs, flake-utils, ... }: - flake-utils.lib.eachDefaultSystem (system: - let pkgs = nixpkgs.legacyPackages.${system}; - in { - devShells.default = pkgs.mkShell { - nativeBuildInputs = with pkgs; [pkg-config] ++ - lib.optionals stdenv.buildPlatform.isDarwin [ - pkgs.darwin.apple_sdk.frameworks.CoreFoundation - pkgs.darwin.apple_sdk.frameworks.CoreServices - pkgs.darwin.apple_sdk.frameworks.Security - pkgs.darwin.apple_sdk.frameworks.SystemConfiguration - ]; - - buildInputs = with pkgs; - [ rustc cargo rustfmt gcc clippy openssl protobuf libiconv bazel_6 bazel-buildtools ]; - }; - } - ); -} diff --git a/container.tf b/infra/container.tf similarity index 100% rename from container.tf rename to infra/container.tf diff --git a/variables.tf b/infra/variables.tf similarity index 100% rename from variables.tf rename to infra/variables.tf