Git Product home page Git Product logo

phplist-docker's Introduction

phpList core module

Build Status Latest Stable Version Total Downloads Latest Unstable Version License

About phpList

phpList is an open source newsletter manager. This project is a rewrite of the original phpList.

About this package

This is the core module of the successor to phpList 3. It will have the following responsibilities:

  • provide access to the DB via Doctrine models and repositories (and raw SQL for performance-critical parts that do not need the models)
  • routing (which the web frontend and REST API will use)
  • authentication (which the web frontend and REST API will use)
  • logging
  • a script for tasks to be called from the command line (or a cron job)
  • tasks to create and update the DB schema

Please note that this module does not provide a web frontend or a REST API. There are the separate modules phpList/web-frontend and phpList/rest-api for these tasks.

This module should not be modified locally. It should be updated via Composer.

Installation

Since this package is only a service required to run a full installation of phpList 4, the recommended way of installing this package is to run composer install from within the phpList base distribution which requires this package. phpList/base-distribution containrs detailed installation instructions in its README.

Contributing to this package

Contributions to phpList repositories are highly welcomed! To get started please take a look at the contribution guide. It contains everything you would need to make your first contribution including how to run local style checks and run tests.

Code of Conduct

This project adheres to a Contributor Code of Conduct. By participating in this project and its community, you are expected to uphold this code.

Structure

Running the web server

The phpList application is configured so that the built-in PHP web server can run in development and testing mode, while Apache can run in production mode.

Please first set the database credentials in config/parameters.yml.

Development

To run the application in development mode using PHP's built-in server, use this command:

bin/console server:run -d public/

The server will then listen on http://127.0.0.1:8000 (or, if port 8000 is already in use, on the next free port after 8000).

You can stop the server with CTRL + C.

Development and Documentation

We use phpDocumentor to automatically generate documentation for classes. To make this process efficient and easier, you are required to properly "document" your classes,properties, methods ... by annotating them with docblocks.

More about generatings docs in PHPDOC.md

Testing

To run the server in testing mode (which normally will only be needed for the automated tests, provide the --env option:

bin/console server:run -d public/ --env=test

Production

For documentation on running the application in production mode using Apache, please see the phpList base distribution README.

Changing the database schema

Any changes to the database schema must always be done both in phpList 3 and later versions so that both versions always have the same schema.

For changing the database schema, please edit resources/Database/Schema.sql and adapt the corresponding domain model classes and repository classes accordingly.

Developing phpList modules (plugins)

In phpList, plugins are called modules. They are Composer packages which have the type phplist-module.

Bundle and route configuration

If your module provides any Symfony bundles, the bundle class names need to be listed in the extra section of the module's composer.json like this:

"extra": {
    "phplist/core": {
        "bundles": [
            "Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle",
            "PhpList\\Core\\EmptyStartPageBundle\\PhpListEmptyStartPageBundle"
        ]
    }
}

Please note that the key of the section with extra needs to always be phplist/core, not the name of your module package. Please have a look at the composer.json in the rest-api module for an example.

Similarly, if your module provides any routes, those also need to be listed in the extra section of the module's composer.json like this:

"extra": {
    "phplist/core": {
        "routes": {
            "homepage": {
                "resource": "@PhpListEmptyStartPageBundle/Controller/",
                "type": "annotation"
            }
        }
    }
}

You can also provide system configuration for your module:

"extra": {
    "phplist/core": {
        "configuration": {
            "framework": {
                "templating": {
                    "engines": [
                        "twig"
                    ]
                }
            }
        }
    }
}

It is recommended to define the routes using annotations in the controller classes so that the route configuration in the composer.json is minimal.

Accessing the database

For accessing the phpList database tables from a module, please use the Doctrine model and repository classes stored in src/Domain/ in the phplist/core package (this package).

For accessing a repository, please have it injected via dependency injection. Please do not get the repository directly from the entity manager as this would skip dependency injection for that repository, causing those methods to break that rely on other services having been injected.

Currently, only a few database tables are mapped as models/repositories. If you need a mode or a repository method that still is missing, please submit a pull request or file an issue.

Accessing the phpList data from third-party applications

To access the phpList data from a third-party application (i.e., not from a phpList module), please use the REST API.

Copyright

phpList is copyright (C) 2000-2021 phpList Ltd.

phplist-docker's People

Contributors

akoscomp avatar bizmate avatar btrappe avatar facundoacevedo avatar michield avatar samtuke avatar zaufi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

phplist-docker's Issues

Unable to start a dev environment : error copying from phplist-unknown/

I have tried setting the version via the .env file and export without any change.

my .env file

PORT=8000
HOSTNAME=localhost
THEME_DEV_PATH=/home/testuser/phplist/themes
CODE_PATH=/home/testuser/phplist/phplist3/public_html/
PLUGIN_DEV_PATH=/home/testuser/phplist/plugins

./start-phplist.sh
..
=> CACHED [11/15] RUN echo VERSION=unknown 0.0s
=> CACHED [12/15] RUN rm -rf /var/www/phpList3 && mkdir /var/www/phpList3 0.0s
=> ERROR [13/15] COPY phplist-unknown/ /var/www/phpList3

phplist don't send email

From 3.6.7 docker version of phplist don't send emails.
I think that happens with cron.
Befor 3.6.7 version, the cron file was places /phplist-crontab and from this file the entrypoint created /var/spool/cron/crontabs/root file.
From 3.6.7 the cron file moved to /etc/cron.d/phplist-crontab and the cron process normally execute it, but I think that this execution don't happen.
Because this repo don't contain this modification, I can't try to fix it, with a pull request.

wait some time?

Wait some time,....
seriously is very long time,... sorry

Update phplist via docker

Hi,

We have phplist as a docker for small academic newsletter. The process of updating/upgrading phplist via docker is not mentioned anywhere so I am assuming is straightforward like pulling the latest images?

Which brings us to the second issue, how often you guys update phplist/phplist on Docker Hub and why does it only have one tag? Having tags with the same version allows us to choose or go back. Besides, it's not possible to know what is latest when it was updated 2 months ago.

As this is an open source project, I am offering help regarding pushing a new version into DockerHub and also make the tags available align with the versions if help is needed :)

