[Archivesspace_Users_Group] Serving ArchivesSpace with prefix and proxy

Steven Majewski sdm7g at virginia.edu
Fri Jul 24 19:41:16 EDT 2015


OK. [1] Copied that file into both {public,frontend}/lib/tasks , replacing the existing file. 

[2] added these env settings to targets  frontend:war and public:war in build.xml 



       <env key="GEM_HOME" value="${gem_home}" />
       <env key="GEM_PATH" value="" />
       <env key="BUNDLE_PATH" value="${gem_home}" />
+      <env key="RAILS_RELATIVE_URL_ROOT" value="admin" />
       <arg line="--1.9 -S rake assets:precompile --trace" />
     </java>


       <env key="GEM_HOME" value="${gem_home}" />
       <env key="GEM_PATH" value="" />
       <env key="BUNDLE_PATH" value="${gem_home}" />
+      <env key="RAILS_RELATIVE_URL_ROOT" value="public" />
       <arg line="--1.9 -S rake assets:precompile --trace" />
     </java>


(did it need a leading or trailing slash ? )

[3] Built distribution, unzipped it an ran. Is that was I was supposed to do ? 


output looks like the env values are getting passed in : 
public:war:
     [echo] Precompiling Rails assets for Public (this can take a little while...)
     [java] ** Invoke assets:precompile (first_time)
     [java] ** Execute assets:precompile
     [java] java -XX:MaxPermSize=128m -Xmx256m -cp /projects/Archivespace/dcs-archivesspace/public/../common:/projects/Archivespace/dcs-archivesspace/public/../build/jruby-complete-1.7.18.jar org.jruby.Main --1.9 -X-C -S rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets RAILS_RELATIVE_URL_ROOT=public
     [java] Using Node ExecJS runtime
     [java] Forcing Rails configuration
     [java] Using Node ExecJS runtime
     [java] Forcing Rails configuration
     [java] Creating public.war
     [java] rm -f public.war



I Still get the same problems with the same set of assets. 
It doesn’t appear to change the behavior at all. 

Note that most of the assets have been loading correctly and still do. 
It’s only that handful that don’t load. See screenshot below showing
correct URLs for one selected. It’s only the ones in red that aren’t loading
on that page.   

— Steve. 







> On Jul 23, 2015, at 11:40 PM, Chris Fitzpatrick <Chris.Fitzpatrick at lyrasis.org> wrote:
> 
> Hi Steven,
> 
> Yeah, so the fix for this is you're probably going to have to precompile you assets again and pass in a relative url root. 
> 
> Something like this would work I think:
> https://gist.github.com/cfitz/8d5d65c30127ff69ff22 <https://gist.github.com/cfitz/8d5d65c30127ff69ff22>
> 
> You can set a RAILS_RELATIVE_URL_ROOT environment variable when you run ./scripts/build_release ( or the build/run dist or whatever ) 
> 
> There's a similar file in the public directory. 
> 
> I think this would work...
> 
> b,chris. 
> 
> Chris Fitzpatrick | Developer, ArchivesSpace
> Skype: chrisfitzpat  | Phone: 918.236.6048
> http://archivesspace.org/ <http://archivesspace.org/>
> 
> 
> From: archivesspace_users_group-bounces at lyralists.lyrasis.org <archivesspace_users_group-bounces at lyralists.lyrasis.org> on behalf of Steven Majewski <sdm7g at virginia.edu>
> Sent: Friday, July 24, 2015 5:25 AM
> To: Archivesspace Users Group
> Subject: Re: [Archivesspace_Users_Group] Serving ArchivesSpace with prefix and proxy
>  
> 
>> On Jul 23, 2015, at 9:11 PM, Steven Majewski <sdm7g at virginia.edu <mailto:sdm7g at virginia.edu>> wrote:
>> 
>> 
>> There is still the issue of LCNAF plugin paths being broken. I haven't looked at that issue yet. 
>> 
>> 
> 
> 
> Looks like LCNAF plugin frontend/routes.rb just needs to be wrapped with a scope like the public and frontend routes: 
> 
> 
> diff --git a/plugins/lcnaf/frontend/routes.rb b/plugins/lcnaf/frontend/routes.rb
> index 9a41305..7f0acd9 100644
> --- a/plugins/lcnaf/frontend/routes.rb
> +++ b/plugins/lcnaf/frontend/routes.rb
> @@ -1,7 +1,9 @@
>  ArchivesSpace::Application.routes.draw do
> +  scope AppConfig[:frontend_prefix] do
>  
> -  match('/plugins/lcnaf' => 'lcnaf#index', :via => [:get])
> -  match('/plugins/lcnaf/search' => 'lcnaf#search', :via => [:get])
> -  match('/plugins/lcnaf/import' => 'lcnaf#import', :via => [:post])
> +    match('/plugins/lcnaf' => 'lcnaf#index', :via => [:get])
> +    match('/plugins/lcnaf/search' => 'lcnaf#search', :via => [:get])
> +    match('/plugins/lcnaf/import' => 'lcnaf#import', :via => [:post])
>  
> +  end
>  end
> _______________________________________________
> Archivesspace_Users_Group mailing list
> Archivesspace_Users_Group at lyralists.lyrasis.org <mailto:Archivesspace_Users_Group at lyralists.lyrasis.org>
> http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group <http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lyralists.lyrasis.org/pipermail/archivesspace_users_group/attachments/20150724/edf250fe/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: assets.tiff
Type: image/tiff
Size: 4099598 bytes
Desc: not available
URL: <http://lyralists.lyrasis.org/pipermail/archivesspace_users_group/attachments/20150724/edf250fe/attachment.tiff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4943 bytes
Desc: not available
URL: <http://lyralists.lyrasis.org/pipermail/archivesspace_users_group/attachments/20150724/edf250fe/attachment.bin>


More information about the Archivesspace_Users_Group mailing list