superdesk / web-publisher

Superdesk Publisher - the next generation publishing platform for journalists and newsrooms.
GNU Affero General Public License v3.0
96 stars 56 forks source link

Superdesk publisher and wordpress #590

Closed dmytrobazeliuk-devops closed 6 years ago

dmytrobazeliuk-devops commented 6 years ago

Hello. I have superdesk publisher. I want to add my WordPress website to superdesk. I see need auth key. Can you screenshot_156 help?

dmytrobazeliuk-devops commented 6 years ago

screenshot_158 Wordpress need installed to server superdesk pusblisher?

takeit commented 6 years ago

Hi @d1mf,

please, check Setup Wordpress as a Publisher Output Channel guide.

dmytrobazeliuk-devops commented 6 years ago

Hello. Yes, I check. I see tenant not working server( without a superdesk publisher) I send a screenshot screenshot_159 This server installed WordPress + router.php

ahilles107 commented 6 years ago

In domain name and subdomain name you need to provide vhost (new one) for current publisher instance - not wordpress instance. Remove this tenant (probably manually from database).

dmytrobazeliuk-devops commented 6 years ago

I check. Now I have a new problem. This server superdesk publisher. screenshot_160

not load theme and api error 500 screenshot_161

2018/08/01 03:06:10 [error] 36053#36053: *19 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Symfony\Component\Config\Definition\Exception\InvalidTypeException: Invalid type for path "nelmio_cors.defaults.allow_origin.0". Expected scalar, but got array. in /var/www/publisher/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/ScalarNode.php:36 Stack trace:

0 /var/www/publisher/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/BaseNode.php(279): Symfony\Component\Config\Definition\ScalarNode->validateType(Array)

1 /var/www/publisher/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/PrototypedArrayNode.php(277): Symfony\Component\Config\Definition\BaseNode->normalize(Array)

2 /var/www/publisher/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/BaseNode.php(282): Symfony\Component\Config\Definition\PrototypedArrayNode->normalizeValue(Array)

3 /var/www/publisher/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/ArrayNode.php(301): Symfony\Component\Config\Definition\BaseNode->normalize(Array)

4" while reading response header from upstream, client: 192.168.1.80, server: , request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "192.168.1.12"

ahilles107 commented 6 years ago

error is here: Invalid type for path "nelmio_cors.defaults.allow_origin.0". Expected scalar, but got array. in your parameters.yml you neet ot provide string not array for nelmio_cors.defaults.allow_origin

dmytrobazeliuk-devops commented 6 years ago

This my full config

parameters: env(DATABASE_HOST): 127.0.0.1 env(DATABASE_PORT): null env(DATABASE_NAME): publisher env(DATABASE_USER): postgres env(DATABASE_PASSWORD): postgres env(DATABASE_SERVER_VERSION): 9 mailer_transport: smtp mailer_host: 127.0.0.1 mailer_user: null mailer_password: null env(SYMFONY_SECRET): SuperSecretTokenPleaseChangeIt swp_updater.version.class: SWP\Bundle\CoreBundle\Version\Version env(SWP_DOMAIN): 192.168.1.12 cache_servers:

I not see value nelmio_cors.defaults.allow_origin

Need to add?

ahilles107 commented 6 years ago

allow_origin_cors: ['*'] should be allow_origin_cors: '*'

dmytrobazeliuk-devops commented 6 years ago

the testing server I see a fix. I see message Tenant for host "192.168.1.12" could not be found!( this not critical - testing server). Ok

This message prod(live server)

2018/08/01 11:17:23 [error] 1846#1846: *44 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Doctrine\ORM\NonUniqueResultException: More than one result was found for query although one row or none was expected. in /var/www/publisher/vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php:770 Stack trace:

0 /var/www/publisher/src/SWP/Bundle/MultiTenancyBundle/Doctrine/ORM/TenantRepository.php(59): Doctrine\ORM\AbstractQuery->getOneOrNullResult()