Cannot connect to database, Sql server is not running. Please check your configuration or contact the administrator.

Hello team.
I have just tried to install it according to instructions in Readme.
Now I can see three containers running:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
a6769a2f514b phplist/phplist:latest "docker-entrypoint.sh" 5 hours ago Up 5 hours 443/tcp, 0.0.0.0:8000->80/tcp phplist-docker_phplist_1
9ffce3a83e8a phplist/postfix:latest "sh -c 'service rsys…" 5 hours ago Up 5 hours 25/tcp, 465/tcp, 587/tcp phplist-docker_mailhost_1
2046e6f7fa37 mariadb:10.1 "docker-entrypoint.s…" 5 hours ago Up 5 hours 3306/tcp phplist-docker_dbhost_1

But when I try to go to the link http://localhost:8000/lists/admin/,
I get:
Sql server is not running. Please check your configuration or contact the administrator.

Appreciate any advice on how to start troubleshooting?

Error sending email to [email protected] SMTP connect() failed.

Connect fails from php.

Connected directly from the container and it can talk to mailhog but php does not.

root@6c74662b8030:/var/www/phpList3# ./busybox telnet mailhog 25
Connected to mailhog
220 mailhog.example ESMTP MailHog
HELO
250 Hello
MAIL FROM [email protected]
550 Invalid syntax in MAIL command
MAIL
550 Invalid syntax in MAIL command
MAIL FROM: [email protected]
250 Sender [email protected] ok
RCPT TO: [email protected]
250 Recipient [email protected] ok
DATA
354 End data with .
HELLO!
.
250 Ok: queued as [email protected]

Please update base image operating system and php version.

Please update base image operating system and php version.

The base image system is debian buster slim, this is very old and PHP Version 7.3.31 is not support any more and deprecate, this compromise the security of system.

Thanks, for excellent work.
Regards.

Table 'phplistdb.phplist_i18n' missing when using a docker image tag

Hi!

I'm experiencing the following error when using a specific docker image tag in phplist.yml. Everything is working fine when using the latest tag.

phpList - Database error 1146 while doing query Table 'phplistdb.phplist_i18n' doesn't exist

Steps to reproduce

  • git clone https://github.com/phpList/phplist-docker.git .
  • run cp .env-dist .env
  • In phplist.yml change line 24 image: phplist/phplist:latest to image: phplist/phplist:3.6.2
  • run ./start-phplist.sh
  • docker logs will show the following
    ➜  phplisttest git:(master) ✗ docker logs phplisttest_phplist_1 | head -n 20
    Initialising phpList, Please wait
    Waiting for the Database to be available - 1/10
    phpList - phpList version 3.6.2 (c) 2000-2021 phpList Ltd, https://www.phplist.com
    Error: initialise does not process commandline
    phpList - phpList version 3.6.2 (c) 2000-2021 phpList Ltd, https://www.phplist.com
    A new version of phpList is available: phpList 3.6.4 Download the new versionor use the phpList Updater
    phpList - ar
    phpList - Initialising language ar
    phpList - Database error 1146 while doing query  Table 'phplistdb.phplist_i18n' doesn't exist
    phpList - Sql error replace into phplist_i18n (lan,original,translation) values("ar","import is not available","استيراد غير متوفر")
    phpList - Database error 1146 while doing query  Table 'phplistdb.phplist_i18n' doesn't exist
    phpList - Sql error replace into phplist_i18n (lan,original,translation) values("ar","statistics","إحصائيات")
    ...
    

Waiting for the Database to be available 1/10 getting bigger then 10

I am trying to install phpList with Docker.
I set the .env variables as shown in link with my own values.

When I deploy the container, it deploys fine, but when I try to access the application, I get a bad gateway error.

When I look in the logs, the message appears: Waiting for database to be available - 1/10 appears.
Now this message keeps appearing and I am currently at Waiting for database to become available - 66/10.
Do I need to add a database container myself or have I forgotten something?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.