This repository has been archived by the owner on Jul 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 367a2e8
Showing
44 changed files
with
7,002 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: ci | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
ci: | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
node: [16] | ||
directory: [register, downloader] | ||
|
||
steps: | ||
- name: Checkout 🛎 | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup node env 🏗 | ||
uses: actions/[email protected] | ||
with: | ||
node-version: ${{ matrix.node }} | ||
check-latest: true | ||
|
||
- name: Get yarn cache directory path 🛠 | ||
id: yarn-cache-dir-path | ||
run: echo "::set-output name=dir::$(yarn cache dir)" | ||
|
||
- name: Cache node_modules 📦 | ||
uses: actions/cache@v3 | ||
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) | ||
with: | ||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | ||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-yarn- | ||
- name: Install dependencies 👨🏻💻 | ||
working-directory: ${{ matrix.directory }} | ||
run: yarn | ||
|
||
- name: Run linter 👀 | ||
working-directory: ${{ matrix.directory }} | ||
run: yarn lint | ||
|
||
- name: Run compile 🏗️ | ||
working-directory: ${{ matrix.directory }} | ||
run: yarn compile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: Docker Image CI | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
directory: [register, downloader] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Build the Docker image (downloader) | ||
working-directory: ${{ matrix.directory }} | ||
run: docker build . --file Dockerfile --tag ${{ github.event.repository.name }}-${{ matrix.directory }}:$(date +%s) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Docker Publish | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
publish: | ||
name: Push Docker image to Docker Hub (${{ matrix.directory }}) | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
directory: [register, downloader] | ||
|
||
|
||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Log in to Docker Hub | ||
uses: docker/[email protected] | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/[email protected] | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-${{ matrix.directory }} | ||
|
||
- name: Build and push Docker image | ||
uses: docker/[email protected] | ||
with: | ||
context: ${{ matrix.directory }} | ||
push: true | ||
platforms: linux/amd64,linux/arm64 | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: hadolint | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
ci: | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
node: [16] | ||
directory: [register, downloader] | ||
|
||
steps: | ||
- name: Checkout 🛎 | ||
uses: actions/checkout@v3 | ||
|
||
- uses: hadolint/[email protected] | ||
with: | ||
dockerfile: ${{ matrix.directory }}/Dockerfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
node_modules/ | ||
dist/ | ||
data/ | ||
TimeshiftRegister_old/ | ||
|
||
config.json | ||
searchWords.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
ignored: | ||
- DL3018 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"configurations": [ | ||
{ | ||
"type": "node", | ||
"request": "launch", | ||
"name": "Launch", | ||
"runtimeExecutable": "yarn", | ||
"cwd": "${workspaceFolder}", | ||
"runtimeArgs": ["dev"], | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"editor.tabSize": 2 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
version: '3.8' | ||
|
||
services: | ||
register: | ||
build: ./register | ||
volumes: | ||
- type: bind | ||
source: ./data | ||
target: /data | ||
- type: bind | ||
source: ./config.json | ||
target: /app/config.json | ||
restart: always | ||
|
||
downloader: | ||
build: ./downloader | ||
volumes: | ||
- type: bind | ||
source: ./data | ||
target: /data | ||
- type: bind | ||
source: ./config.json | ||
target: /app/config.json | ||
restart: always |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
version: '3.8' | ||
|
||
services: | ||
downloader: | ||
build: ./downloader | ||
volumes: | ||
- type: bind | ||
source: ./data | ||
target: /data | ||
- type: bind | ||
source: ./config.json | ||
target: /app/config.json | ||
restart: always |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
version: '3.8' | ||
|
||
services: | ||
register: | ||
build: ./register | ||
volumes: | ||
- type: bind | ||
source: ./data | ||
target: /data | ||
- type: bind | ||
source: ./config.json | ||
target: /app/config.json | ||
restart: always |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
version: '3.8' | ||
|
||
services: | ||
register: | ||
image: ghcr.io/tomacheese/niconico-timeshift-register:v1.0.0 | ||
volumes: | ||
- type: bind | ||
source: ./data | ||
target: /data | ||
- type: bind | ||
source: ./config.json | ||
target: /app/config.json | ||
restart: always | ||
|
||
downloader: | ||
image: ghcr.io/tomacheese/niconico-timeshift-downloader:v1.0.0 | ||
volumes: | ||
- type: bind | ||
source: ./data | ||
target: /data | ||
- type: bind | ||
source: ./config.json | ||
target: /app/config.json | ||
restart: always |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
webpack.config.js | ||
dist | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
env: | ||
es2021: true | ||
node: true | ||
extends: | ||
- standard | ||
- plugin:@typescript-eslint/recommended | ||
- prettier | ||
parser: '@typescript-eslint/parser' | ||
parserOptions: | ||
ecmaVersion: latest | ||
sourceType: module | ||
project: ./tsconfig.json | ||
plugins: | ||
- '@typescript-eslint' | ||
rules: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
semi: false | ||
singleQuote: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
FROM golang:alpine as livedl-builder | ||
|
||
RUN apk update && \ | ||
apk upgrade && \ | ||
apk add --no-cache git gcc musl-dev | ||
|
||
RUN git clone https://github.com/nnn-revo2012/livedl.git /work/livedl | ||
|
||
WORKDIR /work/livedl/src | ||
RUN go build -o /work/livedl/livedl livedl.go | ||
|
||
# /work/livedl | ||
|
||
FROM node:18-alpine | ||
|
||
RUN apk update && \ | ||
apk upgrade | ||
|
||
COPY --from=livedl-builder /work/livedl/livedl /bin/livedl | ||
RUN chmod +x /bin/livedl | ||
|
||
WORKDIR /app | ||
|
||
COPY package.json . | ||
COPY yarn.lock . | ||
RUN yarn install && \ | ||
yarn cache clean | ||
|
||
COPY entrypoint.sh . | ||
RUN chmod +x entrypoint.sh | ||
|
||
COPY src src | ||
COPY tsconfig.json . | ||
|
||
ENTRYPOINT [ "/app/entrypoint.sh" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/sh | ||
|
||
while : | ||
do | ||
yarn build || true | ||
|
||
# wait 6 hours | ||
sleep 21600 | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{ | ||
"name": "niconico-timeshift-register", | ||
"version": "1.0.0", | ||
"description": "", | ||
"main": "dist/main.js", | ||
"repository": "[email protected]:tomacheese/niconico-timeshift.git", | ||
"author": "Tomachi", | ||
"license": "MIT", | ||
"private": true, | ||
"scripts": { | ||
"build": "ts-node -r tsconfig-paths/register ./src/main.ts", | ||
"dev": "ts-node-dev -r tsconfig-paths/register ./src/main.ts", | ||
"start": "node ./dist/main.js", | ||
"compile": "tsc -p .", | ||
"compile:test": "tsc -p . --noEmit", | ||
"lint": "run-p -c lint:prettier lint:eslint lint:tsc", | ||
"lint:prettier": "prettier --check src", | ||
"lint:eslint": "eslint . --ext ts,tsx", | ||
"lint:tsc": "tsc", | ||
"fix": "run-s fix:prettier fix:eslint", | ||
"fix:eslint": "eslint . --ext ts,tsx --fix", | ||
"fix:prettier": "prettier --write src" | ||
}, | ||
"devDependencies": { | ||
"@types/cheerio": "0.22.31", | ||
"@types/node": "18.0.3", | ||
"@typescript-eslint/eslint-plugin": "5.30.5", | ||
"@typescript-eslint/parser": "5.30.5", | ||
"axios": "0.27.2", | ||
"cheerio": "1.0.0-rc.12", | ||
"eslint": "8.19.0", | ||
"eslint-config-prettier": "8.5.0", | ||
"eslint-config-standard": "17.0.0", | ||
"eslint-plugin-import": "2.26.0", | ||
"eslint-plugin-n": "15.2.4", | ||
"eslint-plugin-node": "11.1.0", | ||
"eslint-plugin-promise": "6.0.0", | ||
"prettier": "2.7.1", | ||
"ts-node": "10.8.2", | ||
"ts-node-dev": "2.0.0", | ||
"typescript": "4.7.4", | ||
"yarn-run-all": "3.1.1" | ||
} | ||
} |
Oops, something went wrong.