Compare commits

...

6 Commits

Author SHA1 Message Date
Ruben Fiszel
6ea6258910 all 2024-10-02 14:14:36 +02:00
Ruben Fiszel
9ac3b6b1d5 fix(cli): improve schedule path handling on windows 2024-10-01 16:53:07 +02:00
Ruben Fiszel
99911dc21b refresh superadmin state on workspace list page
refresh superadmin state on workspace list page
2024-10-01 16:47:22 +02:00
Ruben Fiszel
0476f98231 chore(main): release 1.403.1 (#4467)
* chore(main): release 1.403.1

* Apply automatic changes

---------

Co-authored-by: rubenfiszel <rubenfiszel@users.noreply.github.com>
2024-10-01 16:07:57 +02:00
Ruben Fiszel
73ab8e1653 fix: fix new instance db setup 2024-10-01 16:03:58 +02:00
HugoCasa
ae6d99b9f4 fix sqlx skip step (#4466) 2024-10-01 13:34:31 +02:00
38 changed files with 127 additions and 662 deletions

View File

@@ -1,5 +1,12 @@
# Changelog
## [1.403.1](https://github.com/windmill-labs/windmill/compare/v1.403.0...v1.403.1) (2024-10-01)
### Bug Fixes
* fix new instance db setup ([73ab8e1](https://github.com/windmill-labs/windmill/commit/73ab8e1653d6e0c0c69fa7dcd96583f25d13ef86))
## [1.403.0](https://github.com/windmill-labs/windmill/compare/v1.402.3...v1.403.0) (2024-10-01)

View File

@@ -0,0 +1,22 @@
{
"db_name": "PostgreSQL",
"query": "SELECT job_kind = 'identity' FROM completed_job WHERE id = $1",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "?column?",
"type_info": "Bool"
}
],
"parameters": {
"Left": [
"Uuid"
]
},
"nullable": [
null
]
},
"hash": "829130d74c107e4e1a86f3e772657ae030463c139c39072777e453bfb7e9c0c3"
}

48
backend/Cargo.lock generated
View File

@@ -1609,9 +1609,9 @@ dependencies = [
[[package]]
name = "cc"
version = "1.1.23"
version = "1.1.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3bbb537bb4a30b90362caddba8f360c0a56bc13d3a5570028e7197204cb54a17"
checksum = "812acba72f0a070b003d3697490d2b55b837230ae7c6c6497f05cc2ddbb8d938"
dependencies = [
"jobserver",
"libc",
@@ -10428,7 +10428,7 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
[[package]]
name = "windmill"
version = "1.403.0"
version = "1.403.1"
dependencies = [
"anyhow",
"axum",
@@ -10470,7 +10470,7 @@ dependencies = [
[[package]]
name = "windmill-api"
version = "1.403.0"
version = "1.403.1"
dependencies = [
"anyhow",
"argon2",
@@ -10554,7 +10554,7 @@ dependencies = [
[[package]]
name = "windmill-api-client"
version = "1.403.0"
version = "1.403.1"
dependencies = [
"base64 0.21.7",
"chrono",
@@ -10572,7 +10572,7 @@ dependencies = [
[[package]]
name = "windmill-audit"
version = "1.403.0"
version = "1.403.1"
dependencies = [
"chrono",
"serde",
@@ -10585,7 +10585,7 @@ dependencies = [
[[package]]
name = "windmill-common"
version = "1.403.0"
version = "1.403.1"
dependencies = [
"anyhow",
"async-stream",
@@ -10630,7 +10630,7 @@ dependencies = [
[[package]]
name = "windmill-git-sync"
version = "1.403.0"
version = "1.403.1"
dependencies = [
"regex",
"rsmq_async",
@@ -10645,7 +10645,7 @@ dependencies = [
[[package]]
name = "windmill-indexer"
version = "1.403.0"
version = "1.403.1"
dependencies = [
"anyhow",
"bytes",
@@ -10666,7 +10666,7 @@ dependencies = [
[[package]]
name = "windmill-parser"
version = "1.403.0"
version = "1.403.1"
dependencies = [
"convert_case 0.6.0",
"serde",
@@ -10675,7 +10675,7 @@ dependencies = [
[[package]]
name = "windmill-parser-bash"
version = "1.403.0"
version = "1.403.1"
dependencies = [
"anyhow",
"lazy_static",
@@ -10687,7 +10687,7 @@ dependencies = [
[[package]]
name = "windmill-parser-go"
version = "1.403.0"
version = "1.403.1"
dependencies = [
"anyhow",
"gosyn",
@@ -10699,7 +10699,7 @@ dependencies = [
[[package]]
name = "windmill-parser-graphql"
version = "1.403.0"
version = "1.403.1"
dependencies = [
"anyhow",
"lazy_static",
@@ -10711,7 +10711,7 @@ dependencies = [
[[package]]
name = "windmill-parser-php"
version = "1.403.0"
version = "1.403.1"
dependencies = [
"anyhow",
"itertools 0.13.0",
@@ -10722,7 +10722,7 @@ dependencies = [
[[package]]
name = "windmill-parser-py"
version = "1.403.0"
version = "1.403.1"
dependencies = [
"anyhow",
"itertools 0.13.0",
@@ -10733,7 +10733,7 @@ dependencies = [
[[package]]
name = "windmill-parser-py-imports"
version = "1.403.0"
version = "1.403.1"
dependencies = [
"anyhow",
"async-recursion",
@@ -10751,7 +10751,7 @@ dependencies = [
[[package]]
name = "windmill-parser-rust"
version = "1.403.0"
version = "1.403.1"
dependencies = [
"anyhow",
"convert_case 0.6.0",
@@ -10768,7 +10768,7 @@ dependencies = [
[[package]]
name = "windmill-parser-sql"
version = "1.403.0"
version = "1.403.1"
dependencies = [
"anyhow",
"lazy_static",
@@ -10780,7 +10780,7 @@ dependencies = [
[[package]]
name = "windmill-parser-ts"
version = "1.403.0"
version = "1.403.1"
dependencies = [
"anyhow",
"lazy_static",
@@ -10798,7 +10798,7 @@ dependencies = [
[[package]]
name = "windmill-parser-wasm"
version = "1.403.0"
version = "1.403.1"
dependencies = [
"anyhow",
"getrandom 0.2.15",
@@ -10819,7 +10819,7 @@ dependencies = [
[[package]]
name = "windmill-parser-yaml"
version = "1.403.0"
version = "1.403.1"
dependencies = [
"anyhow",
"serde_json",
@@ -10829,7 +10829,7 @@ dependencies = [
[[package]]
name = "windmill-queue"
version = "1.403.0"
version = "1.403.1"
dependencies = [
"anyhow",
"async-recursion",
@@ -10862,7 +10862,7 @@ dependencies = [
[[package]]
name = "windmill-sql-datatype-parser-wasm"
version = "1.403.0"
version = "1.403.1"
dependencies = [
"wasm-bindgen",
"wasm-bindgen-test",
@@ -10872,7 +10872,7 @@ dependencies = [
[[package]]
name = "windmill-worker"
version = "1.403.0"
version = "1.403.1"
dependencies = [
"anyhow",
"async-recursion",

View File

@@ -1,6 +1,6 @@
[package]
name = "windmill"
version = "1.403.0"
version = "1.403.1"
authors.workspace = true
edition.workspace = true
@@ -27,7 +27,7 @@ members = [
]
[workspace.package]
version = "1.403.0"
version = "1.403.1"
authors = ["Ruben Fiszel <ruben@windmill.dev>"]
edition = "2021"

View File

@@ -1,8 +1,8 @@
INSERT INTO workspace(id, name, owner) VALUES
('admins', 'Admins', 'admin@windmill.dev');
('admins', 'Admins', 'admin@windmill.dev') ON CONFLICT DO NOTHING;
INSERT INTO workspace_settings (workspace_id) VALUES
('admins');
('admins') ON CONFLICT DO NOTHING;
INSERT INTO workspace_key
(workspace_id, kind, key)
@@ -13,4 +13,4 @@ INSERT INTO workspace_key
FROM generate_series(1, 32) -- generates 32 characters
),
''
));
)) ON CONFLICT DO NOTHING;

View File

@@ -1,16 +0,0 @@
use anyhow::anyhow;
#[cfg(feature = "enterprise")]
use windmill_common::error::{Error, Result};
pub async fn set_license_key(_license_key: String) -> anyhow::Result<()> {
// Implementation is not open source
Err(anyhow!("License cannot be set in Windmill CE"))
}
#[cfg(feature = "enterprise")]
pub async fn verify_license_key() -> Result<()> {
// Implementation is not open source
Err(Error::InternalErr(
"License always invalid in Windmill CE".to_string(),
))
}

1
backend/src/ee.rs Symbolic link
View File

@@ -0,0 +1 @@
/git/windmill/../windmill-ee-private/src/ee.rs

View File

@@ -1,7 +1,7 @@
openapi: "3.0.3"
info:
version: 1.403.0
version: 1.403.1
title: Windmill API
contact:

View File

@@ -137,6 +137,17 @@ impl Migrate for CustomMigrator {
"../../custom_migrations/create_workspace_without_md5.sql"
))
.await?;
let _ = sqlx::query(
r#"
INSERT INTO _sqlx_migrations ( version, description, success, checksum, execution_time )
VALUES ( $1, $2, TRUE, $3, -1 ) ON CONFLICT DO NOTHING
"#,
)
.bind(migration.version)
.bind(&*migration.description)
.bind(&*migration.checksum)
.execute(&mut *self.inner)
.await?;
return Ok(std::time::Duration::from_secs(0));
} else {
let r = self.inner.apply(migration).await;

View File

@@ -1,32 +0,0 @@
use anyhow::anyhow;
#[cfg(feature = "enterprise")]
use std::sync::Arc;
#[cfg(feature = "enterprise")]
use tokio::sync::RwLock;
pub async fn validate_license_key(_license_key: String) -> anyhow::Result<String> {
// Implementation is not open source
Err(anyhow!("License can't be validated in Windmill CE"))
}
#[cfg(feature = "enterprise")]
pub async fn jwt_ext_auth(
_w_id: Option<&String>,
_token: &str,
_external_jwks: Option<Arc<RwLock<ExternalJwks>>>,
) -> anyhow::Result<(crate::db::ApiAuthed, usize)> {
// Implementation is not open source
Err(anyhow!("External JWT auth is not open source"))
}
#[cfg(feature = "enterprise")]
pub struct ExternalJwks;
#[cfg(feature = "enterprise")]
impl ExternalJwks {
pub async fn load() -> Option<Arc<RwLock<Self>>> {
// Implementation is not open source
None
}
}

View File

@@ -0,0 +1 @@
/git/windmill/../windmill-ee-private/windmill-api/src/ee.rs

View File

@@ -1,5 +0,0 @@
use axum::Router;
pub fn workspaced_service() -> Router {
Router::new()
}

View File

@@ -0,0 +1 @@
/git/windmill/../windmill-ee-private/windmill-api/src/indexer_ee.rs

View File

@@ -1,5 +0,0 @@
use axum::Router;
pub fn workspaced_service() -> Router {
Router::new()
}

View File

@@ -0,0 +1 @@
/git/windmill/../windmill-ee-private/windmill-api/src/job_helpers_ee.rs

View File

@@ -1,188 +0,0 @@
/*
* Author: Ruben Fiszel
* Copyright: Windmill Labs, Inc 2022
* This file and its contents are licensed under the AGPLv3 License.
* Please see the included NOTICE for copyright information and
* LICENSE-AGPL for a copy of the license.
*/
use std::{collections::HashMap, fmt::Debug};
use axum::{routing::get, Json, Router};
use hmac::Mac;
use hyper::HeaderMap;
use itertools::Itertools;
use oauth2::{Client as OClient, *};
use serde::{Deserialize, Serialize};
use sqlx::{Postgres, Transaction};
use windmill_common::more_serde::maybe_number_opt;
use crate::OAUTH_CLIENTS;
use windmill_common::error;
use windmill_common::oauth2::*;
use crate::db::DB;
use std::str;
pub fn global_service() -> Router {
Router::new()
.route("/list_supabase", get(list_supabase))
.route("/list_logins", get(list_logins))
.route("/list_connects", get(list_connects))
}
pub fn workspaced_service() -> Router {
Router::new()
}
#[derive(Serialize)]
#[serde(tag = "type")]
pub enum InstanceEvent {
UserAdded { email: String },
// UserDeleted { email: String },
// UserDeletedWorkspace { workspace: String, email: String },
UserAddedWorkspace { workspace: String, email: String },
UserInvitedWorkspace { workspace: String, email: String },
UserJoinedWorkspace { workspace: String, email: String, username: String },
}
#[derive(Debug, Clone)]
pub struct ClientWithScopes {
_client: OClient,
_scopes: Vec<String>,
_extra_params: Option<HashMap<String, String>>,
_extra_params_callback: Option<HashMap<String, String>>,
_allowed_domains: Option<Vec<String>>,
_userinfo_url: Option<String>,
}
pub type BasicClientsMap = HashMap<String, ClientWithScopes>;
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct OAuthConfig {
auth_url: String,
token_url: String,
userinfo_url: Option<String>,
scopes: Option<Vec<String>>,
extra_params: Option<HashMap<String, String>>,
extra_params_callback: Option<HashMap<String, String>>,
req_body_auth: Option<bool>,
}
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct OAuthClient {
id: String,
secret: String,
allowed_domains: Option<Vec<String>>,
connect_config: Option<OAuthConfig>,
login_config: Option<OAuthConfig>,
}
#[derive(Debug)]
pub struct AllClients {
pub logins: BasicClientsMap,
pub connects: BasicClientsMap,
pub slack: Option<OClient>,
}
pub fn build_oauth_clients(
_base_url: &str,
_oauths_from_config: Option<HashMap<String, OAuthClient>>,
) -> anyhow::Result<AllClients> {
// Implementation is not open source
return Ok(AllClients {
logins: HashMap::default(),
connects: HashMap::default(),
slack: None,
});
}
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct TokenResponse {
access_token: AccessToken,
#[serde(deserialize_with = "maybe_number_opt")]
#[serde(default)]
expires_in: Option<u64>,
refresh_token: Option<RefreshToken>,
#[serde(deserialize_with = "helpers::deserialize_space_delimited_vec")]
#[serde(serialize_with = "helpers::serialize_space_delimited_vec")]
#[serde(default)]
scope: Option<Vec<Scope>>,
}
#[derive(Serialize)]
struct Logins {
oauth: Vec<String>,
saml: Option<String>,
}
async fn list_logins() -> error::JsonResult<Logins> {
// Implementation is not open source
return Ok(Json(Logins { oauth: vec![], saml: None }));
}
async fn list_connects() -> error::JsonResult<Vec<String>> {
Ok(Json(
(&OAUTH_CLIENTS.read().await.connects)
.keys()
.map(|x| x.to_owned())
.collect_vec(),
))
}
pub async fn _refresh_token<'c>(
_tx: Transaction<'c, Postgres>,
_path: &str,
_w_id: &str,
_id: i32,
_db: &DB,
) -> error::Result<String> {
// Implementation is not open source
Err(error::Error::BadRequest(
"Not implemented in Windmill's Open Source repository".to_string(),
))
}
async fn list_supabase(_headers: HeaderMap) -> error::Result<String> {
// Implementation is not open source
Err(error::Error::BadRequest(
"Not implemented in Windmill's Open Source repository".to_string(),
))
}
pub async fn check_nb_of_user(db: &DB) -> error::Result<()> {
let nb_users_sso =
sqlx::query_scalar!("SELECT COUNT(*) FROM password WHERE login_type != 'password'",)
.fetch_one(db)
.await?;
if nb_users_sso.unwrap_or(0) >= 10 {
return Err(error::Error::BadRequest(
"You have reached the maximum number of oauth users accounts (10) without an enterprise license"
.to_string(),
));
}
let nb_users = sqlx::query_scalar!("SELECT COUNT(*) FROM password",)
.fetch_one(db)
.await?;
if nb_users.unwrap_or(0) >= 50 {
return Err(error::Error::BadRequest(
"You have reached the maximum number of accounts (50) without an enterprise license"
.to_string(),
));
}
return Ok(());
}
#[derive(Clone, Debug)]
pub struct SlackVerifier {
_mac: HmacSha256,
}
impl SlackVerifier {
pub fn new<S: AsRef<[u8]>>(secret: S) -> anyhow::Result<SlackVerifier> {
HmacSha256::new_from_slice(secret.as_ref())
.map(|mac| SlackVerifier { _mac: mac })
.map_err(|_| anyhow::anyhow!("invalid secret"))
}
}

View File

@@ -0,0 +1 @@
/git/windmill/../windmill-ee-private/windmill-api/src/oauth2_ee.rs

View File

@@ -1,17 +0,0 @@
/*
* Author: Ruben Fiszel
* Copyright: Windmill Labs, Inc 2023
* This file and its contents are licensed under the AGPLv3 License.
* Please see the included NOTICE for copyright information and
* LICENSE-AGPL for a copy of the license.
*/
use axum::Router;
pub fn global_service() -> Router {
Router::new()
}
pub fn workspaced_service() -> Router {
Router::new()
}

View File

@@ -0,0 +1 @@
/git/windmill/../windmill-ee-private/windmill-api/src/oidc_ee.rs

View File

@@ -1,25 +0,0 @@
/*
* Author: Ruben Fiszel
* Copyright: Windmill Labs, Inc 2023
* This file and its contents are licensed under the AGPLv3 License.
* Please see the included NOTICE for copyright information and
* LICENSE-AGPL for a copy of the license.
*/
#![allow(non_snake_case)]
use axum::{routing::post, Router};
pub struct ServiceProviderExt();
pub async fn build_sp_extension() -> anyhow::Result<ServiceProviderExt> {
return Ok(ServiceProviderExt());
}
pub fn global_service() -> Router {
Router::new().route("/acs", post(acs))
}
pub async fn acs() -> String {
// Implementation is not open source as it is a Windmill Enterprise Edition feature
"SAML available only in enterprise version".to_string()
}

View File

@@ -0,0 +1 @@
/git/windmill/../windmill-ee-private/windmill-api/src/saml_ee.rs

View File

@@ -1,23 +0,0 @@
/*
* Author: Ruben Fiszel
* Copyright: Windmill Labs, Inc 2023
* This file and its contents are licensed under the AGPLv3 License.
* Please see the included NOTICE for copyright information and
* LICENSE-AGPL for a copy of the license.
*/
use axum::{middleware::Next, response::Response, routing::get, Router};
use hyper::Request;
pub fn global_service() -> Router {
Router::new().route("/ee", get(ee))
}
pub async fn ee() -> String {
return "Enterprise Edition".to_string();
}
pub async fn has_scim_token<B>(_request: Request<B>, _next: Next) -> Response {
//Not implemented in open-source version
todo!()
}

View File

@@ -0,0 +1 @@
/git/windmill/../windmill-ee-private/windmill-api/src/scim_ee.rs

View File

@@ -1,17 +0,0 @@
use crate::{db::DB, users::AuthCache};
use std::{net::SocketAddr, sync::Arc};
use windmill_common::db::UserDB;
pub struct SmtpServer {
pub auth_cache: Arc<AuthCache>,
pub db: DB,
pub user_db: UserDB,
pub rsmq: Option<rsmq_async::MultiplexedRsmq>,
pub base_internal_url: String,
}
impl SmtpServer {
pub async fn start_listener_thread(self: Arc<Self>, _addr: SocketAddr) -> anyhow::Result<()> {
Err(anyhow::anyhow!("Implementation not open source"))
}
}

View File

@@ -0,0 +1 @@
/git/windmill/../windmill-ee-private/windmill-api/src/smtp_server_ee.rs

View File

@@ -1,7 +0,0 @@
#[cfg(feature = "stripe")]
use axum::Router;
#[cfg(feature = "stripe")]
pub fn add_stripe_routes(router: Router) -> Router {
return router;
}

View File

@@ -0,0 +1 @@
/git/windmill/../windmill-ee-private/windmill-api/src/stripe_ee.rs

View File

@@ -1,75 +0,0 @@
/*
* Author: Ruben Fiszel
* Copyright: Windmill Labs, Inc 2022
* This file and its contents are licensed under the AGPLv3 License.
* Please see the included NOTICE for copyright information and
* LICENSE-AGPL for a copy of the license.
*/
use std::collections::HashMap;
use windmill_common::{
error::{Error, Result},
utils::Pagination,
};
use crate::{ActionKind, AuditLog, ListAuditLogQuery};
use sqlx::{Postgres, Transaction};
#[derive(Clone)]
pub struct AuditAuthor {
pub username: String,
pub email: String,
pub username_override: Option<String>,
}
impl AuditAuthorable for AuditAuthor {
fn email(&self) -> &str {
&self.email
}
fn username(&self) -> &str {
&self.username
}
fn username_override(&self) -> Option<&str> {
self.username_override.as_deref()
}
}
pub trait AuditAuthorable {
fn username(&self) -> &str;
fn email(&self) -> &str;
fn username_override(&self) -> Option<&str>;
}
#[tracing::instrument(level = "trace", skip_all)]
pub async fn audit_log<'c, E: sqlx::Executor<'c, Database = Postgres>>(
_db: E,
_author: &impl AuditAuthorable,
mut _operation: &str,
_action_kind: ActionKind,
_w_id: &str,
mut _resource: Option<&str>,
_parameters: Option<HashMap<&str, &str>>,
) -> Result<()> {
// Implementation is not open source as Audit logs is a Windmill Enterprise Edition feature
Ok(())
}
pub async fn list_audit(
_tx: Transaction<'_, Postgres>,
_w_id: String,
_pagination: Pagination,
_lq: ListAuditLogQuery,
) -> Result<Vec<AuditLog>> {
// Implementation is not open source as Audit logs is a Windmill Enterprise Edition feature
return Ok(vec![]);
}
pub async fn get_audit(tx: Transaction<'_, Postgres>, _id: i32, _w_id: &str) -> Result<AuditLog> {
// Implementation is not open source as Audit logs is a Windmill Enterprise Edition feature
tx.commit().await?;
Err(Error::NotFound(
"Audit log not not available in Windmill Community edition".to_string(),
))
}

View File

@@ -0,0 +1 @@
/git/windmill/../windmill-ee-private/windmill-audit/src/audit_ee.rs

View File

@@ -1,83 +0,0 @@
#[cfg(feature = "enterprise")]
use crate::db::DB;
use crate::ee::LicensePlan::Community;
#[cfg(feature = "enterprise")]
use crate::error;
use serde::Deserialize;
use std::sync::Arc;
use tokio::sync::RwLock;
lazy_static::lazy_static! {
pub static ref LICENSE_KEY_VALID: Arc<RwLock<bool>> = Arc::new(RwLock::new(true));
pub static ref LICENSE_KEY_ID: Arc<RwLock<String>> = Arc::new(RwLock::new("".to_string()));
pub static ref LICENSE_KEY: Arc<RwLock<String>> = Arc::new(RwLock::new("".to_string()));
}
pub enum LicensePlan {
Community,
Pro,
Enterprise,
}
pub async fn get_license_plan() -> LicensePlan {
// Implementation is not open source
return Community;
}
#[derive(Deserialize)]
#[serde(untagged)]
pub enum CriticalErrorChannel {
Email { email: String },
Slack { slack_channel: String },
}
pub enum CriticalAlertKind {
#[cfg(feature = "enterprise")]
CriticalError,
#[cfg(feature = "enterprise")]
RecoveredCriticalError,
}
#[cfg(feature = "enterprise")]
pub async fn send_critical_alert(
_error_message: String,
_db: &DB,
_kind: CriticalAlertKind,
_channels: Option<Vec<CriticalErrorChannel>>,
) {
}
#[cfg(feature = "enterprise")]
pub async fn schedule_key_renewal(_http_client: &reqwest::Client, _db: &crate::db::DB) -> () {
// Implementation is not open source
}
#[cfg(feature = "enterprise")]
pub enum RenewReason {
Manual,
Schedule,
OnStart,
}
#[cfg(feature = "enterprise")]
pub async fn renew_license_key(
_http_client: &reqwest::Client,
_db: &crate::db::DB,
_key: Option<String>,
_reason: RenewReason,
) -> String {
// Implementation is not open source
"".to_string()
}
#[cfg(feature = "enterprise")]
pub async fn create_customer_portal_session(
_http_client: &reqwest::Client,
_key: Option<String>,
) -> error::Result<String> {
// Implementation is not open source
Ok("".to_string())
}
#[cfg(feature = "enterprise")]
pub async fn worker_groups_alerts(_db: &DB) {}

View File

@@ -0,0 +1 @@
/git/windmill/../windmill-ee-private/windmill-common/src/ee.rs

View File

@@ -1,18 +0,0 @@
use std::future::Future;
use crate::{
error::Error,
s3_helpers::{ObjectStoreResource, StorageResourceType},
};
pub async fn get_s3_resource_internal<'c, F, Fut>(
_resource_type: StorageResourceType,
_s3_resource_value_raw: serde_json::Value,
_gen_token: F,
) -> crate::error::Result<ObjectStoreResource>
where
F: FnOnce(String) -> Fut,
Fut: Future<Output = Result<String, Error>> + Send + 'static,
{
todo!()
}

View File

@@ -0,0 +1 @@
/git/windmill/../windmill-ee-private/windmill-common/src/job_s3_helpers_ee.rs

View File

@@ -1,48 +0,0 @@
use sqlx::Postgres;
use crate::{error::Result, scripts::ScriptLang, DB};
pub async fn get_disable_stats_setting(_db: &DB) -> bool {
// stats details are closed source
false
}
pub async fn schedule_stats(_db: &DB, _http_client: &reqwest::Client) -> () {
// stats details are closed source
}
#[derive(Debug, sqlx::FromRow, serde::Serialize)]
struct JobsUsage {
language: Option<ScriptLang>,
total_duration: i64,
count: i64,
}
pub enum SendStatsReason {
Manual,
Schedule,
OnStart,
}
pub async fn send_stats(
_http_client: &reqwest::Client,
_db: &DB,
_skip_job_usage: bool,
_reason: SendStatsReason,
) -> Result<()> {
// stats details are closed source
Ok(())
}
pub struct ActiveUserUsage {
pub author_count: Option<i32>,
pub operator_count: Option<i32>,
}
pub async fn get_user_usage<'c, E: sqlx::Executor<'c, Database = Postgres>>(
_db: E,
) -> Result<ActiveUserUsage> {
let usage = ActiveUserUsage { author_count: None, operator_count: None };
Ok(usage)
}

View File

@@ -0,0 +1 @@
/git/windmill/../windmill-ee-private/windmill-common/src/stats_ee.rs

View File

@@ -1,17 +0,0 @@
use windmill_common::error::Result;
use crate::{DeployedObject, DB};
pub async fn handle_deployment_metadata<'c, R: rsmq_async::RsmqConnection + Send + Clone + 'c>(
_email: &str,
_created_by: &str,
_db: &DB,
_w_id: &str,
_obj: DeployedObject,
_deployment_message: Option<String>,
_rsmq: Option<R>,
_skip_db_insert: bool,
) -> Result<()> {
// Git sync is an enterprise feature and not part of the open-source version
return Ok(());
}

View File

@@ -0,0 +1 @@
/git/windmill/../windmill-ee-private/windmill-git-sync/src/git_sync_ee.rs

View File

@@ -1,21 +0,0 @@
use sqlx::{Pool, Postgres};
use windmill_common::error::Error;
use anyhow::anyhow;
#[derive(Clone)]
pub struct IndexReader;
#[derive(Clone)]
pub struct IndexWriter;
pub async fn init_index() -> Result<(IndexReader, IndexWriter), Error> {
Err(anyhow!("Cannot initialize index: not in EE").into())
}
pub async fn run_indexer(
_db: Pool<Postgres>,
mut _index_writer: IndexWriter,
mut _killpill_rx: tokio::sync::broadcast::Receiver<()>,
) {
tracing::error!("Cannot run indexer: not in EE");
}

View File

@@ -0,0 +1 @@
/git/windmill/../windmill-ee-private/windmill-indexer/src/indexer_ee.rs

View File

@@ -2,7 +2,7 @@ import { sleep } from "https://deno.land/x/sleep@v1.2.1/mod.ts";
import * as windmill from "https://deno.land/x/windmill@v1.174.0/mod.ts";
import * as api from "https://deno.land/x/windmill@v1.174.0/windmill-api/index.ts";
export const VERSION = "v1.403.0";
export const VERSION = "v1.403.1";
export async function login(email: string, password: string): Promise<string> {
return await windmill.UserService.login({

View File

@@ -35,7 +35,7 @@ import {
pushInstanceConfigs,
type SimplifiedSettings,
} from "./settings.ts";
import { sleep, deepEqual } from "./utils.ts";
import { deepEqual } from "./utils.ts";
import { GlobalOptions } from "./types.ts";
export interface Instance {
@@ -183,10 +183,13 @@ export type InstanceSyncOptions = {
yes?: boolean;
};
export async function pickInstance(opts: InstanceSyncOptions, allowNew: boolean) {
export async function pickInstance(
opts: InstanceSyncOptions,
allowNew: boolean
) {
const instances = await allInstances();
if (opts.baseUrl && opts.token) {
log.info("Using instance fully defined by --base-url and --token")
log.info("Using instance fully defined by --base-url and --token");
return {
name: "custom",
remote: opts.baseUrl,
@@ -284,8 +287,6 @@ async function instancePull(opts: GlobalOptions & InstanceSyncOptions) {
log.info("No instance-level changes to apply");
}
sleep(1000);
if (opts.includeWorkspaces) {
log.info("\nPulling all workspaces");
const remoteWorkspaces = await wmill.listWorkspacesAsSuperAdmin({
@@ -299,7 +300,6 @@ async function instancePull(opts: GlobalOptions & InstanceSyncOptions) {
const rootDir = Deno.cwd();
for (const remoteWorkspace of remoteWorkspaces) {
log.info("\nPulling workspace " + remoteWorkspace.id);
sleep(1000);
const workspaceName = instance.prefix + "_" + remoteWorkspace.id;
await Deno.mkdir(path.join(rootDir, workspaceName), {
recursive: true,
@@ -409,8 +409,6 @@ async function instancePush(opts: GlobalOptions & InstanceSyncOptions) {
log.info("No instance-level changes to apply");
}
sleep(1000);
if (opts.includeWorkspaces) {
instances = await allInstances();
const localPrefix = (await Select.prompt({
@@ -424,20 +422,20 @@ async function instancePush(opts: GlobalOptions & InstanceSyncOptions) {
default: instance.prefix as unknown,
})) as unknown as string;
const remoteWorkspaces = await wmill.listWorkspacesAsSuperAdmin({
page: 1,
perPage: 1000,
});
let localWorkspaces = await allWorkspaces();
const rootDir = Deno.cwd();
let localWorkspaces = Deno.readDir(".");
localWorkspaces = localWorkspaces.filter((w) =>
w.name.startsWith(localPrefix + "_")
);
log.info("\nPushing all workspaces");
const rootDir = Deno.cwd();
log.info(
`\nPushing all workspaces: ${localWorkspaces.join(
", "
)} with prefix ${localPrefix}`
);
for (const localWorkspace of localWorkspaces) {
log.info("\nPushing workspace " + localWorkspace.workspaceId);
sleep(1000);
try {
await Deno.chdir(path.join(rootDir, localWorkspace.name));
} catch (_) {
@@ -481,6 +479,10 @@ async function instancePush(opts: GlobalOptions & InstanceSyncOptions) {
});
}
const remoteWorkspaces = await wmill.listWorkspacesAsSuperAdmin({
page: 1,
perPage: 1000,
});
const workspacesToDelete = remoteWorkspaces.filter(
(w) => !localWorkspaces.find((l) => l.workspaceId === w.id)
);
@@ -544,7 +546,9 @@ async function whoami(opts: {}) {
log.info(colors.green.underline(`global whoami infos:`));
log.info(JSON.stringify(whoamiInfo, null, 2));
} catch (error) {
log.error(colors.red(`Failed to retrieve whoami information: ${error.message}`));
log.error(
colors.red(`Failed to retrieve whoami information: ${error.message}`)
);
}
}

View File

@@ -60,7 +60,7 @@ export {
// }
// });
export const VERSION = "1.403.0";
export const VERSION = "1.403.1";
const command = new Command()
.name("wmill")

View File

@@ -1,5 +1,5 @@
// deno-lint-ignore-file no-explicit-any
import { colors, Command, log, Table } from "./deps.ts";
import { colors, Command, log, SEP, Table } from "./deps.ts";
import { requireLogin, resolveWorkspace, validatePath } from "./context.ts";
import * as wmill from "./gen/services.gen.ts";
@@ -42,8 +42,7 @@ export async function pushSchedule(
schedule: Schedule | ScheduleFile | undefined,
localSchedule: ScheduleFile
): Promise<void> {
path = removeType(path, "schedule");
path = removeType(path, "schedule").replaceAll(SEP, "/");
log.debug(`Processing local schedule ${path}`);
// deleting old app if it exists in raw mode

View File

@@ -1,12 +1,12 @@
{
"name": "windmill-components",
"version": "1.403.0",
"version": "1.403.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "windmill-components",
"version": "1.403.0",
"version": "1.403.1",
"license": "AGPL-3.0",
"dependencies": {
"@aws-crypto/sha256-js": "^4.0.0",

View File

@@ -1,6 +1,6 @@
{
"name": "windmill-components",
"version": "1.403.0",
"version": "1.403.1",
"scripts": {
"dev": "vite dev",
"build": "vite build",

View File

@@ -24,6 +24,7 @@
import { isCloudHosted } from '$lib/cloud'
import { emptyString } from '$lib/utils'
import { getUserExt } from '$lib/user'
import { refreshSuperadmin } from '$lib/refreshUser'
let invites: WorkspaceInvite[] = []
let list_all_as_super_admin: boolean = false
@@ -45,6 +46,7 @@
}
async function loadWorkspaces() {
console.log('loading workspaces', $usersWorkspaceStore)
if (!$usersWorkspaceStore) {
try {
usersWorkspaceStore.set(await WorkspaceService.listUserWorkspaces())
@@ -76,7 +78,7 @@
}
$: list_all_as_super_admin != undefined && $userWorkspaces && handleListWorkspaces()
$: adminsInstance = workspaces?.find((x) => x.id == 'admins')
$: adminsInstance = workspaces?.find((x) => x.id == 'admins') || $superadmin
$: nonAdminWorkspaces = (workspaces ?? []).filter((x) => x.id != 'admins')
$: noWorkspaces = $superadmin && nonAdminWorkspaces.length == 0
@@ -97,6 +99,7 @@
getCreateWorkspaceRequireSuperadmin()
}
refreshSuperadmin()
loadInvites()
loadWorkspaces()

View File

@@ -4,8 +4,8 @@ verify_ssl = true
name = "pypi"
[packages]
wmill = ">=1.403.0"
wmill_pg = ">=1.403.0"
wmill = ">=1.403.1"
wmill_pg = ">=1.403.1"
sendgrid = "*"
mysql-connector-python = "*"
pymongo = "*"

View File

@@ -1,7 +1,7 @@
openapi: "3.0.3"
info:
version: 1.403.0
version: 1.403.1
title: OpenFlow Spec
contact:
name: Ruben Fiszel

View File

@@ -12,7 +12,7 @@
RootModule = 'WindmillClient.psm1'
# Version number of this module.
ModuleVersion = '1.403.0'
ModuleVersion = '1.403.1'
# Supported PSEditions
# CompatiblePSEditions = @()

View File

@@ -1,6 +1,6 @@
[tool.poetry]
name = "wmill"
version = "1.403.0"
version = "1.403.1"
description = "A client library for accessing Windmill server wrapping the Windmill client API"
license = "Apache-2.0"
homepage = "https://windmill.dev"

View File

@@ -1,6 +1,6 @@
[tool.poetry]
name = "wmill-pg"
version = "1.403.0"
version = "1.403.1"
description = "An extension client for the wmill client library focused on pg"
license = "Apache-2.0"
homepage = "https://windmill.dev"

View File

@@ -1,6 +1,6 @@
{
"name": "@windmill/windmill",
"version": "1.403.0",
"version": "1.403.1",
"exports": "./src/index.ts",
"publish": {
"exclude": ["!src", "./s3Types.ts", "./client.ts"]

View File

@@ -1,7 +1,7 @@
{
"name": "windmill-client",
"description": "Windmill SDK client for browsers and Node.js",
"version": "1.403.0",
"version": "1.403.1",
"author": "Ruben Fiszel",
"license": "Apache 2.0",
"devDependencies": {

View File

@@ -1 +1 @@
1.403.0
1.403.1