Skip to content

Commit

Permalink
init project and add /upload route
Browse files Browse the repository at this point in the history
  • Loading branch information
zargarzadehm committed Aug 26, 2024
1 parent 09de942 commit c9b0681
Show file tree
Hide file tree
Showing 32 changed files with 6,983 additions and 91 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@rosen-bridge/changeset-formatter",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "dev",
"updateInternalDependencies": "patch",
"ignore": []
}
2 changes: 2 additions & 0 deletions .changeset/twenty-baboons-fly.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
14 changes: 14 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
node_modules
.nyc_output
coverage
dir
build
dist
logs
tests
docker*
Dockerfile
.dockerignore
.env
README.md
config/local*.yml
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist
13 changes: 13 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"root": true,
"env": {
"node": true
},
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
]
}
48 changes: 48 additions & 0 deletions .github/workflows/docker-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Build and Push Docker Image

on:
release:
types: [published]
push:
branches:
- dev

jobs:
build:
name: Build and Push Docker Image
runs-on: ubuntu-latest

steps:
- name: Checkout the Code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: ${{ vars.PLATFORM_LIST || 'linux/amd64' }}

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

- name: Login to Docker Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ErgoRaffle
password: ${{ secrets.GITHUB_TOKEN }}

- name: Docker Metadata action
uses: docker/metadata-action@v5
id: meta
with:
images: ghcr.io/ErgoRaffle/web3-storage-uploader

- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
platforms: ${{ vars.PLATFORM_LIST || 'linux/amd64' }}
push: true
tags: ${{ steps.meta.outputs.tags }}
21 changes: 21 additions & 0 deletions .github/workflows/mirroring.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Mirroring

on:
push:
branches:
- master
- dev
tags:
- '*'

jobs:
git-sync:
runs-on: ubuntu-latest
steps:
- name: git-sync
uses: wei/git-sync@v3
with:
source_repo: ${GITHUB_REPOSITORY}
source_branch: ${{github.ref_name}}
destination_repo: 'https://${{ secrets.DESTINATION_USER }}:${{ secrets.DESTINATION_TOKEN }}@${{ secrets.DESTINATION_SERVER }}/ergo/${GITHUB_REPOSITORY}.git'
destination_branch: ${{github.ref_name}}
139 changes: 139 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

# Sqlite databases
*.sqlite

config/local*.yml
.env
.DS_Store
.idea
49 changes: 49 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
image: node:20.11.0

stages:
- installation
- type-check
- lint
- changeset

installation:
stage: installation
cache:
key: $CI_COMMIT_REF_NAME
policy: push
paths:
- node_modules
script:
- npm ci

type-check:
stage: type-check
cache:
key: $CI_COMMIT_REF_NAME
policy: pull
paths:
- node_modules
script:
- npm run type-check

lint:
stage: lint
cache:
key: $CI_COMMIT_REF_NAME
policy: pull
paths:
- node_modules
script:
- npm run lint

changeset:
stage: changeset
cache:
key: $CI_COMMIT_REF_NAME
policy: pull
paths:
- node_modules
before_script:
- git fetch origin dev
script:
- npx changeset status --since=origin/dev
15 changes: 15 additions & 0 deletions .gitlab/issue_templates/default.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
**Issue Description:**

<TBD / N/A>

**Solution:**

<TBD / N/A>

**Acceptance Conditions:**

<TBD / N/A>

**Requierd Unit Tests:**

<TBD / N/A>
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx lint-staged
5 changes: 5 additions & 0 deletions .lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export default {
'*.ts': () => 'tsc --noEmit',
'*.{js,ts}': 'eslint --fix',
'*': 'prettier --ignore-unknown --write',
};
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20.11.0
3 changes: 3 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"singleQuote": true
}
24 changes: 24 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM node:20.11.0

LABEL maintainer="ergo-raafle team"
LABEL description="Docker image for the web3-storage-uploader owned by ergo-raffle organization."
LABEL org.label-schema.vcs-url="https://github.com/ErgoRaffle/web3-storage-uploader"

RUN adduser --disabled-password --home /app --uid 8080 --gecos "ErgoPlatform" ergo && \
install -m 0740 -o ergo -g ergo -d /app/peer-dialer /app/logs && chown -R ergo:ergo /app/ && umask 0077
USER ergo

WORKDIR /app
COPY --chmod=700 --chown=ergo:ergo package-lock.json ./
COPY --chmod=700 --chown=ergo:ergo ./package.json ./
ADD --chmod=700 --chown=ergo:ergo ./patches/ ./patches/
RUN npx patch-package
RUN npm ci
COPY --chmod=700 --chown=ergo:ergo . .
RUN npm run build

ENV NODE_ENV=production

EXPOSE 8080

ENTRYPOINT ["npm", "run", "start:prod"]
Loading

0 comments on commit c9b0681

Please sign in to comment.