5 Commits

Author SHA1 Message Date
fccview
e2e95968ef Merge pull request #43 from Navino16/feature/extra-groups-ids
Very happy with these changes, thank you for the help!
2025-10-08 16:04:56 +01:00
fccview
a4ae5ec148 update readme 2025-10-08 16:03:02 +01:00
fccview
8e8069ee92 remove docker exec user and update readme with a note for docker compose as root 2025-10-08 15:44:31 +01:00
fccview
f96c37b55c remove debugging logs 2025-10-08 15:01:18 +01:00
fccview
cda9685e6d Add Navino to readme table 2025-10-08 14:53:56 +01:00
4 changed files with 24 additions and 36 deletions

View File

@@ -2,18 +2,6 @@
<img src="public/heading.png" width="400px">
</p>
# 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.
<br />
---
<p align="center">
<a href="http://discord.gg/invite/mMuk2WzVZu">
<img width="40" src="public/repo-images/discord_icon.webp">
</a>
<br />
<i>Join the discord server for more info</i>
<br />
</p>
---
<br />
## 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/<your_user_here>/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.
**Important Note on Root Commands**: When running commands as `root` within Cronmaster, ensure that these commands also function correctly as `root` on your host machine. If a command works as `root` on your host but fails within Cronmaster, please open an issue with detailed information.
## Usage
### Viewing System Information
@@ -264,6 +264,9 @@ I would like to thank the following members for raising issues and help test/deb
<td align="center" valign="top" width="20%">
<a href="https://github.com/cerede2000"><img width="100" height="100" src="https://avatars.githubusercontent.com/u/38144752?v=4&size=100"><br />cerede2000</a>
</td>
<td align="center" valign="top" width="20%">
<a href="https://github.com/Navino16"><img width="100" height="100" src="https://avatars.githubusercontent.com/u/22234867?v=4&size=100"><br />Navino16</a>
</td>
</tr>
</tbody>
</table>

View File

@@ -265,18 +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") {
console.log(
`Overriding root execution. Running command as user: ${dockerExecUser}`
);
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}'`;
}

View File

@@ -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

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB