Skip to content

Commit

Permalink
fixed #857 - fixed default ticket expiry on MySQL, bumped sea-orm
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugeny committed Aug 8, 2023
1 parent d9385ca commit aca8d3d
Show file tree
Hide file tree
Showing 10 changed files with 522 additions and 242 deletions.
734 changes: 501 additions & 233 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion warpgate-admin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ poem-openapi = { version = "2.0", features = [
russh-keys = { version = "0.37.1", features = ["openssl"] }
# russh-keys = { version = "0.23.0-beta.1", features = ["openssl"], path = "../../russh/russh-keys" }
rust-embed = "6.3"
sea-orm = { version = "0.11.2", features = [
sea-orm = { version = "0.12.2", features = [
"runtime-tokio-native-tls",
"macros",
], default-features = false }
Expand Down
1 change: 1 addition & 0 deletions warpgate-admin/src/api/tickets_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ impl Api {
username: Set(body.username.clone()),
target: Set(body.target_name.clone()),
created: Set(chrono::Utc::now()),
expiry: Set(None),
..Default::default()
};

Expand Down
2 changes: 1 addition & 1 deletion warpgate-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ poem-openapi = { version = "2.0", features = [
rand = "0.8"
rand_chacha = "0.3"
rand_core = { version = "0.6", features = ["std"] }
sea-orm = { version = "0.11.2", features = [
sea-orm = { version = "0.12.2", features = [
"runtime-tokio-native-tls",
"macros",
], default-features = false }
Expand Down
2 changes: 1 addition & 1 deletion warpgate-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ poem-openapi = { version = "2.0", features = [
rand = "0.8"
rand_chacha = "0.3"
rand_core = { version = "0.6", features = ["std"] }
sea-orm = { version = "0.11.2", features = [
sea-orm = { version = "0.12.2", features = [
"runtime-tokio-native-tls",
"macros",
], default-features = false }
Expand Down
2 changes: 1 addition & 1 deletion warpgate-db-entities/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ version = "0.7.4"
[dependencies]
chrono = { version = "0.4", default_features = false, features = ["serde"] }
poem-openapi = { version = "2.0", features = ["chrono", "uuid"] }
sea-orm = { version = "0.11.2", features = [
sea-orm = { version = "0.12.2", features = [
"macros",
"with-chrono",
"with-uuid",
Expand Down
4 changes: 2 additions & 2 deletions warpgate-db-migrations/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ version = "0.7.4"
[dependencies]
async-std = { version = "^1.11", features = ["attributes"] }
chrono = { version = "0.4", default_features = false, features = ["serde"] }
sea-orm = { version = "0.11.2", features = [
sea-orm = { version = "0.12.2", features = [
"runtime-tokio-native-tls",
"macros",
"with-chrono",
"with-uuid",
"with-json",
], default-features = false }
sea-orm-migration = { version = "0.11.2", default-features = false, features = [
sea-orm-migration = { version = "0.12.2", default-features = false, features = [
"cli",
] }
uuid = { version = "1.2", features = ["v4", "serde"] }
Expand Down
13 changes: 12 additions & 1 deletion warpgate-db-migrations/src/m00001_create_ticket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,20 @@ impl MigrationTrait for Migration {
async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> {
let builder = manager.get_database_backend();
let schema = Schema::new(builder);

manager
.create_table(schema.create_table_from_entity(ticket::Entity))
.await
.await?;

// https://github.com/warp-tech/warpgate/issues/857
let _ = manager
.get_connection()
.execute_unprepared(
"ALTER TABLE `tickets` MODIFY COLUMN `expiry` TIMESTAMP NULL DEFAULT NULL",
)
.await;

Ok(())
}

async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> {
Expand Down
2 changes: 1 addition & 1 deletion warpgate-protocol-ssh/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ russh = { version = "0.37.1", features = ["vendored-openssl"] }
# russh = { version = "0.35.0-beta.6", features = ["vendored-openssl"], path = "../../russh/russh"}
russh-keys = { version = "0.37.1", features = ["vendored-openssl"] }
# russh-keys = { version = "0.23.0-beta.1", features = ["vendored-openssl"], path = "../../russh/russh-keys" }
sea-orm = { version = "0.11.2", features = [
sea-orm = { version = "0.12.2", features = [
"runtime-tokio-native-tls",
], default-features = false }
thiserror = "1.0"
Expand Down
2 changes: 1 addition & 1 deletion warpgate/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ notify = "^5.0.0"
rcgen = { version = "0.10", features = ["zeroize"] }
serde_json = "1.0"
serde_yaml = "0.8.23"
sea-orm = { version = "0.11.2", default-features = false }
sea-orm = { version = "0.12.2", default-features = false }
time = "0.3"
tokio = { version = "1.20", features = ["tracing", "signal", "macros"] }
tracing = "0.1"
Expand Down

0 comments on commit aca8d3d

Please sign in to comment.