-
Posts
158 -
Joined
-
Last visited
-
Days Won
1
Everything posted by Karl_T
-
About session fingerprint and load balancer IP change
Karl_T replied to Karl_T's topic in General Support
Hi @Zeka Although this does the trick to prevent log out, I still would want to get the client's real IP address as stated. I found that this is not possible right now as the getIP method Processwire using do not have a place for setting to read new header. I added a feature request for this issue here: https://github.com/processwire/processwire-requests/issues/92 Edit: Sorry, I have made a mistake. Setting $config->sessionFingerprint do nothing to IP storing. The way to get the forawrded client's IP is using something like $sessoin->getIP(false, 2); instead of $sessoin->getIP(); The key is the second parameter. I got logged out even though I set $config->sessionFingerprint = 12; If I find out the reason I will report back here. I can confirm that my own IP address is fixed. -
About session fingerprint and load balancer IP change
Karl_T replied to Karl_T's topic in General Support
Thanks for your advise. I just upgraded to 3.0.60 but unfortunately no luck. -
I am currently using Elastic Load Balancing(ELB) from AWS. ELB is the HTTP end point, so the IP address stored in session is the ELB's local IP address instead of the client's IP. Unfortunately, ELB randomly change its local IP address, which induce session change and log anyone out. I tried change the session fingerprint as below. $config->sessionFingerprint = 12; However, I am still unable to get the client's IP address correctly. ELB is passing the client's IP with X-Forwarded-For header. How can I store correct IP in session? I can just set session fingerprint to not tracking IP, but I am building e-commerce site and using Padloper which required IP address. This is why I want to fix this.
-
Thanks @adrian giving me the hint of the possibility of configuring the parent page. I found I missed the "Where editing tools are available and separately configurable" > "Configurable pages" inside module configuration and then it may be configurable in the page setting tab after adding parent page.
-
Thanks for your points. It indeed makes less difference for low traffic site where shared hosting is the common choice. I always use cheap VPS plan in DigitalOcean or Linode to gain the largest control for less money so I forgot about shared hosting for long..
-
Thanks netcarver, I will try to make a pr on it. I do think using Redis as the session handler has many advantages such as reduce work load for mysql(if you are using it to store sessions) and performance boot(fastest way at the moment?). I experienced a faster page load after using it, no thorough experiment anyway lol. So, I am surprised that no much dev is interested in this(no reply in the SessionHandlerRedis post last two years!?). I wonder if I missed some drawbacks or this tech is already outdated.
-
Hi adrian, I am looking for the config tab that should be appearing at the red rectangle in the above image. Without that I cannot fix the column shown. I tried to use the column tab to set the column, but it only works until a page reload. It just shows the default column set inside BCE module config after page reload while not all the pages need the same fields to show or edit. I wonder if this is possible or this is intended as I can see the config tab for 0.5 second then it disappeared. Thanks.
-
@arjen Thanks for your suggestion. Hopefully my publish does not cause much issue here. Sorry if I have violated something. I wondered if it is appropriate to fork a project with 90% code changed or instead fork to SessionHandlerDB with more similarity. I will try to fork SessionHandlerRedis later. Hope that netcarver is still interested in this module.
-
Greetings. I am here to share my first module. I make this module because I cannot find one to suit my need. I like SessionHandlerDB but I do not want to use mysql database to store session for performance. So, Redis seems to be the best choice. I have tried to use netcarver's SessionHandlerRedis but it lacks something I need, those are the active session checking and the easy module configuration while I do borrow some code from it (thanks to netcarver). So I take this chance to merge them together to form a new module. I am new to use github and I don't know if it is appropriate to publish another similar project, or fork from them. You may grab this from Github: SessionHandlerDBRedis I hope this could give somebody a help. Updated to v0.4 changelog: v0.3 - added ability to get forwarded IP instead of normal remote IP. v0.4 - added session lock
-
Greeting. I installed both ListerPro and BatchChildEditor. When I use listermode, the config tab is missing with Allow Lister Configuration enabled. I would like to set column for each editor using this function, but I can only use the default columns inside module configuration right now. Any chance to solve this?
-
I want to try but unfortunately AWS do not provide this service in my region. I think it should be the best option regardless of the cost. I have not try cloud front yet but would like to use if that can speed the site up a lot. The first response time is really not good now, around 300ms while network latency is around 140ms.
- 10 replies
-
- remote file system
- s3fs
-
(and 2 more)
Tagged with:
-
Thanks for your suggestion. It is really helpful. I have my debug mode enabled and only cache the assets/files folder now. The loading speed is 250-350ms. I am happy now! I guess the filecompiler in cache folder is the issue. Mounting the cache folder also break the whole processwire system some time showing syntax error with broken file, which is a disaster. However, it is still a huge(100%) slow down compared to not using such mounting file system, which may result in a much lower concurrent request cap. I want to try the elastic file system, the native cloud shared file system, but it serves limited region right now.
- 10 replies
-
- remote file system
- s3fs
-
(and 2 more)
Tagged with:
-
After some time, I have tried using s3fs and another claimed faster replacement called goofys to mount s3 bucket to the asset folder. Processwire can work with s3fs, and has no problem with the image sizer fortunately, with the initial loading time increase from 100-200ms to 300-400ms, which is not quite acceptable. I guess the main reason for this is because the cache file is located inside the asset folder. And then I tried goofys. However, it takes over seconds to load the page. I don't know why it is the case. If anybody have experience with s3fs and goofys please share with me. Hopefully I can share my experience later on this topic. Edit: With debug mode off, goofys greatly improve the loading speed from 1-5s to 300-400ms
- 10 replies
-
- remote file system
- s3fs
-
(and 2 more)
Tagged with:
-
Installation stuck when using remote database(AWS RDS)
Karl_T replied to Karl_T's topic in General Support
Unfortunately, I cannot find any clue to get my exported site profile running by connecting remote AWS RDS. The issue should be due to the exported database file. install exported site profile and remote connect RDS database > stuck install exported site profile and local database > success install blank site profile and remote connect RDS database > success And then I tried not using the default processwire installer but import directly to the database and copy the existing files. It shows error that I don't have page "view" permission, then I gave up. I rebuild everything from blank profile again and connect processwire to the aws rds at the beginning and everything is fine. So, the conclusion is if you want to use aws with rds, maybe you should connect to rds at the beginning, otherwise you may stuck like me. And one small piece of information. RDS is very slow when using remotely. The response waiting time increase to 2 seconds from around 100ms. The normal ping from my place to their server is 70ms. -
Installation stuck when using remote database(AWS RDS)
Karl_T replied to Karl_T's topic in General Support
Thanks for your opinion. I just try to use a blank site profile to start installation. This time it has no problem arouse. I am trying to figure out what is happening. -
Thanks for your information. I want to keep everything managed inside PW admin though as what my client need is a simple and native drag and drop image upload. Yes thanks for your reminder, I am planning to store the session on Redis for better performance.
- 10 replies
-
- remote file system
- s3fs
-
(and 2 more)
Tagged with:
-
Installation stuck when using remote database(AWS RDS)
Karl_T replied to Karl_T's topic in General Support
Thanks for the reply and link. I have tried install the site profile with local database and it has no problem. But when I try using remote database, the same issue appears. I have the debug mode on already, but no errors shown during the installation. Once I go back to homepage after stuck, the error shown Fatal error: Exception: Template 'admin' is used by the homepage and thus must have the 'guest' role assigned. (in wire\core\Templates.php line 145) but it seems like the error due to incomplete installation. The error log also has the same error only. -
The database connection is successful. But I stuck with this screen without any buttons after the page entering database info. I cannot make it to reach the set admin info page. I have inspected the remote database and all the tables and fields are looking good(I use site exporter).
-
I am looking for a way to implement the alert/notice list look like the below image. SystemNotifications seems like the closest one, but I cannot find any way to modify it. Also, I think it is a more neat way to present them using individual page for each type of notification instead of display them all like the existing SystemNotifications. I can imagine a template called Notifications under admin. Under Notifications, we can add page using NotificationType template which can control the color. Then we can use something like $user->notifications->type->add("Message to send"); to add notification to a user when some events happen.
-
Short question: is it possible that Processwire uses AWS S3 with s3fs as a remote file system(mount to asset folder)? Please advise anything that have to be take care of. Background: I am currently trying to make Processwire running inside AWS Beanstalk as I want to take advantages of the auto scaling function that my client wanted. I have found a discussion here: By reading this and the link inside, I realize that to use the auto scaling I need to configure my web server to be stateless. So, I was looking for a method that can serve the purpose and then I found s3fs. s3fs is a FUSE filesystem that allows you to mount an Amazon S3 bucket as a local filesystem, quoted from their github. I guess that mounting s3 bucket using s3fs to the asset folder should be the right thing to do. My site needs many image upload as it is an e-commerce site using padloper while the admin always using the local file system for images. I have thought of using modules like AmazonS3Cloudfront or FieldtypeFileS3. It seems like those modules are not support my use case. s3fs suits better and more simple. One of my concerns is that I am not sure can the URL of the images can be generated by the default API like $image->url correctly. Before implementing this, I would like to ask the advise from anyone having implemented this with processwire as I am new to AWS. Is it possible? Any better alternatives? I think if not implementing auto scaling, it is also good to separate asset away in some cases, like reducing requests. Thank you for your reading.
- 10 replies
-
- remote file system
- s3fs
-
(and 2 more)
Tagged with:
-
Thanks for the great module, but I get the following error in php7 environment. It runs smoothly in php5. require_once(): Failed opening required '/home/admin/public_html/site/modules/AutoSmush./ImageOptimizer.php' (include_path='.:/usr/share/php') The error is gone after I change line 5 in AutoSmush.module from require_once /*NoCompile*/__DIR__ . './ImageOptimizer.php'; to require_once /*NoCompile*/__DIR__ . '/ImageOptimizer.php'; (remove dot before /ImageOptimizer.php) However, in Local tool optimizers info, the module cannot find any exe.(EDIT: I found that you have posted solution above. Let me try first, thanks) EDIT: Solved by simply apt-get install optipng jpegoptim gifsicle
-
Thanks for the link. I have googled it and the others. Session folder exists and the permission is 777. Above is another solution I found, and Yes I am using Ubuntu too. However, I got the same error in both php5 and php7 setting.
-
Hello everyone. I got the error "This request was aborted because it appears to be forged" and found the solution by adding $config->protectCSRF = false; to the config.php. I got the error when I follow this tutorial https://processwire.com/talk/topic/2089-create-simple-forms-using-api/?page=1 and after submitting the form. I do not know much about protectCSRF but I think it is better to keep it as "$config->protectCSRF = false" disables protectCSRF in the whole site . I would like to know any ways to solve this error while keeping $config->protectCSRF = true; . Thank you.
-
I am using Dev 3.0.33. It works after adding namespace to wire(). Thanks a lot!
-
Thanks for your reply. I have also used PaegEditPerUser module which offers a $user->editable_pages array in the code below. I have tried using the Custom PHP like this: $p = new PageArray(); $editable_pages = $user->editable_pages; $branches = $pages->find("template=branch"); foreach($branches as $branch){ foreach ($editable_pages as $edit) { if($branch->id == $edit->id){ $p->add($branch); } } } return $p; I tested and this gives correct output in normal template. However, it gives "Error: Class 'PageArray' not found" when I try to enter edit. Then, I tried to remove the PageArray and change the code to: $p = []; $editable_pages = $user->editable_pages; $branches = $pages->find("template=branch"); foreach($branches as $branch){ foreach ($editable_pages as $edit) { if($branch->id == $edit->id){ $p=$branch; } } } return $p; This gives no error, but also no output. I suspect that the Custom PHP is not able to read the $user object so as the PageArray.