friendica / friendica-directory

Global directory for the Friendica project. The repository has moved to git.friendi.ca/friendica/friendica-directory
GNU Affero General Public License v3.0
19 stars 11 forks source link

Update INSTALL.md #10

Closed AndyHee closed 5 years ago

AndyHee commented 5 years ago

Add Nginx configuration line

MrPetovan commented 5 years ago

Thanks for your contribution, what about URL rewriting? On Apache it is taken care of by the .htaccess file in public/ but it won't be picked up by nginx.

AndyHee commented 5 years ago

I'm not sure I understand the issue. I have this line:

  # rewrite to front controller as default rule
  location / {
    rewrite ^/(.*) /index.php?q=$uri&$args last;
  }

Does that make sense?

MrPetovan commented 5 years ago

Not using nginx, I'd be unable to tell, but if it works for you then it should be ok.

AndyHee commented 5 years ago

Ahh.. There is actually an issue. Compare this: https://dir.hubup.pro/search?q=art https://dir.friendica.mrpetovan.com/search?q=art

MrPetovan commented 5 years ago

Indeed. Looking into the Apache rewriting, it turns out there's no translation from the URI to a query string. The q=$uri may be extraneous in your example.

AndyHee commented 5 years ago

It's a puzzle everything works apart from the tag search. Compare:

https://dir.hubup.pro/search?q=linux https://dir.hubup.pro/search?field=country&q=United%20Kingdom

I've read his nginx page https://www.nginx.com/blog/creating-nginx-rewrite-rules/ but I don't know what I'm looking for.

Do you have any idea what is is not rewritten?

AndyHee commented 5 years ago

Error log output

2018/11/12 23:36:32 [error] 2588#2588: *82128 FastCGI sent in stderr: "PHP message: Slim Application Error:
Type: PDOException
Code: HY000
Message: SQLSTATE[HY000]: General error: 1191 Can't find FULLTEXT index matching the column list
File: /var/www/directory/vendor/atlas/pdo/src/Connection.php
Line: 138
Trace: #0 /var/www/directory/vendor/atlas/pdo/src/Connection.php(138): PDOStatement->execute()
#1 /var/www/directory/vendor/atlas/pdo/src/Connection.php(186): Atlas\Pdo\Connection->perform('SELECT p.`id`, ...', Array)
#2 /var/www/directory/src/classes/Models/Profile.php(99): Atlas\Pdo\Connection->fetchAll('SELECT p.`id`, ...', Array)
#3 /var/www/directory/src/classes/Controllers/Web/Search.php(76): Friendica\Directory\Models\Profile->getListForDisplay(20, 0, 'AND MATCH (p.`n...', Array)
#4 /var/www/directory/src/classes/Routes/Http/Search.php(28): Friendica\Directory\Controllers\Web\Search->render(Object(Slim\Http\Request), Object(Slim\Http\Response), Array)
#5 [internal function]: Friendica\Directory\Routes\Http\S" while reading response header from upstream, client: 171.6.204.7, server: dir.hubup.pro, request: "GET /search?q=art HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.1-fpm.sock:", host: "dir.hubup.pro", referrer: "https://dir.hubup.pro/"
MrPetovan commented 5 years ago

Arg, I found the issue. I got this error before so I quickly updated the schema on my database but I didn’t reflect the change in the migration script.

MrPetovan commented 5 years ago

Please update to the latest master, I won't push a release until I can make a proper project archive.

MrPetovan commented 5 years ago

New release v2.0.4 pushed, I changed the INSTALL instructions, which makes conflicts with your changes.

AndyHee commented 5 years ago

Well done, Hypolite! Glad you found it. Thanks!

I'll update to the new release this evening, test the nginx configuration again, and resolve the conflict.

Also I'll be adding some tags to my profile soon too. ^-^

MrPetovan commented 5 years ago

Do you plan to add the nginx rewrite rule?

AndyHee commented 5 years ago

I was planning to, but something is still not working. It's not populating the directory properly. Logs look ok.

All three profile entries you see https://dir.hubup.pro/ are added manually via console.

This is the only error I can see.

bin/console dbupdate Updating database schema to latest version... [Error] Database was not fully updated. Use --force for migrate

Could this be a permission issue? I'm running this under a dedicated user that is part of the www-data group. Cron job also runs under this user.

AndyHee commented 5 years ago

I did a clean installation today with the latest master because of the above db error.

Searching tags is now working but profile_poll_queue is the only table that is empty in the db.

(Signing off now. Catch you later. Cheers.)

MrPetovan commented 5 years ago

Can you please add

"logger": {
    "level": 100
}

at the same level as "database" in your config/local.json?

MrPetovan commented 5 years ago

Did you add a remote directory to your poll queue like bin/console directory-add https://dir.friendica.social? If you didn't, then you won't get much data.

AndyHee commented 5 years ago

Yep. I've added two remote directories. This one and Adam's.

I'll add the logger level this evening and report back. Lets just wait with this PR until everything works properly and then I update the rewrite rules.

AndyHee commented 5 years ago

Interestingly the server list of the directory is filling up as expected; it's only the profiles that don't seem to work.

MrPetovan commented 5 years ago

Found the issue, a wrong boolean condition: https://github.com/friendica/friendica-directory/releases/tag/v2.0.6

Your directory should fill up next time the directories will be polled. You can set the next_poll column to NOW() in the directory_poll_queue table to force the issue.

AndyHee commented 5 years ago

Great. I'll update to 2.0.6 as soon as I have shell access. Thanks!

AndyHee commented 5 years ago

Now, it works like a charm!

Could you please review the rewrite settings. Some of it might be superfluous; it works though.

MrPetovan commented 5 years ago

Thanks for your contribution!

AndyHee commented 5 years ago

My pleasure!