Jump to content

netcarver

PW-Moderators
  • Content Count

    1,749
  • Joined

  • Last visited

  • Days Won

    33

netcarver last won the day on October 30 2019

netcarver had the most liked content!

Community Reputation

2,604 Excellent

About netcarver

  • Rank
    Code Monkey

Profile Information

  • Gender
    Male
  • Location
    UK

Recent Profile Visitors

13,999 profile views
  1. @ryan Now I'm worried that you have some kind of psychic x-men power or something! Seriously though, that's great news and shows I should actually read the code for the new version of the function before I type up a reply here.
  2. @ryan looks like a nice set of improvements, thank you. With regard to the new location() method, I can understand the move away from the second parameter in the existing redirect() call as it is a little confusing. Although this isn't in the spirit of the move to simplify, if I wanted to do a 303 redirect would I have to manually set the location header using sendHeader() and then return a 303 via sendStatusHeader()? I wonder if the existing redirect() call be changed to accept either the existing bool or an int for the second parameter? In the case of an int, maybe one of the 300 (301/302/303/307/308) codes could explicitly be passed and used as the return code. That would certainly make its use more explicit and more intuitive than the existing none/true/false as the second parameter. Regardless, excellent work as usual.
  3. I'm sure this should be pretty easy on PW - but is it possible to delete a user when they logout? Essentially, I have a bunch of ephemeral users I use for testing, once I log out as that user, I want them to disappear from PW. I've tried hooking before/after Session::logoutSuccess, and also just processing the ?logout=1 directly in a template file. Not feeling particularly bright at the moment.
  4. Hi @Markus (Blue Tomato) Don't know, but here are a few things to get started on. Is production running the same version of PW or one prior to that commit? Does production connect to MySQL on localhost or via a second IP address? Ditto for your dev box. If dev box is connecting to MySQL using "localhost" in your config.php file DB settings, try switching it to "127.0.0.1". Any errors/exceptions in the PW log files or web server log files on your dev box?
  5. Going to package and release as a Textformatter in the modules directory @bernhard or @JoshoB?
  6. netcarver

    COVID-19

    Interesting video from MinutePhysics on Youtube. And here's the website for the log-log graph.
  7. Just to confirm, the folks at Folding@Home are using the cluster to search for drugs that might be of use in preventing SARS-CoV2 from initiating infection. So by donating your CPU compute resources you will immediately be helping in research that could save a lot of lives. You can read more about there current efforts here. If you have GPU power that is idle some of the time, you can also have Folding@Home work packets run on that, though I think the SARS-CoV2 research is currently only running on CPUs. There's still plenty for GPUs to work on though. More about the project on Wikipedia.
  8. Hello All, In the middle of this pandemic, I came across a citizen-science site that I think we should all consider helping out. It's called folding@home and aims to produce the largest distributed medical research computer cluster in the world, in order to solve protein folding problems, that should help develop treatments (or cures) for multiple medical conditions we all face. If you, or your company, have any spare internet connected resources, please consider joining the cluster - it's fairly easy to setup the client and connect. I'm running this on my linux laptop and hope to keep doing so. It's quite CPU intensive so you get to choose the level of resource usage it can have. For example, to control my CPU temperature. I've limited to just a single thread on an i7. Please support if you can.
  9. netcarver

    COVID-19

    The best educational videos on covid-19 I have yet seen:
  10. You are right; whilst it is possible to get a vhost/.htaccess-based A+ on security headers while keeping the admin interface fully operational, it is a pain and leaves the apache config files in a bit of a mess. Getting the admin interface sorted in the vhosts file prompted this post over in dev-talk that might also help someone out if they go down that route. What you've posted seems to be a fairly nice approach to the issue - thanks!
  11. Sounds like your test_image field is configured to return an array of results - hence access via the first accessor fixing things for you.
  12. Just a heads up, I hope this might save someone some time in the future. TL:DR> It's taken me hours to work out that Apache version 2.4 <If> statements are broken when trying to do regular expression matches against the %REQUEST_URI variable. Try matching against the variable called %THE_REQUEST instead - but be careful with your regex. Background: I've been trying to add more relaxed CSP headers for the admin portion of one of my PW sites because my default, strict, CSP headers stop some admin features from working properly. After diving in to Apache2 regexs and conditionals, I thought I had the answer with this... <If "%{REQUEST_URI} !~ m#^/admin/?#i"> # CSP headers for external visitors. Header set Content-Security-Policy "<strict policy for public site>" </If> <Else> # CSP headers for admin visitors. Header set Content-Security-Policy "<lax policy for admin>" </Else> ...but I couldn't make it work. After experimenting for several hours I found that the regex shown above does work if you limit it to a single-character match; which is essentially useless for determining if we are in the admin interface. However, you can achieve a useful match with the following... <If "%{THE_REQUEST} !~ m# /admin/?#i"> ... </If> <Else> ... </Else> ...which checks verses the entire HTTP request line made to the server. This block can go in your vhosts file or in the site's .htaccess file. Here's the Apache documentation: https://httpd.apache.org/docs/current/expr.html and it seems I'm not alone in having this issue: https://serverfault.com/questions/940953/apache-if-statement-not-working?noredirect=1&lq=1 although neither of these links had workable solutions for me.
  13. @jajaja With both Digital Ocean and Contabo you get a bare VPS that you have to setup and manage yourself - both of these VPS offerings are capable of running Processwire if you are capable of administering the VPS. Costs are comparable between the two services (I've used both), but Digital Ocean has a much better administration interface, whilst Contabo offer a much better spec of VPS server for the about the same price. Feel free to get in contact via Private Message here on the forums if you want any more details. If you are not used to administering your own VPS, then there are managed solutions that might work better for you - but they will cost more. HTH
×
×
  • Create New...