cypht-docker icon indicating copy to clipboard operation
cypht-docker copied to clipboard

Update to latest code in dockerhub

Open ellis opened this issue 5 years ago • 35 comments

Following the README instruction creates an installation with a various random errors when trying to read messages.

However, when I downloaded your code and built the docker image from scratch, things ran just fine. Could you please rebuild the image and update it in dockerhub so we get the current cypht version again?

ellis avatar Jan 04 '20 11:01 ellis

wow 100K+ pulls of https://hub.docker.com/r/sailfrog/cypht-docker

marclaporte avatar Jan 06 '20 04:01 marclaporte

Thank you. I wish I had seen this sooner. I was not receiving random errors, but a very consistent "Server Error" bar at the top of the page (or 500 from a POST in the nginx logs) whenever trying to load anything, including emails and feed items. The logs showed nothing to explain this. Even Debug Mode was not showing any explanation. Building it myself eliminated this problem.

t-m-w avatar Feb 04 '20 06:02 t-m-w

Same issue as @t-m-w . However building from scratch does not work for me. There is an error in the build process (I will post output here shortly.) Question: Is there a plan to maintain a current image in Docker hub to just pull?

conspacer avatar May 29 '20 04:05 conspacer

i also want to see a code-update on docker-hub. Please :) and a Version indicator, would be great.

THX

csuno avatar Aug 16 '21 13:08 csuno

Agreed for an update.

Some information:

  1. The project evolved from a personal repo to an organization: https://unencumberedbyfacts.com/2023/06/14/cypht-rebooted/ so the commit review process and release process is now handled by a team.
  2. @rodriguezny started modernizing the Docker package: https://github.com/cypht-org/cypht-docker/pull/20
  3. We have yet to update https://hub.docker.com/r/sailfrog/cypht-docker
  4. We'll soon e-meet to discuss this. Can you join us?

marclaporte avatar Aug 18 '23 19:08 marclaporte

and a Version indicator, would be great.

FYI, Cypht's admin panel now indicates revision (one more reason to update our Docker) https://github.com/cypht-org/cypht/pull/638

marclaporte avatar Aug 18 '23 19:08 marclaporte

@wangxiaoerYah wrote: "Can I add Docker workflow to the current branch? Instead of in another repository, I want to create two docker branches for it, stable and nightly." Source: https://github.com/cypht-org/cypht/issues/748

The Cypht development model has evolved: https://github.com/cypht-org/cypht/wiki/Lifecycle so it totally makes sense to have stable and nightly.

As to doing within this repo or the other: I don't know. This should be discussed by the community.

marclaporte avatar Aug 18 '23 20:08 marclaporte

@ellis @t-m-w @conspacer @csuno @wangxiaoerYah: Please share your thoughts and indicate if you can be present at the meeting about this with @mose, @rodriguezny, @josaphatim and myself.

Thanks!

marclaporte avatar Aug 18 '23 20:08 marclaporte

If you build a docker image and create stable and nightly branches, you need to improve code review and functional testing. But I am not proficient in PHP, if you need to start, I will provide the help I can.

The most important thing is PHP code testing. Unlike static languages, as long as the compilation passes, there will generally be no problems. Might need more help with this. We can refer to other webmail projects, how they implement code testing.

wangxiaoerYah avatar Aug 19 '23 03:08 wangxiaoerYah

I checked the action market, maybe this should work

phpunit

As long as the test check is deployed, there will be no major problems in subsequent compilation of the docker image.

After that, the project development will be on the right track, only need stable maintenance, and review, it can allow more users to participate, because docker will make the installation process easier and easier to understand.

wangxiaoerYah avatar Aug 19 '23 03:08 wangxiaoerYah

Today I tried to reproduce the test steps that this project used to host on travis, maybe this is more complicated than I thought.😂

If you want to implement it on GitHub, you need to modify a lot of files. I wonder if the developer plans to use GitHub action to build a test process?

@marclaporte

wangxiaoerYah avatar Aug 20 '23 13:08 wangxiaoerYah

We (Rodriguez, Josaphat, mose and I) held a Cypht-Docker meeting. Takeaways:

1- https://github.com/cypht-org/cypht/wiki will be updated to explain how thing will work (Lifecycle, how to contribute, etc.)

2- Docker aspects will eventually be brought in main repo, we won't maintain a distinct repo like now: https://github.com/cypht-org/cypht-docker

3- Josaphat will review everything related to the CI, and discuss with mose for questions. The CI should run for all Docker builds.

marclaporte avatar Aug 21 '23 16:08 marclaporte

我们(Rodriguez、Josaphat、mose 和我)召开了 Cypht-Docker 会议。要点:

1- https://github.com/cypht-org/cypht/wiki将更新以解释事物如何工作(生命周期、如何贡献等)

2- Docker 方面最终将引入主存储库,我们不会像现在一样维护一个独特的存储库:https://github.com/cypht-org/cypht-docker

