Add files

This commit is contained in:
Braydon 2023-05-04 04:00:45 -04:00
parent db1e2ded52
commit 5decc41252
5 changed files with 102 additions and 0 deletions

View File

@ -0,0 +1,35 @@
name: Publish Image
on:
push:
branches: ["master"]
jobs:
docker:
strategy:
matrix:
arch: ["ubuntu-latest"]
git-version: ["2.38.4"]
runs-on: ${{ matrix.arch }}
container: git.rainnny.club/rainnny/gitea-runner:node-18
steps:
- name: Checkout
uses: https://github.com/actions/checkout@v3
- name: Set up Docker Buildx
uses: https://github.com/docker/setup-buildx-action@v2
- name: Login to Repo
uses: https://github.com/docker/login-action@v2
with:
registry: git.rainnny.club
username: ${{ secrets.REPO_USERNAME }}
password: ${{ secrets.REPO_TOKEN }}
- name: Build and Push
uses: docker/build-push-action@v4
with:
push: true
context: .
tags: git.rainnny.club/rainnny/cors-anywhere:latest

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
node_modules

51
package-lock.json generated Normal file
View File

@ -0,0 +1,51 @@
{
"name": "cors-anywhere",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"dependencies": {
"cors-anywhere": "^0.4.4"
}
},
"node_modules/cors-anywhere": {
"version": "0.4.4",
"resolved": "https://registry.npmjs.org/cors-anywhere/-/cors-anywhere-0.4.4.tgz",
"integrity": "sha512-8OBFwnzMgR4mNrAeAyOLB2EruS2z7u02of2bOu7i9kKYlZG+niS7CTHLPgEXKWW2NAOJWRry9RRCaL9lJRjNqg==",
"dependencies": {
"http-proxy": "1.11.1",
"proxy-from-env": "0.0.1"
},
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/eventemitter3": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-1.2.0.tgz",
"integrity": "sha512-DOFqA1MF46fmZl2xtzXR3MPCRsXqgoFqdXcrCVYM3JNnfUeHTm/fh/v/iU7gBFpwkuBmoJPAm5GuhdDfSEJMJA=="
},
"node_modules/http-proxy": {
"version": "1.11.1",
"resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.11.1.tgz",
"integrity": "sha512-qz7jZarkVG3G6GMq+4VRJPSN4NkIjL4VMTNhKGd8jc25BumeJjWWvnY3A7OkCGa8W1TTxbaK3dcE0ijFalITVA==",
"dependencies": {
"eventemitter3": "1.x.x",
"requires-port": "0.x.x"
},
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/proxy-from-env": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-0.0.1.tgz",
"integrity": "sha512-B9Hnta3CATuMS0q6kt5hEezOPM+V3dgaRewkFtFoaRQYTVNsHqUvFXmndH06z3QO1ZdDnRELv5vfY6zAj/gG7A=="
},
"node_modules/requires-port": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/requires-port/-/requires-port-0.0.1.tgz",
"integrity": "sha512-AzPDCliPoWDSvEVYRQmpzuPhGGEnPrQz9YiOEvn+UdB9ixBpw+4IOZWtwctmpzySLZTy7ynpn47V14H4yaowtA=="
}
}
}

5
package.json Normal file
View File

@ -0,0 +1,5 @@
{
"dependencies": {
"cors-anywhere": "^0.4.4"
}
}

10
server.js Normal file
View File

@ -0,0 +1,10 @@
const host = process.env.HOST || "0.0.0.0"; // The host to bind to
const port = process.env.PORT || 8080; // The port to bind to
require("cors-anywhere")
.createServer({
originWhitelist: [], // Allow all origins
requireHeader: ["origin", "x-requested-with"],
})
.listen(port, host, function () {
console.log(`CORS Proxy started on ${host}:${port}`);
});