WindTalk

WindTalk OP wrote (edited )

Well, I was hoping to draw some help on this, and with emma's public departure and deletion of some technical info here... I may not continue this effort.

I do not know PHP and any of the PHP framework systems being used. But I can say from decades of experience: emma's code is very well structured and readable. As open source code goes, it's great, and in many ways I find it superior to the demo code that the Symfony project publishes! Emma has a great talent for organic growth of code, and her commit history shows a great ability to build up a functional app where basics are important. Emma also shows a regularity of motivation and contribution to the project.

I come from very very old social media, like 1980's social media, and I can say that the current Internet has a real problem drawing mom-and-pop cottage-operators for forums. I think Postmill is incredibly powerful and cheap to operate for a few thousand active users - and it emotionally bothers me how many users on reddit won't pick it up and go start their own independently operated/admin sites built around various topics. I just don't get why people can't see the problem of so much power concentrated in owners who care more about the brand and count of users.

The features of Postmill are good enough for most purposes, and feature wish lists aren't important. But emma clearly has made the code clean and able to be expanded by other developers... and there has to be experienced PHP people out there would be willing to make contributions.

Anyway, I'm not in the position to contribute good code on basic features. My hacking motives were motivated by some other projects I have, I was hoping to coattail on a project that was so cleanly coded and would attract a couple active developers. I still hope for that, as I really think Postmill's server efficiency and clean simplicity should encourage more small-time site operators.

In any event, if I have not made clear enough: Thank you emma.

3

WindTalk wrote (edited )

I think a lot of people love their job. More than they love their own children and spouse. I've witnessed people disown their children, but that same person would not disown their employer (for far worse values). When you talk to middle-age people going through a divorce, often the thing they consider most important is their job stability and how important it is to pay for their lawyer and child custody battle. I scratch my head, as every child has lived through a marriage - the marriage of their parents - and the problem-solving they are educating to their children.

On the other hand, i also question if people have not altered the very meaning of the word "love" to mean something entirely different from a serious classical meaning.

6

WindTalk OP wrote

I brought in the base Twig template, but ran into troubles

Postmill and the Demo Blog app both use a src/Twig/AppExtension.php - and It isn't clear to me how to integrate them. The config/services.yaml for the Demo Blog app has 3 binding references that Postmill does not normally use, but I've been unable to figure out how to make those bindings work. templates/base.html.twig loops through the locales() function - and without those bindings working - it fails.

1

WindTalk wrote (edited )

ok, so I did a complete setup of PHP 7.2, PostgreSQL 10.1, nginx/1.10.3 and managed to get Postmill runing via nginx.

  1. my root folder is /home/myuser/PostmillSite0/Postmill (I did a git checkout from /home/myuser/PostmillSite0 folder)
  2. Everything is working fine with the bin/console server:run 0.0.0.0:8000 using my account myuser
  3. Then i went with the bone-stock version of nginx that Ubuntu 16.04 currently provides.
  4. Based on the information you provided, you and I are both running the same version of PHP 7.2 - HOWEVER

I notice something, you are using Ubuntu 17.10? To run a server in public, I think most would go with 16.04 - as it's LTS and there is more documentation out there on it. (I saw your "7.2.2-3+ubuntu17.10.1+deb.sury.org+1" vs mine "7.2.2-3+ubuntu16.04.1+deb.sury.org+1")

I suspect that puts you on a different, newer version, of nginx/1.10.3 - and maybe some alternate configs?

Here is the config I used that was a non-default site. nginx/1.10.3 is providing a simple static file for my default, using what Ubuntu 16.04 setup. http://server4.plasticirony.com - will show that default site.

Now, to wire up PHP and Postmill, I added a second site (same IP Address, same port):

/etc/nginx/sites-available/forum.plasticirony.com

