Skip to content
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 7 additions & 5 deletions .cargo/config.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@
RUST_LOG="cerium=debug,entity=debug,migration=info,api=debug"

## -- Database Url
DATABASE_URI=""
SELENIUM_URI=""
DATABASE_URI="postgres://root:root@localhost:5433/orca"
SELENIUM_URI="http://localhost:4444/wd/hub"

MINIO_ACCESS_KEY = ""
MINIO_ACCESS_SECRET = ""
MINIO_ACCESS_KEY = "minioadmin"
MINIO_ACCESS_SECRET = "minioadmin"
MINIO_ENDPOINT = "http://localhost:9000"

# -- Encryption salt used for JWT token and other secret keys
ENCRYPTION_SALT=""
# Generate with: openssl rand -hex 32
ENCRYPTION_SALT="change_this_to_a_secure_random_string"

DEBUG=false

Expand Down
24 changes: 23 additions & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1 +1,23 @@
DATABASE_URL="postgres://root:root@localhost:5432/orca"
# Database Configuration
POSTGRES_USER=root
POSTGRES_PASSWORD=root
POSTGRES_DB=orca
POSTGRES_PORT=5433

# MinIO Configuration
MINIO_ACCESS_KEY=minioadmin
MINIO_SECRET_KEY=minioadmin
MINIO_BROWSER_URL=http://localhost:9001

# Redis Configuration
REDIS_PORT=6379

# Application Configuration
APP_PORT=8080
APP_LOG_LEVEL=DEBUG

# Selenium Hub Configuration
SELENIUM_HUB_PORT=4444

# Database URL for application
DATABASE_URL="postgres://root:root@localhost:5433/orca"
20 changes: 20 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Database Configuration
POSTGRES_USER=root
POSTGRES_PASSWORD=your_secure_password_here
POSTGRES_DB=orca
POSTGRES_PORT=5433

# MinIO Configuration
MINIO_ACCESS_KEY=minioadmin
MINIO_SECRET_KEY=your_secure_minio_password_here
MINIO_BROWSER_URL=http://localhost:9001

# Redis Configuration
REDIS_PORT=6379

# Application Configuration
APP_PORT=8080
APP_LOG_LEVEL=DEBUG

# Selenium Hub Configuration
SELENIUM_HUB_PORT=4444
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

