mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-02-13 10:52:53 +00:00
update dependencies & remove google analytics
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
FROM node:15-slim
|
||||
FROM node:18-slim
|
||||
|
||||
ENV PORT 5000
|
||||
EXPOSE $PORT
|
||||
|
||||
@@ -2,9 +2,9 @@ module.exports = {
|
||||
apps: [
|
||||
{
|
||||
name: "AnonymousGitHub",
|
||||
script: "./index.ts",
|
||||
script: "build/index.js",
|
||||
exec_mode: "fork",
|
||||
watch: true,
|
||||
watch: false,
|
||||
ignore_watch: [
|
||||
"node_modules",
|
||||
"repositories",
|
||||
@@ -15,7 +15,6 @@ module.exports = {
|
||||
"build",
|
||||
],
|
||||
interpreter: "node",
|
||||
interpreter_args: "--require ts-node/register",
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
3233
package-lock.json
generated
3233
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
24
package.json
24
package.json
@@ -30,36 +30,36 @@
|
||||
"build"
|
||||
],
|
||||
"dependencies": {
|
||||
"@aws-sdk/client-s3": "^3.321.1",
|
||||
"@aws-sdk/node-http-handler": "^3.321.1",
|
||||
"@octokit/oauth-app": "^4.2.1",
|
||||
"@aws-sdk/client-s3": "^3.354.0",
|
||||
"@aws-sdk/node-http-handler": "^3.350.0",
|
||||
"@octokit/oauth-app": "^4.2.4",
|
||||
"@octokit/plugin-paginate-rest": "^7.1.2",
|
||||
"@octokit/rest": "^19.0.5",
|
||||
"@pm2/io": "^5.0.0",
|
||||
"archiver": "^5.3.1",
|
||||
"aws-sdk": "^2.1368.0",
|
||||
"bullmq": "^2.3.2",
|
||||
"compression": "^1.7.4",
|
||||
"connect-redis": "^7.0.1",
|
||||
"decompress-stream-to-s3": "^2.0.1",
|
||||
"dotenv": "^16.0.3",
|
||||
"express": "^4.18.2",
|
||||
"express-rate-limit": "^6.6.0",
|
||||
"express-rate-limit": "^6.7.0",
|
||||
"express-session": "^1.17.3",
|
||||
"express-slow-down": "^1.5.0",
|
||||
"express-slow-down": "^1.6.0",
|
||||
"got": "^11.8.5",
|
||||
"inquirer": "^8.2.5",
|
||||
"istextorbinary": "^6.0.0",
|
||||
"marked": "^4.1.1",
|
||||
"marked": "^5.1.0",
|
||||
"mime-types": "^2.1.35",
|
||||
"mongoose": "^7.1.0",
|
||||
"node-schedule": "^2.1.0",
|
||||
"mongoose": "^7.3.0",
|
||||
"node-schedule": "^2.1.1",
|
||||
"parse-github-url": "^1.0.2",
|
||||
"passport": "^0.6.0",
|
||||
"passport-github2": "^0.1.12",
|
||||
"rate-limit-redis": "^3.0.1",
|
||||
"redis": "^4.6.6",
|
||||
"rate-limit-redis": "^3.0.2",
|
||||
"redis": "^4.6.7",
|
||||
"textextensions": "^5.16.0",
|
||||
"ts-custom-error": "^3.3.0",
|
||||
"ts-custom-error": "^3.3.1",
|
||||
"unzip-stream": "^0.3.1",
|
||||
"xml-flow": "^1.0.4"
|
||||
},
|
||||
|
||||
@@ -50,7 +50,6 @@
|
||||
<script src="/script/external/angular-translate-loader-static-files.min.js"></script>
|
||||
<script src="/script/external/angular-sanitize.min.js"></script>
|
||||
<script src="/script/external/angular-route.min.js"></script>
|
||||
<script src="/script/external/ana.min.js"></script>
|
||||
|
||||
<script src="/script/external/jquery-3.4.1.min.js"></script>
|
||||
<script src="/script/external/popper.min.js"></script>
|
||||
|
||||
@@ -5,17 +5,9 @@ angular
|
||||
"ui.ace",
|
||||
"ngPDFViewer",
|
||||
"pascalprecht.translate",
|
||||
"angular-google-analytics",
|
||||
"admin",
|
||||
])
|
||||
.config(function (
|
||||
$routeProvider,
|
||||
$locationProvider,
|
||||
$translateProvider,
|
||||
AnalyticsProvider
|
||||
) {
|
||||
AnalyticsProvider.setAccount("UA-5954162-28");
|
||||
|
||||
.config(function ($routeProvider, $locationProvider, $translateProvider) {
|
||||
$translateProvider.useStaticFilesLoader({
|
||||
prefix: "/i18n/locale-",
|
||||
suffix: ".json",
|
||||
@@ -142,7 +134,6 @@ angular
|
||||
});
|
||||
$locationProvider.html5Mode(true);
|
||||
})
|
||||
.run(["Analytics", function (Analytics) {}])
|
||||
.filter("humanFileSize", function () {
|
||||
return function humanFileSize(bytes, si = false, dp = 1) {
|
||||
const thresh = si ? 1000 : 1024;
|
||||
|
||||
9
public/script/external/ana.min.js
vendored
9
public/script/external/ana.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -64,12 +64,15 @@ export default class PullRequest {
|
||||
repo,
|
||||
pull_number,
|
||||
}),
|
||||
octokit.paginate(octokit.rest.issues.listComments, {
|
||||
owner: owner,
|
||||
repo: repo,
|
||||
issue_number: pull_number,
|
||||
per_page: 100,
|
||||
}),
|
||||
octokit.paginate(
|
||||
"GET /repos/{owner}/{repo}/pulls/{pull_number}/comments",
|
||||
{
|
||||
owner: owner,
|
||||
repo: repo,
|
||||
pull_number: pull_number,
|
||||
per_page: 100,
|
||||
}
|
||||
),
|
||||
got(`https://github.com/${owner}/${repo}/pull/${pull_number}.diff`),
|
||||
]);
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ export default class User {
|
||||
// get the list of repo from github
|
||||
const octokit = new Octokit({ auth: this.accessToken });
|
||||
const repositories = (
|
||||
await octokit.paginate(octokit.repos.listForAuthenticatedUser, {
|
||||
await octokit.paginate("GET /user/repos", {
|
||||
visibility: "all",
|
||||
sort: "pushed",
|
||||
per_page: 100,
|
||||
|
||||
@@ -103,7 +103,9 @@ async function webView(req: express.Request, res: express.Response) {
|
||||
}
|
||||
if (f.extension() == "md") {
|
||||
const content = await streamToString(await f.anonymizedContent());
|
||||
res.contentType("html").send(marked.marked(content));
|
||||
res
|
||||
.contentType("html")
|
||||
.send(marked.marked(content, { headerIds: false, mangle: false }));
|
||||
} else {
|
||||
f.send(res);
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ export class GitHubRepository {
|
||||
const octokit = new Octokit({ auth: opt.accessToken });
|
||||
try {
|
||||
const branches = (
|
||||
await octokit.paginate(octokit.repos.listBranches, {
|
||||
await octokit.paginate("GET /repos/{owner}/{repo}/branches", {
|
||||
owner: this.owner,
|
||||
repo: this.repo,
|
||||
per_page: 100,
|
||||
|
||||
Reference in New Issue
Block a user