Skip to content

Commit

Permalink
Update to Node.js 20 and ensure compatibility across all files, add n…
Browse files Browse the repository at this point in the history
…ew features
  • Loading branch information
yashodhank committed Jun 15, 2024
1 parent 1bd007b commit 9d2e221
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 18 deletions.
14 changes: 9 additions & 5 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
# Plesk API Key
# Plesk API key
PLESKKEY=

# Plesk URL
PLESKURL=

# Cloudflare credentials
# Cloudflare API key
CLOUDKEY=

# Cloudflare email
CLOUDEMAIL=

# Cloudflare account ID
CLOUDACCOUNTID=

# Plesk URL
PLESKURL=

# Email settings
EMAIL=
SENDER=
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: '16'
node-version: '20'

- name: Install dependencies
run: npm install
Expand All @@ -32,16 +32,16 @@ jobs:
run: npm test

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Log in to GitHub Container Registry
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin

- name: Build and push Docker image
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
push: true
tags: ghcr.io/${{ github.repository_owner }}/cloudflare-plesk-dns-sync:latest
14 changes: 12 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
FROM node:16-alpine
# Use Node.js 20 as the base image
FROM node:20-alpine

# Set the working directory
WORKDIR /app

# Copy package.json and package-lock.json
COPY package*.json ./

# Install dependencies
RUN npm install

# Copy the rest of the application code
COPY . .

CMD ["node", "index.js"]
# Expose the port the app runs on (if applicable)
EXPOSE 3000

# Command to run the app
CMD ["node", "cli.js", "run"]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# !!DO NOT USE THIS PROJECT IS IT NEVER TESTED FOR IT WORKING!!
# !!DO NOT USE THIS PROJECT IT HAS NEVER BEEN TESTED!!
----
# Cloudflare-Plesk-DNS-Sync

Expand Down
15 changes: 11 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@
"description": "A script to synchronize ACME TXT records between Cloudflare and Plesk and provide additional DNS management automation.",
"main": "index.js",
"scripts": {
"start": "node index.js run",
"start": "node cli.js run",
"setup": "node setup.js",
"test": "jest",
"cleanup": "node index.js cleanup",
"renew-ssl": "node index.js renew-ssl"
"cleanup": "node cli.js cleanup",
"renew-ssl": "node cli.js renew-ssl",
"monitor-health": "node cli.js monitor-health",
"manage-settings": "node cli.js manage-settings",
"backup": "node cli.js backup",
"restore": "node cli.js restore"
},
"dependencies": {
"commander": "^9.0.0",
Expand All @@ -21,5 +25,8 @@
"license": "MIT",
"devDependencies": {
"jest": "^29.7.0"
},
"engines": {
"node": ">=20.0.0"
}
}
}

0 comments on commit 9d2e221

Please sign in to comment.