Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
443 changes: 195 additions & 248 deletions Cargo.lock

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions backend/src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@ fn ensure_workspace_schema_and_backfill(conn: &duckdb::Connection) {
"CREATE INDEX IF NOT EXISTS idx_files_workspace ON files(workspace_id)",
[],
);
let _ = conn.execute(
"ALTER TABLE files ADD COLUMN source_type VARCHAR DEFAULT 'upload'",
[],
);
let _ = conn.execute(
"CREATE INDEX IF NOT EXISTS idx_files_source_type ON files(source_type)",
[],
);

recover_detached_workspace_members(conn).expect("Failed to recover detached workspace members");
backfill_workspace_data(conn).expect("Failed to backfill workspace data");
Expand Down
2 changes: 1 addition & 1 deletion backend/src/handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ pub type TileFileMetadata = (
Option<String>,
);

async fn get_workspace_id(
pub async fn get_workspace_id(
auth_session: &AuthSession<crate::AuthBackend>,
state: &AppState,
) -> Result<String, (StatusCode, Json<ErrorResponse>)> {
Expand Down
1 change: 1 addition & 0 deletions backend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ mod password;
mod postgis;
mod public;
mod routes;
mod server_files_handlers;
mod session_store;
mod static_assets;
mod test_routes;
Expand Down
7 changes: 6 additions & 1 deletion backend/src/routes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ use crate::{
},
postgis::{register_postgis_source, test_postgis_connection},
public::{get_public_pmtiles, get_public_tile, get_public_tile_meta, head_public_pmtiles},
server_files_handlers::{browse_directory, import_files, list_directories},
upload::upload_file,
workspace_handlers::{
create_workspace, delete_workspace, get_current_workspace, get_workspace, invite_member,
Expand Down Expand Up @@ -137,7 +138,11 @@ fn build_api_router_with_auth(state: AppState, with_auth: bool) -> Router {
.route(
"/api/workspaces/{id}/members/{user_id}",
delete(remove_member),
);
)
// Server file import routes
.route("/api/server-files/directories", get(list_directories))
.route("/api/server-files/browse", get(browse_directory))
.route("/api/server-files/import", post(import_files));

if with_auth {
api_router = api_router.route_layer(axum_login::login_required!(crate::AuthBackend));
Expand Down
Loading
Loading