# misc
.DS_Store
.env
.env.local
.env.development.local
.env.test.local
Expand Down
49 changes: 23 additions & 26 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[workspace]
name = "orca"
resolver = "2"
members=[
"crates/libs/cerium",
"crates/libs/entity",
Expand Down Expand Up @@ -31,44 +31,41 @@ api = { path = "crates/services/api", default-features = true }
chrome = { path = "crates/workshop/chrome", default-features = true }
entity_macro = { path = "crates/macro/entity-macro", default-features = true }

thiserror = "1.0.31"
jsonwebtoken = "9.2.0"
serde = { version = "1.0.147"}
serde_json = "1.0.87"
chrono = { version = "0.4.31"}
tracing = "0.1.37"
tracing-subscriber = "0.3.16"
uuid = { version = "1.6.1", features = ["serde", "v4"] }
thiserror = "2.0.16"
jsonwebtoken = "9.3.1"
serde = { version = "1.0.219"}
serde_json = "1.0.143"
chrono = { version = "0.4.41"}
tracing = "0.1.41"
tracing-subscriber = "0.3.19"
uuid = { version = "1.18.0", features = ["serde", "v4"] }
config = "0.14.0"
dotenv = "0.15.0"
futures = "0.3.29"
futures-util = "0.3.29"
rust_decimal = "1.14.3"
futures = "0.3.31"
futures-util = "0.3.31"
rust_decimal = "1.37.2"
cross-test = "0.1.6"

sea-query = "0.30.5"
sea-orm = { version = "0.12.3", features = [
sea-query = "0.32.7"
sea-orm = { version = "1.1.1", features = [
"macros",
"debug-print",
"runtime-async-std-native-tls",
"sqlx-postgres",
] }
sea-orm-migration = {version = "0.12.3", features = ["sqlx-postgres"]}
axum = "0.7.1"
axum-extra = "0.9.1"
tokio = { version = "1.34.0", features = ["full"] }
tower = "0.4.13"
tower-http = { version = "0.5.0", default-features = true, features = ["uuid", "cors", "trace", "compression-br", "catch-panic", "request-id"] }
sea-orm-migration = {version = "1.1.14", features = ["sqlx-postgres"]}
axum = "0.7.9"
axum-extra = "0.9.6"
tokio = { version = "1.47.1", features = ["full"] }
tower = "0.5.2"
tower-http = { version = "0.6.6", default-features = true, features = ["uuid", "cors", "trace", "compression-br", "catch-panic", "request-id"] }


rust-s3 = "0.33.0"
rust-s3 = "0.35.1"

thirtyfour = "0.31.0"
thirtyfour = "0.36.1"

geckodriver="0.34.0"
geckodriver="0.36.0"


[patch.crates-io]
sea-orm = { git="https://github.com/itsparser/sea-orm", branch = "master" }
sea-orm-migration = { git="https://github.com/itsparser/sea-orm", branch = "master" }

7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@ Orca follows the Contributor Covenant Code of Conduct. See [CODE\_OF\_CONDUCT.md
1. Install the Rust compiler and toolchain following the instructions at [https://www.rust-lang.org/](https://www.rust-lang.org/)
2. Install docker in your system following the instructions at [https://docs.docker.com/get-docker/]
3. Go to this repo [https://github.com/orcaci/orca] and fork this repository
4. Clone the Orca repository: ```git clone https://github.com/[username]/orca.git```
4. Clone the Orca repository: ```git clone https://github.com/[username]/orca.git```
5. Change into the Orca directory: ```cd orca```
6. Copy the config file ```cp .cargo/config.local.toml .cargo/config.toml``` or Create a new file named **cargo.toml** under .cargo/ directory and add your own secrets
7. Now run start.sh file to start orca. ```bash start.sh```
6. Set up environment variables: ```cp .env.example .env``` and edit `.env` with your secure credentials
7. Copy the config file ```cp .cargo/config.local.toml .cargo/config.toml``` or Create a new file named **config.toml** under .cargo/ directory and add your own configuration
8. Now run start.sh file to start orca. ```bash start.sh```

## **Usage**

Expand Down
6 changes: 3 additions & 3 deletions crates/libs/cerium/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ serde.workspace=true
serde_json.workspace=true
rust-s3.workspace=true

lazy_static = "1.4.0"
lazy_static = "1.5.0"
async_once = "0.2.6"
rand = { version = "0.8.5", default-features = false, features = ["std"] }
log = "0.4.20"
rand = { version = "0.9.2", default-features = false, features = ["std"] }
log = "0.4.27"


11 changes: 5 additions & 6 deletions crates/libs/cerium/src/client/driver/web.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use thirtyfour::{CapabilitiesHelper, WebDriver as TFWebDriver};
use thirtyfour::{WebDriver as TFWebDriver};

use crate::error::CeriumResult;
use thirtyfour::{By, DesiredCapabilities, WebElement};
Expand Down Expand Up @@ -32,13 +32,12 @@ impl WebDriver {
}

pub async fn session_id(&self) -> CeriumResult<String> {
Ok(self.driver.session_id().await?.clone().to_string())
Ok(self.driver.session_id().to_string())
}

pub async fn default() -> CeriumResult<Self> {
let mut caps = DesiredCapabilities::firefox();
caps.add("se:recordVideo", true)?;
let driver = TFWebDriver::new("http://localhost:4444/wd/hub/session", caps).await?;
let caps = DesiredCapabilities::firefox();
let driver = TFWebDriver::new("http://localhost:4444", caps).await?;
Self::new(driver)
}

Expand All @@ -59,7 +58,7 @@ impl WebDriver {
}

pub async fn find(&self, by: impl Into<By>) -> CeriumResult<WebElement> {
Ok(self.driver.find(by).await?)
Ok(self.driver.find(by.into()).await?)
}

/// take_screenshot - will take screenshot and send png back to the requester
Expand Down
4 changes: 2 additions & 2 deletions crates/libs/cerium/src/client/storage/s3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ impl S3Client {
pub fn get_bucket(&self, bucket_name: &str) -> CeriumResult<Bucket> {
let mut bucket = Bucket::new(bucket_name, self.region.clone(), self.credentials.clone())?;
bucket.set_path_style();
Ok(bucket)
Ok(*bucket)
}

/// Asynchronously lists the buckets.
Expand All @@ -77,7 +77,7 @@ impl S3Client {
/// A CeriumResult indicating success or failure.
pub async fn create(&self, bucket: &str, key: &str, data: &[u8]) -> CeriumResult<()> {
let _bucket_obj = self.get_bucket(bucket)?;
let result = _bucket_obj.put_object(key, data).await?;
let _result = _bucket_obj.put_object(key, data).await?;
Ok(())
}

Expand Down
3 changes: 1 addition & 2 deletions crates/libs/cerium/src/server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@ use tokio::net::TcpListener;
use tower_http::{
catch_panic::CatchPanicLayer,
compression::CompressionLayer,
cors::{Any, CorsLayer},
cors::{CorsLayer},
};
use tower_http::request_id::{PropagateRequestIdLayer, SetRequestIdLayer};
use tower_http::trace::TraceLayer;
use tracing::{info, Level};
use tracing_subscriber::fmt;
use tracing_subscriber::layer::SubscriberExt;

use crate::client::Client;
use crate::server::request_id::OrcaRequestId;
Expand Down
6 changes: 3 additions & 3 deletions crates/libs/entity/src/common/attachment.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
//! SeaORM Entity. Generated by sea-orm-codegen 0.6.0

use sea_orm::entity::prelude::*;
use sea_orm::EntityTrait;
use sea_orm::prelude::StringLen;
use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Deserialize, Serialize)]
#[sea_orm(
rs_type = "String",
db_type = "String(Some(5))",
db_type = "String(StringLen::None)",
enum_name = "storage_type"
)]
pub enum StorageType {
Expand All @@ -22,7 +22,7 @@ pub enum StorageType {
#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Deserialize, Serialize)]
#[sea_orm(
rs_type = "String",
db_type = "String(Some(5))",
db_type = "String(StringLen::None)",
enum_name = "storage_category"
)]
pub enum StorageCategory {
Expand Down
4 changes: 2 additions & 2 deletions crates/libs/entity/src/common/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
//! Config will have all the Orca Configuration

use sea_orm::entity::prelude::*;
use sea_orm::EntityTrait;
use sea_orm::prelude::StringLen;
use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Deserialize, Serialize)]
#[sea_orm(
rs_type = "String",
db_type = "String(Some(5))",
db_type = "String(StringLen::None)",
enum_name = "config_key"
)]
pub enum ConfigType {
Expand Down
4 changes: 2 additions & 2 deletions crates/libs/entity/src/common/tag_entity.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
//! SeaORM Entity. Generated by sea-orm-codegen 0.6.0

use sea_orm::entity::prelude::*;
use sea_orm::EntityTrait;
use sea_orm::prelude::StringLen;
use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Deserialize, Serialize)]
#[sea_orm(
rs_type = "String",
db_type = "String(Some(5))",
db_type = "String(StringLen::None)",
enum_name = "tag_entity_type"
)]
pub enum EntityType {
Expand Down
4 changes: 2 additions & 2 deletions crates/libs/entity/src/test/field.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
//! SeaORM Entity. Generated by sea-orm-codegen 0.6.0

use sea_orm::entity::prelude::*;
use sea_orm::EntityTrait;
use sea_orm::prelude::StringLen;
use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Deserialize, Serialize)]
#[sea_orm(
rs_type = "String",
db_type = "String(Some(5))",
db_type = "String(StringLen::None)",
enum_name = "table_kind"
)]
pub enum FieldDataKind {
Expand Down
8 changes: 4 additions & 4 deletions crates/libs/entity/src/test/history.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
//! SeaORM Entity. Generated by sea-orm-codegen 0.6.0

use sea_orm::entity::prelude::*;
use sea_orm::EntityTrait;
use sea_orm::prelude::StringLen;
use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Deserialize, Serialize)]
#[sea_orm(
rs_type = "String",
db_type = "String(Some(10))",
db_type = "String(StringLen::None)",
enum_name = "execution_type"
)]
pub enum ExecutionType {
Expand All @@ -22,7 +22,7 @@ pub enum ExecutionType {
#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Deserialize, Serialize)]
#[sea_orm(
rs_type = "String",
db_type = "String(Some(10))",
db_type = "String(StringLen::None)",
enum_name = "execution_kind"
)]
pub enum ExecutionKind {
Expand All @@ -38,7 +38,7 @@ pub enum ExecutionKind {
#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Deserialize, Serialize)]
#[sea_orm(
rs_type = "String",
db_type = "String(Some(10))",
db_type = "String(StringLen::None)",
enum_name = "execution_status"
)]
pub enum ExecutionStatus {
Expand Down
4 changes: 2 additions & 2 deletions crates/libs/entity/src/test/ui/action/action.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! SeaORM Entity. Generated by sea-orm-codegen 0.6.0

use sea_orm::entity::prelude::*;
use sea_orm::EntityTrait;
use sea_orm::prelude::StringLen;
use serde::{Deserialize, Serialize};

use crate::prelude::target::ActionTargetKind;
Expand All @@ -10,7 +10,7 @@ use crate::test::ui::action::data::ActionDataKind;
#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Deserialize, Serialize)]
#[sea_orm(
rs_type = "String",
db_type = "String(Some(15))",
db_type = "String(StringLen::None)",
enum_name = "action_kind"
)]
pub enum ActionKind {
Expand Down
4 changes: 2 additions & 2 deletions crates/libs/entity/src/test/ui/action/data.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
//! SeaORM Entity. Generated by sea-orm-codegen 0.6.0

use sea_orm::entity::prelude::*;
use sea_orm::EntityTrait;
use sea_orm::prelude::StringLen;
use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Deserialize, Serialize)]
#[sea_orm(
rs_type = "String",
db_type = "String(Some(15))",
db_type = "String(StringLen::None)",
enum_name = "action_data_kind"
)]
pub enum ActionDataKind {
Expand Down
Loading
Loading