Compare commits
3 Commits
french-krh
...
feature-ch
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
63bb83d36a | ||
|
|
9011ac93b7 | ||
|
|
3aef0da7a0 |
@@ -8,5 +8,5 @@
|
||||
"verify_removal_text": "Hello {0},\n\nplease verify removal of your email address {1} from our key server ({2}) by clicking on the following link:\n\n{3}\n\nGreetings from the Mailvelope Team",
|
||||
"removal_success": "Email address {0} removed from the key directory",
|
||||
"check_signatures_subject": "Confirm new signatures",
|
||||
"check_signatures_text": {"one":"Hello {0},\n\n{1} new signature has been uploaded to your keys on our keyserver ({3}) ! Please select it if you want to add it by clicking on the following link:\n\n{2}\n\nGreetings from the Mailvelope Team", "other": "Hello {0},\n\n{1} new signatures have been uploaded to your keys on our keyserver ({3}) ! Please select the ones you want to add by clicking on the following link:\n\n{2}\n\nGreetings from the Mailvelope Team"}
|
||||
"check_signatures_text": "Hello {0},\n\n{1} new signature(s) have been uploaded to your keys on our keyserver ({3}) ! Please select the ones you want to add by clicking on the following link:\n\n{2}\n\nGreetings from the Mailvelope Team"
|
||||
}
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
{
|
||||
"key_not_found": "Clef non trouvée",
|
||||
"verify_key_subject": "Vérifiez votre adresse mail",
|
||||
"verify_key_text": "Bonjour {0},\n\nVeuillez vérifier votre adresse mail {1} en cliquant sur le lien suivant :\n\n{2}\n\nAprès vérification de votre adresse mail, Votre clef publique sera disponible dans notre annuaire de clefs.\n\nVous trouverez plus d'infos sur {3}.\n\nBisous sur les tentacules !",
|
||||
"verify_success_header": "Adresse mail {0} vérifiée avec succès",
|
||||
"verify_success_link": "Votre clef publique OpenPGP est maintenant disponible à l'adresse suivante :",
|
||||
"verify_removal_subject": "Demande de suppression de clef",
|
||||
"verify_removal_text": "Bonjour {0},\n\nVeuillez confirmer la suppression de votre adresse mail ({1}) de notre serveur de clef ({2}) en cliquant sur le lien suivant :\n\n{3}\n\nBisous sur les tentacules !",
|
||||
"removal_success": "L'adresse mail {0} a été supprimée du serveur",
|
||||
"check_signatures_subject": "Confirmez de nouvelles signatures",
|
||||
"check_signatures_text": {"one":"Bonjour {0},\n\nUne nouvelle signature a été ajoutée à votre clef sur notre serveur ({3}) ! Veuillez la sélectionner en cliquant sur le lien suivant si vous voulez la conserver :\n\n{2}\n\nBisous sur les tentacules !", "other": "Bonjour {0},\n\n{1} nouvelles signatures ont été ajoutées à votre clef sur notre serveur ({3}) ! Veuillez sélectionner celles que vous voulez conserver en cliquant sur le lien suivant :\n\n{2}\n\nBisous sur les tentacules !"}
|
||||
}
|
||||
@@ -21,6 +21,7 @@
|
||||
"release:archive": "zip -rq release.zip package.json package-lock.json node_modules/ *.js src/ config/ locales/"
|
||||
},
|
||||
"dependencies": {
|
||||
"chroot": "1.0.10",
|
||||
"co-body": "6.0.0",
|
||||
"config": "3.2.2",
|
||||
"koa": "2.7.0",
|
||||
|
||||
@@ -41,8 +41,7 @@ render(app, {
|
||||
locales(app, {
|
||||
defaultLocale: 'en',
|
||||
dirs: [path.join(__dirname, '../../locales')],
|
||||
localeAlias: {'de-DE': 'de', 'de-de': 'de', 'de-AT': 'de', 'de-at': 'de', 'de-CH': 'de', 'de-ch': 'de', 'de-LI': 'de', 'de-li': 'de',
|
||||
'fr-fr': 'fr', 'fr-FR': 'fr'},
|
||||
localeAlias: {'de-DE': 'de', 'de-de': 'de', 'de-AT': 'de', 'de-at': 'de', 'de-CH': 'de', 'de-ch': 'de', 'de-LI': 'de', 'de-li': 'de'},
|
||||
writeCookie: false
|
||||
});
|
||||
|
||||
@@ -52,7 +51,6 @@ let rest;
|
||||
app.use(async (ctx, next) => {
|
||||
ctx.state = ctx.state || {};
|
||||
ctx.state.__ = ctx.__.bind(ctx);
|
||||
ctx.state.__n = ctx.__n.bind(ctx);
|
||||
await next();
|
||||
});
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ function checkNewSigs(ctx, {name, sigsNb, nonce, origin, keyId}) {
|
||||
const link = `${util.url(origin)}/api/v1/key?op=checkSignatures&keyId=${keyId}&nonce=${nonce}`;
|
||||
return {
|
||||
subject: ctx.__('check_signatures_subject'),
|
||||
text: ctx.__n('check_signatures_text', sigsNb, [name, sigsNb, link, origin.host])
|
||||
text: ctx.__('check_signatures_text', [name, sigsNb, link, origin.host])
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
13
src/index.js
13
src/index.js
@@ -20,12 +20,23 @@
|
||||
const log = require('winston');
|
||||
const config = require('config');
|
||||
const init = require('./app');
|
||||
const chroot = require('chroot');
|
||||
|
||||
(async () => {
|
||||
try {
|
||||
const app = await init();
|
||||
app.listen(config.server.port, "localhost");
|
||||
log.info('app', `Listening on http://localhost:${config.server.port}`);
|
||||
log.info('app', `Listening on http://localhost:${config.server.port}`, function(err) {
|
||||
if (err) { throw err; }
|
||||
|
||||
try {
|
||||
chroot('/var/empty', 'test');
|
||||
console.log('changed root to "/var/empty" and user to "test"');
|
||||
} catch(err) {
|
||||
console.error('changing root or user failed', err);
|
||||
process.exit(1);
|
||||
}
|
||||
});
|
||||
} catch (err) {
|
||||
log.error('app', 'Initialization failed!', err);
|
||||
}
|
||||
|
||||
@@ -136,9 +136,7 @@ class HKP {
|
||||
ctx.body = `info:${VERSION}:${COUNT}\npub:${fp}:${algo}:${key.keySize}:${created}::\n`;
|
||||
|
||||
for (const uid of key.userIds) {
|
||||
if(uid.verified) {
|
||||
ctx.body += `uid:${encodeURIComponent(`${uid.name} <${uid.email}>`)}:::\n`;
|
||||
}
|
||||
ctx.body += `uid:${encodeURIComponent(`${uid.name} <${uid.email}>`)}:::\n`;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
6
src/static/js/bootstrap-3.4.1.min.js
vendored
6
src/static/js/bootstrap-3.4.1.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -1,35 +0,0 @@
|
||||
/* eslint-disable */
|
||||
|
||||
;(function($) {
|
||||
'use strict';
|
||||
|
||||
$('#copy-button').tooltip({
|
||||
trigger: 'manual',
|
||||
placement: 'right',
|
||||
});
|
||||
|
||||
function setTooltip(message) {
|
||||
$('#copy-button').attr('data-original-title', message)
|
||||
.tooltip('show');
|
||||
}
|
||||
|
||||
function hideTooltip() {
|
||||
setTimeout(function() {
|
||||
$('#copy-button').tooltip('hide');
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
$('#copy-button').click(function(e) {
|
||||
const copyText = $('#publickey-block').text();
|
||||
const textArea = document.createElement('textarea');
|
||||
textArea.textContent = copyText;
|
||||
document.body.append(textArea);
|
||||
textArea.select();
|
||||
document.execCommand("copy");
|
||||
textArea.remove();
|
||||
|
||||
setTooltip('Key copied to clipboard!');
|
||||
hideTooltip();
|
||||
});
|
||||
|
||||
}(jQuery));
|
||||
@@ -49,54 +49,5 @@
|
||||
$('#' + region + ' .alert-' + outcome + ' span').text(text);
|
||||
$('#' + region + ' .alert-' + outcome).removeClass('hidden');
|
||||
}
|
||||
|
||||
$('#drop_zone').on('drop',
|
||||
function(ev) {
|
||||
// Prevent default behavior (Prevent file from being opened)
|
||||
ev.stopPropagation();
|
||||
ev.preventDefault();
|
||||
$('#addKey .alert').addClass('hidden');
|
||||
if(ev.originalEvent.dataTransfer.files[0].type != "text/plain") {
|
||||
alert('addKey', 'danger', 'You must import an ascii-armored key file!');
|
||||
return;
|
||||
}
|
||||
handleFiles(ev.originalEvent.dataTransfer.files);
|
||||
});
|
||||
$('#drop_zone').on('dragover',
|
||||
function(ev) {
|
||||
// Prevent default behavior (Prevent file from being opened)
|
||||
ev.stopPropagation();
|
||||
ev.preventDefault();
|
||||
ev.originalEvent.dataTransfer.dropEffect = 'copy';
|
||||
});
|
||||
$('#drop_zone').on('dragenter',
|
||||
function(ev) {
|
||||
// Prevent default behavior (Prevent file from being opened)
|
||||
ev.stopPropagation();
|
||||
ev.preventDefault();
|
||||
ev.originalEvent.dataTransfer.dropEffect = 'copy';
|
||||
});
|
||||
|
||||
$('#fileSelect').click(function() {
|
||||
$('#file-selector').click();
|
||||
});
|
||||
|
||||
$('#file-selector').change(function() {
|
||||
$('#addKey .alert').addClass('hidden');
|
||||
handleFiles(this.files);
|
||||
});
|
||||
|
||||
function handleFiles(files) {
|
||||
if(files.length > 1) {
|
||||
alert('addKey', 'danger', 'You must import a single file!');
|
||||
return;
|
||||
}
|
||||
const file = files[0];
|
||||
const reader = new FileReader();
|
||||
reader.onload = function(){
|
||||
$('#addKey textarea').val(reader.result);
|
||||
}
|
||||
reader.readAsText(file);
|
||||
}
|
||||
|
||||
}(jQuery));
|
||||
}(jQuery));
|
||||
@@ -1,13 +1,3 @@
|
||||
<style type="text/css">
|
||||
|
||||
textarea {
|
||||
position: absolute;
|
||||
left: -100%;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<div class="container">
|
||||
|
||||
<div class="header clearfix">
|
||||
@@ -24,14 +14,10 @@
|
||||
<div class="row marketing">
|
||||
<div class="col-lg-12">
|
||||
<h4><%= query.email ? `Email: ${query.email}` : query.fingerprint ? `Fingerprint: ${query.fingerprint}` : `Key ID: ${query.keyId}` %></h4>
|
||||
<button id="copy-button" class="btn btn-primary">Copy key to clipboard</button>
|
||||
<pre id="publickey-block"><%= key.publicKeyArmored %></pre>
|
||||
<pre><%= key.publicKeyArmored %></pre>
|
||||
</div> <!-- /col-lg-12 -->
|
||||
</div>
|
||||
|
||||
<%- include('footer') %>
|
||||
|
||||
</div> <!-- /container -->
|
||||
<script src="/js/jquery.min.js"></script>
|
||||
<script src="/js/bootstrap-3.4.1.min.js"></script>
|
||||
<script src="/js/key-armored.js"></script>
|
||||
|
||||
@@ -24,9 +24,7 @@
|
||||
<div class="progress-bar progress-bar-striped active" role="progressbar"></div>
|
||||
</div>
|
||||
<form action="/pks/add" method="post">
|
||||
<p><textarea id="drop_zone" class="form-control ui-droppable" name="keytext" rows="5" spellcheck="false" placeholder="Drag a single ascii-armored key file here or paste PGP PUBLIC KEY BLOCK here ..." required></textarea></p>
|
||||
<input type="file" id="file-selector" accept="text/plain" style="display:none">
|
||||
<p>Or <button type="button" id="fileSelect">select a file</button> </p>
|
||||
<p><textarea class="form-control" name="keytext" rows="5" spellcheck="false" placeholder="Paste PGP PUBLIC KEY BLOCK here ..." required></textarea></p>
|
||||
<input class="btn btn-primary btn-lg" type="submit" value="Upload">
|
||||
</form>
|
||||
<hr>
|
||||
|
||||
Reference in New Issue
Block a user