Serious Safe Mode Discussion

andrezero

Joined: 2006-06-13
Posts: 4
Posted: Tue, 2006-06-13 01:13

I'm also very disapointed about this (among other things) and looking for alternatives to g2.

But considering the amzing stuff you guys have pulled together, i' taking on hour of my life in to writing the best intervention i can make here.

First of all, let me point out that this post will not be another safe_mode silly or wise digression.

I read all the thread very carefully and I do understand the gallery team point of view.

But you guys must accept the other point of view. And it looks like you won't.

For me, as I said, I'm allreaedy looking for alternatives (anyone wan't to point some?.... ah! just kidding..) beacuse I'm with my hosting provider for 5 years now and he never let me down. I all my life there, 12 domains, apps, blogs and communitys i'm putting all my life juice into... so you must understand, it would be crazy to question this realtion and investment for some odd safe_mode question that was never an issue (it's nearly 10 years of web devlopment now)

So let's go for it:

#1 "[ y o u r ] . f o c u s . i s . t o . w r i t e

the best, most full-featured Gallery product that [you] can because that is what [your] users want

SURE, OK with that.

#2 - G 2 . h a s . a . m i l l i o n . u s e r s .

GREAT! GOOD for you... could have a million and on.

Now think about the future very carefully. I mean think like a business man, or even better like a paleontologist or historian. You have this big big big big big entity, a huge animal or civilisation, very big, full featured, dominant... but just not flexible and adpatative.

Of course, when your big you can adpat the (the, not to the) environment around you. You can lobby (duh! you do allready) the Hosting market to go suexec (+this & that) or whatever else you want...

NO! Really... you are that big?

So just think, what if the environment changes, for the worse?... you know it will, don't cha?.. web 2.0 is not just spiffy flash interfaces and video online processing... it is also more control, more scurity checks, more business in line, but also more hackers and crackers on the loose... who will watch the magnificent gallerian civilisation (or the all mighty gallerosaurus) fall

My better advise is to make it a top priority to create a more environment independet solution. Make the features available/not available depending on environment. Make it easy for people to install/uninstall modules and plugins, provinding separate downloads for feature packs, and the same time checking for inter-dependencies, and cleaning up files on uninstall.

Check the way that wordpress is going. I don't know about theyr code, but theyr architecture is slim and smart.

Also remember that your fixed requirements are living out thousands more users *without* gallery.

S o . l e t . m e . b e . c o n s t r u c t i v e . h e r e :

As I undesrtand, binaries and time limits are the reasons for the safe_mode requirement.

#1 binaries. that's solved with the easy to install plugins. for instance, i'm not even planning to upload video, or pdf's, just a jpg's (thousands of them). I would love to use G2 that way. Upload the G2 engine, install it. Test it. Download a couple of plugins, upload, activate, test... couple more... nice, couple more... ups! this one needs safe_mode... can't use it... nevermid...

Know what I mean, right? Have the 1000's of users you have plus 10x more which will never need video thumbnails and other youtube-like 5 star features.

#2 as for the "30 second limit may break processes and currupt data" that's a bit more complicated.

Please read this carefully, I'm going to speak about what i know best, and this issue wasn't really addressed here before since it has been more of an (un)safe_mode g2_devs/isp_sysamin discussion.

A N D . T H I S . I S . M Y . B E T T E R . A D V I S E

If you have designed your application with a database in mind that has no transaction support you should have never break your data processes into parts without placing the proper checks and providing the automatic mecanisms to render any and all data integrity corruption rollback'ble.

Hacking time_limit is a veeeeeeeeeeery poor solution. It's no solution at all. If process is slow, low, or whatever else (whateve else as like someone said here, you never know what myght be happening around) do you really think you can complete your php level "transaction"? Even in a crash? As in a power failure? As in an energy crises?

Well, so long for the future (again...)

I would sugest you make a "really no transaction's" version of the application. It's not that hard.

I mean, I haven't seen your DB structure yet, but I bet you've done a hell of a job on making a state-of-the-art relational database on this v2, right?

Wrong! Go back to... reality: no transactional database means no transactions, flat data-model, and all transaction-like code in php should be automatically rollback'ble (like in oldskool coding... integrity checks, trash collectors, etc...)

In a world of coherence, and big balls, the gallery dev team must choose:

* no safe_mode » secure dedicated server (or alternative solutions, for that matter)
* transactional data model » transactional data base.
* full featured » business oriented

or

* safe_mode(or not) » any type of server
* transaction(or not) » any db
* less features » comunity oriented

Right now, you are not doing a good job on securing each path. Start thinking about v3 right away.

 
andrezero

Joined: 2006-06-13
Posts: 4
Posted: Tue, 2006-06-13 01:42

One more idea for galley3

ajax

follow the light guys

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7993
Posted: Tue, 2006-06-13 03:07

Hi, Andrezero. Thanks for taking the time to post. However, none of this changes the fundamental stopping point in this equation which is that in the past 5 years *nobody* has stepped up to do this work. I have offered over and over again to help *anybody* who is willing to take on this task. We made it a Summer of Code idea to see if people would be interested. Nobody is donating the time.

Lots of people show up and say "hey, this is easy -- why don't you do it". But when they actually *try* to make it happen they realize that it's far harder than they think. You're a developer (I know this from the emails you've sent). You're smart and motivated. If you step up and commit to helping us make a safe_mode compliant version of G2 then great -- we'll provide you with all the support you need to make it happen. But it all starts with you.

The bottom line is that we developers have donated thousands of hours to this project, and that means that each developer gets to choose what he or she would like to work on. None of the developers are interested in making Gallery safe mode compliant, therefore it does not happen. It would only take *one* developer to step up and work on this, but for all the hundreds of people who have been involved in this thread and the the tens of thousands of people who have certainly read it -- nobody is actually willing to spend any time on it.

My challenge to you: find me *one* qualified developer who is willing to take on this task, and I'll give that developer whatever he or she needs to make it happen. Until that developer shows up, it's not going to happen.

P.S. safe_mode is gone in PHP6. The PHP developers themselves don't believe it's a good solution. If we wait long enough this problem vanishes. Oh, and there are lots of hosting companies that provide solutions with safe_mode off.

 
dmolavi
dmolavi's picture

Joined: 2002-12-05
Posts: 573
Posted: Tue, 2006-06-13 11:23

bharat-
seeing as how this is a recurring thorn in our side, maybe the project should pony up something more than "if you can do it, do it"...although, seeing as how the $4500 from SoC wasn't enough for anyone to step up, I'm not sure what sort of incentive it would take to make this happen.

Personally, I'm with you on this, though. This horse is dead, let's stop beating it.

[img]http://www.nukedgallery.net/signature.jpg[/img]

 
Oldiesmann
Oldiesmann's picture

Joined: 2005-05-18
Posts: 151
Posted: Thu, 2006-06-15 22:49

While I am not a PHP guru by any means, there is one simple solution to safe_mode that many people overlook - open_basedir. If you can't use Gallery because of safe mode restrictions and you don't want to change hosts, try asking your host to use this instead. It will provide the security they're looking for without the annoying ownership restrictions enforced by Safe Mode.

The Oldiesmann
SMF Support Specialist
SMF+G2 Integration Project - Beta2 now available!

 
tanhnhi

Joined: 2006-08-16
Posts: 2
Posted: Wed, 2006-08-16 16:27

I've installed Gallery 2 on my host who has safe mode ON. Visit my blog http://shawking.free.fr/blog/index.php for more information. But I really hope that there will be a version of Gallery that supports safe mode ON, simply because I cannot change my host (who proposes 10 GB storage + MySQL + totally free)

 
searon

Joined: 2006-09-26
Posts: 8
Posted: Tue, 2006-09-26 13:11

i made a previous post on another place on the forum ..

there is a working version of g2 v.2 and v.2.1 at http://www.netsons.org/viewtopic.php?t=117&sid=147134b

(V.2.1 is located at the very bottom of the thread so dont miss it)

these patched versions DO work in safe_mode, i Dl them and tested them .. both versons work just fine in safe_mode.

so Enjoy

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Tue, 2006-09-26 17:04

Here are the diffs in that patch: http://tools.gallery2.org/pastebin/859

 
fryfrog

Joined: 2002-10-30
Posts: 3236
Posted: Tue, 2006-09-26 18:34

I took a look at the diff, and it is pretty simple. I think, if I am reading it right all it basically does is disable the check for safe mode and remove *everything* related to time limits.

This means that your G2 *could* end up totally trashed sometime if you happen to take longer to finish than the server thinks you should be allowed. So don't upload a lot of files at once, don't try and generate a ton of thumbs/resizes at once and generally don't do anything that takes a long time.

Fortunatly, since you'll be limited to GD and none of the "awsome" functionality, you should be okay.

At least, I think that is how I've read it.
_________________________________
Support & Documentation || Donate to Gallery || My Website

 
searon

Joined: 2006-09-26
Posts: 8
Posted: Tue, 2006-09-26 23:00

I guess that depends on what you refer to as a long time .. i uploaded 60 images at a time and i had no problem .. guess it could happen then if u try it with hundreds at a time .. but that seem a bit silly to work with that many at a time ...

besides im not limited to GD either .. im not even running GD on my host ..

as i see it, though i havent run it for a long time yet .. its just as good as the "original"
i guess time will tell as the trafic increase and the galleries pile up ..

 
fryfrog

Joined: 2002-10-30
Posts: 3236
Posted: Wed, 2006-09-27 15:50

Please do keep an eye on things, and once there is a db consistancy task it should be easier to find out if there are any db problems being created as you grow. It'd be nice to find out how it all goes.
_________________________________
Support & Documentation || Donate to Gallery || My Website

 
searon

Joined: 2006-09-26
Posts: 8
Posted: Wed, 2006-09-27 21:51

site and gallery is working just great .. please have a look if u feel like it ..
www.peterhogel.com gallery is working fine so far .. atm with only 9 albums and aprox 200 images .. more to come though

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7993
Posted: Wed, 2006-09-27 23:11

@searon: glad to hear that you have it working. The problem with safe_mode is that it's a sliding scale-- your provider can disable many features with it. It sounds like they have not disabled the "exec" command (or else you would be forced to use GD because it's the only graphics toolkit that doesn't require exec support). So what works for you may not work for others.

 
shivac

Joined: 2003-04-06
Posts: 2
Posted: Tue, 2007-01-30 21:19

Hey, first I want to say thanks to the people that have developed this amazing gallery script. Just love it!

I have one problem though, im using the php safe modded verison. www.one.com has php safe enabled of course.

In some albums, and some files. Im trying to edit permissions or delete files. I get a WHITE screen. No error messages or anything. Just "clicky, pop white screen" ...

Anyone been into this before? Are there any solutions to this problem?

 
yukio

Joined: 2007-01-27
Posts: 1
Posted: Fri, 2007-02-02 11:22

Hello everyone!

Thanks for all here!
But I have on request: I cannot download the patched version, because it seems, that the Server is down. Could this be right? I used G2 at my Homepage with +2000 Pictures, till a hacking attempt forced my hoster to set "safe_mode" on (how i hate script-kiddy-hacker! ^_^)
So, is there some opportunity to get the patch via another Server or so...?
Would be very glad to get answers,

Blessings and greetings from Japan,
Yukio

 
DylanL

Joined: 2007-02-13
Posts: 14
Posted: Mon, 2007-02-19 11:31

Same as above, is there anyone that knows a mirror of the Netsons patched 2.1.2 version?
The original forum thread on Netsons, together with the file, have been removed.

Thanks in advance.

 
george9t8

Joined: 2007-02-06
Posts: 129
Posted: Fri, 2007-03-09 16:09

Thanks for the diffs.

I've been using G2 with safe mode on with no problems so far (I'm not using NetPBM).

I asked my host about set_time_limit() and they said it was set to 1000s on their servers. Am I right in thinking this is quite high, and could it be why I haven't experienced any problems (yet)?

my gallery

 
torgeiten

Joined: 2007-03-25
Posts: 2
Posted: Sun, 2007-03-25 17:51

youcan no longer get the patch at netsons, can anyone host the newest patchs somewhere?
or send it on msn to me so i can host it?

 
Oldiesmann
Oldiesmann's picture

Joined: 2005-05-18
Posts: 151
Posted: Thu, 2007-04-05 20:27

A quick search on their forum brought up this topic... http://www.netsons.org/viewtopic.php?t=1536
---------------------
The Oldiesmann
SMF Project Manager
SMF+G2 Integration Project - Beta3 Now Available!

 
Espo

Joined: 2007-04-22
Posts: 1
Posted: Sun, 2007-04-22 20:20

Just to give people some hope, I am glad to mention that PHP 6.0 is not going to have safe_mode at all. This way, the grumpy ISPs/webhosters will have to secure their server properly. I hope this can bring focus for the developers away from safe-mode compatibility programming, and into making this already great product even better.

Espen

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7993
Posted: Thu, 2007-09-13 03:29

Here's yet another amusing post about a safe_mode workaround for your entertainment.
http://www.securityfocus.com/archive/1/479189/30/0/threaded

Can't wait for PHP6!

 
Oldiesmann
Oldiesmann's picture

Joined: 2005-05-18
Posts: 151
Posted: Mon, 2007-09-17 22:41

Yeah. I can't wait to laugh at all the hosts that start freaking out when they can't find safe_mode :D
---------------------
The Oldiesmann
SMF Project Manager
SMF+G2 Integration Project - Beta3.1 Now Available!

 
Slayergirl
Slayergirl's picture

Joined: 2007-09-12
Posts: 180
Posted: Wed, 2007-10-31 09:41
Espo wrote:
Just to give people some hope, I am glad to mention that PHP 6.0 is not going to have safe_mode at all. This way, the grumpy ISPs/webhosters will have to secure their server properly. I hope this can bring focus for the developers away from safe-mode compatibility programming, and into making this already great product even better.

Espen

One prob is probably that the hosters will not upgrade to PHP 6 in YEARS. Look at PHP5...enough hosts are still running PHP4.x

0_0 my host just disabled safe mode for me (didn't expect that they would do it)

 
virshu
virshu's picture

Joined: 2003-09-13
Posts: 314
Posted: Wed, 2007-12-19 09:02

Here is the final word re: PHP6 from the man himself:
http://news.php.net/php.internals/31925

 
MalastiC

Joined: 2007-03-21
Posts: 34
Posted: Thu, 2008-01-17 17:26

Good morning. The technicians who carry the administration of my site I have offered to change PHP 5 to version 6.

Can I do better or hope?

Regards,

My Webs: http://www.malastic.com & http://www.fondosbuenos.com

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Thu, 2008-01-17 19:45

PHP 6? :) php 6 hasn't been released yet, it's still in development. i wouldn't use it for any website yet. you can play with it, but it's not ready for production yet.
stick with php 5.

g2 doesn't work with php 6 yet. gallery 2.4 is scheduled to work with php 6.

--------------
Documentation: Support / Troubleshooting | Installation, Upgrade, Configuration and Usage

 
dostroyer44

Joined: 2008-01-17
Posts: 3
Posted: Thu, 2008-01-17 22:02

yes.safe_mode was a try to ease the process of securing a system...

 
Build a Website
Build a Website's picture

Joined: 2008-02-04
Posts: 1
Posted: Mon, 2008-02-04 21:08

I agree with valiant, I do not think php6 should be implemented anywhere just yet :D

 
Bodrum villas

Joined: 2008-03-24
Posts: 2
Posted: Thu, 2008-04-03 07:43

thanks for information...

 
Feldon

Joined: 2007-01-15
Posts: 16
Posted: Sat, 2008-04-26 02:13

While my host doesn't have safe_mode enabled, they refused to let me use ImageMagick and FFMpeg due to "gallery2's improper use of exec() and shell_exec()." They went on to say that they've had them uninstalled since 2004 because they are the most likely way their server would be hacked.

What's that all about? I assume the Gallery2 developers would disagree.

Regardless, would it ever be possible for ImageMagick or FFMpeg to work as intended without exec() or shell_exec()?

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7993
Posted: Sat, 2008-04-26 04:12

Our improper use of exec? I have *no* idea what these guys are talking about. Please tell them to contact us, if we're doing something wrong (or even unreasonable) we can definitely fix it. Unfortunately, ImageMagick, NetPBM and ffmpeg are all separate binaries and the only reasonable way to use them is by using exec(). We strive to do this right and until now had no indication that we weren't doing so.

 
JasonFrank75

Joined: 2008-11-15
Posts: 1
Posted: Sat, 2008-11-15 10:45

maybe turn off safe mode on demand?

 
fangji

Joined: 2008-12-07
Posts: 3
Posted: Tue, 2008-12-09 11:39

sorry for asking it here...
I have been changed Liv-Tyler.com's server more than 6 times in 8 months because of bandwith usage and 2 times because of safe mode.

Whatever Finally I solved the problem...
Sorry again...

 
paulcobb

Joined: 2006-05-04
Posts: 122
Posted: Fri, 2009-01-02 18:04
Quote:
Manual instructions to patch the official release of G2 yourself to make it work with safe_mode on:

Is there a valid patch to make the latest version of gallery work on a server with safe mode on?
If so - can someone point the way please.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sat, 2009-01-03 00:16

i'd check with the users of free.fr. historically, they kept their safe mode patched version of gallery 2 somewhat up to date.

--------------
Documentation: Support / Troubleshooting | Installation, Upgrade, Configuration and Usage

 
liquid-motion

Joined: 2009-03-14
Posts: 3
Posted: Sat, 2009-03-14 17:48
paulcobb wrote:
Is there a valid patch to make the latest version of gallery work on a server with safe mode on?
If so - can someone point the way please.

Finally there is! A patched version of Gallery 2.3 can be found here: http://www.liquid-motion.nl/dl/download.php?t=f&i=1.

 
tuxian

Joined: 2005-06-16
Posts: 10
Posted: Fri, 2009-03-27 17:26

Thank you but I still get a error message that safe mode is enabled.

I would like to upgrade an existing gallery which was previous on a server with safe_mode enabled php.
Now I need to upgrade gallery and switch to the patched version.

 
MalastiC

Joined: 2007-03-21
Posts: 34
Posted: Sat, 2010-01-02 08:33
liquid-motion wrote:
paulcobb wrote:
Is there a valid patch to make the latest version of gallery work on a server with safe mode on?
If so - can someone point the way please.

Finally there is! A patched version of Gallery 2.3 can be found here: http://www.liquid-motion.nl/dl/download.php?t=f&i=1.

Thank you. I will try.
Regards,