View more context

 

nightjarnz

I get around that by sudo -u $WEB_USER vendor/bin/sake

nightjarnz

on my dev setup WEB_USER is http, but on may e.g. Debian (based) systems it's often www-data.

nightjarnz

Long and short of it is @Hels - try to verify that your .env file is even being read before getting too stressed about why it's not working :)

Hels

that .htaccess in public/assets I changed the owner to apache to allow flush to work normally. If I change the owner back to my login user will that allow the flush to work

Jason Hale

Hi all, I have a request to disable CMS users after 3 failed login attempts. I'm thinking there would be a module for this but can't find anything right now.

nightjarnz

My dev env (not recommending for production) my user owns the file, with the web user group. Both user and group have permission to write.

Hels

I found that that didn’t allow a normal flush to work so I changed the user of that 1 file. & have to remember to change it any time I update silverstripe

👍 (1)
Hels

I changed the user for the .htaccess in both assets and .protected. that got rid of those errors. manually deleting the tinymce .js file it was getting stuck on made it complete the flush without errors

Hels

But, .env still doesn’t seem to be recognised. It is still asking for a password to do dev/build in chrome.

nightjarnz

are you able to verify that your .env file is being read?

Hels

normally I can switch between environment type dev & live as often as I like just by changing it in .env

nightjarnz

e.g. from app/config.php do something like

  1. use SilverStripe\Core\Environment;
  2. //[...]
  3. die(var_dump(Environment::getEnv('SS_DEFAULT_ADMIN_USERNAME'));
nightjarnz

your site will STOP working though, so don't do that if it's on prod.

nightjarnz

as in, write out to a log, not "log out" of the site :P

Hels

hmmm the archive permalink wasn’t quite right. the message says : The default admin isn't set anymore, so it tries to hash the password, but the default admin doesn't have a hashing method set.

Hels

seems to imply that maybe setting the username/password in .env is not possible anymore

nightjarnz

for that person, yeah. There's a missing classname in their database.

Hels

I’ve done the _config.php file. Is something supposed to happen?

Hels

the site was working fine last time I went on it. now I need to use it again either I forgot that I changed the password & now can’t log in, or something has broken. but I haven’t changed anything on it so don’t see how it could have broken

nightjarnz

well die will kill execution. You should have a small bit of text though, the output of Environment::getEnv - you should see what you've set in the .env file for the default admin username.

Hels

how do i see it though? I saved the file and nothing happened

nightjarnz

simply trying to load the site should kill it

Hels

I went to the site & it still wants me to log in. I have now locked myself out cos I failed log in too many times

nightjarnz

Yeah, the site you're editing isn't the site you're viewing then :)

nightjarnz

to be triple sure you could edit public/index.php and put die('THIS IS THE SITE'); right at the top under the opening <?php If you don't see that site on your screen, then it is most definitely not the site you're editing the files for.

I've made this mistake many times.

Hels

you made me think I was losing my mind so i checked!! wierdly though, the .conf file is not currently in sites-enabled. it should be. so I don’t know how I can even get to the log in page in chrome

Hels

its very weird. I just created a new subdomain in cloudflare, and a new .conf file for it. & that one also is accessible even though the .conf file is only in sites-available not copied to sites-enabled - which is meant to be a requirement to work

Hels

the plot thickens. I tried a different site I havent used for ages that is also not in sites-enabled & also the document root in its .conf file (& the whole silverstripe project) is deleted. That site also goes to a log in page. It is identical to the problem one. there is 1 menu link to a non-password protected page. the page contents is empty. neither of the mariadb databases has an entry in the SiteTree table for a page with that name

Hels

could someone have broken into the server & played around?

nightjarnz

Seems unlikely, but is possible I guess. Glad you've found an answer though, even if it is just another question 😅

Hels

Ive looked further. There’s something making some subdomains point all to the same site. (see my message in channel)

nightjarnz

Never dealt with either cloudflare or digital ocean I'm afraid. But I can certainly see how that would be troublesome!

Hels

it was all going fine until now. its something I haven’t touched in a couple months. The one they are all pointing to is one that i actually need otherwise I would just delete it

Hels

fyi I fixed it. I answered my other question as a thread so that the archive has the solution

👍 (1)

Show less replies
Hels

@Jason Hale I remember seeing something about setting that in the regular Member class when I was recently reading it to try to figure out some stuff

👍 (1)
nightjarnz

The system will lock an account for a period of time - reasonably sure that could be configured to be 99billion minutes :P

null

Is it possible to intentionally add duplicate records to a many_many relationship?