Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 14 additions & 28 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,7 @@
FROM node:20-slim AS base

RUN apt-get update && apt-get install -y \
pciutils \
curl \
iputils-ping \
util-linux \
ca-certificates \
gnupg \
lsb-release \
&& rm -rf /var/lib/apt/lists/*

RUN curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null \
&& apt-get update \
&& apt-get install -y docker-ce-cli \
&& rm -rf /var/lib/apt/lists/*
FROM node:20-alpine AS base

FROM base AS deps
RUN apk add --no-cache libc6-compat
WORKDIR /app

COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* ./
Expand All @@ -42,26 +27,27 @@ WORKDIR /app
ENV NODE_ENV=production
ENV NEXT_TELEMETRY_DISABLED=1

RUN groupadd --system --gid 1001 nodejs
RUN useradd --system --uid 1001 nextjs
RUN apk add --no-cache su-exec docker-cli pciutils curl iputils util-linux ca-certificates

RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs

RUN mkdir -p /app/scripts /app/data /app/snippets && \
chown -R nextjs:nodejs /app/scripts /app/data /app/snippets

COPY --from=builder /app/public ./public

COPY --from=builder --chown=nextjs:nodejs /app/.next ./.next
RUN mkdir -p /app/.next/cache && \
chown -R nextjs:nodejs /app/.next

COPY --from=builder --chown=nextjs:nodejs /app/app ./app
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static

COPY --from=builder /app/package.json ./package.json
COPY --from=builder /app/yarn.lock ./yarn.lock

COPY --from=deps --chown=nextjs:nodejs /app/node_modules ./node_modules
COPY --from=builder /app/public ./public

EXPOSE 3000

ENV PORT=3000
ENV HOSTNAME="0.0.0.0"

CMD ["yarn", "start"]
USER nextjs

CMD ["node", "server.js"]
43 changes: 12 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<img src="public/heading.png" width="400px">
</p>

## Table of Contents
## Quick links

- [Features](#features)
- [Quick Start](#quick-start)
Expand All @@ -18,11 +18,16 @@
- [Managing Cron Jobs](#managing-cron-jobs)
- [Job Execution Logging](#job-execution-logging)
- [Managing Scripts](#managing-scripts)
- [Technologies Used](#technologies-used)
- [Contributing](#contributing)
- [License](#license)

---

<div align="center">

| Desktop | Mobile |
|---------|--------|
| ![Dark Mode Desktop](screenshots/home-dark.png) | ![Dark Mode Mobile](screenshots/home-dark-mobile.png) |
| ![Light Mode Desktop](screenshots/home-light.png) | ![Light Mode Mobile](screenshots/home-light-mobile.png) |

</div>

## Features

Expand Down Expand Up @@ -51,26 +56,13 @@
<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. 🚫

If you find my projects helpful and want to fuel my late-night coding sessions with caffeine, I'd be super grateful for any support! ☕

<p align="center">
<a href="https://www.buymeacoffee.com/fccview">
<img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy me a coffee" width="150">
<img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy me a coffee" width="120">
</a>
</p>

<div align="center">
<img width="500px" src="screenshots/home.png">
<img width="500px" src="screenshots/live-running.png" />
</div>
---

<a id="quick-start"></a>

Expand All @@ -93,7 +85,6 @@ services:
- "40123:3000"
environment:
- NODE_ENV=production
- DOCKER=true
- NEXT_PUBLIC_CLOCK_UPDATE_INTERVAL=30000
- AUTH_PASSWORD=very_strong_password
- HOST_CRONTAB_USER=root
Expand Down Expand Up @@ -335,16 +326,6 @@ I would like to thank the following members for raising issues and help test/deb
</tbody>
</table>

<a id="license"></a>

## License

This project is licensed under the MIT License.

## Support

For issues and questions, please open an issue on the GitHub repository.

## Star History

[![Star History Chart](https://api.star-history.com/svg?repos=fccview/cronmaster&type=Date)](https://www.star-history.com/#fccview/cronmaster&Date)
30 changes: 15 additions & 15 deletions app/_components/FeatureComponents/Cronjobs/CronJobList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ import {
import { Button } from "@/app/_components/GlobalComponents/UIElements/Button";
import { Switch } from "@/app/_components/GlobalComponents/UIElements/Switch";
import {
Clock,
Plus,
ClockIcon,
PlusIcon,
Archive,
ChevronDown,
Code,
MessageSquare,
Settings,
Loader2,
Filter,
} from "lucide-react";
CaretDownIcon,
CodeIcon,
ChatTextIcon,
GearIcon,
CircleNotchIcon,
FunnelIcon,
} from "@phosphor-icons/react";
import { CronJob } from "@/app/_utils/cronjob-utils";
import { Script } from "@/app/_utils/scripts-utils";
import { UserFilter } from "@/app/_components/FeatureComponents/User/UserFilter";
Expand Down Expand Up @@ -236,8 +236,8 @@ export const CronJobList = ({ cronJobs, scripts }: CronJobListProps) => {
<CardHeader>
<div className="flex flex-col sm:flex-row sm:items-center justify-between gap-4">
<div className="flex items-center gap-3">
<div className="p-2 bg-primary/10 rounded-lg">
<Clock className="h-5 w-5 text-primary" />
<div className="p-2 bg-primary/10 ascii-border">
<ClockIcon className="h-5 w-5 text-primary" />
</div>
<div>
<CardTitle className="text-xl brand-gradient">
Expand All @@ -261,7 +261,7 @@ export const CronJobList = ({ cronJobs, scripts }: CronJobListProps) => {
className="btn-outline"
title={t("cronjobs.filters")}
>
<Filter className="h-4 w-4" />
<FunnelIcon className="h-4 w-4" />
</Button>
<Button
onClick={() => setIsBackupModalOpen(true)}
Expand All @@ -276,7 +276,7 @@ export const CronJobList = ({ cronJobs, scripts }: CronJobListProps) => {
onClick={() => setIsNewCronModalOpen(true)}
className="btn-primary glow-primary"
>
<Plus className="h-4 w-4 mr-2" />
<PlusIcon className="h-4 w-4 mr-2" />
{t("cronjobs.newTask")}
</Button>
</div>
Expand All @@ -301,7 +301,7 @@ export const CronJobList = ({ cronJobs, scripts }: CronJobListProps) => {
onNewTaskClick={() => setIsNewCronModalOpen(true)}
/>
) : (
<div className="space-y-3 max-h-[55vh] min-h-[55vh] overflow-y-auto">
<div className="space-y-4 max-h-[55vh] min-h-[55vh] overflow-y-auto tui-scrollbar pr-1">
{loadedSettings ? (
filteredJobs.map((job) =>
minimalMode ? (
Expand Down Expand Up @@ -347,7 +347,7 @@ export const CronJobList = ({ cronJobs, scripts }: CronJobListProps) => {
)
) : (
<div className="flex items-center justify-center h-full min-h-[55vh]">
<Loader2 className="h-8 w-8 animate-spin text-primary" />
<CircleNotchIcon className="h-8 w-8 animate-spin text-primary" />
</div>
)}
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use client";

import { Button } from "@/app/_components/GlobalComponents/UIElements/Button";
import { Clock, Plus } from "lucide-react";
import { ClockIcon, PlusIcon } from "@phosphor-icons/react";

interface CronJobEmptyStateProps {
selectedUser: string | null;
Expand All @@ -15,7 +15,7 @@ export const CronJobEmptyState = ({
return (
<div className="text-center py-16">
<div className="mx-auto w-20 h-20 bg-gradient-to-br from-primary/20 to-blue-500/20 rounded-full flex items-center justify-center mb-6">
<Clock className="h-10 w-10 text-primary" />
<ClockIcon className="h-10 w-10 text-primary" />
</div>
<h3 className="text-xl font-semibold mb-3 brand-gradient">
{selectedUser
Expand All @@ -32,7 +32,7 @@ export const CronJobEmptyState = ({
className="btn-primary glow-primary"
size="lg"
>
<Plus className="h-5 w-5 mr-2" />
<PlusIcon className="h-5 w-5 mr-2" />
Create Your First Task
</Button>
</div>
Expand Down
Loading