picocms / Pico

Pico is a stupidly simple, blazing fast, flat file CMS.
http://picocms.org/
MIT License
3.84k stars 614 forks source link

Pico's Nginx rules interfere with Plugins #362

Closed mayamcdougall closed 6 years ago

mayamcdougall commented 8 years ago

I don't remember what the reason was that we didn't start these rules with a ^ (regex start of line), but by 404-ing any \lib\ directory, the plugin Pico Edit (or Editor, Peeked, insert fork here) does not work. This happens because they store their javascript inside a lib directory. While we could write this off as a problem with the plugin, it seems more like an oversight on our part.

Since these rules (.htaccess especially) are recommended/included, it may confuse a user who can't figure out why these javascript files would 404. Actually, I think it may have confused me in the past too. :unamused:

I feel like there was a reason for not starting with the ^, but can't remember. I think it was just to maintain compatibility with Pico in a subfolder... because otherwise this would be a quick solution.

mayamcdougall commented 8 years ago

sigh After all the time we spent going over these rules, I did not want to open this Issue. :disappointed:

PhrozenByte commented 8 years ago

I think it was just to maintain compatibility with Pico in a subfolder...

Yes, this was the reason for it. However, it affects the nginx config only, Apache/.htaccess works just fine.

mayamcdougall commented 8 years ago

Are you sure that the .htaccess rule doesn't block all lib folders? The last time I tried one of the editor plugins I couldn't get it to work. That was when I was running Apache with Pico's .htaccess.

I didn't care enough at the time to bother diagnosing it, so I don't know if it was the same issue. It caused the same symptoms though, a blank area where the editing/text field should have been.

PhrozenByte commented 8 years ago

Yes, it works just fine with Apache. .htaccess already includes the ^ in question.

mayamcdougall commented 8 years ago

I don't know how I missed that. :open_mouth:

PhrozenByte commented 8 years ago

So @smcdougall, any updates on this? :wink:

mayamcdougall commented 8 years ago

No... I haven't really thought about it. :sweat:

The only solution I can think of right now is to use change the regex to start with ^/pico (like the later example) if you have Pico in a subfolder.

The reason why we didn't sugget that originally was to keep configuration to a minimum.

Sigh I don't think there's going to be an elegant solution for this. We might just have to provide two configurations.

At some point, I'll try to rewrite that section and move the Root/Subfolder explanation to somewhere earlier in the document.

As long as it's written well, it shouldn't be a big deal. The explanation would really boil down to "change all your /'s into /pico/'s"

PhrozenByte commented 8 years ago

It doesn't have to be a "perfect" solution, it's temporary anyway - Pico 1.1 doesn't need this, see 6465c2b0a99b5262f25083af70b94668c1cac6af

PhrozenByte commented 6 years ago

Fixed in Pico 2.0 (resp. the corresponding website updates), see https://github.com/picocms/picocms.github.io/commit/8ccd6610646d31c950ee42f5c2c3b60878a824bc. This will be merged as soon as we finally release Pico 2.0 (hopefully soon...)