mirror of
https://github.com/fccview/cronmaster.git
synced 2025-12-24 06:28:26 -05:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b267fb9ce6 | ||
|
|
032c63cfbd | ||
|
|
89fed1f1b4 | ||
|
|
129f4d8464 | ||
|
|
9d42a99c71 | ||
|
|
5eef50aeb9 | ||
|
|
47ad6d764c | ||
|
|
185afc0022 | ||
|
|
0b4ebe7240 |
9
.github/workflows/docker-publish.yml
vendored
9
.github/workflows/docker-publish.yml
vendored
@@ -2,7 +2,7 @@ name: Docker
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ["main"]
|
||||
branches: ["main", "legacy", "feature/*", "bugfix/*"]
|
||||
tags: ["v*.*.*"]
|
||||
pull_request:
|
||||
branches: ["main"]
|
||||
@@ -22,6 +22,12 @@ jobs:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Log in to the Container registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
@@ -45,6 +51,7 @@ jobs:
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
|
||||
18
README.md
18
README.md
@@ -75,8 +75,24 @@ services:
|
||||
- ./snippets:/app/snippets
|
||||
restart: unless-stopped
|
||||
init: true
|
||||
# Default platform is set to amd64, can be overridden by using arm64.
|
||||
#platform: linux/arm64
|
||||
```
|
||||
|
||||
### ARM64 Support
|
||||
|
||||
The application supports both AMD64 and ARM64 architectures:
|
||||
|
||||
**For AMD64 users**: No changes needed - the default configuration works out of the box.
|
||||
|
||||
**For ARM64 users**: Uncomment the platform line in your `docker-compose.yml`:
|
||||
|
||||
```yaml
|
||||
platform: linux/arm64
|
||||
```
|
||||
|
||||
**Note**: Multi-platform Docker images are automatically built for both architectures. The image will automatically use the correct architecture for your platform.
|
||||
|
||||
2. Build and run with Docker Compose:
|
||||
|
||||
```bash
|
||||
@@ -85,7 +101,7 @@ docker compose up --build
|
||||
|
||||
3. Open your browser and navigate to `http://localhost:40123`
|
||||
|
||||
**Note**: The Docker implementation uses direct file access to read and write crontab files, ensuring real-time synchronization with the host system's cron jobs. This approach bypasses the traditional `crontab` command limitations in containerized environments.
|
||||
**Note**: The Docker implementation uses direct file access to read and write crontab files, ensuring real-time synchronization with the host system's cron jobs. This approach bypasses the traditional `crontab` command limitations in containerized environments
|
||||
|
||||
### Local Development
|
||||
|
||||
|
||||
@@ -39,10 +39,21 @@ export function ScriptModal({
|
||||
}: ScriptModalProps) {
|
||||
const handleSubmit = async (e: React.FormEvent) => {
|
||||
e.preventDefault();
|
||||
|
||||
if (!form.name.trim()) {
|
||||
showToast("error", "Validation Error", "Script name is required");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!form.content.trim()) {
|
||||
showToast("error", "Validation Error", "Script content is required");
|
||||
return;
|
||||
}
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append("name", form.name);
|
||||
formData.append("description", form.description);
|
||||
formData.append("content", form.content);
|
||||
formData.append("name", form.name.trim());
|
||||
formData.append("description", form.description.trim());
|
||||
formData.append("content", form.content.trim());
|
||||
|
||||
Object.entries(additionalFormData).forEach(([key, value]) => {
|
||||
formData.append(key, value);
|
||||
@@ -66,18 +77,24 @@ export function ScriptModal({
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
<div>
|
||||
<label className="block text-sm font-medium text-foreground mb-2">
|
||||
Script Name
|
||||
Script Name <span className="text-red-500">*</span>
|
||||
</label>
|
||||
<Input
|
||||
value={form.name}
|
||||
onChange={(e) => onFormChange({ name: e.target.value })}
|
||||
placeholder="My Script"
|
||||
required
|
||||
className={
|
||||
!form.name.trim()
|
||||
? "border-red-300 focus:border-red-500 focus:ring-red-500"
|
||||
: ""
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<label className="block text-sm font-medium text-foreground mb-2">
|
||||
Description
|
||||
Description{" "}
|
||||
<span className="text-muted-foreground text-xs">(optional)</span>
|
||||
</label>
|
||||
<Input
|
||||
value={form.description}
|
||||
@@ -102,7 +119,7 @@ export function ScriptModal({
|
||||
<div className="flex items-center gap-2 mb-4 flex-shrink-0">
|
||||
<FileText className="h-4 w-4 text-primary" />
|
||||
<h3 className="text-sm font-medium text-foreground">
|
||||
Script Content
|
||||
Script Content <span className="text-red-500">*</span>
|
||||
</h3>
|
||||
</div>
|
||||
<div className="flex-1 min-h-0">
|
||||
|
||||
@@ -46,13 +46,13 @@ async function scanScriptsDirectory(dirPath: string): Promise<Script[]> {
|
||||
const content = await fs.readFile(filePath, "utf-8");
|
||||
const metadata = parseMetadata(content);
|
||||
|
||||
if (metadata.id && metadata.title && metadata.description) {
|
||||
if (metadata.id && metadata.title) {
|
||||
const stats = await fs.stat(filePath);
|
||||
|
||||
scripts.push({
|
||||
id: metadata.id,
|
||||
name: metadata.title,
|
||||
description: metadata.description,
|
||||
description: metadata.description || "",
|
||||
filename: file,
|
||||
createdAt: stats.birthtime.toISOString(),
|
||||
});
|
||||
|
||||
@@ -38,3 +38,5 @@ services:
|
||||
- ./snippets:/app/snippets
|
||||
restart: unless-stopped
|
||||
init: true
|
||||
# Default platform is set to amd64, can be overridden by using arm64.
|
||||
#platform: linux/arm64
|
||||
|
||||
Reference in New Issue
Block a user