Skip to content
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

Select all jobs at once from the dashboard #242

Closed
Sulivan1999 opened this issue May 23, 2024 · 22 comments
Closed

Select all jobs at once from the dashboard #242

Sulivan1999 opened this issue May 23, 2024 · 22 comments

Comments

@Sulivan1999
Copy link

Hello!

Would it be possible to create an option to select all jobs at once, directly on the panel?

When we need to delete or deactivate multiple jobs, we need to select them one by one and then do the action. When there are many jobs this becomes a bit tiring, the option to select them all would be interesting.

@pschlan
Copy link
Owner

pschlan commented May 28, 2024

Good point. Let me see what I can do.

@kleenkanteen
Copy link

kleenkanteen commented Jun 1, 2024

Saw the same use case myself except to delete cron jobs I made when testing.

@pschlan Is this already implemented? I see it is. If not, could I pick up this task?

@pschlan
Copy link
Owner

pschlan commented Jun 1, 2024

Of course, feel free to work on it. That would be awesome.

@kleenkanteen
Copy link

I tried running the repo in a github codespace (smallest one with 8gb ram). I made a devcontainer from the provided Dockerfile. It uses Ubuntu 20.04 LTS.

I followed the steps on https://github.com/pschlan/cron-job.org?tab=readme-ov-file#example-environment-using-docker-compose but on step 4 with docker compose up, I get this error, posting as a gist because it is so long: https://gist.github.com/kleenkanteen/819ca0e714875dc955513f801eb7f19c

Any idea why it isn't builiding?

@pschlan
Copy link
Owner

pschlan commented Jun 2, 2024

I have never seen this. It might be running out of memory, can you try to assign more RAM, even if just for building?

@kleenkanteen
Copy link

kleenkanteen commented Jun 3, 2024

Doubling the ram fixed the issue. All services started now and showing logs in terminal. Although I get this log showing up:
chronos-1 | Chronos runtime error: MySQL_DB::connect(): Unknown MySQL server host 'mysql-node' (2)

my .env ends like this:

NODE_MYSQL_ROOT_PASSWORD=chronos
NODE_MYSQL_USER=chronos
NODE_MYSQL_PASSWORD=chronos
NODE_MYSQL_DATABASE=chronos_node

I tried changing the last name from chronos_node to mysql_node? It didn't remove the error. Reverted back.

@kleenkanteen
Copy link

kleenkanteen commented Jun 3, 2024

I'm unable to create an account after opening up the frontend. Status of 500 from http://127.0.0.1:8010/api/ when clicking create account.

@pschlan
Copy link
Owner

pschlan commented Jun 3, 2024

Doubling the ram fixed the issue. All services started now and showing logs in terminal. Although I get this log showing up: chronos-1 | Chronos runtime error: MySQL_DB::connect(): Unknown MySQL server host 'mysql-node' (2)

That's not unusual during startup phase. It should retry and eventually succeed.

I'm unable to create an account after opening up the frontend. Status of 500 from http://127.0.0.1:8010/api/ when clicking create account.

Did you set a valid SMTP_SERVER which accepts emails?

@kleenkanteen
Copy link

kleenkanteen commented Jun 3, 2024

That's not unusual during startup phase. It should retry and eventually succeed.

Looking at the terminal it keeps on happening.

Did you set a valid SMTP_SERVER which accepts emails?

Nope. Easiest way to do it? I would expect it to be setup in the docker compose file already.

Does using this work also?: https://www.ionos.ca/digitalguide/e-mail/technical-matters/set-up-docker-mail-server/

Here is what I see upon running docker compose up: https://gist.github.com/kleenkanteen/927e6a66a5d51c5eaa94fa7c94d487c6

@kleenkanteen
Copy link

