sebsauvage / Shaarli

The personal, minimalist, super-fast, no-database delicious clone.
http://sebsauvage.net/wiki/doku.php?id=php:shaarli
Other
678 stars 394 forks source link

RSS feed has an incorrect url #101

Open Riduidel opened 11 years ago

Riduidel commented 11 years ago

When using a non standard HTTP port, the feed address obtained when clicking the RSS Feed contains the server port.

In my case, server port is 8080, and the obtained link is http://my-server:8080/Shaarli/?do=rss. Which is obviously incorrect. I can not yet work on it, since I've a pull request waiting to be integrated (unfortunatly on my trunk branch, stupid of me).

respencer commented 11 years ago

I haven't tested, but that could probably be fixed simply by deleting '{$feedurl}' from tpl/page.header.html. I don't understand why we would even need that variable. It looks to me that it could be treated like any other link.

respencer commented 11 years ago

Just noticed that @jcsaaddupuy already did that. Also catching the references in tpl/includes.html that I missed.

nodiscc commented 10 years ago

@Riduidel how is http://my-server:8080/Shaarli/?do=rss incorrect? Where do you expect the port number to be?

Can this be closed?

Riduidel commented 10 years ago

On 09/09/2014 17:20, nodiscc wrote:

@Riduidel https://github.com/Riduidel how is |http://my-server:8080/Shaarli/?do=rss| incorrect? Where do you expect the port number to be?

Can this be closed?

Look my instance at http://nicolas-delsaux.hd.free.fr/Shaarli/

When you check top links, you have

Do you see how both RSS and ATOM are wrong ?

There seems to be a way in Shaarli to use as port number the one that was already used, but this feature is not used for feeds. Strange.

Nicolas Delsaux

nodiscc commented 10 years ago

Do you see how both RSS and ATOM are wrong ?

Ok I see it now. Strange, what part of your setup serves over port 8080? Is there a reverse proxy? As far as I can see http://nicolas-delsaux.hd.free.fr/Shaarli is served over port 80 so I don't get where the :8080 comes from. I think there's something about your setup I don't understand.

Care to enlighten me?

Thanks

Riduidel commented 10 years ago

On 09/09/2014 18:41, nodiscc wrote:

Do you see how both RSS and ATOM are wrong ?

Ok I see it now. Strange, what part of your setup serves over port 8080? Is there a reverse proxy? As far as I can see http://nicolas-delsaux.hd.free.fr/Shaarli is served over port 80 so I don't get where the |:8080| comes from. I think there's something about your setup I don't understand.

Care to enlighten me?

Well, that's he reason I created this issue :-)

My Shaarli instance is served by my home NAS, which has a lighttpd server running on port 8080. And the web access is provided by a port redirection rule on my freebox server, acting as a router.

As a consequence, web traffic come on my net on port 80, is redirected on port 8080 and served by the NAS.

Clear enough ?

Nicolas Delsaux

nodiscc commented 9 years ago

@Riduidel Hi, sorry for taking so long. Can you try with this (i hope) fixed version https://github.com/nodiscc/Shaarli/tree/skip-port-detection and tell us if that solves your problem?

Either git clone https://github.com/nodiscc/Shaarli/; cd Shaarli; git checkout skip-port-detection, or download and extract https://github.com/nodiscc/Shaarli/archive/skip-port-detection.zip

You have to configure REVERSE_PROXY_PORT in index.php

Riduidel commented 9 years ago

On 21/10/2014 20:12, nodiscc wrote:

@Riduidel https://github.com/Riduidel can you merge #209 https://github.com/sebsauvage/Shaarli/pull/209 in your install and tell us if that fixes your problem? I don't have a reverse proxy at hand to test myself. Your help would be appreciated :)

Sorry for the incredibly late reply. Indeed, the Httqm pull request did the trick, provided I understood I had to create a data/options.php file in which to put the option.

This issue can be considered fixed, provided a reasonable amount of doc is provided ;-)

Something like

Possible documentation

Most of commons case are correctly handled by Shaarli, but there are some rare occasions where some base behaviour must be customized.

in that case, the following operations are required

  1. Create a data/options.php file
  2. Put in that file the following content

    $GLOBALS['config']['DATADIR'] = 'data'; // Data subdirectory $GLOBALS['config']['CONFIG_FILE'] = $GLOBALS['config']['DATADIR'].'/config.php'; // Configuration file (user login/password) $GLOBALS['config']['DATASTORE'] = $GLOBALS['config']['DATADIR'].'/datastore.php'; // Data storage file. $GLOBALS['config']['LINKS_PER_PAGE'] = 20; // Default links per page. $GLOBALS['config']['IPBANS_FILENAME'] = $GLOBALS['config']['DATADIR'].'/ipbans.php'; // File storage for failures and bans. $GLOBALS['config']['BAN_AFTER'] = 4; // Ban IP after this many failures. $GLOBALS['config']['BAN_DURATION'] = 1800; // Ban duration for IP address after login failures (in seconds) (1800 sec. = 30 minutes) $GLOBALS['config']['OPEN_SHAARLI'] = false; // If true, anyone can add/edit/delete links without having to login $GLOBALS['config']['HIDE_TIMESTAMPS'] = false; // If true, the moment when links were saved are not shown to users that are not logged in. $GLOBALS['config']['ENABLE_THUMBNAILS'] = true; // Enable thumbnails in links. $GLOBALS['config']['CACHEDIR'] = 'cache'; // Cache directory for thumbnails for SLOW services (like flickr) $GLOBALS['config']['PAGECACHE'] = 'pagecache'; // Page cache directory. $GLOBALS['config']['ENABLE_LOCALCACHE'] = true; // Enable Shaarli to store thumbnail in a local cache. Disable to reduce webspace usage. $GLOBALS['config']['PUBSUBHUB_URL'] = ''; // PubSubHubbub support. Put an empty string to disable, or put your hub url here to enable. $GLOBALS['config']['UPDATECHECK_FILENAME'] = $GLOBALS['config']['DATADIR'].'/lastupdatecheck.txt'; // For updates check of Shaarli. $GLOBALS['config']['UPDATECHECK_INTERVAL'] = 86400 ; // Updates check frequency for Shaarli. 86400 seconds=24 hours // Note: You must have publisher.php in the same directory as Shaarli index.php $GLOBALS['config']['REVERSE_PROXY_PORT'] = 0; // 0 : no reverse proxy.

    0 : the port listened to by the reverse proxy.

Customize it with values suiting your needs

Step 3 : profit :-)

Notice the values given here may not be accurate. Please take a look at the beginning of index.php file to have the exact list of such "hardcoded options".

This is only an attempt at creating some doc. Take this as, at best, an inspiration, and feel totally free to rewrite it.

Anyway, thanks for continuing Shaarli.

nodiscc commented 9 years ago

Thanks @Riduidel no problem, better late than never :+1: The doc about options.php is at https://github.com/shaarli/Shaarli/wiki#configuration. Maybe it should be more clear from the README, thanks for the reminder.