1 /var/www/publisher/src/SWP/Component/MultiTenancy/Resolver/TenantResolver.php(54): SWP\Bundle\MultiTenancyBundle\Doctrine\ORM\TenantRepository->findOneByDomain('88.208.192.142')

2 /var/www/publisher/app/cache/prod/Container2u1kqzx/TenantResolver_98081b0.php(13): SWP\Component\MultiTenancy\Resolver\TenantResolver->resolve('88.208.192.142')

3 /var/www/publisher/src/SWP/Bundle/CoreBundle/Context/CachedTenantContext.php(79): TenantResolver_98081b0->resolve('88.208.192.142')

4 /var/www/publisher/src/SWP/Bundle/CoreBundle/Security/Storage/DynamicDomainSessionStorage.php(41): SWP\Bundle\CoreBundle\Context\CachedTenan" while reading response header from upstream, client: 77.123.36.142, server: , request: "POST /wp-admin/admin-ajax.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "88.208.192.142", referrer: "http://88.208.192.142/wp-admin/"

This file is auto-generated during the composer install

parameters: env(DATABASE_HOST): localhost env(DATABASE_PORT): null env(DATABASE_NAME): publisher env(DATABASE_USER): postgres env(DATABASE_PASSWORD): postgres env(DATABASE_SERVER_VERSION): 9 mailer_transport: smtp mailer_host: 127.0.0.1 mailer_user: null mailer_password: null env(SYMFONY_SECRET): SuperSecretTokenPleaseChangeIt swp_updater.version.class: SWP\Bundle\CoreBundle\Version\Version env(SWP_DOMAIN): 88.208.192.142 cache_servers:

same error 500

ahilles107 commented 6 years ago

You have two tenants in databse with this same data. Remove one.

Btw. those issues are about publisher issues not configuration problems. Please create them only with informations how to reproduce issue. Pull Requests with code fixes are also welcome.

dmytrobazeliuk-devops commented 6 years ago

I understand I just want to get the application working. Very difficult. Thanks for the answer, I'll check it out.

dmytrobazeliuk-devops commented 6 years ago

Done. I reinstall DB. Now I see this messages( server superdesk publisher)

Tenant for host "88.208.192.142" could not be found!

ahilles107 commented 6 years ago

Hey, message is clear. After db reinstall did you created tenant?

dmytrobazeliuk-devops commented 6 years ago

Sorry. I wrong this ( I mean wrong ip address)

SYMFONY_ENV=prod php app/console swp:tenant:create 88.208.192.142 Superdesk

I see the theme load.

Next step I want to add WordPress. and API down. I add WordPress using the website(GUI).

Or need using this manual https://www.superdesk.org/news/installing-superdesk-publisher?topic=publisher ( switch superdesk publisher to WordPress?)

dmytrobazeliuk-devops commented 6 years ago

I not known what remove two tenants in the database with this same data. what find tenants?

ahilles107 commented 6 years ago

Output controll and wordpress support is in not released yet version. So it may break. We spotted in last days many ui issues related to output channels, so i woudn't recommend you using it for creating new tenant. If You use latest master (there is open PR with improvements for wordpress adapter) then using api should work.

In general when you have publisher running, then follow this cookbook https://superdesk-publisher.readthedocs.io/en/latest/cookbooks/implementators/wordpress_output_channel.html.

Working with not released publisher features require some technicall knowledge - espcialy databes and php. I can recommend You to wait for next stable release (1.4) - planned for September. Then you will can configure all of it with UI.

dmytrobazeliuk-devops commented 6 years ago

Is it possible to configure superdesk publisher + WordPress? This my task. If this needs only terminal, I can. Or need to wait for new version support WordPress?

ahilles107 commented 6 years ago

It is still work in progress. Many things works already but we are polishing the rest. Final release should be in September.

dmytrobazeliuk-devops commented 6 years ago

Ok. Issue You can close

dmytrobazeliuk-devops commented 6 years ago

Close