-
-
Notifications
You must be signed in to change notification settings - Fork 2
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 37c56b8
Showing
23 changed files
with
3,685 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,7 @@ | ||
node_modules | ||
*.log* | ||
.nitro | ||
.cache | ||
.output | ||
.env | ||
dist |
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 @@ | ||
root = true | ||
|
||
[*] | ||
end_of_line = lf | ||
insert_final_newline = true | ||
indent_size = 2 | ||
indent_style = space |
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,58 @@ | ||
# name: Docker Publish | ||
|
||
# on: | ||
# push: | ||
# branches: | ||
# - main | ||
|
||
# env: | ||
# REGISTRY: ghcr.io | ||
# IMAGE_NAME: ${{ github.repository }} | ||
|
||
# jobs: | ||
# build: | ||
# runs-on: ubuntu-latest | ||
# permissions: | ||
# contents: read | ||
# packages: write | ||
# id-token: write | ||
|
||
# steps: | ||
# - name: Checkout repository | ||
# uses: actions/checkout@v4 | ||
|
||
# - name: Setup Docker buildx | ||
# uses: docker/setup-buildx-action@v3 | ||
|
||
# - name: Get version | ||
# id: package-version | ||
# uses: martinbeentjes/npm-get-version-action@main | ||
|
||
# - name: Log into registry ${{ env.REGISTRY }} | ||
# uses: docker/login-action@v3 | ||
# with: | ||
# registry: ${{ env.REGISTRY }} | ||
# username: ${{ github.actor }} | ||
# password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
# - name: Extract Docker metadata | ||
# id: meta | ||
# uses: docker/metadata-action@v5 | ||
# with: | ||
# images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
# flavor: | | ||
# latest=auto | ||
# tags: | | ||
# type=semver,pattern={{version}},value=v${{ steps.package-version.outputs.current-version }} | ||
|
||
# - name: Build and push Docker image | ||
# id: build-and-push | ||
# uses: docker/build-push-action@v5 | ||
# with: | ||
# push: true | ||
# platforms: linux/amd64,linux/arm64 | ||
# context: . | ||
# labels: ${{ steps.meta.outputs.labels }} | ||
# tags: ${{ steps.meta.outputs.tags }} | ||
# cache-from: type=gha | ||
# cache-to: type=gha,mode=max |
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,68 @@ | ||
# name: Release | ||
|
||
# on: | ||
# push: | ||
# branches: | ||
# - main | ||
|
||
# jobs: | ||
# release: | ||
# name: Release | ||
# runs-on: ubuntu-latest | ||
|
||
# steps: | ||
# - name: Checkout code | ||
# uses: actions/checkout@v4 | ||
|
||
# - uses: pnpm/action-setup@v2 | ||
# with: | ||
# version: latest | ||
|
||
# - name: Get version | ||
# id: package-version | ||
# uses: martinbeentjes/npm-get-version-action@main | ||
|
||
# - name: Install packages | ||
# run: pnpm install --frozen-lockfile | ||
|
||
# - name: Build for cloudflare | ||
# run: pnpm build:cloudflare && cp ./.output/server/index.mjs ./cloudflare.worker.mjs | ||
|
||
# - name: Build for Node | ||
# run: pnpm build:node && cd .output/server && zip -r ../../nodejs.zip . | ||
|
||
# - name: Create Release | ||
# id: create_release | ||
# uses: actions/create-release@v1 | ||
# env: | ||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# with: | ||
# tag_name: v${{ steps.package-version.outputs.current-version }} | ||
# release_name: cors-proxy v${{ steps.package-version.outputs.current-version }} | ||
# draft: false | ||
# prerelease: false | ||
# body: | | ||
# Instead of downloading a package, you can also run it in docker: | ||
# ```sh | ||
# docker run ghcr.io/spiceitfy/cors-proxy:${{ steps.package-version.outputs.current-version }} | ||
# ``` | ||
|
||
# - name: Upload cloudflare build | ||
# uses: actions/upload-release-asset@v1 | ||
# env: | ||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# with: | ||
# upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
# asset_path: ./cloudflare.worker.mjs | ||
# asset_name: cors-proxy-cloudflare.mjs | ||
# asset_content_type: text/javascript | ||
|
||
# - name: Upload Node build | ||
# uses: actions/upload-release-asset@v1 | ||
# env: | ||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# with: | ||
# upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
# asset_path: ./nodejs.zip | ||
# asset_name: cors-proxy-nodejs.zip | ||
# asset_content_type: application/zip |
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,46 @@ | ||
name: Linting and Testing | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
building: | ||
name: Build project | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- uses: pnpm/action-setup@v2 | ||
with: | ||
version: latest | ||
|
||
- name: Install Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
cache: 'pnpm' | ||
|
||
- name: Install pnpm packages | ||
run: pnpm install --frozen-lockfile | ||
|
||
- name: Build Project | ||
run: pnpm build | ||
|
||
docker: | ||
name: Build docker | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Build | ||
uses: docker/build-push-action@v5 |
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,8 @@ | ||
node_modules | ||
*.log* | ||
.nitro | ||
.cache | ||
.output | ||
.env | ||
dist | ||
.netlify |
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,4 @@ | ||
module.exports = { | ||
trailingComma: 'all', | ||
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,3 @@ | ||
{ | ||
"editor.formatOnSave": 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,20 @@ | ||
FROM node:20-alpine as base | ||
WORKDIR /app | ||
|
||
# Build layer | ||
FROM base as build | ||
|
||
RUN npm i -g pnpm | ||
COPY pnpm-lock.yaml package.json ./ | ||
RUN pnpm install --frozen-lockfile | ||
COPY . . | ||
RUN pnpm build | ||
|
||
# Production layer | ||
FROM base as production | ||
|
||
EXPOSE 3000 | ||
ENV NODE_ENV=production | ||
COPY --from=build /app/.output ./.output | ||
|
||
CMD ["node", ".output/server/index.mjs"] |
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,22 @@ | ||
MIT License | ||
|
||
Copyright (c) 2023 movie-web | ||
Copyright (c) 2024 Spicetify contributors | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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,14 @@ | ||
# cors-proxy | ||
|
||
Simple reverse proxy to bypass CORS, used by [spicetify](https://spicetify.app). | ||
|
||
--- | ||
|
||
### features: | ||
- Deployable on many platforms - thanks to nitro | ||
- header rewrites - read and write protected headers | ||
- bypass CORS - always allows browser to send requests through it | ||
|
||
### supported platforms: | ||
- cloudflare workers | ||
- nodejs |
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,34 @@ | ||
{ | ||
"$schema": "https://biomejs.dev/schemas/1.7.2/schema.json", | ||
"organizeImports": { | ||
"enabled": true | ||
}, | ||
"linter": { | ||
"enabled": true, | ||
"rules": { | ||
"recommended": true, | ||
"suspicious": { | ||
"noExplicitAny": "off" | ||
} | ||
} | ||
}, | ||
"formatter": { | ||
"enabled": true, | ||
"formatWithErrors": true, | ||
"indentStyle": "tab", | ||
"indentWidth": 2, | ||
"lineWidth": 150 | ||
}, | ||
"javascript": { | ||
"formatter": { | ||
"trailingComma": "none", | ||
"arrowParentheses": "asNeeded" | ||
} | ||
}, | ||
"vcs": { | ||
"enabled": true, | ||
"clientKind": "git", | ||
"useIgnoreFile": true, | ||
"defaultBranch": "master" | ||
} | ||
} |
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,14 @@ | ||
import { join } from "node:path"; | ||
import pkg from "./package.json"; | ||
|
||
//https://nitro.unjs.io/config | ||
export default defineNitroConfig({ | ||
noPublicDir: true, | ||
srcDir: "./src", | ||
runtimeConfig: { | ||
version: pkg.version | ||
}, | ||
alias: { | ||
"@": join(__dirname, "src") | ||
} | ||
}); |
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,27 @@ | ||
{ | ||
"name": "simple-proxy", | ||
"private": true, | ||
"version": "2.1.4", | ||
"scripts": { | ||
"prepare": "nitropack prepare", | ||
"dev": "nitropack dev", | ||
"build": "nitropack build", | ||
"build:cloudflare": "NITRO_PRESET=cloudflare npm run build", | ||
"build:node": "NITRO_PRESET=node-server npm run build", | ||
"start": "node .output/server/index.mjs", | ||
"preinstall": "npx only-allow pnpm" | ||
}, | ||
"dependencies": { | ||
"fetch-cookie": "^3.0.1", | ||
"h3": "^1.10.0", | ||
"nitropack": "^2.8.1" | ||
}, | ||
"devDependencies": { | ||
"@rollup/wasm-node": "^4.9.4" | ||
}, | ||
"pnpm": { | ||
"overrides": { | ||
"rollup": "npm:@rollup/wasm-node" | ||
} | ||
} | ||
} |
Oops, something went wrong.