filler00 / etcg

Tradepost Management Script
22 stars 8 forks source link

Using SSL ruins auto-upload #14

Open autisticjane opened 7 years ago

autisticjane commented 7 years ago

I'm using SSL with my domain (https://effys.space), but I noticed using SSL has resulted in the auto-upload feature not working.

How can I use both this feature and SSL?

I have tried disabling SSL on specific files by adding an .htaccess file in the /etcg/ directory containing the following:

<IfModule mod_rewrite.c>
RewriteCond %{HTTPS} on
RewriteCond %{REQUEST_METHOD} !=POST
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(class-lib|cards\.php)  [NC]
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>

It turns off SSL, but auto-upload continues to not work. :/

tooblue commented 7 years ago

Are you able to find any related error messages in your server logs? And/or could you provide the TCG settings which you are trying to use with auto-upload? I'm currently not able to replicate this issue on my own SSL enabled server.

autisticjane commented 7 years ago

I removed the .htaccess edits (because they seemed to be creating other issues), and tried to do it again, and this error presents itself:

[09-Apr-2017 00:01:09 UTC] PHP Warning: file_get_contents(): http:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /home/effspace/public_html/tcg/etcg/class_lib.php on line 241 [09-Apr-2017 00:01:09 UTC] PHP Warning: file_get_contents( http://rapture.silverblood.net/cards/catfancy03.png): failed to open stream: no suitable wrapper could be found in /home/effspace/public_html/tcg/etcg/class_lib.php on line 241

image

These are the TCG settings.

tooblue commented 7 years ago

Can you check to make sure that you have allow_url_fopen set to ON in your php.ini?

autisticjane commented 7 years ago

I don't, but my host may be able to turn it on [globally]. Is easyTCG compatible w/PHP 7?

tooblue commented 7 years ago

allow_url_fopen is required for the auto-upload feature to work. Once you can get that turned on it should start working for you.

I'm not sure, I haven't tested it with PHP 7. I'm not aware of anything in eTCG that wouldn't work in PHP 7 off the top of my head, so feel free to try it.

autisticjane commented 7 years ago

It's on, but it's still pulling up an error.

I'm on the latest release (beta)...is that an issue? Or I was thinking it might be because the TCG URL isn't https.

Sincerely, Liz Lawson janepedia.com

Sent from my phone

On Apr 9, 2017 9:16 AM, "Michelle Lewis" notifications@github.com wrote:

allow_url_fopen is required for the auto-upload feature to work. Once you can get that turned on it should start working for you.

I'm not sure, I haven't tested it with PHP 7. I'm not aware of anything in eTCG that wouldn't work in PHP 7 off the top of my head, so feel free to try it.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/filler00/etcg/issues/14#issuecomment-292788486, or mute the thread https://github.com/notifications/unsubscribe-auth/AEFJvBBlGZ9HoRZ0x70IsOhbYPk9lAYNks5ruOg-gaJpZM4M3ipr .

autisticjane commented 7 years ago

​The​ error_log:

[09-Apr-2017 22:35:42 UTC] PHP Warning: file_get_contents(): http:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /home/effspace/public_html/tcg/etcg/class_lib.php on line 241 [09-Apr-2017 22:35:42 UTC] PHP Warning: file_get_contents( http://novella.tcg-publicity.com/cards/fated01.png): failed to open stream: no suitable wrapper could be found in /home/effspace/public_html/tcg/etcg/class_lib.php on line 241

tooblue commented 7 years ago

If you're getting that same error as before, then it doesn't look like allow_url_fopen was enabled properly. Depending on your host and server configurations, it's possible that allow_url_fopen is being controlled by a different php.ini than the one you modified, or your host has blocked changing this configuration.

To check whether allow_url_fopen is enabled, you can create a test.php file in the same directory where you have eTCG installed containing this code:

 <?php 
if( ini_get('allow_url_fopen') ) {
    die('allow_url_fopen is enabled. file_get_contents should work well');
} else {
    die('allow_url_fopen is disabled. file_get_contents would not work');
}

You might also check that allow_url_include = ON in your PHP configuration as well.

autisticjane commented 7 years ago

It's enabled: https://effys.space/tcg/etcg/test.php

It's getting a new, similar error:

[10-Apr-2017 02:09:20 UTC] PHP Warning: file_put_contents(/public_html/tcg/img/cards/novella/fated01.png): failed to open stream: No such file or directory in /home/effspace/public_html/tcg/etcg/class_lib.php on line 243 [10-Apr-2017 02:15:01 UTC] PHP Warning: file_put_contents(/public_html/tcg/img/cards/novella/fated01.png): failed to open stream: No such file or directory in /home/effspace/public_html/tcg/etcg/class_lib.php on line 243

It exists, though, because it's here: https://effys.space/tcg/img/cards/novella/ (I moved trading posts, hence why there ARE files inside it).

tooblue commented 7 years ago

It looks like your cards path in your TCG settings is /public_html/tcg/img/cards/novella/ but it should be /home/effspace/public_html/tcg/img/cards/novella/ (or something like that). Since you moved trading posts it's likely you need to update this setting for all of your TCGs.