better support for non netlify deployments

This commit is contained in:
dexter21767
2024-12-19 14:40:03 +01:00
parent bb082697cb
commit e4885510d6
8 changed files with 40 additions and 9 deletions
+5
View File
@@ -0,0 +1,5 @@
TOKEN="github Token"
DISCORD_WEBHOOK="discord webhook"
REPO="stremio-addons-list"
REPO_AUTHOR="danamag"
DOMAIN="stremio-addons.com"
+1 -1
View File
@@ -2,7 +2,7 @@
> [!NOTE] > [!NOTE]
> Due to recent abuse of this repository (malicious addons, spam) by a user called [vancengvn](https://github.com/Vance-ng-vn) we were forced to implement a moderation system. New addon submissions now need explicit approval from a contributor to be published - unless you are on the [trusted publishers](./trusted_publishers.json) list. Please contact a moderator on Discord or Reddit if your addon hasn't been approved after 7 days. > Due to recent abuse of this repository (malicious addons, spam) by a user called [vancengvn](https://github.com/Vance-ng-vn) we were forced to implement a moderation system. New addon submissions now need explicit approval from a contributor to be published - unless you are on the [trusted publishers](./trusted_publishers.json) list. Please contact a moderator on Discord or Reddit if your addon hasn't been approved after 7 days.
To see the great list of Stremio Addons go to [the website](https://stremio-addons.netlify.app/). To see the great list of Stremio Addons go to [the website](https://stremio-addons.com/).
To submit a new addon to the list, use [this link](https://github.com/danamag/stremio-addons-list/issues/new?assignees=&labels=pending+approval&template=submit-addon.yaml&title=Addon+Name). To submit a new addon to the list, use [this link](https://github.com/danamag/stremio-addons-list/issues/new?assignees=&labels=pending+approval&template=submit-addon.yaml&title=Addon+Name).
+1 -1
View File
@@ -208,7 +208,7 @@ getCached().then(cached => {
}, 1) }, 1)
queue.drain = () => { queue.drain = () => {
if (process.env.DISCORD_WEBHOOK && newAddons.length) if (config.DISCORD_WEBHOOK && newAddons.length)
sendDiscordMessage(newAddons) sendDiscordMessage(newAddons)
console.log('copying resources (styles, js, images)') console.log('copying resources (styles, js, images)')
fs.readdirSync('./resources').forEach(file => { fs.readdirSync('./resources').forEach(file => {
+8 -3
View File
@@ -1,8 +1,13 @@
require('dotenv').config()
module.exports = { module.exports = {
// env vars
"DISCORD_WEBHOOK": process.env.DISCORD_WEBHOOK,
"GITHUB_TOKEN": process.env.TOKEN,
// for repo: danamag/stremio-addons-list // for repo: danamag/stremio-addons-list
"repository": "stremio-addons-list", "repository": process.env.REPO || "stremio-addons-list",
"author": "danamag", "author": process.env.REPO_AUTHOR || "danamag",
"netlify-domain": "stremio-addons.netlify.app", "netlify-domain": process.env.DOMAIN || "stremio-addons.com",
"page-title": "Stremio Community Addons List", "page-title": "Stremio Community Addons List",
// images are located in ./resources/ // images are located in ./resources/
"meta-favicon": "stremio_community_logo.png", "meta-favicon": "stremio_community_logo.png",
+1 -1
View File
@@ -41,7 +41,7 @@ const sendDiscordMessage = (addons) => {
const needleOpts = Object.assign({}, config.needle) const needleOpts = Object.assign({}, config.needle)
needleOpts.json = true needleOpts.json = true
console.log(`sending discord message about ${addons.length} new addons`) console.log(`sending discord message about ${addons.length} new addons`)
needle.post(process.env.DISCORD_WEBHOOK, payload, needleOpts, (err, resp, body) => { needle.post(config.DISCORD_WEBHOOK, payload, needleOpts, (err, resp, body) => {
if (!err) if (!err)
console.log(`sent discord message about ${addons.length} new addons`) console.log(`sent discord message about ${addons.length} new addons`)
else { else {
+1 -1
View File
@@ -4,7 +4,7 @@ const config = require('../config')
const request = graphql.defaults({ const request = graphql.defaults({
headers: { headers: {
authorization: `token ${process.env.TOKEN}`, authorization: `token ${config.GITHUB_TOKEN}`,
}, },
}) })
+21 -1
View File
@@ -9,10 +9,14 @@
"version": "1.0.0", "version": "1.0.0",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@octokit/graphql": "4.5.2", "@octokit/graphql": "^4.5.2",
"async.queue": "0.5.2", "async.queue": "0.5.2",
"dotenv": "^16.4.7",
"needle": "3.1.0", "needle": "3.1.0",
"slug": "8.2.2" "slug": "8.2.2"
},
"engines": {
"node": "16.18.0"
} }
}, },
"node_modules/@octokit/endpoint": { "node_modules/@octokit/endpoint": {
@@ -148,6 +152,17 @@
"resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz", "resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz",
"integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==" "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ=="
}, },
"node_modules/dotenv": {
"version": "16.4.7",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.7.tgz",
"integrity": "sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ==",
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://dotenvx.com"
}
},
"node_modules/iconv-lite": { "node_modules/iconv-lite": {
"version": "0.6.3", "version": "0.6.3",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz",
@@ -399,6 +414,11 @@
"resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz", "resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz",
"integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==" "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ=="
}, },
"dotenv": {
"version": "16.4.7",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.7.tgz",
"integrity": "sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ=="
},
"iconv-lite": { "iconv-lite": {
"version": "0.6.3", "version": "0.6.3",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz",
+2 -1
View File
@@ -8,8 +8,9 @@
}, },
"dependencies": { "dependencies": {
"@octokit/graphql": "^4.5.2", "@octokit/graphql": "^4.5.2",
"needle": "3.1.0",
"async.queue": "0.5.2", "async.queue": "0.5.2",
"dotenv": "^16.4.7",
"needle": "3.1.0",
"slug": "8.2.2" "slug": "8.2.2"
}, },
"engines": { "engines": {