diff --git a/.gitlab/auto-deploy-values.yaml b/.gitlab/auto-deploy-values.yaml index 84ee94a..34430b1 100644 --- a/.gitlab/auto-deploy-values.yaml +++ b/.gitlab/auto-deploy-values.yaml @@ -34,10 +34,3 @@ persistence: accessMode: ReadWriteMany size: 1Gi storageClass: nfs-client - - name: autogram-server-well-known - mount: - path: /app/public/.well-known - claim: - accessMode: ReadWriteMany - size: 1Mi - storageClass: nfs-client diff --git a/app/controllers/apple_controller.rb b/app/controllers/apple_controller.rb deleted file mode 100644 index 41c7f0f..0000000 --- a/app/controllers/apple_controller.rb +++ /dev/null @@ -1,20 +0,0 @@ -class AppleController < ApplicationController - def apple_app_site_association - render :json => { - "applinks": { - "details": [ - { - "appIDs": [ - "44U4JSRX4Z.digital.slovensko.avm" - ], - "components": [ - { - "/": "/api/*" - } - ] - } - ] - } - } - end -end diff --git a/app/controllers/assetlinks_controller.rb b/app/controllers/assetlinks_controller.rb new file mode 100644 index 0000000..fa9d7d1 --- /dev/null +++ b/app/controllers/assetlinks_controller.rb @@ -0,0 +1,9 @@ +class AssetlinksController < ApplicationController + def apple_app_site_association + render :json => JSON.load(Base64.decode64 ENV.fetch('APPLE_APP_SITE_ASSOCIATION', 'e30=')) + end + + def android_assetlinks + render :json => JSON.load(Base64.decode64 ENV.fetch('ANDROID_ASSEtLINKS', 'e30=')) + end +end diff --git a/config/routes.rb b/config/routes.rb index 8deed54..aa7f396 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -20,11 +20,12 @@ resources :integration_devices, path: '/integration-devices', only: [:index, :destroy] resource :sign_request, path: '/sign-request', only: [:create] - get '/qr-code', to: redirect('https://sluzby.slovensko.digital/autogram-v-mobile/#download', status: 302) + get '/qr-code', to: redirect(ENV.fetch("QR_CODE_URL_REDIRECT", 'https://sluzby.slovensko.digital/autogram-v-mobile/#download'), status: 302) end end - get '/.well-known/apple-app-site-association' => 'apple#apple_app_site_association' + get '/.well-known/apple-app-site-association' => 'assetlinks#apple_app_site_association' + get '/.well-known/assetlinks.json' => 'assetlinks#android_assetlinks' # Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html # Reveal health status on /up that returns 200 if the app boots with no exceptions, otherwise 500.