server {
    server_name plasticirony.com forum.plasticirony.com;
    root /home/myuser/PostmillSite0/Postmill/public;

    location / {
        # try to serve file directly, fallback to index.php
        try_files $uri /index.php$is_args$args;
    }

    location ~ ^/index\.php(/|$) {
        fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
        fastcgi_split_path_info ^(.+\.php)(/.*)$;
        include fastcgi_params;

        # optionally set the value of the environment variables used in the application
        # fastcgi_param APP_ENV prod;
        # fastcgi_param APP_SECRET <app-secret-id>;
        # fastcgi_param DATABASE_URL "mysql://db_user:db_pass@host:3306/db_name";

        # Postmill
        fastcgi_param APP_ENV 'prod';
        fastcgi_param APP_SECRET 'mysecret';
        fastcgi_param SITE_NAME 'forum.PlasticIrony.com';
        fastcgi_param DATABASE_URL 'pgsql://postmill:[email protected]/postmilldb0?serverVersion10.1';
        fastcgi_param MAILER_URL 'smtp://localhost:25?encryption=&auth_mode=';
        fastcgi_param NO_REPLY_ADDRESS '[email protected]';


        # When you are using symlinks to link the document root to the
        # current version of your application, you should pass the real
        # application path instead of the path to the symlink to PHP
        # FPM.
        # Otherwise, PHP's OPcache may not properly detect changes to
        # your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126
        # for more information).
        fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
        fastcgi_param DOCUMENT_ROOT $realpath_root;
        # Prevents URIs that include the front controller. This will 404:
        # http://domain.tld/index.php/some-path
        # Remove the internal directive to allow URIs like this
        internal;
    }

    # return 404 for all other php files not matching the front controller
    # this prevents access to other php files you don't want to be accessible.
    location ~ \.php$ {
        return 404;
    }

    error_log /var/log/nginx/project_error.log;
    access_log /var/log/nginx/project_access.log;
}

And, it's working fine off of http://forum.PlasticIrony.com - and responding correctly. I did waste 30 minutes figuring out that the proper PHP 7.2 path for /var/run/php/php7.2-fpm.sock - but once I solved that issue, Postmill started working file via nginx.

My Ubuntu 16.04 server has only 1GB of RAM, so I'm running Postmill on Nginx off of less than what you are attempting.

cat /proc/meminfo

MemTotal:        1048576 kB
MemFree:          501372 kB
Cached:           126480 kB
Buffers:               0 kB
Active:            84096 kB
Inactive:         131424 kB
Active(anon):      34932 kB
Inactive(anon):    54108 kB
Active(file):      49164 kB
Inactive(file):    77316 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:       1048576 kB
SwapFree:        1034996 kB
Dirty:             42252 kB
Writeback:             0 kB
AnonPages:         89040 kB
Shmem:            316680 kB
Slab:              14984 kB
SReclaimable:       3744 kB
SUnreclaim:        11240 kB
1

WindTalk wrote

Reply to comment by bootes in 404 errors with index.php by bootes

Allowed memory size of 134217728 bytes exhausted

128MB is standard memory limit for PHP, and apps like Drupal run fine with that amount. So, I'm thinking something else. However, try removing the limit

  1. run "php --ini" to confirm you are using the INI you think you are. What's your version of php? "php -v"
  2. Just to see if problem goes away, change memory_limit in php.ini to -1 and see if that changes behavior.
1

WindTalk OP wrote

So, where I'm stuck...

The templates/admin/blog/new.html.twig and other files are not showing any of the output in the "block main" section. However, if I copy the form code over to the "block sidebar" section (the right sidebar), it does show up.

Not sure how to resolve this conflict between the two apps and their output conventions.

3

WindTalk OP wrote (edited )

Postmill and Symfony demo seem to use different method of registering routes. The Symfony demo code uses @Route tags? I couldn't really figure out how to combine the two methods, so I hacked in some entries to config/routes.yaml to make it work with the Postmill method?

3

WindTalk wrote (edited )

Reply to by !deleted1665

Emma or other pull-request contributors: if you need or desire money, I can offer an underwhelming USD$4.50 bounty. One-time, yada yada. Bonus of USD$0.50 if you do the other, far more difficult, request;)

NOTE: I personally mean none of the violence aspect of "bounty", to me "dead or alive" or not equal. And "I was just following bounty incentive" and "I was just following orders" are up for massive 500-year-lasting dialog debate. I do not promote the pro-violence pro-dominate "urge" i often sense here on this BBS, but I do support the lasting quality of low-budget forum hosting with many cottage BBS operators.

5

WindTalk wrote (edited )

Quantity, count of comments? Reddit has always suffered from sticky posts where people comment and argue, but do not up-vote the main posting.

Related: Does Postmill allow multi-factor sorts? Time + upvotes? "Most upvote topic in past 7 days"?

Technology, performance: perhaps restrict server-punishing to an offline (server cron/batch job) static generation cache, once every 4 hours?

5