diff --git a/README.md b/README.md index 61874a3..e4bba29 100644 --- a/README.md +++ b/README.md @@ -2,18 +2,6 @@

-# ATTENTION BREAKING UPDATE!! - -> The latest `main` branch has completely changed the way this app used to run. -> The main reason being trying to address some security concerns and make the whole application work -> across multiple platform without too much trouble. -> -> If you came here due to this change trying to figure out why your app stopped working you have two options: -> -> 1 - Update your `docker-compose.yml` with the new one provided within this readme (or just copy [docker-compose.yml](docker-compose.yml)) -> -> 2 - Keep your `docker-compose.yml` file as it is and use the legacy tag in the image `image: ghcr.io/fccview/cronmaster:legacy`. However bear in mind this will not be supported going forward, any issue regarding the legacy tag will be ignored and I will only support the main branch. Feel free to fork that specific branch in case you want to work on it yourself :) - ## Features - **Modern UI**: Beautiful, responsive interface with dark/light mode. @@ -23,6 +11,23 @@ - **Docker Support**: Runs entirely from a Docker container. - **Easy Setup**: Quick presets for common cron schedules. +
+ +--- + +

+ + + +
+ Join the discord server for more info +
+

+ +--- + +
+ ## Before we start Hey there! 👋 Just a friendly heads-up: I'm a big believer in open source and love sharing my work with the community. Everything you find in my GitHub repos is and always will be 100% free. If someone tries to sell you a "premium" version of any of my projects while claiming to be me, please know that this is not legitimate. 🚫 @@ -72,12 +77,6 @@ services: # replace root with your user - find it with: ls -asl /var/spool/cron/crontabs/ # For multiple users, use comma-separated values: HOST_CRONTAB_USER=root,user1,user2 - HOST_CRONTAB_USER=root - - # --- !! IMPORTANT !!DOCKER EXEC USER - # If you do not specify this user to be a valid user on your system, - # any cronjob containing a docker command will fail. IDEALLY you should not be running - # docker commands as root, so this is only a fallback. ONLY ONE USER IS ALLOWED. - - DOCKER_EXEC_USER=fccview volumes: # --- MOUNT DOCKER SOCKET # Mount Docker socket to execute commands on host @@ -153,7 +152,6 @@ The following environment variables can be configured: | `DOCKER` | `false` | ONLY set this to true if you are runnign the app via docker, in the docker-compose.yml file | | `HOST_CRONTAB_USER` | `root` | Comma separated list of users that run cronjobs on your host machine | | `AUTH_PASSWORD` | `N/A` | If you set a password the application will be password protected with basic next-auth | -| `DOCKER_EXEC_USER` | `N/A` | If you don't set this user you won't be able to run docker commands as root. | **Example**: To change the clock update interval to 60 seconds: @@ -173,6 +171,8 @@ HOST_PROJECT_DIR=/home//homelab/cronmaster - `HOST_PROJECT_DIR` is required in order for the scripts created within the app to run properly - The `DOCKER=true` environment variable enables direct file access mode for crontab operations. This is REQUIRED when running the application in docker mode. +**Please Note**: If you want to run `docker compose` commands as `root` within your cron jobs (highly discouraged btw), you will need to install Docker with root privileges. Otherwise, `docker compose` won't be found when executing commands. + ## Usage ### Viewing System Information diff --git a/app/_server/actions/cronjobs/index.ts b/app/_server/actions/cronjobs/index.ts index 181b2e2..effa712 100644 --- a/app/_server/actions/cronjobs/index.ts +++ b/app/_server/actions/cronjobs/index.ts @@ -265,15 +265,9 @@ export const runCronJob = async ( if (isDocker) { const userInfo = await getUserInfo(job.user); - const dockerExecUser = process.env.DOCKER_EXEC_USER; - - let executionUser = userInfo ? userInfo.username : "root"; - - if (dockerExecUser && executionUser === "root") { - executionUser = dockerExecUser; - } - + const executionUser = userInfo ? userInfo.username : "root"; const escapedCommand = job.command.replace(/'/g, "'\\''"); + command = `nsenter -t 1 -m -u -i -n -p su - ${executionUser} -c '${escapedCommand}'`; } diff --git a/docker-compose.yml b/docker-compose.yml index e4e570c..2e1865e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -23,12 +23,6 @@ services: # replace root with your user - find it with: ls -asl /var/spool/cron/crontabs/ # For multiple users, use comma-separated values: HOST_CRONTAB_USER=root,user1,user2 - HOST_CRONTAB_USER=root - - # --- !! IMPORTANT !!DOCKER EXEC USER - # If you do not specify this user to be a valid user on your system, - # any cronjob containing a docker command will fail. IDEALLY you should not be running - # docker commands as root, so this is only a fallback. ONLY ONE USER IS ALLOWED. - - DOCKER_EXEC_USER=fccview volumes: # --- MOUNT DOCKER SOCKET # Mount Docker socket to execute commands on host diff --git a/public/repo-images/discord_icon.webp b/public/repo-images/discord_icon.webp new file mode 100644 index 0000000..365ad81 Binary files /dev/null and b/public/repo-images/discord_icon.webp differ