annularis / shop

Annularis E-Shop
MIT License
29 stars 16 forks source link

Install script works fine but missing files and can't get past index. #3

Closed JTD420 closed 7 years ago

JTD420 commented 7 years ago

So thanks for you're support @serhack!

I have got the project to install and listed the steps in the previous issue report in case you want to update the git to make it easier for anyone else who want's to use it for their own work in the future,

As for once it's been installed and the page displays correctly. Now there is a new issue! It seems none of the links work. If I go to login, items, register they all lead to a 404. The only working link is home because that's index?

I've tried setting the basedir in codeignitors config but that's already correct because the CSS and other files are loading fine.

I think it's actually missing these files?

I tried doing a search for login inside the main bitwasp repo but didn't find much besides one login.php.txt file in the documentation. I also checked another persons fork of the repo and they had a login.php inside their views/users/ directory which I did not so I tried uploading that to the server but still no luck going to login.

Could it be a codeignitor issue and if so what could it possibly be? I haven't worked with codeignitor in like 4 years so I'm extremely rusty! I don't even remember the order in which the system works I just remember views is the public part but the whole model controller views system confuses me now! Only reason I think it could maybe just be a codeignitor fault is the url is just /shop-master/login now I know codeignitor works by sending the users to the view through either the model or the controller or w.e so I know in doing this it can strip away the .php and other directory traits etc but maybe this is confusing it or theres an error somewhere pointing these links to the wrong directory?

Let me know if you come up with a fix or suggestion or anything thank you!

I'll keep this updated myself in the meanwhile if I manage to come up with a fix or anything new to add!

serhack commented 7 years ago

Try to add index.php before /login ;)

JTD420 commented 7 years ago

@serhack yep that fixes it!

Is there a config file I can add something to in order for it to update everywhere cause unfortunately the site is still unusable as it stands... I can get to the login page manually adding index.php/ then login but if I try to login pressing the login button still just takes me to /login which of course is a 404...

I seem to remember being able to add the filename or remove the filename from codeignitor so I'm hoping the issue is in one of the configs?

What do you think? Thanks again! :)

JTD420 commented 7 years ago

UPDATE: Did a quick check of config/config.php and found something called index_page. I think this was what I was referring to in my above message so I attempted to set it to index.php

This FIXED the problem with links. I can now login, and press any linkable button and it seems to go to the correct place HOWEVER it has broken the CSS and other scripts. Now obviously all references including the stylesheets are going to index.php/{filename} so its not a suitable fix.

@serhack Do you have any other ideas or potential fixes?

Thanks

JTD420 commented 7 years ago

I've fixed a lot. Manually hardcoded the header file inside views folder so that it didn't need that fancy piece of code detecting where exactly that file is and then try to get to the root from there etc etc. Luckily it was only a few different links in the one header file and was able to get both a functioning site and stylesheet working etc etc.

Now I've found some more bugs messing around that you may want to fix.

The token system (didn't even know this had one, amazing!) - but it doesn't work. I tried registering with the link provided and the role I'd selected was admin but it kept saying after submit that I needed to select a role (when you first land on the page from the link it says the correct role in place of the dropdown so in my case it said Admin in bold but once I click submit that changes to a drop down with two options buyer or vendor and it says I haven't selected either.) that's one bug...

Then I tried to register as a vendor and I got this error message

An uncaught Exception was encountered

Type: InvalidArgumentException

Message: Unsupported magic byte

Filename: /var/www/html/BitWasp/shop-master/vendor/bitwasp/bitcoin-lib/src/BIP32.php

Line Number: 414

Backtrace:

File: /var/www/html/BitWasp/shop-master/vendor/bitwasp/bitcoin-lib/src/BIP32.php
Line: 250
Function: import

File: /var/www/html/BitWasp/shop-master/vendor/bitwasp/bitcoin-lib/src/BIP32.php
Line: 330
Function: get_definition_tuple

File: /var/www/html/BitWasp/shop-master/application/models/Bip32_model.php
Line: 47
Function: build_key

File: /var/www/html/BitWasp/shop-master/application/models/Bip32_model.php
Line: 83
Function: recurse_until_unique_bip32_key

File: /var/www/html/BitWasp/shop-master/application/models/Bitcoin_model.php
Line: 46
Function: get_next_admin_child

File: /var/www/html/BitWasp/shop-master/application/controllers/Users.php
Line: 266
Function: get_fees_address

File: /var/www/html/BitWasp/shop-master/index.php
Line: 282
Function: require_once

I've had this "magic byte" error before somewhere while logged in on the admin page but I can't remember what it was on as I was just exploring everywhere... I think you might benefit from taking a look around my site seeing as it's basically as fresh an install as you can get straight from the most recent version of your script? Only issue is I don't feel comfortable sharing my server IP publically here but if you're interested on exploring a version of the source setup by someone else so you can experience the different bugs and things for yourself I could send you the IP privately as long as you dont share it I shouldn't have a problem with that. :)

serhack commented 7 years ago

I think you should not hardcode css. You should edit .htaccess in order to delete index.php and that is working :)

JTD420 commented 7 years ago

There was no .htaccess file included with your repo...

I found an htaccess in someone elses fork but I wasn't able to get it to work on my VestaCP Server. I haven't been able to fully test it inside of the other main VPS because that is the one where I hardcoded the changes into the header files which means that until I undo those changes even if I upload a working htaccess it shouldn't make a difference to the sites functionality as it's already hard coded to work correct?

Or would the htaccess fix the other issues regarding magic byte etc?

I have already uploaded it to the server so its just a matter of undoing the header file to see if the htaccess even works and then hoping that fixes the rest of the functions etc that are broken.

FOR YOUR REFERENCE: https://github.com/galzuntpanz/BitWasp/ https://github.com/1234max/BitWasp

Those are the two other repos besides the main bitwasp/bitwasp repo I have been using to grab files from that yours is missing. Perhaps you'll want to go through and find the files that may be useful and add them to here with the required edits so more people can get a working site out of the box with as fewer issues as possible?

Hopefully I'm helping with this info I'm giving? I can of course write a lot less just being detailed so hopefully you find adding the fixes to the project itself relatively easy and non timewasting

JTD420 commented 7 years ago

@serhack do you have an IM I can contact you by?

serhack commented 7 years ago

What is IM? Try to reach me on twitter @serhack_, reddit (/u/serhack) or mail me support@monerointegrations.com