Skip to content

Commit f0782a6

Browse files
authored
Update Dependencies (nenokkadine#12)
* Update Workflows - Node Server Will run on UDS - Remove unused deps in Dockerfile - Remove Base image Workflow * Update Dependencies * Fix Docker Release * Fix * Use Build Push Action
1 parent 5331e62 commit f0782a6

File tree

6 files changed

+52
-47
lines changed

6 files changed

+52
-47
lines changed

.github/workflows/baseimage-build.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

.github/workflows/release-publish.yml

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,23 @@ name: Release
33
on:
44
push:
55
tags:
6-
- "v*"
6+
- "v*.*.*"
77

88
jobs:
9-
Builds:
9+
ReleaseAssets:
1010
runs-on: ubuntu-latest
1111

1212
steps:
1313
- name: Get the version
1414
id: get_version
1515
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
1616
- uses: actions/checkout@v2
17-
- run: docker build . -f builder/Dockerfile -t builder:latest
18-
- run: docker run --name=gdutils --rm -dit builder:latest bash
19-
- run: docker cp gdutils:/builder/ ./
17+
- name: Docker Build
18+
run: docker build . -f builder/Dockerfile -t builder:latest
19+
- name: Run the Docker image
20+
run: docker run --name=gdutils --rm -dit builder:latest bash
21+
- name: Copy Built files
22+
run: docker cp gdutils:/builder/ ./
2023
- name: Compress Build Outputs
2124
run: |
2225
cd builder
@@ -35,3 +38,28 @@ jobs:
3538
name: GD-Utils Build ${{ steps.get_version.outputs.VERSION }}
3639
files: |
3740
builder/build/gdutils.tar.gz
41+
DockerImage:
42+
runs-on: ubuntu-latest
43+
steps:
44+
- name: Checkout
45+
uses: actions/checkout@v2
46+
- name: Docker meta
47+
id: meta
48+
uses: docker/metadata-action@v3
49+
with:
50+
images: ghcr.io/nenokkadine/gdutils
51+
- name: Login to GitHub Container Registry
52+
uses: docker/login-action@v1
53+
with:
54+
registry: ghcr.io
55+
username: token
56+
password: ${{ secrets.GH_TOKEN }}
57+
- name: Build and push
58+
uses: docker/build-push-action@v2
59+
with:
60+
context: .
61+
file: baseimage/Dockerfile
62+
platforms: linux/amd64
63+
push: true
64+
tags: ${{ steps.meta.outputs.tags }}
65+
labels: ${{ steps.meta.outputs.labels }}

baseimage/Dockerfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ RUN apk update && \
1010
tar \
1111
unzip \
1212
xz \
13-
neofetch \
14-
htop \
1513
bash && \
16-
mkdir /gdutils
14+
mkdir /gdutils && chmod 777 /gdutils
1715
WORKDIR /gdutils

heroku/start.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ node server.js &
3535

3636
# HTTPS Auth
3737
if [[ -n "$HTTP_USER" && -n "$HTTP_PASS" ]]; then
38-
wget -qO- https://gist.github.com/nenokkadine/5db0fff9216fcedc0dd5862d0a5ab864/raw/95cabcaaf776e47ebb1990b2583f443171cf742a/caddyauth | sed -e "s/\$HTTP_USER/$HTTP_USER/g" -e "s/\$HASHPASS/$(caddy hash-password --plaintext $HTTP_PASS)/g" > /Caddyfile
38+
wget -qO- https://gist.github.com/nenokkadine/5db0fff9216fcedc0dd5862d0a5ab864/raw/4dd7e7b8edb691fc77a78cc174e88baab4ff073c/caddyauth | sed -e "s/\$HTTP_USER/$HTTP_USER/g" -e "s/\$HASHPASS/$(caddy hash-password --plaintext $HTTP_PASS)/g" > /Caddyfile
3939
else
40-
wget -q https://gist.github.com/nenokkadine/5db0fff9216fcedc0dd5862d0a5ab864/raw/95cabcaaf776e47ebb1990b2583f443171cf742a/caddynoauth -O /Caddyfile
40+
wget -q https://gist.github.com/nenokkadine/5db0fff9216fcedc0dd5862d0a5ab864/raw/4dd7e7b8edb691fc77a78cc174e88baab4ff073c/caddynoauth -O /Caddyfile
4141
fi
4242

4343
#Terminal over Web

src/package.json

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,20 @@
11
{
2-
"name": "gd-utils",
3-
"version": "1.0.1",
4-
"description": "google drive utils",
2+
"name": "GD-Utils",
3+
"version": "1.0.2",
4+
"description": "Google Drive Utils",
55
"repository": "iwestlin/gd-utils",
6-
"main": "src/gd.js",
7-
"scripts": {
8-
"start": "https_proxy='http://127.0.0.1:1086' nodemon server.js",
9-
"test": "echo \"Error: no test specified\" && exit 1"
10-
},
116
"keywords": [],
127
"author": "viegg",
138
"license": "ISC",
149
"dependencies": {
1510
"@koa/router": "^10.0.0",
1611
"@viegg/axios": "^1.0.0",
17-
"better-sqlite3": "^7.1.5",
12+
"better-sqlite3": "^7.4.1",
1813
"bytes": "^3.1.0",
1914
"cli-table3": "^0.6.0",
2015
"colors": "^1.4.0",
21-
"dayjs": "^1.10.4",
22-
"gtoken": "^5.2.1",
16+
"dayjs": "^1.10.5",
17+
"gtoken": "^5.3.0",
2318
"html-escaper": "^3.0.3",
2419
"https-proxy-agent": "^5.0.0",
2520
"koa": "^2.13.1",
@@ -28,6 +23,6 @@
2823
"prompts": "^2.4.1",
2924
"proxy-agent": "^4.0.1",
3025
"signal-exit": "^3.0.3",
31-
"yargs": "^16.2.0"
26+
"yargs": "^17.0.1"
3227
}
3328
}

src/server.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ const dayjs = require('dayjs')
22
const Koa = require('koa')
33
const bodyParser = require('koa-bodyparser')
44
const router = require('./src/router')
5+
var fs = require('fs');
56

67
const app = new Koa()
78
app.proxy = true
@@ -11,8 +12,13 @@ app.use(bodyParser())
1112
app.use(router.routes())
1213
app.use(router.allowedMethods())
1314

14-
const PRT = 23333
15-
app.listen(PRT, '0.0.0.0', console.log('http://127.0.0.1:' + PRT))
15+
const G_SOCK = "/usr/gdutils.sock"
16+
17+
if (fs.existsSync(G_SOCK)) {
18+
fs.unlinkSync(G_SOCK)
19+
}
20+
21+
app.listen(G_SOCK, '0.0.0.0')
1622

1723
async function catcher (ctx, next) {
1824
try {
@@ -22,4 +28,4 @@ async function catcher (ctx, next) {
2228
ctx.status = 500
2329
ctx.body = e.message
2430
}
25-
}
31+
}

0 commit comments

Comments
 (0)