major update
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
"api": {
|
||||
"port": 3020,
|
||||
"languages": ["en", "fr"],
|
||||
"exposedHeaders": ["xdays", "xhash", "xalias", "xlang", "xtribe", "xapp"],
|
||||
"exposedHeaders": ["xdays", "xhash", "xalias", "xlang", "xtribe", "xapp","xuuid"],
|
||||
"nationObjects": [
|
||||
"schema",
|
||||
"blocks",
|
||||
|
@@ -1,6 +1,6 @@
|
||||
user {{{sudoerUser}}};
|
||||
worker_processes auto;
|
||||
error_log {{{ }}}/var/log/nginx/error.log notice;
|
||||
error_log /var/log/nginx/error.log notice;
|
||||
pid /var/run/nginx.pid;
|
||||
#include /etc/nginx/modules-enabled/*.conf;
|
||||
|
||||
@@ -15,16 +15,26 @@ http {
|
||||
'"$http_user_agent"';
|
||||
|
||||
log_format mainold '$remote_addr - $remote_user [$time_local] "$request" '
|
||||
'$status $body_bytes_sent "$http_referer" '
|
||||
'"$http_user_agent" "$http_x_forwarded_for"';
|
||||
log_format trace '$remote_addr - $remote_user [$time_local] '
|
||||
'$host "$request" $status $body_bytes_sent '
|
||||
'"$http_referer" "$http_user_agent" '
|
||||
'"$http_x_forwarded_for" $request_id';
|
||||
access_log /var/log/nginx/access.log main;
|
||||
'$status $body_bytes_sent "$http_referer" '
|
||||
'"$http_user_agent" "$http_x_forwarded_for"';
|
||||
|
||||
log_format track escape=json '{"time":"$time_iso8601","alias":"$sent_http_xalias","uuid":"$sent_http_xuuid",'
|
||||
'"lg":"$sent_http_xlang","consentcookie":"$sent_http_consentcookie",'
|
||||
'"request_filename":"$request_filename","request":"$request",'
|
||||
'"args":"$args","remoteaddr":"$remote_addr","httpxforwardedfor":"$http_x_forwarded_for",'
|
||||
'"httpreferer":"$http_referer","httpuseragent":"$http_user_agent"}';
|
||||
|
||||
#access_log /var/log/nginx/access.log main;
|
||||
sendfile on;
|
||||
keepalive_timeout 65;
|
||||
gzip on;
|
||||
gzip on;
|
||||
gzip_vary on;
|
||||
gzip_proxied any;
|
||||
gzip_comp_level 6;
|
||||
gzip_buffers 4 32k;
|
||||
gzip_http_version 1.1;
|
||||
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/x-font-ttf application/javascript font/eot font/opentype image/svg+xml image/x-icon text/plain;
|
||||
|
||||
##
|
||||
# Virtual Host Configs
|
||||
##
|
||||
|
@@ -2,10 +2,22 @@ server {
|
||||
server_name {{#dns}} {{.}} {{/dns}};
|
||||
access_log {{{nginx.logs}}}.access.log main;
|
||||
|
||||
location ~* /trk/ {
|
||||
access_log {{{nginx.logs}}}.trk.log track;
|
||||
if ( $uri ~ ^/trk/redirect ){
|
||||
return 301 $arg_url;
|
||||
}
|
||||
rewrite ^/trk/(.*)$ /$1;
|
||||
}
|
||||
|
||||
location ~* /nationchains/(blocks|pagans|towns|nations)/ {
|
||||
# Warning: never add tribes for keeping it private
|
||||
root {{{dirapi}}}/;
|
||||
}
|
||||
location ~* /nationchains/models/ {
|
||||
rewrite /nationchains/models/(.*$) /$1 break;
|
||||
root {{{dirapi}}}/api/models/lg/;
|
||||
}
|
||||
location ~* /nationchains/schema/ {
|
||||
#outside of nationchains for git purpose
|
||||
rewrite /nationchains/schema/(.*$) /$1 break;
|
||||
@@ -23,8 +35,10 @@ return 403 "No valid token access for plugin:$arg_plugin with token:$arg_plugink
|
||||
}
|
||||
|
||||
location /cdn/ {
|
||||
rewrite /cdn/(.*$) /$1 break;
|
||||
root {{{nginx.fswww}}}/cdn/;
|
||||
expires 1y;
|
||||
add_header Cache-Control "public";
|
||||
rewrite /cdn/(.*$) /$1 break;
|
||||
root {{{nginx.fswww}}}/cdn/;
|
||||
}
|
||||
|
||||
location /spacedev/ {
|
||||
@@ -38,6 +52,13 @@ proxy_pass http://localhost:{{{api.port}}};
|
||||
proxy_redirect off;
|
||||
include proxy_params;
|
||||
}
|
||||
|
||||
location /apxwebapp/ {
|
||||
rewrite /apxwebapp/(.*$) /$1 break;
|
||||
root {{{dirapxwebapp}}}/apxwebapp/;
|
||||
index index.html index_en.html;
|
||||
}
|
||||
|
||||
#to add htpasswd install apache2-utils => sudo htpasswd -c dirtown/tribes/tribeId/.htpasswd loginname passwd see man for
|
||||
option
|
||||
|
||||
|
@@ -47,7 +47,7 @@ pagans.generateKey = async (alias, passphrase) => {
|
||||
// check alias does not exist
|
||||
return { alias, privateKey, publicKey };
|
||||
};
|
||||
pagans.detachedSignature = async (pubK, privK, passphrase, message) => {
|
||||
pagans.detachedSignatureold = async (pubK, privK, passphrase, message) => {
|
||||
/**
|
||||
* @pubK {string} a text public key
|
||||
* @privK {string} a test priv key
|
||||
@@ -75,6 +75,43 @@ pagans.detachedSignature = async (pubK, privK, passphrase, message) => {
|
||||
});
|
||||
return btoa(sig);
|
||||
};
|
||||
|
||||
pagans.detachedSignature = async (pubK, privK, passphrase, message) => {
|
||||
/**
|
||||
* @pubK {string} a text public key
|
||||
* @privK {string} a test priv key
|
||||
* @passphrase {string} used to read privK
|
||||
* @message {string} message to sign
|
||||
* @Return a detached Signature of the message
|
||||
*/
|
||||
//const publicKey = await openpgp.readKey({ armoredKey: pubK });
|
||||
//as sup inutile
|
||||
/*privK=`-----BEGIN PGP PRIVATE KEY BLOCK-----
|
||||
|
||||
xVgEZPB0MhYJKwYBBAHaRw8BAQdAV9XVko619o1DbLQRvuopr5/UN3Eao+vo
|
||||
H8Z+nftq/2kAAP0XKCgHb46kEBUDveaOX19hixOxz1l4fpL3CuFJYELU9A8Y
|
||||
zQDCjAQQFgoAPgWCZPB0MgQLCQcICZConW0nymKQ3QMVCAoEFgACAQIZAQKb
|
||||
AwIeARYhBAlofmCeHwmJsSeGiKidbSfKYpDdAADNpQD/ZZ9WGtKXuenB5xcf
|
||||
+JuoHWxVY4X6GT6l8MOHf+vadbgA/0zRayyRzrC5DcWpYomDSaqub6tw6iHS
|
||||
BJ89N/QYTksPx10EZPB0MhIKKwYBBAGXVQEFAQEHQN+OUc24uVrr9g83fJvN
|
||||
ZPbyEg7kdYus3VL8vyLnhVY6AwEIBwAA/1SwFdlBE/pC7I2TB/RFVFUvSEBu
|
||||
MueDhdccgUm1Q5P4D/zCeAQYFggAKgWCZPB0MgmQqJ1tJ8pikN0CmwwWIQQJ
|
||||
aH5gnh8JibEnhoionW0nymKQ3QAAOSsBANkvznf3EaEtGrPH0tUOnRLsCwTf
|
||||
BwaCFNom9YsHOmY8AP9XJmgIH+AS3tWp1nIB9yXLpfiKlWDreYI28iiqlM31
|
||||
AQ==
|
||||
=DOoD
|
||||
-----END PGP PRIVATE KEY BLOCK-----`;*/
|
||||
const privateKey = await openpgp.readKey({ armoredKey: privK,passphrase:passphrase });
|
||||
console.log(message);
|
||||
const {data:cleartextMessage} = await apenpgp.sign({
|
||||
message:openpgp.cleartext.fromText(message),
|
||||
privateKeys:[privateKey]
|
||||
})
|
||||
console.log('signed')
|
||||
console.log(cleartextMessage)
|
||||
return cleartextMessage;
|
||||
};
|
||||
|
||||
pagans.authenticatedetachedSignature = async (
|
||||
alias,
|
||||
pubK,
|
||||
|
Reference in New Issue
Block a user