linagora / linshare

LinShare
https://www.linshare.org/
GNU Affero General Public License v3.0
449 stars 84 forks source link

[6.1.0] External link not found #296

Open PhidarkMM opened 9 months ago

PhidarkMM commented 9 months ago

Hello,

We are testing the latest 6.1 version, upgrading from 5.2.

From 5.2 version, we have first upgraded to 6.0, then 6.0.4, and stopped upgrade progression, all external link where not working. So the we restarted from 5.2, then 6.0, and 6.0.3, and all external links where working.

When we upgrade from 6.0.3 or 6.0.4 to 6.1.1, every external links are also broken, 6.0.3 is the latest version with external links working.

For example: Guest reset password link https://ftp-test2.xxxxx.yy/external/reset/16be588d-9721-4c4a-a5da-5bedaf374a88 -> 404 not found

External anonymous share link: https://ftp-test2.xxxxx.yy/external/anonymous/5761c10f-dd97-4911-9ca3-060793d3ab9f -> 404 not found

New guest link https://ftp-test2.xxxxx.yy/external/reset/c3a567fe-349a-40dc-8ebb-f833667a4134 -> 404 not found

Best regards,

PhidarkMM commented 9 months ago

We also tried to upgrade from 6.0.0, then 6.0.2 and 6.1.0, same result, external links are OK in 6.0.2 (we don't have the bug with the external links corrected in 6.0.3) but not in 6.1.0

IxFail commented 9 months ago

Sounds like you did not changed the apache configuration as written at https://github.com/linagora/linshare/blob/master/documentation/EN/upgrade/linshare-upgrade-from-v6.0.0-to-v6.0.2.md#linshare-ui-user-apache-configuration

wboudiche commented 8 months ago

Hi check links in config file linshare.user.url.download.receivedshares=/files/received?fileUuid=%1$s linshare.user.url.fragment.param.file.uuid=&fileUuid=%1$s linshare.user.url.download.documents=/files/list?fileUuid=%1$s linshare.user.url.anonymousurl.link=/external/anonymous/ linshare.user.url.guest.reset=/external/reset/%1$s linshare.user.url.workgroup.link=/sharedspace/workgroups/%1$s linshare.user.url.workgroup.folder.link=/sharedspace/workgroups/%1$s/%2$s/%3$s/%4$s linshare.user.url.workgroup.document.link=/sharedspace/workgroups/%1$s/%2$s/%3$s/%4$s?fileUuid=%5$s linshare.user.url.workspace.link=/sharedspace/workspace/%1$s linshare.user.url.download.uploadrequests.entries=/#!/uploadrequests/list?fileUuid=%1$s linshare.user.url.download.uploadrequests.upload.file=/#!/upload_request_groups/%1$s/upload_requests/%2$s/entries?entryUuid=%3$s linshare.user.jwt.token.link=/token linshare.user.guest.link=/administration/adminguests?guestUuid=%1$s

PhidarkMM commented 8 months ago

Hello,

@IxFail apache configuration is ok, 6.0.2 version is working

@wboudiche these line where not present in our linshare.properties, but it doesn't change anything: # Logger names for example used by JMX beans. linshare.available.loggers=org.linagora.linshare,org.linagora.linshare.ldap,org.linagora.linshare.auth

#### User Download linshare.user.url.download.receivedshares=/files/received?fileUuid=%1$s linshare.user.url.fragment.param.file.uuid=&fileUuid=%1$s linshare.user.url.download.documents=/files/list?fileUuid=%1$s linshare.user.url.anonymousurl.link=/external/anonymous/ linshare.user.url.guest.reset=/external/reset/%1$s linshare.user.url.workgroup.link=/sharedspace/workgroups/%1$s linshare.user.url.workgroup.folder.link=/sharedspace/workgroups/%1$s/%2$s/%3$s/%4$s linshare.user.url.workgroup.document.link=/sharedspace/workgroups/%1$s/%2$s/%3$s/%4$s?fileUuid=%5$s linshare.user.url.workspace.link=/sharedspace/workspace/%1$s linshare.user.url.download.uploadrequests.entries=/#!/uploadrequests/list?fileUuid=%1$s linshare.user.url.download.uploadrequests.upload.file=/#!/upload_request_groups/%1$s/upload_requests/%2$s/entries?entryUuid=%3$s linshare.user.jwt.token.link=/token linshare.user.guest.link=/administration/adminguests?guestUuid=%1$s

linshare.notifications.email.templating.override.readonly.mode=false linshare.notifications.email.templating.subject.prefix.enable=false linshare.notifications.email.templating.strict.mode=false

# For production, one day we should test and use strict mode : # linshare.notifications.email.templating.strict.mode=true

# SafeDetail properties value safe.detail.country.code=FR safe.detail.control.key=58 safe.detail.iufsc=LINSHARE

Regards,

PhidarkMM commented 8 months ago

Any other idea why all external links no longer work for us from version 6.0.4 ?

wboudiche commented 8 months ago

can you send me your apache vhost config

PhidarkMM commented 8 months ago

#linshare-ui-user.conf \<Directory /var/www/linshare-ui-user> RewriteEngine on RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f [OR] RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^ - [L] RewriteRule ^ index.html [L] \

\ ServerName linshare-test2.internal.fr DocumentRoot /var/www/linshare-ui-user SSLCertificateFile /etc/linshare/pki/user/2022_09_linshare-test2.cert.pem SSLCertificateKeyFile /etc/linshare/pki/user/2022_09_linshare-test2.server.key SSLEngine on <Location /linshare> AuthType GSSAPI AuthName "Compte du domaine internal.fr" GssapiCredStore keytab:/var/www/krb5.keytab GssapiAllowedMech krb5 Require valid-user GssapiUseSessions On Session on SessionCookieName gssapi_session path=/;httponly;secure; GssapiSessionKey key:OTA4Nj...N2E0YjM0MWU= ProxyPass http://127.0.0.1:8080/linshare ProxyPassReverse http://127.0.0.1:8080/linshare ProxyPassReverseCookiePath /linshare / RewriteEngine On RewriteCond %{REMOTE_USER} (.+)@INTERNAL.FR$ RewriteRule . - [E=RU:%1] RequestHeader set SamAccountName %{RU}e Header set Cache-Control "max-age=0,no-cache,no-store" \ ErrorLog /var/log/httpd/linshare-user-error.log CustomLog /var/log/httpd/linshare-user-access.log combined \

\ ServerName ftp-test2.external.fr DocumentRoot /var/www/linshare-ui-user SSLCertificateFile /etc/linshare/pki/user/2022_09_linshare-test2.cert.pem SSLCertificateKeyFile /etc/linshare/pki/user/2022_09_linshare-test2.server.key SSLEngine on <Location /linshare> ProxyPass http://127.0.0.1:8080/linshare ProxyPassReverse http://127.0.0.1:8080/linshare ProxyPassReverseCookiePath /linshare / # Workaround to remove httpOnly flag (could also be done with Tomcat) Header edit Set-Cookie "(JSESSIONID=.); Path." "$1; Path=/" # For https, you should add Secure flag. # Header edit Set-Cookie "(JSESSIONID=.); Path." "$1; Path=/; Secure" #This header is added to avoid the JSON cache issue on IE. Header set Cache-Control "max-age=0,no-cache,no-store" \ ErrorLog /var/log/httpd/linshare-user-error.log CustomLog /var/log/httpd/linshare-user-access.log combined \

# Redirect port 80 \<VirtualHost :80> RewriteEngine On RewriteCond %{HTTPS} off RewriteCond "%{REQUEST_URI}" "!/server-status" RewriteRule (.) https://%{SERVER_NAME}/$1 [R,L] \

wboudiche commented 8 months ago

Hi, Move the directory configuration to the virtual host

PhidarkMM commented 8 months ago

Hello @wboudiche,

I tried to move the directory conf to the virtual host, but it didn't change anything.

Test versions: 6.0.4 and 6.1.0

6.0.3 received links: Anonymous link file share: https://ftp-test2.xx.yy/#!/external/anonymous/9fc9f2bc-0455-474b-8abe-969608e5a8fa Contact link file share: https://ftp-test2.xx.yy/#!/files/received?fileUuid=de6bf7cf-4263-45c7-a346-ea8d4e41460a

6.0.4/6.1.1 received links: Anonymous link file share: https://ftp-test2.xx.yy/external/anonymous/3cf8d8de-afa7-42c4-9203-238964200468 Contact link file share: https://ftp-test2.xx.yy/files/received?fileUuid=1d2bec1d-e6e5-4d7e-8473-bb4ac782e507

If i try to add /#!/ to 6.0.4/6.1.1 received links are correctly redirected and it works, so i must have missed something in configuration.

Same thing if i change /etc/linshare/linshare.properties links: linshare.user.url.download.receivedshares=/#!/files/received?fileUuid=%1$s linshare.user.url.anonymousurl.link=/#!/external/anonymous/

jonathanh478 commented 5 months ago

@PhidarkMM did you ever figure out this issue. I am having the same exact issue with links not found error.

wboudiche commented 5 months ago

can u send the content of the table anonymous_url ?

jonathanh478 commented 5 months ago

@wboudiche here are the contents of the table anonymous_url

linshare=> SELECT * FROM anonymous_url; (0 rows)

PhidarkMM commented 3 months ago

Sorry for the late answer:

Test platform

linshare=> SELECT * FROM anonymous_url; (0 rows)

Production platform

linshare=# SELECT * FROM anonymous_url; id | url_path | uuid | password | contact_id --------+-------------------------+--------------------------------------+---------------------------------------------------------------- ------+------------ 133134 | /#!/external/anonymous/ | f0b54bed-272d-4dd8-96bc-a789f8fc8099 | {bcrypt}$2a$10$mYsDQP...V5fzN8 2kn8i | 133133 131505 | /#!/external/anonymous/ | f0879fe4-a346-4fa6-ac26-ad76947d65b6 | {bcrypt}$2a$10$vlPbSgDlsrX....380WCqg Wy0Uy | 131504 131528 | /#!/external/anonymous/ | e7bfadff-1500-4617-a446-acb25c0fb64b | {bcrypt}$2a$10$miJX./U7cg6dMqM.DB...yMGC a/zTq | 29799 131873 | /#!/external/anonymous/ | 5a870ae3-bed1-4276-a2a9-74d459544325 | {bcrypt}$2a$10$sh5DiWh...sTx3PxdD Rd3cy | 131872 133138 | /#!/external/anonymous/ | 3ecc89e9-6975-49f7-ac56-096e0f5b58a5 | {bcrypt}$2a$10$gxPAxY8X...An/tBGh/ rFVRi | 133137 133655 | /#!/external/anonymous/ | 7a0d9f14-c9ac-4938-aa43-84b007aae8c0 | {bcrypt}$2a$10$EupbpW...RiWH.9gb9 ETGUS | 133654 (6 rows)