3- Josaphat将审查与CI相关的所有内容,并与mose讨论问题。CI 应该针对所有 Docker 构建运行。

This is great! ! ! ! !

wangxiaoerYah avatar Aug 22 '23 21:08 wangxiaoerYah

3- Josaphat will review everything related to the CI, and discuss with mose for questions. The CI should run for all Docker builds.

Progress: https://github.com/cypht-org/cypht/pull/755

marclaporte avatar Sep 11 '23 04:09 marclaporte

@josaphatim Is it necessary to test selenium in Action ci? I tried it for a few hours on my dev branch and I feel that if I enable selenium tests, it is tedious on github ci and they depend on too many things and I have to do it on a lot of Switch between os images and maintain specific dependencies for specific systems. I think we should abandon the old software package dependencies and embrace the latest version.

wangxiaoerYah avatar Sep 30 '23 14:09 wangxiaoerYah

It requires php-fpm dependency, but there is no php7.4-fpm in ubuntu20. I tried to get it running and tried many times, but it had some problems. dev

wangxiaoerYah avatar Sep 30 '23 14:09 wangxiaoerYah

@marclaporte @josaphatim @kroky

Can you guys help me figure out what I'm doing wrong? Is it a missing dependency that's causing the compiled index.php to be missing elements?

github action

AttributeError: 'WebDriver' object has no attribute 'find_element_by_name'

Is this caused by adding the '--headless' parameter when starting chrome? Or is there a problem with my dependencies, resulting in incomplete page compilation? Because I see composer install showing many repeated warnings.

wangxiaoerYah avatar Oct 09 '23 18:10 wangxiaoerYah

Selenium 4.3.0 removes find_element_by_name method. Maybe you are using too new version? Try with an older one. https://github.com/SeleniumHQ/selenium/blob/a4995e2c096239b42c373f26498a6c9bb4f2b3e7/py/CHANGES

kroky avatar Oct 10 '23 13:10 kroky

Selenium 4.3.0 removes find_element_by_name method. Maybe you are using too new version? Try with an older one. https://github.com/SeleniumHQ/selenium/blob/a4995e2c096239b42c373f26498a6c9bb4f2b3e7/py/CHANGES

I updated the code and selenium has started running, but I still cannot pass the test. This is my latest progress:action

wangxiaoerYah avatar Oct 10 '23 13:10 wangxiaoerYah

Selenium 4.3.0 removes find_element_by_name method. Maybe you are using too new version? Try with an older one. https://github.com/SeleniumHQ/selenium/blob/a4995e2c096239b42c373f26498a6c9bb4f2b3e7/py/CHANGES

Hello, can I add your matrix account? So maybe I can contact you better.

wangxiaoerYah avatar Oct 10 '23 13:10 wangxiaoerYah

@kroky Did selenium run normally when you tested it? There seemed to be some errors when I tested it on Github action.

servers PASSED
 - finding element by class menu_settings
 - waiting for page by class name: main_menu ...
