-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RedmineReceivingEmails and the cronjob #64
Comments
@yosifkit Hello, this docker does not have a planned mission environment, so |
I have the same issue, any progress on this? |
Yep, need some nice way to add cron jobs! E-mail fetfer and regular notifications... |
Hi I have just done this using the rufus-scheduler method and it appears to work fine. It requires that you create your own Docker image, but really this is required if you are adding any plugins or to configure your outbound email settings. My Dockerfile looks like this:
The getmail.rb then configures rufus-scheduler:
In the getmail.rb, you can set any of the receive email parameters using ENV , like default-group and project_from_subaddress, etc. Hope this helps. -Barry Flanagan |
Hi everybody, finally I decided to handle all cron jobs via another external container, here is something interesting: http://deck-chores.readthedocs.io/en/stable/index.html Why? Coz our production server is getting more and more containers I need one centralized place for managing cron jobs. One, place, easy to read and configure, no need to manually adjust each of the containers. |
I used @flantel 's approach with the rufus-scheduler using the docker image for redmine 4.0. I had the issue that Redmine:IMAP was not found and I got following ruby error:
Same with POP3. |
If you do not want to create your own Docker image you could also add a cronjob on the host. Create the script
Where Make the script executable:
Edit the crontab of the user which is running the container:
...and add this line to execute your script
This will execute every minute. |
Hi there! Currently wanted to setup with cron. But Im constantly getting this error:
Opened this issue on this subject: #232 |
I am unsure this would work if the container is inside a Kubernetes cluster which could change machine in each restart or, mostly, if the cluster is managed in the cloud such as ECS by AWS. |
I have some proposals of changes to fix the issue permanently:
I have the following questions:
|
Unfortunately, an image using "supervisor" (or a similar multi-process init
replacement) is not going to be acceptable as part of the Docker Official
Images program that this image is part of.
|
I am unsure to understand. |
@tianon Recently, I have seen that Nextcloud allows 3 options for scheduled tasks at their side. The first being AJAX requests while loading the frontend and the second being using an external scheduled request call a PHP script which performs the tasks internally. This last option could be something that Redmine could implement I guess. Given that this is more important for get it working properly on Docker, I guess this should be performed at this side? A little endpoint in RubyOnRails to make the tasks after getting a scheduled curl request? |
I submitted an issue at https://www.redmine.org/issues/38226 anyways to cover both sides in the case is preferable to be implemented by upstream. |
I too am opposed to the inclusion of cron, logrotate, and supervisor. The latest version finally got rid of all the detritus involved in using passenger. The inclusion of an in-Rails scheduler fits more with Docker's "single-process-per-container" design pattern. Would love to see rufus-scheduler or something similar included as part of the base image so we can still run the stock official image. |
@petiepooo the proposal I made to the Redmine team is quite different already. Maybe you could appreciate it since it is what Nextcloud uses optionally. |
@EchedeyLR If I am reading #38226 correctly, your solution would still require an external app (like curl or cron) to launch the RAKE task. I would prefer puma launch periodic tasks directly per flantel's solution using rufus-scheduler. As for an AJAX or REST interface to create/manage/launch tasks, I am not opposed, but don't need that functionality myself. What I am opposed to is running multiple processes within a single docker container. Requiring supervisor or tini in an image should be avoided, IMHO. |
The problem with Rufus scheduler is that would likely behave the same as the cron proposal (basically, every single node of the instance would have its own scheduler being called and sending a notification for each node) in HA setups, which may be a big problem. |
Following the guide here:
http://www.redmine.org/projects/redmine/wiki/RedmineReceivingEmails
Using the approach 'fetching emails from an IMAP server' and that is working great.
My project is here: https://github.com/DINA-Web/redmine-docker/tree/task760
I have created a script with the 'rake'-command to harvest my mailbox : receive_imap.sh with the following content
The user and the psw are in the .env-file
running the script manually works fine and an issue is created in my project 'myproject'.
The entry in the crontab (root account ) is like this >
* * * * * /usr/src/redmine/mail-script/receive_imap.sh
For the sake of testing I am running it right now every minute.
The only thing that I am seeing is the /var/log/cron-mail.log - no 'harvesting of my mailbox'.
Summary
Being new to Ruby.
One thing I see is that the crontab cannot find the environment for Ruby, it says it cannot find rake version 12.
As I understand this, this question boils down to 'the environment variables are not present with me when running crontab' - I tried to copy every environmental variable for root to a file and running source on that file when starting the script, but this does not help.
regards, Ingimar
The text was updated successfully, but these errors were encountered: