fix typos

This commit is contained in:
tdurieux
2021-04-06 17:45:36 +02:00
parent b653f37920
commit cf17e1c456
18 changed files with 66 additions and 68 deletions

View File

@@ -26,7 +26,7 @@ Using Anonymous Github
## How to create a new anonymized repository
To use it, open the main page (e.g., [http://anonymous.4open.science/](http://anonymous.4open.science/)), login with GitHub, and click on "Anonymize".
Simply fill 1. the Github repo URL and 2. the id of the anonymized repository, 3. the terms to anonymize (which can be updated afterwards).
Simply fill 1. the Github repo URL and 2. the id of the anonymized repository, 3. the terms to anonymize (which can be updated afterward).
The anonymization of the content is done by replacing all occurrences of words in a list by "XXX".
The word list is provided by the authors, and typically contains the institution name, author names, logins, etc...
The README is anonymized as well as all files of the repository. Even filenames are anonymized.
@@ -40,11 +40,11 @@ To start using Anonymous Github right now, a public instance of anonymous_github
## What is the scope of anonymization?
In double-blind peer-review, the boundary of anonymization is the paper plus its online appendix, and only this, it's not the whole world. Googling any part of the paper or the online appendix can be considered as deliberate attempt to break anonymity ([explanation](http://www.monperrus.net/martin/open-science-double-blind))
In double-blind peer-review, the boundary of anonymization is the paper plus its online appendix, and only this, it's not the whole world. Googling any part of the paper or the online appendix can be considered as a deliberate attempt to break anonymity ([explanation](http://www.monperrus.net/martin/open-science-double-blind))
How it works?
--------------
How does it work?
-----------------
Anonymous Github either download the complete repository and anonymize the content of the file or proxy the request to GitHub. In both case, the original and anonymized versions of the file are cached on the server.
@@ -57,7 +57,7 @@ cd anonymous_github
npm i
```
2. Configure the Github tocken
2. Configure the Github token
Create a file `.env` that contains
@@ -71,7 +71,7 @@ DB_PASSWORD=
AUTH_CALLBACK=http://localhost:5000/github/auth,
```
`GITHUB_TOKEN` can be generate here: https://github.com/settings/tokens/new with `repo` scope.
`GITHUB_TOKEN` can be generated here: https://github.com/settings/tokens/new with `repo` scope.
`CLIENT_ID` and `CLIENT_SECRET` are the tokens are generated when you create a new GitHub app https://github.com/settings/applications/new.
The callback of the GitHub app needs to be defined as `https://<host>/github/auth` (the same as defined in AUTH_CALLBACK).
@@ -82,7 +82,7 @@ docker-compose up -d
4. Go to Anonymous Github
By default, Anonymous Github uses the port 5000. It can be changed in `docker-compose.yml`.
By default, Anonymous Github uses port 5000. It can be changed in `docker-compose.yml`.
Related tools

View File

@@ -44,7 +44,7 @@ app.use("/github", rateLimit, connection.router);
// app routes
app.use("/api/user", rateLimit, require("./routes/user"));
app.use("/api/repo", rateLimit, require("./routes/file"));
app.use("/api/repo", rateLimit, require("./routes/repositoy"));
app.use("/api/repo", rateLimit, require("./routes/repository"));
// wesite view
app.use("/w/", rateLimit, require("./routes/webview"));

View File

@@ -1,7 +1,7 @@
{
"ERRORS": {
"repo_not_found": "The repository is not found.",
"repo_not_accessible": "Anonymous GitHub does not have the persmission to access the repository.",
"repo_not_accessible": "Anonymous GitHub does not have the permission to access the repository.",
"repository_expired": "The repository is expired",
"repository_not_ready": "Anonymous GitHub is still processing the repository, it can take several minutes.",
"repo_is_updating": "Anonymous GitHub is still processing the repository, it can take several minutes.",
@@ -9,9 +9,9 @@
"repoId_already_used": "The repository id is already used.",
"invalid_repoId": "The format of the repository id is invalid.",
"branch_not_specified": "The branch is not specified.",
"options_not_provided": "Anonimization options are mendatory.",
"options_not_provided": "Anonymization options are mandatory.",
"invalid_terms_format": "Terms are in an invalid format.",
"unable_to_anonymize": "An error happened during the anonimization proccess. Please try later or report the issue.",
"unable_to_anonymize": "An error happened during the anonymization process. Please try later or report the issue.",
"non_supported_mode": "The selected anonymization mode is invalid, only download and stream are supported.",
"invalid_path": "The provided path is invalid or missing.",
"file_not_found": "The requested file is not found.",
@@ -24,8 +24,8 @@
"branches_not_found": "The requested branch is not found.",
"readme_not_available": "No readme for the repository is found.",
"user_not_found": "The current user is not found in the database",
"not_connected": "User is not connectd",
"page_not_supported_on_different_branch": "Anonimized GitHub pages are only supported on the same branch.",
"page_not_activated": "Anonimized GitHub page is not enabled."
"not_connected": "User is not connected",
"page_not_supported_on_different_branch": "Anonymized GitHub pages are only supported on the same branch.",
"page_not_activated": "Anonymized GitHub page is not enabled."
}
}

View File

@@ -16,9 +16,9 @@
name="anonymize"
novalidate
>
<h5 class="card-title">Annoymize a reposiotry</h5>
<h5 class="card-title">Anonymize a repository</h5>
<h6 class="card-subtitle mb-2 text-muted">
Fill the information to annoymize! It will only take 5min.
Fill the information to anonymize! It will only take 5min.
</h6>
<!-- repoUrl -->
<div class="form-group">
@@ -50,7 +50,7 @@
class="invalid-feedback"
ng-show="anonymize.repoUrl.$error.used"
>
{{repoUrl}} is already anonymized
{{repoUrl}} is already d
</div>
</div>
<!-- select repo -->
@@ -316,7 +316,7 @@
>Github page</label
>
<small id="termsHelp" class="form-text text-muted"
>Enable anonymized Github pages. It currently only suported for Github pages that are defined in the same branch. It will be available
>Enable anonymized Github pages. It currently only supported for Github pages that are defined in the same branch. It will be available
at https://anonymous.4open.science/w/{{repoId}}</small
>
</div>
@@ -333,7 +333,7 @@
>
<small id="termsHelp" class="form-text text-muted"
>Display the number of line of code in the
reposiotry</small
repository</small
>
</div>
</div>
@@ -490,7 +490,7 @@
ng-show="repoUrl"
ng-if="!isUpdate"
>
Annoymize
Anonymize
</button>
<button
id="submit"

View File

@@ -7,9 +7,9 @@
name="claimForm"
novalidate
>
<h5 class="card-title">Claim an annoymized reposiotry</h5>
<h5 class="card-title">Claim an anonymized repository</h5>
<h6 class="card-subtitle mb-2 text-muted">
Claim the ownership of an exisiting annoymized reposiotry.
Claim the ownership of an existing anonymized repository.
</h6>
<div class="form-row">
<div class="col form-group">

View File

@@ -71,8 +71,7 @@
Claim repository
</a>
<a class="btn btn-primary" href="/anonymize">
<i class="fa fa-plus-circle" aria-hidden="true"></i> Annoymize
repository
<i class="fa fa-plus-circle" aria-hidden="true"></i> Anonymize
</a>
</div>
</div>
@@ -157,7 +156,8 @@
ng-show="repo.status == 'removed'"
ng-click="updateRepository(repo)"
>
<i class="fa fa-check-circle" aria-hidden="true"></i> Enable
<i class="fa fa-check-circle" aria-hidden="true"></i>
Enable
</a>
<a
class="dropdown-item"

View File

@@ -155,8 +155,8 @@
>
<div class="panel-body px-3 mb-4">
<p>
Anonymous Github is free to use, however the server costs me hundreds of dollars per year, a small donation to cover to cost is largely appricated.
You can support me financiarly by <a href="https://github.com/sponsors/tdurieux/" target="__self">Sponsoring my GitHub account</a>, send me money thought <a href="https://ko-fi.com/tdurieux" target="__self">Ko-fi</a> or by clicking on the "Support me" button.
Anonymous Github is free to use, however the server costs me hundreds of dollars per year, a small donation to cover to cost is largely appreciated.
You can support me financially by <a href="https://github.com/sponsors/tdurieux/" target="__self">Sponsoring my GitHub account</a>, send me money thought <a href="https://ko-fi.com/tdurieux" target="__self">Ko-fi</a> or by clicking on the "Support me" button.
</p>
</div>
</div>
@@ -188,7 +188,7 @@
<div class="panel-body px-3 mb-4">
<p>
The data stored on Anonymous Github are never used or shared in any cases.
When a repository is removed or expired only the configuration of the repository is conserved to be able to restore easily the reposiotry and to ensure that no future repository will use the same repository id.
When a repository is removed or expired only the configuration of the repository is conserved to be able to restore easily the repository and to ensure that no future repository will use the same repository id.
</p>
</div>
</div>
@@ -219,8 +219,8 @@
>
<div class="panel-body px-3 mb-4">
<p>
The viewers of the reposiotry are not tracked, only the number of view of the repository is collected (a signle incremental digit).
It is not possible for the reposiotry owner neither for Anonymous GitHub to track down the identity of the viewer.
The viewers of the repository are not tracked, only the number of view of the repository is collected (a single incremental digit).
It is not possible for the repository owner neither for Anonymous GitHub to track down the identity of the viewer.
</p>
</div>
</div>
@@ -251,7 +251,7 @@
>
<div class="panel-body px-3 mb-4">
<p>
Anonymous GitHub is fully open source and the deployment of a new instance is relatively easy. More information can be found on the GitHub reposiotry of the project.
Anonymous GitHub is fully open source and the deployment of a new instance is relatively easy. More information can be found on the GitHub repository of the project.
</p>
</div>
</div>

View File

@@ -33,7 +33,7 @@
class="nav-link"
ng-class="{'active':path == '/anonymize'}"
href="/anonymize"
>Annoymize</a
>Anonymize</a
>
</li>
<li class="nav-item">
@@ -85,7 +85,7 @@
<!-- <span ng-bind="user.username"></span> -->
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
<a class="dropdown-item" href="/profile">My Profile</a>
<a class="dropdown-item" href="/profile">Default settings</a>
<a class="dropdown-item" href="/dashboard">Projects</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="/api/user/logout" target="__self"

View File

@@ -45,7 +45,7 @@
<li>Complete the list of terms that will be anonymized.</li>
<li>Anonymize and share your link in your double-blind paper.</li>
</ol>
Example of an annoymized repository:
Example of an anonymized repository:
<a
href="https://anonymous.4open.science/r/840c8c57-3c32-451e-bf12-0e20be300389/"
>https://anonymous.4open.science/r/840c8c57-3c32-451e-bf12-0e20be300389/</a

View File

@@ -1,6 +1,4 @@
<div class="container py-4">
<h1 ng-bind="user.username"></h1>
<h2>Default anonymization options</h2>
<form class="form needs-validation" name="default" novalidate>
<!-- Terms -->
@@ -136,7 +134,7 @@
/>
<label class="form-check-label" for="page">Github page</label>
<small id="termsHelp" class="form-text text-muted"
>Enable anonymized Github pages. It currently only suported
>Enable anonymized Github pages. It currently only supported
for Github pages that are defined in the same branch.</small
>
</div>
@@ -150,7 +148,7 @@
/>
<label class="form-check-label" for="page">Line of code</label>
<small id="termsHelp" class="form-text text-muted"
>Display the number of line of code in the reposiotry</small
>Display the number of line of code in the repository</small
>
</div>
<div class="form-group">

View File

@@ -35,7 +35,7 @@
<h2>Contribute</h2>
<p>
Collabore to the Anonymous GitHub by implementing new features and
Collaborate to the Anonymous GitHub by implementing new features and
fixing bugs. Contribution likes supporting new file format or
improving the deployment are more than welcome.
</p>
@@ -73,9 +73,9 @@
<h2>Finance</h2>
<p>
You can also help the project by supporting financiarly the project.
You can also help the project by supporting financially the project.
The server costs around 25$ per month. Any help to support the cost
would be gradly appriciated.
would be gladly appreciated.
</p>
<p>
<a

View File

@@ -292,7 +292,7 @@ angular
$scope.progress = 25;
} else if ($scope.repo.status == "preparing") {
$scope.progress = 10;
} else if ($scope.repo.status == "anonimizing") {
} else if ($scope.repo.status == "anonymizing") {
$scope.progress = 75;
}
if ($scope.repo.status != "ready") {

View File

@@ -40,7 +40,7 @@ async function anonymizeRepository(options) {
console.error("Error while updating the repository.");
console.error(error);
}
await repoUtils.updateAnonimizedRepository(repoConfig);
await repoUtils.updateAnonymizedRepository(repoConfig);
}
await githubUtils.downloadRepoAndAnonymize(repoConfig);
}

View File

@@ -135,7 +135,7 @@ router.post("/:repoId/refresh", async (req, res) => {
return res.status(401).json({ error: "not_authorized" });
}
try {
await repoUtils.updateAnonimizedRepository(repoConfig);
await repoUtils.updateAnonymizedRepository(repoConfig);
return res.send("ok");
} catch (error) {
return res.status(500).json({ error });

View File

@@ -3,7 +3,7 @@ const ofs = require("fs");
const path = require("path");
const fileUtils = require("./file");
const ananymiseContent = (content, repoConfig) => {
const anonymizeContent = (content, repoConfig) => {
const urlRegex = /<?\b((https?|ftp|file):\/\/)[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]\b\/?>?/g;
if (repoConfig.options.image === false) {
@@ -54,7 +54,7 @@ const ananymiseContent = (content, repoConfig) => {
return content;
};
const ananymisePath = (path, repoConfig) => {
const anonymizePath = (path, repoConfig) => {
for (let term of repoConfig.terms) {
if (term.trim() == "") {
continue;
@@ -80,13 +80,13 @@ const anonymizeFolder = async (root, destination, repoConfig) => {
for await (const originalFilePath of walk(root)) {
const destinationFilePath = path.join(
destination,
ananymisePath(originalFilePath.replace(root, ""), repoConfig)
anonymizePath(originalFilePath.replace(root, ""), repoConfig)
);
const destinationFolder = path.dirname(destinationFilePath);
if (!ofs.existsSync(destinationFolder)) {
await fs.mkdir(destinationFolder, { recursive: true });
}
await ananymiseFile(originalFilePath, destinationFilePath, repoConfig);
await anonymizeFile(originalFilePath, destinationFilePath, repoConfig);
}
} catch (error) {
fs.rm(destination, { recursive: true, force: true });
@@ -94,12 +94,12 @@ const anonymizeFolder = async (root, destination, repoConfig) => {
}
};
const ananymiseFile = async (filePath, target, repoConfig) => {
const anonymizeFile = async (filePath, target, repoConfig) => {
if (!ofs.existsSync(path.dirname(target))) {
await fs.mkdir(path.dirname(target), { recursive: true });
}
if (fileUtils.isText(filePath)) {
const content = ananymiseContent(
const content = anonymizeContent(
(await fs.readFile(filePath)).toString(),
repoConfig
);
@@ -109,7 +109,7 @@ const ananymiseFile = async (filePath, target, repoConfig) => {
}
};
module.exports.ananymiseFile = ananymiseFile;
module.exports.ananymisePath = ananymisePath;
module.exports.anonymizeFile = anonymizeFile;
module.exports.anonymizePath = anonymizePath;
module.exports.anonymizeFolder = anonymizeFolder;
module.exports.ananymiseContent = ananymiseContent;
module.exports.anonymizeContent = anonymizeContent;

View File

@@ -201,7 +201,7 @@ function anonymizeTree(tree, repoConfig) {
}
const output = {};
for (let file in tree.child) {
const anonymizedPath = anonymizeUtils.ananymisePath(file, repoConfig);
const anonymizedPath = anonymizeUtils.anonymizePath(file, repoConfig);
output[anonymizedPath] = anonymizeTree(tree.child[file], repoConfig);
}
return output;
@@ -320,8 +320,8 @@ module.exports.isFilePathValid = async (options) => {
throw "file_not_supported";
}
let unanonymizePath = options.path;
if (unanonymizePath.indexOf("XXX") > -1) {
let anonymizePath = options.path;
if (anonymizePath.indexOf("XXX") > -1) {
const files = await module.exports.getFileList({ repoConfig });
const file = getFile(files, options.path);
@@ -335,23 +335,23 @@ module.exports.isFilePathValid = async (options) => {
const shatree = tree2sha(r.originalFiles);
if (shatree[file.sha]) {
unanonymizePath = shatree[file.sha];
anonymizePath = shatree[file.sha];
}
}
}
const orignalFilePath = path.join(
const originalFilePath = path.join(
repoUtils.getOriginalPath(repoConfig.repoId),
unanonymizePath
anonymizePath
);
if (ofs.existsSync(anonymizedFilePath)) {
return true;
}
if (ofs.existsSync(orignalFilePath)) {
if (ofs.existsSync(originalFilePath)) {
if (!module.exports.isFileSupported(repoConfig, anonymizedFilePath)) {
throw "file_not_supported";
}
await anonymizeUtils.ananymiseFile(
orignalFilePath,
await anonymizeUtils.anonymizeFile(
originalFilePath,
anonymizedFilePath,
repoConfig
);
@@ -432,14 +432,14 @@ module.exports.isFilePathValid = async (options) => {
}
try {
await fs.mkdir(path.dirname(orignalFilePath), { recursive: true });
await fs.mkdir(path.dirname(originalFilePath), { recursive: true });
} catch (_) {
// ignore
}
try {
await fs.writeFile(orignalFilePath, content, { encoding: "utf-8" });
await anonymizeUtils.ananymiseFile(
orignalFilePath,
await fs.writeFile(originalFilePath, content, { encoding: "utf-8" });
await anonymizeUtils.anonymiseFile(
originalFilePath,
anonymizedFilePath,
repoConfig
);

View File

@@ -32,7 +32,7 @@ module.exports.downloadRepoAndAnonymize = async (repoConfig) => {
return true;
}
if (repoConfig.options.mode == "download") {
// if cache folder does not exist download and anonumize it
// if cache folder does not exist download and anonymize it
const originalPath = repoUtils.getOriginalPath(repoConfig.repoId);

View File

@@ -308,7 +308,7 @@ module.exports.getRepoReadme = async (options) => {
}
};
module.exports.updateAnonimizedRepository = async (repoConfig) => {
module.exports.updateAnonymizedRepository = async (repoConfig) => {
if (repoConfig.status == "updating") {
throw "repo_is_updating";
}