site FAILED
Traceback (most recent call last):
  File "/home/runner/work/cypht/cypht/tests/selenium/runner.py", line 16, in run_tests
    func()
  File "/home/runner/work/cypht/cypht/tests/selenium/./pages.py", line 104, in site
    self.wait_with_folder_list()
 - finding element by class menu_folders
  File "/home/runner/work/cypht/cypht/tests/selenium/base.py", line 121, in wait_with_folder_list
    self.wait(By.CLASS_NAME, "main_menu")
  File "/home/runner/work/cypht/cypht/tests/selenium/base.py", line 114, in wait
    element = WebDriverWait(self.driver, timeout).until(
  File "/home/runner/.local/lib/python3.10/site-packages/selenium/webdriver/support/wait.py", line 95, in until
    raise TimeoutException(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message: 
Stacktrace:
#0 0x55fc6ecaa933 <unknown>
#1 0x55fc6e9846f7 <unknown>
#2 0x55fc6e9cbaa6 <unknown>
#3 0x55fc6e9cbb91 <unknown>
#4 0x55fc6ea08fc4 <unknown>
#5 0x55fc6e9ed62d <unknown>
#6 0x55fc6ea06857 <unknown>
#7 0x55fc6e9ed3d3 <unknown>
#8 0x55fc6e9bfe64 <unknown>
#9 0x55fc6e9c0c4e <unknown>
#10 0x55fc6ec70558 <unknown>
#11 0x55fc6ec744a0 <unknown>
#12 0x55fc6ec7e97c <unknown>
#13 0x55fc6ec750b8 <unknown>
#14 0x55fc6ec40cdf <unknown>
#15 0x55fc6ec99048 <unknown>
#16 0x55fc6ec99219 <unknown>
#17 0x55fc6eca9ac3 <unknown>
#18 0x7f4972e94b43 <unknown>

wangxiaoerYah avatar Oct 10 '23 13:10 wangxiaoerYah

I remember having hard time running selenium but managed to run it at the end. Will check it later and reply...

kroky avatar Oct 10 '23 14:10 kroky

I remember having hard time running selenium but managed to run it at the end. Will check it later and reply...

You can refer to my dev branch, although the quality of my code is terrible. Well, if the code is fixed, I hope it can run directly in the project root path, just to make it look good, without switching paths 🤣🤣. Waiting for you Message, remember to @ me, remember to @ me, thank you, I am very happy to be with you.

wangxiaoerYah avatar Oct 10 '23 14:10 wangxiaoerYah

@wangxiaoerYah OK, I managed to run all of the selenium tests locally against an external postfix server but had to push a bit of fixes here: https://github.com/cypht-org/cypht/pull/791

Can you try latest latest master?

I see a couple of issues in your setup:

  • enable account module in hm3.ini to run some specific tests
  • I met timeout error when my external server firewall blocked my local system because of too many logins - selenium tests issue quite a bunch of requests to the postfix server in short amount of time, so normal firewalls block at some point. I had to ignore my IP to run them successfully. Check your env setup and preferrably disable all firewalls in the github ci...
  • some tests depend on the external mail server being able to send messages and have specific messages in its mail account inbox (e.g. search test is searching for keyword 'test'). If you see them failing, please artificially add some emails to the inbox or whatever is missing.

Also, feel free to modify the tests, so they run regardless of the mail server settings and state - this will be best but will require some more time that I lack now...

kroky avatar Oct 11 '23 08:10 kroky

@wangxiaoerYah OK, I managed to run all of the selenium tests locally against an external postfix server but had to push a bit of fixes here: https://github.com/cypht-org/cypht/pull/791

Can you try latest latest master?

I see a couple of issues in your setup:

  • enable account module in hm3.ini to run some specific tests
  • I met timeout error when my external server firewall blocked my local system because of too many logins - selenium tests issue quite a bunch of requests to the postfix server in short amount of time, so normal firewalls block at some point. I had to ignore my IP to run them successfully. Check your env setup and preferrably disable all firewalls in the github ci...
  • some tests depend on the external mail server being able to send messages and have specific messages in its mail account inbox (e.g. search test is searching for keyword 'test'). If you see them failing, please artificially add some emails to the inbox or whatever is missing.

Also, feel free to modify the tests, so they run regardless of the mail server settings and state - this will be best but will require some more time that I lack now...

This is great news and thank you for your work. I'll experiment later in me👍👍👍

wangxiaoerYah avatar Oct 11 '23 09:10 wangxiaoerYah

@kroky @marclaporte @josaphatim

  • composer suggest prompts for missing dependencies, should they be installed?

In my dev branch, I forcibly upgraded the PHP dependencies to completely deprecate PHP7.4. The selenium test looked fine. However, the phpunit test still did not work properly. I tried some modifications, but I had no idea. selenium phpunit

After I improved the dependencies, there is still a package that depends on the previous version of the library.

> composer suggest
paragonie/random_compat suggests:
 - ext-libsodium: Provides a modern crypto API that can be used to generate random bytes.

ext-libsodium is already built-in in php7. Is there any replacement for this package?

Is it possible to give up support for lower versions of PHP? I think the optimization of the latest version must be better than the previous version.

Also, I am going to create a docker compilation workflow, do you have any good suggestions?

wangxiaoerYah avatar Oct 12 '23 17:10 wangxiaoerYah

@wangxiaoerYah , I don't see an error in your phpunit pipeline - maybe try to run phpunit in verbose or even debug mode to see why it is returning a non-zero exit code.

sodium extension is part of php in all versions after 7.2 but it should be compiled with that when libsodium is available on the system. Any modern php package coming from OS package management systems should have it - I have mostly used Ubuntu.

We will deprecate and remove support for PHP versions that reached EOL one day but it is a discussion to be held. There are still a lot of places where PHP7 is supported/used.

I don't have experience with docker compilation workflows, sorry.

kroky avatar Oct 16 '23 07:10 kroky

@wangxiaoerYah Are you good? What is the next step?

Tks

marclaporte avatar Nov 06 '23 03:11 marclaporte

@wangxiaoerYah Are you good? What is the next step?

Tks

I can't pass the selenium test. Because of the local configuration of smtp and imap, my local configuration is normal smtp and imap, but when it comes to the action, I don't know why it can't connect.

I made some settings on my dev branch, you can refer to it.

https://github.com/wangxiaoerYah/cypht/tree/dev/.github

SMTP and imap are very difficult.

😂😂😂😂

wangxiaoerYah avatar Nov 06 '23 06:11 wangxiaoerYah

Maybe we merge what we have here and I continue by setting up the proper postfix config in the pipeline, so selenium tests can execute there?

kroky avatar Nov 06 '23 09:11 kroky