I added this to docker-compose.yml:

  mailserver:
    image: docker.io/mailserver/docker-mailserver:latest
    container_name: mailserver
    hostname: mail-server
    # example.com should be replaced with the own domain for the mail server:
    ports:
        - "25:25"
        - "587:587"
        - "465:465"
    volumes:
        - ./docker-data/dms/mail-data/:/var/mail/
        - ./docker-data/dms/mail-state/:/var/mail-state/
        - ./docker-data/dms/mail-logs/:/var/log/mail/
        - ./docker-data/dms/config/:/tmp/docker-mailserver/
        # Path should be adjusted accordingly:
        - ./docker-data/nginx-proxy/certs/:/etc/letsencrypt/
        - /etc/localtime:/etc/localtime:ro
    environment:
        - ENABLE_FAIL2BAN=1
        # If letsencrypt for SSL/TLS certificate is used (otherwise adapt)
        - SSL_TYPE=letsencrypt
        - PERMIT_DOCKER=network
        - ONE_DIR=1
        - ENABLE_POSTGREY=0
        - ENABLE_CLAMAV=0
        - ENABLE_SPAMASSASSIN=0
        - SPOOF_PROTECTION=0
    cap_add:
        - NET_ADMIN # For Fail2Ban to work
        - SYS_PTRACE

and in .env changed this line:
SMTP_SERVER=http://${CJO_DOMAIN}:25

Still upon creating an account, I get a 500 server error.

@kleenkanteen
Copy link

@pschlan any idea about the MySQL and mailserver error?

@kleenkanteen
Copy link

I isolated the MySQL issue by starting it by itself. Details here: https://gist.github.com/kleenkanteen/aa6b066ebb2857e4c0a6bc55be5bdae5

@kleenkanteen
Copy link

kleenkanteen commented Jun 6, 2024

Ok after asking for help on stackoverflow it turns out the default_authentication_plugin is deprecated, image is mysql 8.4, but according to the docs, "the plugin is deprecated as of MySQL 8.0.27 and subject to removal in a future MySQL version."

Aaaand it just got disabled by default last month: docker-library/mysql#1048

Also, /workspaces/cron-job.org/database/struct_node.sql, line 42, can't have the text field have a default value. Had to remove that. Now mysql-node and mysql-master start perfectly fine.

I will move on to adding mailserver to docker compose.

@kleenkanteen
Copy link

kleenkanteen commented Jun 6, 2024

@pschlan So I'm reading over this guide for setting up a mail server where I can see the email contents and log in: https://docker-mailserver.github.io/docker-mailserver/latest/examples/tutorials/basic-installation/

But there's so much to setup. What is the easiest way to do this email account confirmation flow?

@kleenkanteen
Copy link

kleenkanteen commented Jun 6, 2024

I am following this email guide: https://www.youtube.com/watch?v=4SQiTXHYrnw

which seems the simplest but upon sending an email, nothing sends. This is my email .env's:

SMTP_SERVER=localhost:2500

# Email sender address and return path. '%s' in the return path will be
# replaced by a VERP token which can be used to automatically processed
# bounce emails and match them to a user account (e.g. to disable sending
# further emails to this user).
[email protected]
# CJO_EMAIL_RETURN_PATH=bounce+%[email protected]
CJO_EMAIL_RETURN_PATH=bounce+%@bounces.example.com

anything wrong with these?

terminal logs show this upon sending:

