Re: [Arches] Images stopped working

2019-02-25 Thread Adam Cox
Hi Dale, nice work troubleshooting. I think putting that in Apache and
leaving the default MEDIA_URL setting is the best answer. Thanks for
letting me know what worked for you!

Adam

On Mon, Feb 25, 2019 at 11:19 AM Dale Lloyd  wrote:

> I tried 'Alias /files/ /opt/Projects/mehs/mehs/uploadedfiles/' again and
> it did not work.
>
> Then it occurred to my to try 'Alias /files/uploadedfiles/ /opt/Projects/
> mehs/mehs/uploadedfiles/' and it worked. Is this ok, or would altering
> the MEDIA_URL setting be preferable?
>
> Thanks for your time, expertise and patience!
>
> --
> -- To post, send email to archesproject@googlegroups.com. To unsubscribe,
> send email to archesproject+unsubscr...@googlegroups.com. For more
> information, visit https://groups.google.com/d/forum/archesproject?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Arches Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to archesproject+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- To post, send email to archesproject@googlegroups.com. To unsubscribe, send 
email to archesproject+unsubscr...@googlegroups.com. For more information, 
visit https://groups.google.com/d/forum/archesproject?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Arches Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to archesproject+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Arches] Images stopped working

2019-02-25 Thread Dale Lloyd
I tried 'Alias /files/ /opt/Projects/mehs/mehs/uploadedfiles/' again and it 
did not work.

Then it occurred to my to try 'Alias /files/uploadedfiles/ /opt/Projects/
mehs/mehs/uploadedfiles/' and it worked. Is this ok, or would altering the 
MEDIA_URL setting be preferable?

Thanks for your time, expertise and patience!

-- 
-- To post, send email to archesproject@googlegroups.com. To unsubscribe, send 
email to archesproject+unsubscr...@googlegroups.com. For more information, 
visit https://groups.google.com/d/forum/archesproject?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Arches Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to archesproject+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Arches] Images stopped working

2019-02-25 Thread Adam Cox
Hi Dale, it would definitely be a security risk to expose that whole
directory in that manner. However, are you sure it doesn't work, regardless
of what's in the URL already? I think it should because 'uploadedfiles' is
hard-coded into the URL here:
https://github.com/archesproject/arches/blob/master/arches/app/datatypes/datatypes.py#L1106.
Frankly, the way this is handled has always confused me a bit, but the I do
know that it will work without you exposing that directory.

You can always alter the URL with the MEDIA_URL setting.

We don't have an authoritative guide on permissions, but it would certainly
be helpful to have. Feel free to make a ticket in our documentation repo,
github.com/archesproject/arches-docs, and add as much information as you
can, to help push it along.

Thanks!
Adam


On Mon, Feb 25, 2019 at 9:49 AM Dale Lloyd  wrote:

> Thanks Adam!
>
> I would have to put something slightly different in the Apache config,
> because 'uploadedfiles' is already in the image URL:
>
> Alias /files/ /opt/Projects/mehs/mehs/
>
> I did a quick test and found that if i put the the alias into the Apache
> config, the whole Arches directory would be exposed to the internet. Would
> this present a security risk?
>
> Is there a list somewhere which says which files and directories Apache
> needs read and write access to?
>
> --
> -- To post, send email to archesproject@googlegroups.com. To unsubscribe,
> send email to archesproject+unsubscr...@googlegroups.com. For more
> information, visit https://groups.google.com/d/forum/archesproject?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Arches Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to archesproject+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- To post, send email to archesproject@googlegroups.com. To unsubscribe, send 
email to archesproject+unsubscr...@googlegroups.com. For more information, 
visit https://groups.google.com/d/forum/archesproject?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Arches Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to archesproject+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Arches] Images stopped working

2019-02-25 Thread Dale Lloyd
Thanks Adam!

I would have to put something slightly different in the Apache config, 
because 'uploadedfiles' is already in the image URL:

Alias /files/ /opt/Projects/mehs/mehs/

I did a quick test and found that if i put the the alias into the Apache 
config, the whole Arches directory would be exposed to the internet. Would 
this present a security risk? 

Is there a list somewhere which says which files and directories Apache 
needs read and write access to?

-- 
-- To post, send email to archesproject@googlegroups.com. To unsubscribe, send 
email to archesproject+unsubscr...@googlegroups.com. For more information, 
visit https://groups.google.com/d/forum/archesproject?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Arches Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to archesproject+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Arches] Images stopped working

2019-02-24 Thread Adam Cox
Hi Dale,

The static settings you mention actually have to do with js/css/image files
that are part of the code base, for example background images on the
homescreen, or logos. The file uploads you are talking about are handled
with the MEDIA settings. I think that the default settings should be ok,
but adding another line to your Apache config file should help.

First, look on the server and make sure that the jpg files themselves have
actually been uploaded. I'm guessing they are in
/opt/Projects/mehs/mehs/uploadedfiles.

Assuming they are there, add this line to your apache config file and then
restart apache:

Alias /files/ /opt/Projects/mehs/mehs/uploadedfiles/

If that doesn't work, try tail /var/log/apache2/error.log to see if apache
is recording any errors. It's possible that you may have to add another
block to the config file that explicitly give apache access to that
uploadedfiles directory just like you have already done for the static
directory.

Adam

On Thu, Feb 21, 2019 at 4:34 AM Dale Lloyd  wrote:

> Images for resource reports (under Information Carrier) have stopped
> working on our Arches site.
>
>
> http://maldivesheritagedata.oxcis.ac.uk/report/c40118dc-bfeb-11e8-a7ea-005056ad8063
>
> I have installed Arches on Ubuntu 16.04 using the setup script
> 
> and set up Apache using the instructions here
> .
>
>
> http://maldivesheritagedata.oxcis.ac.uk/files/uploadedfiles/Isdhoo_Lomaafaanu_2.JPG
> is stored in /opt/Projects/mehs/mehs/uploadedfiles/Isdhoo_Lomaafaanu_2.JPG
>
> /etc/apache2/sites-enabled/000-default.conf contains the following:
>
> WSGIDaemonProcess arches python-path=/opt/Projects/mehs/mehs:/opt/Projects
> /ENV/lib/python2.7/site-packages
> WSGIScriptAlias / /opt/Projects/mehs/mehs/wsgi.py process-group=arches
>
>
> 
> Options Indexes FollowSymLinks
> AllowOverride None
> Require all granted
> 
>
>
> Alias /static/ /opt/Projects/mehs/mehs/static/
> 
> Options Indexes FollowSymLinks
> AllowOverride None
> Require all granted
> 
>
>
> settings.py contains:
>
> STATIC_ROOT = "/opt/Projects/mehs/mehs/static"
> STATIC_URL = "/static/"
>
>
> STATIC_ROOT = os.path.join(PACKAGE_ROOT, 'static') does not work
>
>
> Hope that somebody can help.
>
> --
> -- To post, send email to archesproject@googlegroups.com. To unsubscribe,
> send email to archesproject+unsubscr...@googlegroups.com. For more
> information, visit https://groups.google.com/d/forum/archesproject?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Arches Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to archesproject+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- To post, send email to archesproject@googlegroups.com. To unsubscribe, send 
email to archesproject+unsubscr...@googlegroups.com. For more information, 
visit https://groups.google.com/d/forum/archesproject?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Arches Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to archesproject+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.