Skip to content

Commit 9e8da42

Browse files
committed
try
1 parent b40e1a3 commit 9e8da42

File tree

12 files changed

+72
-33
lines changed

12 files changed

+72
-33
lines changed

.env

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@ RUST_LOG=ogcapi=debug,ogcapi_services=debug,ogcapi_client=debug,tower_http=debug
33
APP_HOST=0.0.0.0
44
APP_PORT=8484
55

6+
# PUBLIC_URL=http://example.org
7+
68
DB_USER=postgres
79
DB_PASSWORD=password
810
DB_HOST=localhost
9-
DB_PORT=5433
11+
DB_PORT=5432
1012
DB_NAME=ogcapi
1113

12-
DATABASE_URL=postgresql://postgres:password@localhost:5433/ogcapi
14+
DATABASE_URL=postgresql://postgres:password@localhost:5432/ogcapi
1315

1416
AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE
1517
AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY

.github/workflows/cite.yml

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,26 +26,22 @@ jobs:
2626
--health-retries 5
2727
ports:
2828
- 5432:5432
29-
# cite:
30-
# image: docker.io/ogccite/ets-ogcapi-features10
31-
# ports:
32-
# - 8080:8080
29+
cite:
30+
image: docker.io/ogccite/ets-ogcapi-features10
31+
ports:
32+
- 8080:8080
3333

3434
steps:
3535
- name: Checkout
3636
uses: actions/checkout@v4
3737

3838
- name: Load
39-
run: cargo run -p data-loader -- --input data/ne_110m_admin_0_countries.geojson --collection countries
40-
env:
41-
DATABASE_URL: "postgresql://postgres:password@localhost:5432/ogcapi"
39+
run: cargo run -p data-loader -- --input data/ne_110m_populated_places.geojson --collection places
4240

4341
- name: Run
4442
run: RUNNER_TRACKING_ID="" && cargo run -p cite-service &
4543
env:
46-
APP_HOST: "0.0.0.0"
47-
APP_PORT: "8484"
48-
DATABASE_URL: "postgresql://postgres:password@localhost:5432/ogcapi"
44+
PUBLIC_URL: "http://host.docker.internal:8484"
4945

5046
- name: Check running service
5147
run: |
@@ -55,15 +51,29 @@ jobs:
5551
do
5652
sleep 5
5753
done
54+
curl -v http://localhost:8484/ | jq
5855
5956
- name: Downgrade click
6057
run: pip install ogc-cite-runner "click<8.2.0"
6158

59+
# - name: Cite container
60+
# run: docker run -d --network host docker.io/ogccite/ets-ogcapi-features10
61+
62+
- name: Check running container
63+
run: |
64+
until [ \
65+
"$(curl -s -w '%{http_code}' -o /dev/null "http://localhost:8080/teamengine")" \
66+
-eq 200 ]
67+
echo $http_code
68+
do
69+
sleep 5
70+
done
71+
6272
- name: Validate
63-
run: docker run -d --network host docker.io/ogccite/ets-ogcapi-features10 && sleep 20 && ogc-cite-runner execute-test-suite http://localhost:8080/teamengine ogcapi-features-1.0 --suite-input iut http://host.docker.internal:8484
64-
# uses: OSGEO/[email protected]
65-
# with:
66-
# test_suite_identifier: ogcapi-features-1.0
67-
# test_session_arguments: >-
68-
# iut=http://host.docker.internal:8484
73+
# run: ogc-cite-runner execute-test-suite http://localhost:8080/teamengine ogcapi-features-1.0 --suite-input iut http://host.docker.internal:8484
74+
uses: OSGEO/[email protected]
75+
with:
76+
test_suite_identifier: ogcapi-features-1.0
77+
test_session_arguments: >-
78+
iut=http://host.docker.internal:8484
6979

examples/cite-service/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ tokio = { version = "1.47", features = ["full"] }
1212
tracing = "0.1.41"
1313
tracing-subscriber = { version = "0.3.19", features = ["env-filter"] }
1414

15-
ogcapi = { path = "../../ogcapi", version = "0.3", features = [
15+
ogcapi = { path = "../../ogcapi", version = "0.3", default-features = false, features = [
1616
"services",
1717
"common",
1818
"features",

ogcapi-drivers/src/postgres/collection.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ impl CollectionTransactions for Db {
107107
}
108108

109109
async fn list_collections(&self, _query: &Query) -> anyhow::Result<Collections> {
110-
println!("Query collections");
111110
let collections: Option<sqlx::types::Json<Vec<Collection>>> = if cfg!(feature = "stac") {
112111
sqlx::query_scalar(
113112
r#"

ogcapi-drivers/src/postgres/feature.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ impl FeatureTransactions for Db {
153153
.unwrap_or_default()
154154
.as_srid();
155155

156+
// TODO: handle antimeridian (lower > upper on axis 1)
156157
let intersection = match bbox {
157158
Bbox::Bbox2D(bbox) => format!(
158159
"ST_Intersects(geom, ST_Transform(ST_MakeEnvelope({}, {}, {}, {}, {}), {storage_srid}))",

ogcapi-processes/src/gdal_loader.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ mod tests {
372372
collection: "streets-gdal".to_string(),
373373
filter: None,
374374
s_srs: None,
375-
database_url: "postgresql://postgres:password@localhost:5433/ogcapi".to_string(),
375+
database_url: "postgresql://postgres:password@localhost:5432/ogcapi".to_string(),
376376
};
377377

378378
let execute = Execute {

ogcapi-processes/src/geojson_loader.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ mod tests {
249249
input: "../data/ne_10m_railroads_north_america.geojson".to_owned(),
250250
collection: "streets-geojson".to_string(),
251251
s_srs: None,
252-
database_url: "postgresql://postgres:password@localhost:5433/ogcapi".to_string(),
252+
database_url: "postgresql://postgres:password@localhost:5432/ogcapi".to_string(),
253253
};
254254

255255
let execute = Execute {

ogcapi-services/assets/openapi/openapi.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ info:
1414
servers:
1515
- url: http://localhost:8484
1616
description: "Development server"
17+
- url: http://host.docker.internal:8484
18+
description: "CI server"
1719
tags:
1820
- name: server
1921
- name: Capabilities

ogcapi-services/src/extractors.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,13 @@ where
2020
async fn from_request_parts(parts: &mut Parts, state: &S) -> Result<Self, Self::Rejection> {
2121
let uri = OriginalUri::from_request_parts(parts, state).await.unwrap();
2222

23-
let url = if uri.0.scheme().is_some() {
23+
let url = if let Ok(url) = std::env::var("PUBLIC_URL") {
24+
format!(
25+
"{}{}",
26+
url.trim_end_matches('/'),
27+
uri.path_and_query().unwrap()
28+
)
29+
} else if uri.0.scheme().is_some() {
2430
uri.0.to_string()
2531
} else {
2632
let host = Host::from_request_parts(parts, state)

ogcapi-services/src/openapi.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use utoipa::OpenApi;
22

33
/// TODO: remove once Open API 3.1 is supported
44
#[cfg(all(feature = "features", not(feature = "edr")))]
5-
pub(crate) static OPENAPI: &[u8; 29696] = include_bytes!("../assets/openapi/openapi.yaml");
5+
pub(crate) static OPENAPI: &[u8; 29767] = include_bytes!("../assets/openapi/openapi.yaml");
66

77
/// TODO: remove once Open API 3.1 is supported
88
#[cfg(feature = "edr")]

0 commit comments

Comments
 (0)