api-1           | 172.20.0.9 -  06/Jun/2024:16:59:09 +0000 "POST /api/index.php" 409
www-1           | 172.20.0.1 - - [06/Jun/2024:16:59:09 +0000] "POST /api/ HTTP/1.1" 409 5 "http://localhost:8010/signup" "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36" "-"
api-1           | NOTICE: PHP message: PHP Fatal error:  Uncaught ValueError: Unknown format specifier "@" in /var/www/html/lib/Mail.php:39
api-1           | Stack trace:
api-1           | #0 /var/www/html/lib/Mail.php(39): sprintf('bounce+%@bounce...', 'signup-4-35ebce...')
api-1           | #1 /var/www/html/resources/User.php(513): Mail->setVerp('signup', '4', Array)
api-1           | #2 /var/www/html/resources/User.php(487): UserManager::sendActivationEmail('easyascake1@gma...', 'en', Object(AccountConfirmationToken), '4')
api-1           | #3 /var/www/html/apimethods/CreateAccount.php(68): UserManager::createAccount('easyascake1@gma...', 'Sabh', 'S', 'easyascake', 'en', 'America/Toronto')
www-1           | 172.20.0.1 - - [06/Jun/2024:16:59:15 +0000] "POST /api/ HTTP/1.1" 200 851 "http://localhost:8010/signup" "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36" "-"
api-1           | #4 /var/www/html/lib/APIDispatcher.php(140): CreateAccount->execute(Object(stdClass), false, 'en')
api-1           | #5 /var/www/html/index.php(72): APIDispatcher->dispatch()
api-1           | #6 {main}
api-1           |   thrown in /var/www/html/lib/Mail.php on line 39
api-1           | 172.20.0.9 -  06/Jun/2024:16:59:15 +0000 "POST /api/index.php" 200
mailslurper-1   | time="2024-06-06T16:59:18Z" level=info msg="Mail collection page 1 retrieved" who=ServiceController
mailslurper-1   | time="2024-06-06T16:59:19Z" level=info msg="Mail collection page 1 retrieved" who=ServiceController
mailslurper-1   | time="2024-06-06T16:59:20Z" level=info msg="Mail collection page 1 retrieved" who=ServiceController
mailslurper-1   | time="2024-06-06T16:59:21Z" level=info msg="Mail collection page 1 retrieved" who=ServiceController
mailslurper-1   | time="2024-06-06T16:59:26Z" level=info msg="Mail collection page 1 retrieved" who=ServiceController
mailslurper-1   | time="2024-06-06T16:59:27Z" level=info msg="Mail collection page 1 retrieved" who=ServiceController
chronos-1       | App::processJobs(): Done waiting for plannedTime = 1717693200.

@kleenkanteen
Copy link

kleenkanteen commented Jun 6, 2024

help me bro I've suffered enough to get this running to this point 😩 (jk I am not suffering but it is hard)

@kleenkanteen
Copy link

kleenkanteen commented Jun 23, 2024

Ok so I found a way to bypass the email verification login without needing a SMTP server. I was able to login to the site using this method. Here are the steps after creating an account and it says confirmation email sent:

  1. In docker-compose.yml, after line 19, add this:
      - "3306:3306"

This will expose the docker container on post 3306 of your machine.
2. Then with your database IDE of choice, login at localhost (127.0.0.1) on port 3306. default user and pass is chronos. db name is chronos_master. Then in the user table, for the row of your new account, you set the status column to 1 which means it's verified.
3. Now login with your account details and you will enter the dashboard.

@pschlan
Copy link
Owner

pschlan commented Jun 27, 2024

Sorry for not being able to support here, lots of stuff going on the last weeks. I hope I can have a look at this (and your PR - thanks so much for this) soon.
I'm glad you found a way to unblock yourself for now.

@kleenkanteen
Copy link

kleenkanteen commented Jun 27, 2024 via email

@kleenkanteen
Copy link

kleenkanteen commented Jun 30, 2024

here is the full error message when I try creating a cronjob:

image

All of it is running in gh codespaces. One weird thing is that in datagrip, I can test the connection to chronos_master and chronos_node. It succeeds for chronos_node but not chronos_master. For the latter, it just infinite loads, see the loading sign at the bottom of this pic:

image

But for chronos_node, connection works:

image

Gist of my docker compose file: https://gist.github.com/kleenkanteen/71038837b8ea3d26e9aa4d1f21e362d0

@kleenkanteen
Copy link

kleenkanteen commented Jul 1, 2024

Regarding connecting to mysql-master, found the issue. On line 21 in docker-compose.yml, it should be - "4307:3306". Since mysql by default is exposed on port 3306.

struct_node.sql for some reason is not fully executed, so only the first 2 tables are created in the mysql-node db. I tried deleting the parts with "DEFAULT x" as that caused an error with the struct_master.sql, but same deal.

One workaround is that in datagrip, I connected to mysql-node and ran the create table statements for the remaining 7 tables. Then I was able to create a cron job successfully.

@pschlan
Copy link
Owner

pschlan commented Jul 1, 2024

It seems MySQL strict mode is not correctly disabled in your setup. That would explain why some tables have not been created properly. It puzzles me a bit since for me it works without issues with the docker compose setup in the repo. I will check again ASAP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants