Jump to content

teppo

PW-Moderators
  • Posts

    3,227
  • Joined

  • Last visited

  • Days Won

    109

Everything posted by teppo

  1. Because simple RT won’t do: “Overcoming Impostor Syndrome” the best post I’ve read in a while. Highly recommended! https://t.co/P9sWiXz18s

  2. RT @_marcusherrmann: Wrote a tutorial on how to kickstart new @processwire installs: get the latest versions of a set of modules at once: h…

  3. teppo

    go hard with wp

    This is one thing that Zend Framework nailed perfectly; in typical setup your entire application lives one level beyond what's directly accessible from the web. I liked it, and it's also something that the security chapter of Programming PHP and the OWASP PHP Security Cheat Sheet suggest.
  4. teppo

    go hard with wp

    Perhaps we're talking about same thing here, but what I meant is that these are just about all handled by ProcessWire out of the box, in one way or another. Probably the most important things webmasters can do are a) avoiding shared hosting like the plague (there are a few examples where this is done right, but usually it's broken and/or a compromise between security and usability) and b) handling server-level permissions properly. I tend to stick with pretty strict permission model and, for an example, won't ever give ProcessWire itself (i.e. the Apache user) permission to write anywhere it strictly speaking doesn't need to write. IMHO making things like .htaccess writable for Apache is not such a good idea, but perhaps that's just me being paranoid. In your post you said that "Set 777 permissions on important content", which seems kind of backwards to me. 777 isn't really harmful in controlled environments, but it's very rarely needed either, unless your permissions, groups etc. are configured in a really weird way. Sometimes it's easier to use that if you don't know what sort of permissions, users and groups the server will have, but that's just about all it's ever good for in this context.
  5. teppo

    go hard with wp

    Clearly defined review process is a good thing to have, +1 for that. I've found this essential in larger projects, but it's not very easy to get right level of specificity. You do want to make sure that all the important things are checked yet you don't want to limit too much (and a process that's defined but not used and/or followed is worse than not having a process at all, as it only gives you false confidence.) Something that scans for vulnerabilities would be very interesting to see in action. It should not be relied upon, but could definitely be used to spot the most obvious sources of potential issues. The main problem is that it can't really distinguish between valid use cases of those "potentially problematic" things: SQL queries can be an issue, except that some modules really need those (and even Ryan has suggested using them a few times on the forum). Calls to system(), exec() and/or shell_exec() can be very dangerous, but some modules can and do use them appropriately. preg_replace() with 'e' modifier is dangerous, but again far less dangerous if used properly (not letting user input affect it etc.) External libraries (and thus any call to include(), require() etc.) are always sources of potential security issues. Any user input is a potential issue, unless properly handled (nearly impossible to distinguish by static analysis.) Anything related to handling files yourself is potentially dangerous. .. and then there are a ton of very real security issues that would be next to impossible to spot just by programmatically analysing code. Anyway, I'm definitely not against such a scanner (and have, in fact, been evaluating a few code analysis tools lately) as long as it's not thought to be some sort of miracle cure. It's not. RIPS is one of the options for doing this kind of thing without writing a ton of code yourself, but it seems that the project is kind of dead right now. No idea when that happened or at what state the existing code base is in, but I wouldn't count too much on that either. I'm not going to comment on the rest of your post except by mentioning that this doesn't have much to do with ProcessWire
  6. teppo

    go hard with wp

    The problem especially with any markup-generating modules -- there's an unlimited amount of possibilities. Unless the thing you're trying to achieve is relatively simple ("list tweets from this user account") or implements very extensive markup configuration options, you'll end up with a ton of modules doing just about the same but with slightly different markup Definitely something to consider for us too: as a general guideline, if there's a module that does just about the same already, it would be awesome if module authors would seriously consider working together instead of posting near-duplicates just to address some minor difference of opinions. Just saying -- I know it's not easy in real world use cases. Still I've seen that happen many times over on our modules, which is great
  7. In addition to what @adrian said above (it's true that without knowing how exactly your "include & bootstrap" code is set up this is very difficult to debug), you mentioned that logging in helps and things start working instantly. This really makes it sound like it could be related to caching, which is then disabled once you login.. or perhaps permissions, though those shouldn't matter at all for API use. Just for the record, is this site hosted on your local machine or a remote server? As a first step when debugging site issues you should always take a look at the error log files (/site/assets/logs/errors.txt) of both sites, in case that something went really wrong. Server logs (Apache logs mainly) may also uncover something of interest. Please let us know if there's anything strange there from roughly the times this has occurred.
  8. RT @veryrobert: I got nudged into using @processwire today by @smngy if you're using Wordpress it's such an easy move with great documentat…

  9. Just for the record, here's how PW itself (in current dev branch) is doing it: $config->cli = (!isset($_SERVER['SERVER_SOFTWARE']) && (php_sapi_name() == 'cli' || ($_SERVER['argc'] > 0 && is_numeric($_SERVER['argc']))));
  10. @bracketfire: that's a cool way to do it, but whether it's the best approach depends on what you're trying to achieve. It's entirely possible, although quite rare, for $_SERVER['HTTP_USER_AGENT'] to be missing from non-cli requests too (it's a header after all), so checking for cli use doesn't entirely prevent this notice from appearing. If the underlying issue is that $_SERVER['HTTP_USER_AGENT'] isn't found and it's necessary for this module to work at all (haven't checked the code so can't really tell), it would probably make more sense to simply check for that specifically with isset(). On the other hand, if the module isn't useful in cli use at all and $_SERVER['HTTP_USER_AGENT'] isn't necessary for it to work properly in non-cli use case, it would make most sense to apply your fix (skip the module entirely for cli users) and add an isset() check to prevent unnecessary notices for non-cli clients that don't, for any given reason, send this header (Sorry, meant to point out something simple, but this turned into a kind of a long rant anyway..)
  11. Sounds good to me! Config setting is a good idea too
  12. RT @snookca: What’s old is new again. Spend enough time in this industry and you’ll see it repeat, for better or worse. It’s like the fashi…

  13. RT @cmdrtaco: The warnings I see on every site telling me they use cookies feel exactly the same to me as the warning on my cup "Coffee may…

  14. RT @emilyst: Evidently the Finnish idiom for “grammar nazi” is “comma fucker”. I move we adopt this idiom right away in English.

  15. Looks great Marcus, I'm looking forward to trying this out! Just thinking out loud, but you could, perhaps, simplify this a bit without sacrificing any flexibility: // the sprintf way echo $flags->renderLink("Add %s to flags", "Remove %s from flags"); // the placeholder way echo $flags->renderLink("Add {flag} to flags", "Remove {flag} from flags");
  16. Thanks Adrian! This has been on my to-do list for a while, looks like I can tick it off now. Benefits of free software -- just wait long enough and someone will solve it for you The way I've seen this implemented before was a checkbox titled "Force password change on next login", which was unchecked when a password was changed. That would slightly simplify things by removing the need to check it for existing users.. and perhaps make things a bit easier to understand if you want to use it at some point later (for some reason unchecking "password changed" sounds weird). Just saying, doesn't matter much either way. The module looks great and I look forward to using it.. on all of our sites Edit: by the way, would you mind specifying a license for this module? I'm not suspicious of your motives or anything (honestly), it's just that I try to avoid any code where licensing isn't clearly stated, and modules are no exception here
  17. RT @netmag: WE NEED YOU - Please help with the @netmag browser testing techniques poll - https://t.co/YzQ3lIDiRy

  18. That moment, when you realise you’ve been switching between http://t.co/9cebBrQFOG and TweetDeck for, like, hours. Sign of addiction?

  19. RT @processwire: Don't miss @Joss_Sanglier's new tutorial on how to integrate any CSS framework with ProcessWire: http://t.co/iqJgpRWZpl

  20. Site doesn't have to look identical in separate devices. Animations and font rendering don't have to be perfect. #Usability is what matters.

  21. @Macrura: I've just pushed 1.0.4 to GitHub. This version drops saveReady hook in favour of ___processInput() method. This actually eliminates the need to throw any exceptions, as the module can simply use current value and continue saving the page. Hope this helps -- and hope it doesn't cause any additional issues either. I've tested it in my own environment and everything seems to work just fine, but please let me know if anything goes wrong!
×
×
  • Create New...