Skip to content

Commit

Permalink
Update Dependencies (#12)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
nenokkadine authored Jun 20, 2021
1 parent 5331e62 commit f0782a6
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 47 deletions.
22 changes: 0 additions & 22 deletions .github/workflows/baseimage-build.yml

This file was deleted.

38 changes: 33 additions & 5 deletions .github/workflows/release-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,23 @@ name: Release
on:
push:
tags:
- "v*"
- "v*.*.*"

jobs:
Builds:
ReleaseAssets:
runs-on: ubuntu-latest

steps:
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- uses: actions/checkout@v2
- run: docker build . -f builder/Dockerfile -t builder:latest
- run: docker run --name=gdutils --rm -dit builder:latest bash
- run: docker cp gdutils:/builder/ ./
- name: Docker Build
run: docker build . -f builder/Dockerfile -t builder:latest
- name: Run the Docker image
run: docker run --name=gdutils --rm -dit builder:latest bash
- name: Copy Built files
run: docker cp gdutils:/builder/ ./
- name: Compress Build Outputs
run: |
cd builder
Expand All @@ -35,3 +38,28 @@ jobs:
name: GD-Utils Build ${{ steps.get_version.outputs.VERSION }}
files: |
builder/build/gdutils.tar.gz
DockerImage:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: ghcr.io/nenokkadine/gdutils
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: token
password: ${{ secrets.GH_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: baseimage/Dockerfile
platforms: linux/amd64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
4 changes: 1 addition & 3 deletions baseimage/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ RUN apk update && \
tar \
unzip \
xz \
neofetch \
htop \
bash && \
mkdir /gdutils
mkdir /gdutils && chmod 777 /gdutils
WORKDIR /gdutils
4 changes: 2 additions & 2 deletions heroku/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ node server.js &

# HTTPS Auth
if [[ -n "$HTTP_USER" && -n "$HTTP_PASS" ]]; then
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
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
else
wget -q https://gist.github.com/nenokkadine/5db0fff9216fcedc0dd5862d0a5ab864/raw/95cabcaaf776e47ebb1990b2583f443171cf742a/caddynoauth -O /Caddyfile
wget -q https://gist.github.com/nenokkadine/5db0fff9216fcedc0dd5862d0a5ab864/raw/4dd7e7b8edb691fc77a78cc174e88baab4ff073c/caddynoauth -O /Caddyfile
fi

#Terminal over Web
Expand Down
19 changes: 7 additions & 12 deletions src/package.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,20 @@
{
"name": "gd-utils",
"version": "1.0.1",
"description": "google drive utils",
"name": "GD-Utils",
"version": "1.0.2",
"description": "Google Drive Utils",
"repository": "iwestlin/gd-utils",
"main": "src/gd.js",
"scripts": {
"start": "https_proxy='http://127.0.0.1:1086' nodemon server.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "viegg",
"license": "ISC",
"dependencies": {
"@koa/router": "^10.0.0",
"@viegg/axios": "^1.0.0",
"better-sqlite3": "^7.1.5",
"better-sqlite3": "^7.4.1",
"bytes": "^3.1.0",
"cli-table3": "^0.6.0",
"colors": "^1.4.0",
"dayjs": "^1.10.4",
"gtoken": "^5.2.1",
"dayjs": "^1.10.5",
"gtoken": "^5.3.0",
"html-escaper": "^3.0.3",
"https-proxy-agent": "^5.0.0",
"koa": "^2.13.1",
Expand All @@ -28,6 +23,6 @@
"prompts": "^2.4.1",
"proxy-agent": "^4.0.1",
"signal-exit": "^3.0.3",
"yargs": "^16.2.0"
"yargs": "^17.0.1"
}
}
12 changes: 9 additions & 3 deletions src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const dayjs = require('dayjs')
const Koa = require('koa')
const bodyParser = require('koa-bodyparser')
const router = require('./src/router')
var fs = require('fs');

const app = new Koa()
app.proxy = true
Expand All @@ -11,8 +12,13 @@ app.use(bodyParser())
app.use(router.routes())
app.use(router.allowedMethods())

const PRT = 23333
app.listen(PRT, '0.0.0.0', console.log('http://127.0.0.1:' + PRT))
const G_SOCK = "/usr/gdutils.sock"

if (fs.existsSync(G_SOCK)) {
fs.unlinkSync(G_SOCK)
}

app.listen(G_SOCK, '0.0.0.0')

async function catcher (ctx, next) {
try {
Expand All @@ -22,4 +28,4 @@ async function catcher (ctx, next) {
ctx.status = 500
ctx.body = e.message
}
}
}

0 comments on commit f0782a6

Please sign in to comment.