diff --git a/cdk/bin/app.ts b/cdk/bin/app.ts index db1fbb85..b23d49ff 100644 --- a/cdk/bin/app.ts +++ b/cdk/bin/app.ts @@ -21,6 +21,7 @@ const environments: Environment[] = [ account: '847483222616', zoneName: 'nabu-stage.paradisec.org.au', acmeValue: 'PM0DillUQGnKlpqsD9dmT-s8U6Jq7WeSPEKOrptZWQI', + cloudflare: 'catalog.nabu-stage.paradisec.org.au.cdn.cloudflare.net', }, { ...globals, @@ -30,6 +31,7 @@ const environments: Environment[] = [ account: '618916419351', zoneName: 'nabu-prod.paradisec.org.au', acmeValue: 'coAr3vAsNUwrReLqZAtAPgfcwvnqPCPovbyYTp791i8', + cloudflare: 'catalog.nabu-prod.paradisec.org.au.cdn.cloudflare.net', }, ]; const prod = environments.find((env) => env.env === 'prod'); diff --git a/cdk/lib/app-stack.ts b/cdk/lib/app-stack.ts index e0a0dfe3..7db1474f 100644 --- a/cdk/lib/app-stack.ts +++ b/cdk/lib/app-stack.ts @@ -31,6 +31,7 @@ export class AppStack extends cdk.Stack { catalogBucket, zone, tempCertificate, + cloudflare, } = appProps; // //////////////////////// @@ -406,7 +407,7 @@ export class AppStack extends cdk.Stack { new route53.CnameRecord(this, 'CatalogRecord', { recordName: 'catalog', zone, - domainName: ssm.StringParameter.valueForStringParameter(this, '/usyd/resources/application-load-balancer/ingress/dns'), + domainName: cloudflare, }); // //////////////////////// diff --git a/cdk/lib/types.ts b/cdk/lib/types.ts index 43ae07d3..31018cc5 100644 --- a/cdk/lib/types.ts +++ b/cdk/lib/types.ts @@ -11,6 +11,7 @@ export type Environment = { readonly account: string, readonly zoneName: string, readonly acmeValue: string, + readonly cloudflare: string, }; export type AppProps = Environment & { diff --git a/config/routes.rb b/config/routes.rb index 62a08457..0304e67d 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -45,10 +45,8 @@ post 'exsite9' => 'collections#create_from_exsite9' post 'spreadsheet' => 'collections#create_from_spreadsheet' end - resources :items, except: %i[index show] do + resources :items, except: %i[index] do member do - get :show - get 'ro-crate-metadata.json', to: 'items#show', as: 'rocrate', defaults: { format: :rocrate } get :display get :data patch :inherit_details @@ -76,6 +74,14 @@ end end + resources :collections do + resources :items, only: %i[] do + member do + get 'ro-crate-metadata.json', to: 'items#show', as: 'rocrate', defaults: { format: :rocrate } + end + end + end + get '/repository/:collection_identifier' => 'repository#collection', :as => 'repository_collection' get '/repository/:collection_identifier/:item_identifier' => 'repository#item', :as => 'repository_item' get '/repository/:collection_identifier/:item_identifier/:essence_filename' => 'repository#essence',