How to install along with Superdesk?
  • How to install Superdesk Web Publisher, along with Superdesk, so it appears on the backend as "Web Site Management" option? (as in this sc screen)
    image
  • 17 Comments sorted by
  • Hi Nalyk,

    in order to see Web Site Management (lately it has been renamed to "Publisher") menu item, you need to install Superdesk from sdsite branch (https://github.com/superdesk/superdesk/tree/sdsite). 

    Once it will be installed, this menu item will be available for you automatically.

    For now we keep it in a separate branch that's why it is not available in master branch.
  • Hello again, and thank you for your quick reply.

    I did a fresh install of Superdesk (sdsite branch) on http://desk.unimedia.info. I did not make any config changes, but I already have some errors on main.log. Is it a warning or a config error? Could you please tell me if I can move forward with configuration?

    Thank you.

    Attached you have a fragment from main.log
  • I can not add a site into the Publisher section of Superdesk, i press on save and nothing happens, still i have no hint on the error on main.log.

    image

  • From the console, i see that Superdesk is trying to access localhost, allthoug i have these settings in superdesk.config.js:

            publisher: {
                protocol: 'http',
                tenant: 'beta',
                domain: 'unimedia.info',
                base: 'api/v1'
            },

    image
  • Hi,

    it can be installed on different servers, it doesn't matter.

    On the Superdesk side:

    1. log in to Superdesk
    2. check via Chrome console what command window.superdeskConfig.publisher is returning
    In your case it should be: 

    1. base:"api/v1"
    2. domain:"unimedia.info"
    3. protocol:"https" // or http if you run on http
    4. tenant:"beta"
    5.  
    6. You can set those values here: https://github.com/superdesk/superdesk/blob/sdsite/client/superdesk.config.js, once it is set you need to install superdesk with those vars so it can build.

     You can also set PUBLISHER_API_SUBDOMAIN env var set to "beta" and PUBLISHER_API_DOMAIN env var set to "unimedia.info" while deploying/installing Superdesk so it will automatically set proper env vars for you without a need to change the above config.

    On the Publisher side (assuming you already have it installed): 

    1. Run command php app/console swp:organization:create Unimedia

    This command will create a a proper organization if you didn't create it.

    2. Run command php app/console swp:tenant:create <organization_code_generated_by_the_above_command> unimedia.info Unimedia beta

    This command will create a a proper tenant if you didn't create it.

    3. You can install theme and its assets see: 
    https://github.com/superdesk/web-publisher/blob/master/install.md#local-installationBut I saw you already did that.
    So this is what should be done in order to connect Superdesk with Publisher so it can work together properly.
  • Rafał,

    Thank you again for your time.

    Following Superdesk Web Publisher local installation I got an error on:
    php app/console doctrine:migrations:migrate

    But as I understand, those are duplicated values that are already present in the database.

    Next, I created the Organization and the tenant as you specified.

    Then I executed:

    php app/console swp:theme:install <tenant> src/SWP/Bundle/FixturesBundle/Resources/themes/DefaultTheme/ -f

    I replaced <tenant> with the tenant code, generated in the previous step.

    Finally, I executed:
    php app/console sylius:theme:assets:install

    The site gives me an Error 500 with the following output on error.log

    2017/07/05 12:19:19 [error] 4565#0: *2858 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught Twig_Error_Loader: Unable to find template "index.html.twig" (looked into: /var/www/beta.unimedia.info/htdocs/app/Resources/views, /var/www/beta.unimedia.info/htdocs/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Resources/views/Form, /var/www/beta.unimedia.info/htdocs/vendor/knplabs/knp-menu/src/Knp/Menu/Resources/views). in /var/www/beta.unimedia.info/htdocs/vendor/twig/twig/lib/Twig/Loader/Filesystem.php:247

    P.S.: As for the Superdesk configuration - it all went well after I made the config (and rebuild - I never did rebuild after reconfiguring) for the client side. Although in the console I get some cors error:
    image
    In parameters.yml for SWP, the setting is:
    allow_origin_cors: 'http://desk.unimedia.info'
  • Looks like the theme name is not set for current tenant (probably a bug let me know pls). Check in swp_tenant table if the tenant has swp/default-theme (this name is from theme.jsonset in theme_name column.


    Set
    allow_origin_cors param to '*' and remove cache folder: rm -rf /var/www/beta.unimedia.info/htdocs/cache/*
  • You were right: there was no value for the theme_name for the tenant in the swp_tenant table. I did the change on the table (added: swp/default-theme). Now it loads, but i guess there is something wrong with the assets (style.css and all.js).

    Loaded layout (http://beta.unimedia.info):
    image

    Here is a screen from console:
    image

    P.S.: Unfortunately the allow_origin_cors setting does nothing, as I get the same error:

    image
    Post edited by Nalyk Calmis at 2017-07-05 06:54:02
  • For assets run command php app/console sylius:theme:assets:install it should do the trick. To be sure run rm -rf /var/www/beta.unimedia.info/htdocs/cache/*

    For cors issue, have you changed in it /var/www/beta.unimedia.info/htdocs/app/config/parameters.yml?

    Please, check also var/www/beta.unimedia.info/htdocs/app/logs/prod.log file if there are any issues with /auth/superdesk endpoint
  • I did it step by step:

    image

    I have the same type/set of errors.

    As for prod.log - the only issue with /auth/superdesk endpoint is a "Method not allowed" error:
    No route found for \"GET /api/v1/auth/superdesk/\
  • For the assets, it is a template "error" (although it is more like a misconfiguration). The answer is here:


    Is still got auth issues and origin cors issues as i wrote above, so i still can not "bind" Superdesk with Superdesk Publisher




  • Ok about the issue with auth endpoint. What is the value set in parameters.yml for superdesk_servers param? Could be that the wrong host is set here - it should point to Superdesk API
  • Rafał, I had a productive morning :) The issue with auth endpoint was because there was not a role set for the user (my user, might be a bug). I created a role and assigned it to me and now everything is fine.

    I managed to solve CORS problem with the help of Nginx configuration, adding the needed header there.

    image

    Now the saga is to bring the menu I created in the Superdesk to the default theme. I browsed through the templating documentation and sadly I did not found much info.

    image

    Your help is really priceless. Thank you.


    UPDATE

    I copied and replaced the menu invocation tag from the theme-dailyNews and placed it in the base.html.twig -> Now I see the menu.

    I still did not manage to bypass the auth issues. On the SWP site, i get this error in the console:
    image

    Might it be related?

    Post edited by Nalyk Calmis at 2017-07-07 06:04:09
  • Vote Up0Vote Down Paweł MikołajczukPaweł Mikołajczuk
    Posts: 62Member, Sourcefabric Team
    This auth issue is known theme bug, we will fix it soon. 
  • Vote Up0Vote Down Paweł MikołajczukPaweł Mikołajczuk
    Posts: 62Member, Sourcefabric Team
    It's fixed in latest master. 
  • Thank you, i will reinstall on dev server. By the way, what is the correct upgrade procedure/instructions for Superdesk Web Publisher? 
  • Friend, could you please help me with the following:
    I installed Superdesk together with Publisher, but when I'm going to test Publish an article the Publishing Menu DOES NOT GIVE ME THE OPTION TO PUBLISH IN MORE THAN ONE SITE, as shown in the following figure01 ...

    I ask, what should I do to have access to the Publication menu like figure02 attached ...

    Thanks in advance.
    1360 x 768 - 211K
    1440 x 900 - 151K