Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not really a bug but an installation question. >< #46

Closed
ghost opened this issue Aug 3, 2017 · 11 comments
Closed

Not really a bug but an installation question. >< #46

ghost opened this issue Aug 3, 2017 · 11 comments

Comments

@ghost
Copy link

ghost commented Aug 3, 2017

So first of all, you have a great site. Much cleaner and nicer than pomf.

I've had some trouble installing it. I'm relatively new to server stuff. I seem to have everything working fine http://i.idgaf.fyi/ apart from when i upload, my links come out as http://i.idgaf.fyi/i.idgaf.fyi/ke3mHtZLQy8KIqsTjyGlAFz6oV4Z818i.jpg rather than http://i.idgaf.fyi/ke3mHtZLQy8KIqsTjyGlAFz6oV4Z818i.jpg

Know where I went wrong?

thank you for your time ><

@Pitu
Copy link
Member

Pitu commented Aug 3, 2017

Sure! Can you show me your config file?

@ghost
Copy link
Author

ghost commented Aug 3, 2017 via email

@Pitu
Copy link
Member

Pitu commented Aug 3, 2017

Great then, enjoy!

@Pitu Pitu closed this as completed Aug 3, 2017
@B-rock-Code
Copy link

B-rock-Code commented Sep 19, 2017

Hello, I just wanted to re-open this as I am having the same problem and I 1 other person I talked to about this had the same problem. The OP didn't give a very detailed response on how he fixed it, attached is my config file (yes, it's normally .js). If you want me to open up another report let me know as well.

It's setup pretty much the same as far as the problem.

example:
https://i.site.me/i.site.me/picture.png

I am using Nginx and restarting lolisafe.js and nginx between config changes and hard refreshing the site.

Thank you for your help and work.

config.txt

@Pitu
Copy link
Member

Pitu commented Sep 19, 2017

Could you please tell me what should the final URL look like and how does it look like for you with this config?

@Pitu Pitu reopened this Sep 19, 2017
@B-rock-Code
Copy link

B-rock-Code commented Sep 19, 2017

Should be https://img.site.me/picture.png (I'd assume)

With this config, I get https://i.site.me/i.site.me/picture.png

I setup a subdomain for lolisafe under i.site.me.
server_name is i.site.me
location / {

I got the same results if I changed the config to i.site.me for the host: and resolve: with all the restarts as well

Edit: Worth noting, the plain text URL shows as: i.site.me/picture.png but the clickable link is what leads to https://i.site.me/i.site.me/picture.png

@Pitu
Copy link
Member

Pitu commented Sep 19, 2017

Try with

domains: [
	{ host: 'img.site.me', resolve: 'https://img.site.me'},
]

Replace your domains array with this one and tell me if it works.

@B-rock-Code
Copy link

B-rock-Code commented Sep 19, 2017

Same exact results (still referencing i.site.com). I restarted lolisafe.js and nginx service as well as hard refresh and tried a different browser. I will note that I am running this as root as well when uploading.

The links under "uploads" from the dashboard link the exact same as well.

edit: Even if I leave all the domains portion commented out it will still host the image but still have the same problem as far as the actual link destination

@Aareksio
Copy link

Aareksio commented Sep 19, 2017

config.domains[] doesn't make the app serve files on resolve URL. In fact, it only ever serves on / (source, have I mention it also ignores config.uploads.folder, which makes it break once you decide to change upload destination? Oh, I have). You have to do any redirection manually.

The URL is composed as following: basedomain + '/' + file.name (source), where basename is req.get('host') or resolve part of matching config.domains[]. If you don't specify resolve or no matching domain is found - it'll compose something like example.com/picture.png - no protocol included. That's the reason why the link's destination is https://i.site.me/i.site.me/picture.png - href without a protocol, or at least two trailing slashes, is treated as relative.

If config sample from above ({ host: 'img.example.com', resolve: 'https://img.example.com' }) doesn't solve the issue (and your host matches real host), your application cannot properly read the host for some reason.

Aside from the bad, prone to such errors, design of the application, the problem is with your forwarding software / other configuration.

@iCrawl
Copy link
Contributor

iCrawl commented Sep 19, 2017

The whole resolving should be on the nginx part anyway. Theres nearly no reason to have what the current design is, because as you mentioned it's prone to errors.
But as it stands right now this project is in a rewrite with a backend that's solid and structured. This project can be treated more as a side-project now since the major focus lies in the complete rewrite + rebranding.

@Pitu
Copy link
Member

Pitu commented Oct 4, 2017

This release makes it possible to choose between node and nginx to serve files. If you want simplicity and your files at the root of your domain, set serveFilesWithNode to true in the config file. Otherwise set it to false and serve the files via nginx/apache manually. You can check the sample nginx conf for guidance.

@Pitu Pitu closed this as completed Oct 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants