update auth openpgp.js

This commit is contained in:
philc 2023-05-12 07:59:32 +02:00
parent dc11e8235e
commit a78bd8404a
85 changed files with 47890 additions and 1042 deletions

5
.gitignore vendored
View File

@ -5,9 +5,10 @@
/nationchains/blocks
/nationchains/deals
/nationchains/logs
/nationchains/towns
/nationchains/pagans
/nationchains/nations
/nationchains/pagans
/nationchains/towns
/nationchains/tribes
/nationchains/www/nginx_adminapx.conf
/nationchainssave
/yarn*

View File

@ -1,82 +1,95 @@
const conf = require( '../../nationchains/tribes/conf.json' );
const conf = require("../../nationchains/tribes/conf.json");
const checkHeaders = ( req, res, next ) => {
/**
* @apiDefine apxHeader
* @apiGroup Middleware
* @apiDescription Header is mandatory to access apxtrib see tribes/townconf.json.exposedHeaders
* A turn around can be done with a simple get params has to be sent in the get url. Usefull to send simple get without header like ?xworkon=tribeName&xlang=en... priority is given to headers
* For performance, tokens are store globaly in req.app.locals.tokens={xpaganid:xauth}
* if xlang is not in conf.languagesAvailable
*
* @apiHeader {string} xjwt Pagans unique jwt token store in local town Pagans data or "noauth"
* @apiHeader {string} xpseudo Pagans unique Pagan id in uuid format or "nouuid"
* @apiHeader {string} xlang the 2 letter langage it request the api (if not exist the 2 first letter of Accept-Language header ) if lang does not exist in the town then en is set (as it always exist in en).
* @apiHeader {string} xtribe Tribes id where pseudo want to act
* @apiHeader {string} xapp Name of www/xapp folder that host app that send the request
* /tribeid/person/xpseudo.json have accessright on this app store in /tribe/tribeid/www/xapp
*
* @apiError missingexposedHeaders it miss an exposedHeaders
*
* @apiErrorExample {json} Error-Response:
* HTTP/1/1 404 Not Found
* {
* status:400,
* ref:"middleware"
* msg:"missingheaders",
* data: ["xpseudo","xjwt"]
* }
*
* @apiHeaderExample {json} Header-Exemple:
* {
* xtribe:"apache",
* xalias:"toto",
* xhash:"",
* xlang:"en",
* xapp:"popular"
* }
*/
req.session = {};
const header = {};
if (!req.header('xlang') && req.header('Content-Language')) req.params.xlang=req.header('Content-Language');
let missingheader = [];
console.log('req.headers',req.headers)
for( const h of conf.api.exposedHeaders ) {
//console.log( h, req.header( h ) )
if( req.params[ h ] ) {
header[ h ] = req.params[ h ]
} else if( req.header( h ) ) {
header[ h ] = req.header( h )
} else {
missingheader.push(h);
}
};
//console.log( 'header', header )
// store in session the header information
req.session.header = header;
// Each header have to be declared
if( missingheader != "" ) {
// bad request
return res.status( 400 )
.json( {
ref:"headers",
msg: "missingheader",
data: missingheader
} );
};
//console.log( req.app.locals.tribeids )
if( !req.app.locals.tribeids.includes( header.xtribe ) ) {
return res.status( 400 )
.json( {
ref:"headers",
msg: 'tribeiddoesnotexist',
moreinfo: header.xtribe
} );
}
if( !conf.api.languages.includes( header.xlang ) ) {
console.log('warning language requested does not exist force to en glish')
header.xlang="en";
}
next();
const checkHeaders = (req, res, next) => {
/**
* @apiDefine apxHeader
* @apiGroup Middleware
* @apiDescription Header is mandatory to access apxtrib see tribes/townconf.json.exposedHeaders
* A turn around can be done with a simple get params has to be sent in the get url. Usefull to send simple get without header like ?xworkon=tribeName&xlang=en... priority is given to headers
* For performance, tokens are store globaly in req.app.locals.tokens={xpaganid:xauth}
* if xlang is not in conf.languagesAvailable
*
* @apiHeader {string} xjwt Pagans unique jwt token store in local town Pagans data or "noauth"
* @apiHeader {string} xpseudo Pagans unique Pagan id in uuid format or "nouuid"
* @apiHeader {string} xlang the 2 letter langage it request the api (if not exist the 2 first letter of Accept-Language header ) if lang does not exist in the town then en is set (as it always exist in en).
* @apiHeader {string} xtribe Tribes id where pseudo want to act
* @apiHeader {string} xapp Name of www/xapp folder that host app that send the request
* /tribeid/person/xpseudo.json have accessright on this app store in /tribe/tribeid/www/xapp
*
* @apiError missingexposedHeaders it miss an exposedHeaders
*
* @apiErrorExample {json} Error-Response:
* HTTP/1/1 400 Not Found
* {
* status:400,
* ref:"headers"
* msg:"missingheaders",
* data: ["headermissing1"]
* }
*@apiErrorExample {json} Error-Response:
* HTTP/1/1 404 Not Found
* {
* status:404,
* ref:"headers"
* msg:"tribeiddoesnotexist",
* data: {xalias}
* }
*
* @apiHeaderExample {json} Header-Exemple:
* {
* xtribe:"apache",
* xalias:"toto",
* xhash:"",
* xdays:"123"
* xlang:"en",
* xapp:"popular"
* }
*/
req.session = {};
const header = {};
if (!req.header("xlang") && req.header("Content-Language"))
req.params.xlang = req.header("Content-Language");
let missingheader = [];
console.log("req.headers", req.headers);
for (const h of conf.api.exposedHeaders) {
//console.log( h, req.header( h ) )
if (req.params[h]) {
header[h] = req.params[h];
} else if (req.header(h)) {
header[h] = req.header(h);
} else {
missingheader.push(h);
}
}
//console.log( 'header', header )
// store in session the header information
req.session.header = header;
// Each header have to be declared
if (missingheader != "") {
// bad request
return res.status(400).json({
ref: "headers",
msg: "missingheader",
data: missingheader,
});
}
//console.log( req.app.locals.tribeids )
// xtribe == "town" is used during the setup process
if (
!(
header.xtribe == "town" || req.app.locals.tribeids.includes(header.xtribe)
)
) {
return res.status(404).json({
ref: "headers",
msg: "tribeiddoesnotexist",
data: { xtribe: header.xtribe },
});
}
if (!conf.api.languages.includes(header.xlang)) {
console.log("warning language requested does not exist force to english");
header.xlang = "en";
}
next();
};
module.exports = checkHeaders;

View File

@ -1,42 +1,69 @@
const fs = require( 'fs-extra' );
const glob = require( 'glob' );
const path = require( 'path' );
const fs = require("fs-extra");
const glob = require("glob");
const path = require("path");
const config = require( '../../nationchains/tribes/conf.json' );
const config = require("../../nationchains/tribes/conf.json");
const hasAccessrighton = ( object, action, ownby ) => {
/*
const hasAccessrighton = (object, action, ownby) => {
/*
@action (mandatory) : CRUDO
@object (mandatory)= name of a folder object in /tribeid space can be a tree for example objects/items
@ownby (option) = list des uuid propriétaire
return next() if all action exist in req.app.local.tokens[UUID].ACCESSRIGHTS.data[object]
OR if last action ="O" and uuid exist in ownBy
Careffull if you have many action CRO let O at the end this will force req.right at true if the owner try an action on this object
*/
return ( req, res, next ) => {
//console.log( 'err.stack hasAccessrights', err.statck )
//console.log( `test accessright on object:${object} for ${req.session.header.xworkon}:`, req.app.locals.tokens[ req.session.header.xpaganid ].ACCESSRIGHTS.data[ req.session.header.xworkon ] )
req.right = false;
if( req.app.locals.tokens[ req.session.header.xpaganid ].ACCESSRIGHTS.data[ req.session.header.xworkon ] && req.app.locals.tokens[ req.session.header.xpaganid ].ACCESSRIGHTS.data[ req.session.header.xworkon ][ object ] ) {
req.right = true;
[ ...action ].forEach( a => {
if( a == "O" && ownby && ownby.includes( req.session.header.xpaganid ) ) {
req.right = true;
} else {
req.right = req.right && req.app.locals.tokens[ req.session.header.xpaganid ].ACCESSRIGHTS.data[ req.session.header.xworkon ][ object ].includes( a )
}
} )
}
//console.log( 'Access data autorise? ', req.right )
if( !req.right ) {
return res.status( 403 )
.json( {
info:'forbiddenAccessright',
ref: 'headers',
moreinfo: {xpaganid:req.session.header.xpaganid,object:object, xworkon:req.session.header.xworkon, action:action}
} )
}
next();
}
}
need to check first a person exist with this alias in tribe
const person = fs.readJsonSync(
`${conf.dirname}/nationchains/tribes/${req.session.header.xtribe}/persons/${req.session.header.xalias}.json`
);
*/
return (req, res, next) => {
//console.log( 'err.stack hasAccessrights', err.statck )
//console.log( `test accessright on object:${object} for ${req.session.header.xworkon}:`, req.app.locals.tokens[ req.session.header.xpaganid ].ACCESSRIGHTS.data[ req.session.header.xworkon ] )
req.right = false;
if (
req.app.locals.tokens[req.session.header.xpaganid].ACCESSRIGHTS.data[
req.session.header.xworkon
] &&
req.app.locals.tokens[req.session.header.xpaganid].ACCESSRIGHTS.data[
req.session.header.xworkon
][object]
) {
req.right = true;
[...action].forEach((a) => {
if (a == "O" && ownby && ownby.includes(req.session.header.xpaganid)) {
req.right = true;
} else {
req.right =
req.right &&
req.app.locals.tokens[
req.session.header.xpaganid
].ACCESSRIGHTS.data[req.session.header.xworkon][object].includes(a);
}
});
}
//console.log( 'Access data autorise? ', req.right )
if (!req.right) {
return res.status(403).json({
info: "forbiddenAccessright",
ref: "headers",
moreinfo: {
xpaganid: req.session.header.xpaganid,
object: object,
xworkon: req.session.header.xworkon,
action: action,
},
});
}
next();
};
};
module.exports = hasAccessrighton;

View File

@ -1,207 +1,106 @@
const jwt = require("jwt-simple");
const fs = require("fs-extra");
const moment = require("moment");
const dayjs = require("dayjs");
const glob = require("glob");
const openpgp = require("openpgp");
const conf = require("../../nationchains/tribes/conf.json");
const isAuthenticated = (req, res, next) => {
//once a day rm oldest tokens than 24hours
const isAuthenticated = async (req, res, next) => {
// once a day rm oldest tokens than 24hours tag job by adding tmp/tokensmenagedone{day}
const currentday = dayjs().date();
console.log("dayjs", currentday);
console.log(
"test si menagedone" + currentday,
!fs.existsSync(`${conf.dirname}/tmp/tokensmenagedone${currentday}`)
"if menagedone" + currentday,
!fs.existsSync(`${__base}tmp/tokensmenagedone${currentday}`)
);
if (!fs.existsSync(`${conf.dirname}/tmp/tokensmenagedone${currentday}`)) {
if (!fs.existsSync(`${__base}/tmp/tokens`))
fs.mkdirSync(`${__base}tmp/tokens`);
if (!fs.existsSync(`${__base}tmp/tokensmenagedone${currentday}`)) {
// clean oldest
const tsday = dayjs().date();
console.log("tsday", tsday);
glob.sync(`${conf.dirname}/tmp/tokensmenagedone*`).forEach((f) => {
const tsday = dayjs().valueOf(); // now in timestamp format
glob.sync(`${__base}tmp/tokensmenagedone*`).forEach((f) => {
fs.removeSync(f);
});
glob.sync(`${conf.dirname}/tmp/tokens/*.json`).forEach((f) => {
fs.readJson(f, (err, data) => {
if (!err && tsday - data.timestamp > 86400000) fs.remove(f);
});
glob.sync(`${__base}tmp/tokens/*.json`).forEach((f) => {
if (tsday - parseInt(f.split("_")[1]) > 86400000) fs.remove(f);
});
}
//Check register in tmp/tokens/
console.log("isRegister?");
console.log("isAuthenticate?");
const resnotauth = {
ref: "headers",
msg: "notauthenticated",
data: {
xalias: req.session.header.xalias,
xtribe: req.session.header.xtribe,
xaliasexists: true,
},
};
console.lolg(req.session.header)
if (req.session.header.xalias == "anonymous") res.status(401).json(resnotauth);
const tmpfs = `${conf.dirname}/tmp/tokens/${req.session.header.xtribe}_${req.session.header.xalias}_${req.session.header.hash}.json`;
if (!fs.exists(tmpfs)) {
//check if pseudo exist as a pagan in pagans/ and as a person in xtribe/persons/ and check hash is coming from publickey
if (
!fs.existsSync(
`${conf.dirname}/nationchains/tribes/${req.session.header.xtribe}/persons/${req.session.header.xalias}.json`
)
) {
console.log(
`pseudo:${req.session.header.xalias} does not exist for xtribe ${req.session.header.xtribe}`
);
res.status(401).json(resnotauth);
}
if (
!fs.existsSync(
`${conf.dirname}/nationchains/pagans/${req.session.header.xalias}.json`
)
) {
console.log(
`pseudo:${req.session.header.xalias} does not exist as a pagan`
);
res.status(401).json(resnotauth);
}
const person = fs.readJsonSync(
`${conf.dirname}/nationchains/tribes/${req.session.header.xtribe}/persons/${req.session.header.xalias}.json`
);
const pagan = fs.readJsonSync(
`${conf.dirname}/nationchains/pagans/${req.session.header.xalias}.json`
);
//check hash with publickey pagan.publickey
// if good => create a /tmp/tokens/xtribe_xalias_xhash.json ={timestamp}
// if not good res.json(resnotauth)
console.log(req.session.header);
if (req.session.header.xalias == "anonymous") {
console.log("alias anonymous means not auth");
return res.status(401).json(resnotauth);
}
const tmpfs = `${__base}tmp/tokens/${req.session.header.xalias}_${
req.session.header.xdays
}_${req.session.header.xhash.substring(20, 200)}`;
console.log(tmpfs);
if (!fs.existsSync(tmpfs)) {
// need to check detached sign
let publickey;
if (
fs.existsSync(
`${__base}nationchains/pagans/itm/${req.session.header.xalias}.json`
)
) {
const pagan = fs.readJsonSync(
`${__base}nationchains/pagans/itm/${req.session.header.xalias}.json`
);
publickey = pagan.publicKey;
} else {
resnotauth.data.xaliasexists = false;
if (req.body.publickey) {
publickey = req.body.publickey;
} else {
console.log("alias unknown");
return res.status(404).send(resnotauth);
}
}
console.log(publickey);
console.log(Buffer.from(req.session.header.xhash, "base64").toString());
const publicKey = await openpgp.readKey({ armoredKey: publickey });
const msg = await openpgp.createMessage({
text: `${req.session.header.xalias}_${req.session.header.xdays}`,
});
const signature = await openpgp.readSignature({
armoredSignature: Buffer.from(
req.session.header.xhash,
"base64"
).toString(),
});
console.log(msg);
console.log(signature);
console.log(publicKey);
const checkauth = await openpgp.verify({
message: msg,
signature: signature,
verificationKeys: publicKey,
});
console.log(checkauth);
console.log(checkauth.signatures[0].keyID);
//console.log(await checkauth.signatures[0].signature);
//console.log(await checkauth.signatures[0].verified);
const { check, keyID } = checkauth.signatures[0];
try {
await check; // raise an error if necessary
fs.outputFileSync(tmpfs, req.session.header.xhash, "utf8");
} catch (e) {
resnotauth.msg = "signaturefailed";
console.log("not auth fail sign");
return res.status(401).send(resnotauth);
}
}
console.log("Authenticated");
next();
};
const isAuthenticatedold = (req, res, next) => {
/*
check if authenticated with valid token
if not => set req.session.header.xjwt=1
if yes => set for xWorkon
req.session.header.accessrights={
app:{'tribeid:website':[liste of menu]},
data:{ "sitewebsrc": "RWCDO",
"contacts": "RWCDO"}}
Liste of menu is linked with the app tht h
ave to be consistent with accessrights.data
data, list of object accessright Read Write Create Delete Owner
a xuuid can read any objet if R
if O wner means that it can only read write its object create by himself
*/
console.log("isAuthenticated()?");
//console.log( 'req.app.locals.tokens', req.app.locals.tokens )
//console.log( 'req.session.header', req.session.header );
// Check if token exist or not
req.session.header.accessrights = { app: "", data: {} };
if (
req.session.header.xalias == "1" ||
!req.app.locals.tokens[req.session.header.xalias]
) {
console.log(
`isAuthenticated no : uuid=1 (value=${req.session.header.xalias}) or locals.tokens[uuid] empty `
);
console.log(
"req.app.locals.tokens de xalias",
req.app.locals.tokens[req.session.header.xalias]
);
console.log(
"list key uuid de req.app.locals.tokens",
Object.keys(req.app.locals.tokens)
);
req.session.header.xjwt = "1";
} else if (
req.app.locals.tokens[req.session.header.xalias].TOKEN !==
req.session.header.xjwt
) {
// console.log(req.session.header.xuuid);
// console.log(req.session.header.xjwt);
// update tokens from file in case recently logged
try {
console.log(
"token not in list of token (req.app.locals.tokens) try to refresh from file"
);
req.app.locals.tokens = fs.readJsonSync(`${conf.tmp}/tokens.json`);
} catch (err) {
console.log(
`check isAuthenticated issue in reading ${conf.tmp}/tokens.json`
);
}
if (
req.app.locals.tokens[req.session.header.xalias].TOKEN !==
req.session.header.xjwt
) {
// if still does not exist then out
console.log("isAuthenticated no, token outdated");
req.session.header.xjwt = "1";
req.session.header.xalias = "1";
}
}
if (req.session.header.xjwt == "1") {
//return res.status( 403 )
return res.status(403).json({
info: ["forbiddenAccess"],
model: "Pagans",
moreinfo: "isAuthenticated faill",
});
} else {
console.log("isAuthenticated yes");
if (req.app.locals.tokens[req.session.header.xalias]) {
//console.log( `accessright pour ${req.session.header.xalias}`, req.app.locals.tokens[ req.session.header.xalias ].ACCESSRIGHTS );
//set header.accessrights from tokens.json
req.session.header.accessrights =
req.app.locals.tokens[req.session.header.xalias].ACCESSRIGHTS;
} else {
// case of bypass no accessright available
req.session.header.accessrights = {};
}
// Once per day, clean old token
const currentday = moment().date();
console.log(
"test si menagedone" + currentday,
!fs.existsSync(`${conf.tmp}/menagedone${currentday}`)
);
if (!fs.existsSync(`${conf.tmp}/menagedone${currentday}`)) {
glob.sync(`${conf.tmp}/menagedone*`).forEach((f) => {
fs.remove(f, (err) => {
if (err) {
console.log("err remove menagedone", err);
}
});
});
glob.sync(`${conf.tmp}/mdcreator*.log`).forEach((f) => {
fs.remove(f, (err) => {
if (err) {
console.log("err remove mdcreator log", err);
}
});
});
const newtokens = {};
for (const k of Object.keys(req.app.locals.tokens)) {
try {
const decodedToken = jwt.decode(
req.app.locals.tokens[k].TOKEN,
conf.jwtSecret
);
//console.log( moment( decodedToken.expiration ), moment() )
//console.log( moment( decodedToken.expiration ) >= moment() )
if (moment(decodedToken.expiration) >= moment()) {
newtokens[k] = req.app.locals.tokens[k];
}
} catch (err) {
console.log("Check isAuthenticated cleaning token ", err);
}
}
req.app.locals.tokens = newtokens;
fs.outputJsonSync(`${conf.tmp}/tokens.json`, newtokens);
fs.writeFileSync(
`${conf.tmp}/menagedone${currentday}`,
"fichier semaphore to clean data each day can be deleted with no consequence",
"utf-8"
);
}
next();
}
};
module.exports = isAuthenticated;

View File

@ -1,7 +1,7 @@
{
"missingheader":"Some header miss to have a valid request: {{#data}} {{.}} {{/data}}",
"tribeiddoesnotexist":"Header xtribe: {{data}} does not exist in this town",
"authenticated":"Your perso{{{xpseudo}}} is register for tribe {{{xtribe}}}",
"notauthenticated":"Your pseudo {{xpseudo}} are not register into tribe {{xtribe}} ",
"forbiddenAccessright":"Pagan {{data.xpseudo}} has not access right to act {{data.action}} onto object {{data.object}} for tribe {{mor.xworkon}}"
"missingheader": "Some header miss to have a valid request: {{#data}} {{.}} {{/data}}",
"tribeiddoesnotexist": "Header xtribe: {{data.xtribe}} does not exist in this town",
"authenticated": "Your alias{{{data.xalias}}} is authenticated",
"notauthenticated": "Your alias: {{data.xalias}} is not authenticated {{^data.aliasexists}} and this alias does not exist !{{/data.aliasexists}}",
"forbiddenAccessright": "Pagan {{data.xalias}} has not access right to act {{data.action}} onto object {{data.object}} for tribe {{mor.xworkon}}"
}

View File

@ -0,0 +1,20 @@
const glob = require("glob");
const path = require("path");
const fs = require("fs-extra");
/**
* To manage any communication between Pagan
* mayor druid emailing/sms/paper from tribe register smtp, simcard, mail api to Person(s) / Pagan(s)
* volatile notification message from tribe activities to Pagans / person ()
*
*/
const Notifications = {};
Notifications.send = (data) => {
const ret = {};
console.log("TODO dev notification emailing");
return ret;
};
module.exports = Notifications;

View File

@ -1,97 +1,125 @@
const glob = require("glob");
const path = require("path");
const dayjs = require("dayjs");
const fs = require("fs-extra");
const axios = require('axios');
const openpgp = require('openpgp');
const conf=require('../../nationchains/tribes/conf.json')
const axios = require("axios");
const openpgp = require("openpgp");
var conf = {};
if (fs.existsSync("../../nationchains/tribes/conf.json")) {
conf = require("../../nationchains/tribes/conf.json");
}
console.log(conf);
/**
* Pagan Management numeric Identity
* Pagan Management numeric Identity and Person (Person = Pagan Id + tribe)
*
*
*
*/
const Pagans= {}
const Pagans = {};
Pagans.createId = async (alias,passphrase) =>{
/**
* @param {string} alias a unique alias that identify an identity
* @param {string} passphrase a string to cipher the publicKey (can be empty, less secure but simpler)
* @return {publicKey,privateKey} with userIds = [{alias}]
*/
let apxpagans={};
if (fs.existsSync(`${conf.dirname}/nationchains/pagans/idx/alias_all.json`)){
apxpagans = fs.readJsonSync(
`${conf.dirname}/nationchains/pagans/idx/alias_all.json`
);
}
if (Object.keys(apxpagans).includes(alias)){
return {status:409,ref:"pagans",msg:"aliasalreadyexist"}
};
const {privateKey,publicKey} = await openpgp.generateKey({
type: "ecc", // Type of the key, defaults to ECC
curve: "curve25519", // ECC curve name, defaults to curve25519
userIDs: [{ alias: alias }], // you can pass multiple user IDs
passphrase: passphrase, // protects the private key
format: "armored", // output key format, defaults to 'armored' (other options: 'binary' or 'object')
});
apxpagans[alias]={alias,publicKey};
fs.outputJsonSync(`${conf.dirname}/nationchains/pagans/idx/alias_all.json`,apxpagans);
fs.outputJsonSync(`${conf.dirname}/nationchains/pagans/itm/${alias}.json`,{alias,publicKey});
return {status:200, data:{alias,privateKey,publicKey}}
}
//console.log( Pagans.generateKey('toto',''))
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 });
const privateKey = await openpgp.decryptKey({
privateKey: await openpgp.readPrivateKey({ armoredKey: privK }),
passphrase,
});
const msg = await openpgp.createMessage({ text: message });
return await openpgp.sign({ msg, signinKeys: privK, detached: true });
};
Pagans.checkdetachedSignature = async (
Pagans.create = (alias, publicKey) => {
/**
* @param {string} alias a unique alias that identify an identity
* @param {string} publicKey a publicKey
* @return {object} { status: 200, data: { alias, publicKey } }
* xhash was checked by isauthenticated
* @todo use Odmdb to add a pagan
*/
let apxpagans = {};
if (fs.existsSync(`${__base}nationchains/pagans/idx/alias_all.json`)) {
apxpagans = fs.readJsonSync(
`${__base}nationchains/pagans/idx/alias_all.json`
);
}
apxpagans[alias] = { alias, publicKey };
fs.outputJsonSync(
`${__base}nationchains/pagans/idx/alias_all.json`,
apxpagans
);
fs.outputJsonSync(`${__base}nationchains/pagans/itm/${alias}.json`, {
alias,
pubK,
detachedSignature,
message
) => {
/**
* @alias {string} alias link to the publicKey
* @pubK {string} publiKey text format
* @detachedSignature {string} a detachedsignatured get from apx.detachedSignature
* @message {string} the message signed
* @return {boolean} true the message was signed by alias
* false the message was not signed by alias
*/
const publicKey = await openpgp.readKey({ armoredKey: pubK });
const msg = await openpgp.createMessage({ text: message });
const signature = await openpgp.readSignature({
armoredSignature: detachedSignature, // parse detached signature
});
const verificationResult = await openpgp.verify({
msg, // Message object
signature,
verificationKeys: publicKey
});
const { verified, keyID } = verificationResult.signatures[0];
try {
await verified; // throws on invalid signature
console.log("Signed by key id " + keyID.toHex());
return KeyId.toHex().alias == alias;
} catch (e) {
console.log("Signature could not be verified: " + e.message);
return false;
}
};
publicKey,
});
return { status: 200, data: { alias, publicKey } };
};
module.exports=Pagans;
Pagans.personupdate = (alias, tribe, persondata) => {
//later use Odmdb ans schema person to manage this
/**
* @Param {string} alias pagan unique id
* @Param {string} tribe tribe id in this town
* @Param {object} persondata that respect /nationchains/schema/person.json + nationchains/tribe/tribeid/schema/personextented.json
* @return create or update a person /tribe/tribeid/person/alias.json
*/
let person = {
alias: alias,
dt_create: dayjs(),
accessrights: { profil: "user" },
};
if (fs.existsSync(`${__base}tribes/${tribe}/person/itm/${alias}.json`)) {
person = fs.readJsonSync(
`${__base}tribes/${tribe}/person/itm/${alias}.json`
);
person.dt_update = dayjs();
}
Object.keys(persondata).forEach((d) => {
person[d] = persondata[d];
});
//const checkjson= Checkjson.schema.data = (fs.readJsonSync(`${__base}}nationchains/schema/person.json`, person, false)
// if checkjson.status==200 create /update with odmdb to update index data
// see odmdb that did all and return standard message
fs.outputJSONSync(
`${__base}tribes/${tribe}/person/itm/${alias}.json`,
person,
{
space: 2,
}
);
return {
status: 200,
ref: "Pagans",
msg: "successfullupdate",
data: { tribe: tribe },
};
};
Pagans.authenticatedetachedSignature = async (
alias,
pubK,
detachedSignature,
message
) => {
/**
* Check that a message was signed with a privateKey from a publicKey
* This is not necessary if isAuthenticated, but can be usefull to double check
* @TODO finish it and implement it also in /apxpagan.js for browser
* @alias {string} alias link to the publicKey
* @pubK {string} publiKey text format
* @detachedSignature {string} a detachedsignatured get from apx.detachedSignature
* @message {string} the message signed
* @return {boolean} true the message was signed by alias
* false the message was not signed by alias
*/
const publicKey = await openpgp.readKey({ armoredKey: pubK });
const msg = await openpgp.createMessage({ text: message });
const signature = await openpgp.readSignature({
armoredSignature: detachedSignature, // parse detached signature
});
const verificationResult = await openpgp.verify({
msg, // Message object
signature,
verificationKeys: publicKey,
});
const { verified, keyID } = verificationResult.signatures[0];
try {
await verified; // throws on invalid signature
console.log("Signed by key id " + keyID.toHex());
return KeyId.toHex().alias == alias;
} catch (e) {
console.log("Signature could not be verified: " + e.message);
return false;
}
};
module.exports = Pagans;

View File

@ -4,6 +4,7 @@ const dnsSync = require("dns-sync");
const mustache = require("mustache");
const readlineSync = require("readline-sync");
const Wwws = require("../models/Wwws.js");
/**
* This Setup is run at the first installation
* This is not an exportable module
@ -28,9 +29,9 @@ Setup.check = () => {
);
process.exit();
}
if (fs.existsSync("./nationchains/tribes/conf.json")) {
if (fs.existsSync("./nationchains/www/nginx_adminapx.conf")) {
console.log(
"\x1b[31m Be carefull you already have a town set in ./nationchains/tribes/index.conf.json, check and remove it if you want to setup this town."
"\x1b[31m Be carefull you already have a town set, check http://adminapx or remove ./nationchains/www/nginx_adminapx.conf to reset a sync with the last nationchains"
);
process.exit();
}
@ -38,6 +39,40 @@ Setup.check = () => {
};
Setup.init = async () => {
/**
* create empty nationchains
* rsync all subfolder nationchains except the tribes/ and /www/nginx_adminapx.conf
*
* Then to send new version we fix a master production
*
*/
const initconf = fs.readJSONSync(
"./nationchains/www/adminapx/static/tpldata/initconf.json"
);
initconf.sudoerUser = process.env.USER;
initconf.dirname = path.resolve(`${__dirname}/../../`);
// To allow to serve the nation website until the end
initconf.nginx.include.push(
`${townconf.dirname}/nationchains/www/nginx_*.conf`
);
// To allow to serve tribes web site
initconf.nginx.include.push(
`${townconf.dirname}/nationchains/tribes/*/www/nginx_*.conf`
);
initconf.nginx.logs = `${townconf.dirname}/nationchains/logs/nginx`;
initconf.nginx.website = "adminapx";
initconf.nginx.fswww = "nationchains/"; //for a local tribe nationchains/tribes/tribeid
initconf.nginx.tribeid = "town";
initconf.nginx.pageindex = "index_en.html";
const nginxconf = Wwws.apxtribinstall(initconf);
if (nginxconf.status == 200) {
}
};
if (Setup.check()) Setup.init();
// After testing remove all stuff after this line
Setup.initold = async () => {
// Get standard conf and current data
const townconf = fs.readJsonSync("./nationchains/www/adminapx/townconf.json");
const apxnations = fs.readJsonSync(
@ -45,12 +80,10 @@ Setup.init = async () => {
);
const apxtowns = fs.readJsonSync(`./nationchains/towns/idx/townId_all.json`);
let apxpagans={}
if (fs.existsSync(`./nationchains/pagans/idx/alias_all.json`)){
apxpagans = fs.readJsonSync(
`./nationchains/pagans/idx/alias_all.json`
);
}
let apxpagans = {};
if (fs.existsSync(`./nationchains/pagans/idx/alias_all.json`)) {
apxpagans = fs.readJsonSync(`./nationchains/pagans/idx/alias_all.json`);
}
if (!Object.keys(apxnations).includes(townconf.nationId)) {
console.log(
@ -112,6 +145,16 @@ Setup.init = async () => {
mustache.render(tplnginxconf, townconf),
"utf8"
);
//proxyparam
const proxy_params = fs.readFileSync(
"./nationchains/www/adminapx/nginx/proxy_params.mustache",
"utf8"
);
fs.outputFileSync(
"/etc/nginx/proxy_params",
mustache.render(proxy_params, townconf),
"utf8"
);
const tplnginxwww = fs.readFileSync(
"./nationchains/www/adminapx/nginx/modelwebsite.conf.mustache",
"utf8"
@ -124,8 +167,10 @@ Setup.init = async () => {
fs.outputJsonSync("./nationchains/tribes/conf.json", townconf, {
spaces: 2,
});
// Integrer cette partie du setup en inteactif.
// l'objectif du setup est de rendere accessible adminapx en local (IP local) ou production IP public
//CREATE A TOWN setup local voir utiliser towns.create
townconf.town = {
/* townconf.town = {
townId: townconf.townId,
nationId: townconf.nationId,
url: `http://${townconf.dns[0]}`,
@ -133,9 +178,13 @@ Setup.init = async () => {
mayorid: townconf.mayorId,
status: "unchain",
};
apxtowns[townconf.townId]=townconf.town;
fs.outputJsonSync(`./nationchains/towns/idx/townId_all.json`,apxtowns);
fs.outputJsonSync(`./nationchains/towns/itm/${townconf.townId}.json`,townconf.town,{spaces:2});
apxtowns[townconf.townId] = townconf.town;
fs.outputJsonSync(`./nationchains/towns/idx/townId_all.json`, apxtowns);
fs.outputJsonSync(
`./nationchains/towns/itm/${townconf.townId}.json`,
townconf.town,
{ spaces: 2 }
);
// Create tribe id voir a utiliser tribes.create()
townconf.tribe = {
tribeId: townconf.tribeId,
@ -145,27 +194,47 @@ Setup.init = async () => {
townId: townconf.townId,
};
//tribe does not exist in a new town
apxtribes={}
apxtribes[townconf.tribeId]=townconf.tribe;
fs.outputJsonSync(`./nationchains/tribes/idx/tribeId_all.json`,apxtribes);
fs.outputJsonSync(`./nationchains/tribes/itm/${townconf.tribeId}.json`,townconf.tribe,{spaces:2});
apxtribes = {};
apxtribes[townconf.tribeId] = townconf.tribe;
fs.outputJsonSync(`./nationchains/tribes/idx/tribeId_all.json`, apxtribes);
fs.outputJsonSync(
`./nationchains/tribes/itm/${townconf.tribeId}.json`,
townconf.tribe,
{ spaces: 2 }
);
fs.ensureDirSync(`./nationchains/tribes/${townconf.tribeId}/logs/nginx`);
//CREATE a mayorId pagans if it does not exist
if (!apxpagans[townconf.mayorId]){
const Pagans=require('./Pagans');
const createPagans=await Pagans.createId(townconf.mayorId,townconf.passphrase);
if (createPagans.status==200){
fs.outputFileSync(`./${townconf.mayorId}_PrivateKey.txt`,createPagans.data.privateKey,"utf8");
fs.outputFileSync(`./${townconf.mayorId}_PublicKey.txt`,createPagans.data.publicKey,"utf8");
console.log(`\x1b[43mCut paste your keys /${townconf.mayorId}_PrivateKey.txt /${townconf.mayorId}_PublicKey.txt \x1b[0m`)
}else{
console.log('Error at Pagan creation ');
if (!apxpagans[townconf.mayorId]) {
const Pagans = require("./Pagans");
const createPagans = await Pagans.createId(
townconf.mayorId,
townconf.passphrase
);
if (createPagans.status == 200) {
fs.outputFileSync(
`./${townconf.mayorId}_PrivateKey.txt`,
createPagans.data.privateKey,
"utf8"
);
fs.outputFileSync(
`./${townconf.mayorId}_PublicKey.txt`,
createPagans.data.publicKey,
"utf8"
);
console.log(
`\x1b[43mCut paste your keys /${townconf.mayorId}_PrivateKey.txt /${townconf.mayorId}_PublicKey.txt \x1b[0m`
);
} else {
console.log("Error at Pagan creation ");
console.log(createPagans);
process.exit();
}
}
//restart nginx
}*/
//fin de partie à integer dans l'interface graphique adminapx
//restart nginx
const { exec } = require("child_process");
exec(townconf.nginx.restart, (error, stdout, stderr) => {
if (error) {

118
api/models/Wwws.js Normal file
View File

@ -0,0 +1,118 @@
const fs = require("fs-extra");
const path = require("path");
const dnsSync = require("dns-sync");
const mustache = require("mustache");
const readlineSync = require("readline-sync");
const conf = fs.existsSync("../../nationchains/tribes/conf.json")
? require("../../nationchains/tribes/conf.json")
: {};
const Wwws = {};
Wwws.apxtribinstall = (paramconf) => {
/**
* First install for a setup
*
*/
if (fs.existsSync("../../nationchains/www/nginx_adminapx.conf")) {
console.log("You already have a conf on this town");
process.exit();
}
//first install
const nginxconf = fs.readFileSync(
"../../nationchains/www/adminapx/static/tpl/nginx.conf.mustache",
"utf8"
);
const proxyparams = fs.readFileSync(
"../../nationchains/www/adminapx/static/tpl/nginxproxy_params.mustache",
"utf8"
);
// saved and change nginx conf
if (!fs.existsSync("/etc/nginx/nginxconf.saved")) {
fs.moveSync("/etc/nginx/nginx.conf", "/etc/nginx/nginxconf.saved");
console.log(
"your previous /etc/nginx/nginx.conf was backup in /etc/nginx/nginxconf.saved"
);
}
fs.outputFileSync(
"/etc/nginx/nginx.conf",
mustache.render(nginxconf, paramconf),
"utf8"
);
fs.outputFileSync(
"/etc/nginx/proxy_params",
mustache.render(proxyparams, paramconf),
"utf8"
);
if (!fs.existsSync(paramconf.nginx.logs)) fs.mkdirSync(paramconf.nginx.logs);
paramconf.nginx.firstinstall = true;
fs.outputJsonSync("../../nationchains/tribes/conf.json", paramconf, {
space: 2,
});
return Www.create(paramconf.nginx);
};
Wwws.create = (paramnginx) => {
/**
* Create an nginx conf to make available https://adminapx on a local network
* paramconf nginx.fswww place where the www folder is /tribeId/
*/
const res = {
status: 200,
ref: "Www",
msg: "successfulwww",
data: { website: paramnginx.website },
};
const nginxwebsite = fs.readFileSync(
"../../nationchains/www/adminapx/static/tpl/nginxmodelwebsite.conf.mustache",
"utf8"
);
fs.outputFileSync(
`./${paramnginx.fswww}www/nginx_${paramnginx.website}.conf`,
mustache.render(nginxwebsite, paramnginx),
"utf8"
);
if (!fs.existsSync(`./${paramnginx.fswww}www/${paramnginx.website}`)) {
//See later how to generate specific template of webapp
fs.mkdirSync(`./${paramnginx.fswww}www/${paramnginx.website}`);
}
if (!fs.existsSync(`./${paramnginx.fswww}www/cdn`)) {
//See later how to generate specific template of webapp
fs.mkdirSync(`./${paramnginx.fswww}www/cdn`);
}
//restart nginx
const { exec } = require("child_process");
exec(paramnginx.restart, (error, stdout, stderr) => {
if (error) {
if (paramnginx.firstinstall) {
console.log("\x1b[42m", error, stdout, stderr, "x1b[0m");
}
//@todo supprimer la derniere config et relancer
res.status = 500;
res.msg = "nginxError";
res.data = { msg: `${error}<br>${stdout}<br>${stderr}` };
} else {
if (paramnginx.firstinstall) {
// the tribes/conf.json is saved in apxtribinstall
console.log(
`\x1b[42m###########################################################################################\x1b[0m\n\x1b[42mWellcome into apxtrib, you can now 'yarn dev' for dev or 'yarn startpm2' for prod or \n'yarn unittest' for testing purpose. Access to your town here \x1b[0m\x1b[32mhttp://adminapx\x1b[0m \x1b[42m \nto finish your town setup. Don't forget to set your localhost /etc/hosts by adding 127.0.0.1 adminapx or {LAN IP} adminapx . Check README's project to learn more. \x1b[0m\n\x1b[42m###########################################################################################\x1b[0m`
);
} else {
// add website to tribe conf
}
}
});
return res;
};
Wwws.setssl = () => {
// Run process to change nginx conf to get a ssl
};
Wwws.configlist = (tribeId) => {
//if accessright R return list of conf parameter {webapp:{conf parameter}}
const res = { status: 200, data: {} };
return res;
};
module.exports = Wwws;

View File

@ -1,3 +1,5 @@
{
"successfullcreate": "Alias creation for {{alias}} successfull. {{#withemail}} An email was sent to {{email}}, if you do not receive it, please download your keys before living this page.{{/withemail}}",
"successfulluppdate": "Your alias as a Person is now update into {{tribe}}",
"tribedoesnotexist": "Your tribe {{tribe}} does not exist in this town"
}

View File

@ -33,5 +33,9 @@ router.post( '/push', checkHeaders, ( req, res ) => {
res.send( { status: 200, payload: { moreinfo: fs.readFileSync( `${config.tribes}/${config.mayorId}/nationchains/nodes/${config.rootURL}`, 'utf-8' ) } } )
} )
router.get('/synchro',checkHeaders, isAuthenticated,(req,res)=>{
// run a sync from a list of electedtown to update nationchains folder
console.log('TODO')
})
module.exports = router;

View File

@ -32,6 +32,7 @@ router.get(
* @apiSuccess (200) {object} data contains indexfile requested
*
*/
console.log("pzasse");
// indexname = objectname_key_value.json
let objectLocation = "../../nationchains/";
if (!conf.api.nationObjects.includes(req.params.objectname)) {
@ -42,13 +43,11 @@ router.get(
if (fs.existsSync(indexpath)) {
res.status(200).json({ data: fs.readJsonSync(indexpath) });
} else {
res
.status(404)
.json({
ref: "Odmdb",
msg: "objectfiledoesnotexist",
data: { indexpath },
});
res.status(404).json({
ref: "Odmdb",
msg: "objectfiledoesnotexist",
data: { indexpath },
});
}
}
);
@ -88,13 +87,11 @@ router.get(
if (fs.existsSync(objectpath)) {
res.status(200).json({ data: fs.readJsonSync(objectpath) });
} else {
res
.status(404)
.json({
ref: "Odmdb",
msg: "objectfiledoesnotexist",
data: { objectpath },
});
res.status(404).json({
ref: "Odmdb",
msg: "objectfiledoesnotexist",
data: { objectpath },
});
}
}
);

View File

@ -1,12 +1,13 @@
const express = require( 'express' );
const path = require( 'path' );
const express = require("express");
const path = require("path");
// Classes
const Pagans = require( '../models/Pagans.js' );
const Pagans = require("../models/Pagans.js");
const Notifications = require("../models/Notifications.js");
// Middlewares
const checkHeaders = require( '../middlewares/checkHeaders' );
const isAuthenticated = require( '../middlewares/isAuthenticated' );
const hasAccessrighton = require( '../middlewares/hasAccessrighton' );
const checkHeaders = require("../middlewares/checkHeaders");
const isAuthenticated = require("../middlewares/isAuthenticated");
const hasAccessrighton = require("../middlewares/hasAccessrighton");
const router = express.Router();
/*
models/Pagans.js
@ -47,53 +48,107 @@ Owner means it can be Write/Delete if field OWNER contain the UUID that try to a
*/
router.get('/isregister', checkHeaders, isAuthenticated,(req,res)=>{
/**
* @api {get} /pagans/isregister
* @apiName Is register check xalias and xhash
* @apiGroup Odmdb
*
* @apiUse apxHeader
*
* @apiParam {String} indexname Mandatory if in conf.nationObjects then file is into nationchains/ else in /nationchains/tribes/xtribe/objectname/idx/indexname indexname contains the ObjectName .*_ (before the first _)
*
* @apiError (404) {string} status the file does not exist
* @apiError (404) {string} ref objectmodel to get in the right language
* @apiError (404) {string} msg key to get template from objectmodel
* @apiError (404) {object} data use to pagansmodel: 'Pagans' } );render lg/objectmodel_lg.json
*
* @apiSuccess (200) {object} data contains indexfile requested
*
*/
res.send(Pagans.checkdetachedSignature(req.session.header.xalias,req.session.header.xhash));
router.get("/isauth", checkHeaders, isAuthenticated, (req, res) => {
/**
* @api {get} /pagans/isregister
* @apiName Is register check xalias and xhash
* @apiGroup Pagans
*
* @apiUse apxHeader
*
* @apiError (400) {object} status missingheaders / xalias does not exist / signaturefailled
* @apiError (401) {object} alias anonymous (not authenticated)
* @apiError (404) {string} tribe does not exist
*
*
*
* @apiSuccess (200) {object} data contains indexfile requested
*
*/
res.send({
status: 200,
ref: "headers",
msg: "authenticated",
data: {
xalias: req.session.header.xalias,
},
});
});
router.post("/", checkHeaders, isAuthenticated, (req, res) => {
/**
* Create a pagan account from alias, publickey, if trusted recovery =>
* Create a person in xtribe/person/xalias.json with profil.auth={email,privatekey, passphrase}
* Middleware isAuthenticated check that:
* - xhash is well signed from private key linked to the publickey of alias
* - check that alias does not already exist (if yes then verifiedsigne would be false)
* Need to wait next block chain to be sure that alias is register in the blokchain
*/
console.log("pass ici", req.body);
const feedback = { alias: req.body.alias, publickey: req.body.publickey };
const newpagan = Pagans.create(req.body.alias, req.body.publickey);
if (newpagan.status == 200) {
if (req.body.email) {
feedback.withemail = true;
feedback.email = req.body.email;
feedback.privatekey = req.body.privatekey;
feedback.passphrase = req.body.passphrase;
Notifications.send({
type: "email",
from: "",
dest: [req.body.email],
tpl: "registeremail",
tribe: req.session.header.xtribe,
data: feedback,
});
}
if (req.body.trustedtribe) {
if (req.app.locals.tribeids.includes(req.body.trustedtribe)) {
delete feedback.withemail;
const persondata = { recovery: feedback };
res.send(
Pagans.personupdate(req.body.alias, req.body.trustedtribe, persondata)
);
} else {
res.send({
status: 404,
ref: "Pagans",
msg: "tribedoesnotexist",
data: { tribe: req.body.trustedtribe },
});
}
} else {
newpagan.data = feedback;
res.send(newpagan);
}
} else {
//error to create pagan
res.send(newpagan);
}
});
router.put("/person", checkHeaders, isAuthenticated, (req, res) => {
/**
* add/update a person = alias + tribe with specific accessright and specific schema link to tribe
* @todo add tribe/schema/person.json
*/
console.log(req.body);
res.send(
Pagans.personupdate(req.body.alias, req.session.header.xtribe, req.body)
);
});
router.delete("/:alias", checkHeaders, isAuthenticated, (req, res) => {
console.log(`DELETE pagans nationchains/pagans/${req.params.alias}.json`);
const result = Pagans.delete(req.params.id, req.session.header);
res.status(result.status).send(result.data);
});
res.send({status:200,ref:"headers",msg:"authenticated",data:{xalias:req.session.header.xalias,xtribe:req.session.header.xtribe}})
})
router.post('/', checkHeaders, (req,res)=>{
// create a pagan account from alias, publickey, if trusted recovery={email,privatekey}
console.log(req.body)
} )
router.delete( '/:alias', checkHeaders, isAuthenticated, ( req, res ) => {
console.log( `DELETE pagans nationchains/pagans/${req.params.alias}.json` );
const result = Pagans.delete( req.params.id, req.session.header );
res.status( result.status )
.send( result.data );
} );
router.get( '/isauth', checkHeaders, isAuthenticated, ( req, res ) => {
if( req.session.header.xpseudo == "1" ) {
return res.status( 401 )
.send( { info: "not authenticate" } );
} else return res.status( 200 )
.send( { info: "well authenticated" } )
} )
router.post( '/login', checkHeaders, async ( req, res ) => {
// console.log('POST /users/login with: ', req.app.locals.header);
/*
/*router.get("/isauth", checkHeaders, isAuthenticated, (req, res) => {
if (req.session.header.xpseudo == "1") {
return res.status(401).send({ info: "not authenticate" });
} else return res.status(200).send({ info: "well authenticated" });
});*/
router.post("/login", checkHeaders, async (req, res) => {
// console.log('POST /users/login with: ', req.app.locals.header);
/*
Check un mot de passe pour un login pour obtenir un token d'authentification
valable 1 hour, 1 day
@header
@ -104,21 +159,22 @@ router.post( '/login', checkHeaders, async ( req, res ) => {
utile le temps de reinitialisé son mot de passe.
@return
*/
console.log( 'login for ', req.body, "in", req.session.header )
const log = await Pagans.loginUser( req.session.header, req.body, true );
console.log( "log user login", log );
if( log.status == 200 ) {
// update req.app.locals.tokens for this uuid just after login success then next isAuth will be valid
req.app.locals.tokens[ log.data.user.UUID ] = { TOKEN: log.data.user.TOKEN, ACCESSRIGHTS: log.data.user.ACCESSRIGHTS }
console.log( req.app.locals )
}
return res.status( log.status )
.send( log.data );
} );
console.log("login for ", req.body, "in", req.session.header);
const log = await Pagans.loginUser(req.session.header, req.body, true);
console.log("log user login", log);
if (log.status == 200) {
// update req.app.locals.tokens for this uuid just after login success then next isAuth will be valid
req.app.locals.tokens[log.data.user.UUID] = {
TOKEN: log.data.user.TOKEN,
ACCESSRIGHTS: log.data.user.ACCESSRIGHTS,
};
console.log(req.app.locals);
}
return res.status(log.status).send(log.data);
});
router.get( '/getlinkwithoutpsw/:email', checkHeaders, async ( req, res ) => {
/*
router.get("/getlinkwithoutpsw/:email", checkHeaders, async (req, res) => {
/*
Permet pour un email existant de renvoyer un email avec un lien valable 1h
@email est le compte pour lequel on demande un accès
Réponse:
@ -134,109 +190,161 @@ router.get( '/getlinkwithoutpsw/:email', checkHeaders, async ( req, res ) => {
}
}
*/
console.log( `GET /users/getlinkwithoutpsw for email: ${req.params.email} tribeid :${req.header('X-Client-Id')}` );
if( !req.params.email ) {
return res.status( 404 )
.send( {
info: [ 'emailmissing' ],
model: 'Pagans'
} );
} else {
try {
const getlink = await Pagans.getlinkwithoutpsw( req.params.email, req.session.header );
console.log( 'getlink', getlink )
//met à jour le token créer pour le uuid
req.app.locals.tokens[ getlink.data.info.xuuid ] = getlink.data.info.token;
// attention si on relance le serveur le token temporaire est perdu
return res.status( getlink.status )
.send( getlink.data );
} catch ( err ) {
console.log( err )
}
}
} );
router.post( '/register', checkHeaders, async ( req, res ) => {
console.log( `POST /users for ${req.session.header.xtribe}` );
if( req.session.header.xjwt == '123123' ) {
// Creation d'un utilisateur avec information de base aucun droit
// On modifie le contenu du form pour n egarder que login/email et psw
// pour le client_id permet de traiter un user en attente de validation
console.log( 'req du post', req );
}
} );
router.get( '/info/:listindex', checkHeaders, isAuthenticated, hasAccessrighton( 'users', 'R' ), async ( req, res ) => {
console.log( `get users info on tribeid ${req.session.header.xworkon} for ${req.params.listindex} with accessright`, req.session.header.accessrights.data );
const result = await Pagans.getinfoPagans( req.session.header.xpresworkon, req.session.header.accessrights, req.params.listindex );
res.status( result.status )
.send( result.data );
} );
router.get( '/list/:filter/:field', checkHeaders, isAuthenticated, hasAccessrighton( 'users', 'R' ), async ( req, res ) => {
console.log( 'GET /users/list/filtre/champs list for ' + req.session.header.xworkon );
if(
[ 'admin', 'manager' ].includes( req.session.header.decodetoken[ 'apps' + req.session.header.xworkon + 'profil' ] ) ) {
try {
const userslist = await Pagans.getUserlist( req.session.header, req.params.filter, req.params.field );
console.log( 'userslist', userslist );
if( userslist.status == 200 ) {
return res.status( userslist.status )
.send( userslist.data );
}
} catch ( err ) {
console.log( err );
return res.status( 400 )
.send( { info: 'erreur' } );
}
} else {
res.status( 403 )
.send( {
info: [ 'forbiddenAccess' ],
model: 'Pagans'
} );
}
} );
router.get( '/uuid/:id', checkHeaders, isAuthenticated, hasAccessrighton( 'users', 'R' ), async ( req, res ) => {
console.log( `GET /users/uuid/${req.params.id}` );
//console.log('req.app.locals: ', req.app.locals);
//console.log('req.session', req.session);
const result = await Pagans.getUser( req.params.id, req.session.header.xworkon, req.session.header.accessrights );
res.status( result.status )
.send( result.data );
} );
router.put( '/chgpsw/:id', checkHeaders, isAuthenticated, async ( req, res ) => {
console.log( `PUT update /users/chgpsw/${req.params.id}` );
try {
const majpsw = await Pagans.updateUserpassword( req.params.id, req.session.header, req.body );
res.status( majpsw.status )
.send( majpsw.data );
} catch ( {
status,
data
} ) {
res.status( status )
.send( data );
}
} );
router.post( '/uuid', checkHeaders, isAuthenticated, hasAccessrighton( 'users', 'C' ), async ( req, res ) => {
console.log( 'POST /users create for ' + req.session.header.xworkon, req.body );
const usercreate = await Pagans.createUser( req.session.header, req.body );
return res.status( usercreate.status )
.send( usercreate.data );
} );
router.put( '/uuid/:id', checkHeaders, isAuthenticated, hasAccessrighton( 'users', 'U' ), async ( req, res ) => {
console.log( `PUT update /users/${req.params.id}` );
// console.log('req.app.locals: ', req.app.locals);
// console.log('req.session', req.session);
try {
const majUser = await Pagans.updateUser( req.params.id, req.session.header, req.body );
res.status( majUser.status )
.send( majUser.data );
} catch ( {
status,
data
} ) {
res.status( status )
.send( data );
}
} );
console.log(
`GET /users/getlinkwithoutpsw for email: ${
req.params.email
} tribeid :${req.header("X-Client-Id")}`
);
if (!req.params.email) {
return res.status(404).send({
info: ["emailmissing"],
model: "Pagans",
});
} else {
try {
const getlink = await Pagans.getlinkwithoutpsw(
req.params.email,
req.session.header
);
console.log("getlink", getlink);
//met à jour le token créer pour le uuid
req.app.locals.tokens[getlink.data.info.xuuid] = getlink.data.info.token;
// attention si on relance le serveur le token temporaire est perdu
return res.status(getlink.status).send(getlink.data);
} catch (err) {
console.log(err);
}
}
});
router.post("/register", checkHeaders, async (req, res) => {
console.log(`POST /users for ${req.session.header.xtribe}`);
if (req.session.header.xjwt == "123123") {
// Creation d'un utilisateur avec information de base aucun droit
// On modifie le contenu du form pour n egarder que login/email et psw
// pour le client_id permet de traiter un user en attente de validation
console.log("req du post", req);
}
});
router.get(
"/info/:listindex",
checkHeaders,
isAuthenticated,
hasAccessrighton("users", "R"),
async (req, res) => {
console.log(
`get users info on tribeid ${req.session.header.xworkon} for ${req.params.listindex} with accessright`,
req.session.header.accessrights.data
);
const result = await Pagans.getinfoPagans(
req.session.header.xpresworkon,
req.session.header.accessrights,
req.params.listindex
);
res.status(result.status).send(result.data);
}
);
router.get(
"/list/:filter/:field",
checkHeaders,
isAuthenticated,
hasAccessrighton("users", "R"),
async (req, res) => {
console.log(
"GET /users/list/filtre/champs list for " + req.session.header.xworkon
);
if (
["admin", "manager"].includes(
req.session.header.decodetoken[
"apps" + req.session.header.xworkon + "profil"
]
)
) {
try {
const userslist = await Pagans.getUserlist(
req.session.header,
req.params.filter,
req.params.field
);
console.log("userslist", userslist);
if (userslist.status == 200) {
return res.status(userslist.status).send(userslist.data);
}
} catch (err) {
console.log(err);
return res.status(400).send({ info: "erreur" });
}
} else {
res.status(403).send({
info: ["forbiddenAccess"],
model: "Pagans",
});
}
}
);
router.get(
"/uuid/:id",
checkHeaders,
isAuthenticated,
hasAccessrighton("users", "R"),
async (req, res) => {
console.log(`GET /users/uuid/${req.params.id}`);
//console.log('req.app.locals: ', req.app.locals);
//console.log('req.session', req.session);
const result = await Pagans.getUser(
req.params.id,
req.session.header.xworkon,
req.session.header.accessrights
);
res.status(result.status).send(result.data);
}
);
router.put("/chgpsw/:id", checkHeaders, isAuthenticated, async (req, res) => {
console.log(`PUT update /users/chgpsw/${req.params.id}`);
try {
const majpsw = await Pagans.updateUserpassword(
req.params.id,
req.session.header,
req.body
);
res.status(majpsw.status).send(majpsw.data);
} catch ({ status, data }) {
res.status(status).send(data);
}
});
router.post(
"/uuid",
checkHeaders,
isAuthenticated,
hasAccessrighton("users", "C"),
async (req, res) => {
console.log(
"POST /users create for " + req.session.header.xworkon,
req.body
);
const usercreate = await Pagans.createUser(req.session.header, req.body);
return res.status(usercreate.status).send(usercreate.data);
}
);
router.put(
"/uuid/:id",
checkHeaders,
isAuthenticated,
hasAccessrighton("users", "U"),
async (req, res) => {
console.log(`PUT update /users/${req.params.id}`);
// console.log('req.app.locals: ', req.app.locals);
// console.log('req.session', req.session);
try {
const majUser = await Pagans.updateUser(
req.params.id,
req.session.header,
req.body
);
res.status(majUser.status).send(majUser.data);
} catch ({ status, data }) {
res.status(status).send(data);
}
}
);
module.exports = router;

45
api/routes/wwws.js Normal file
View File

@ -0,0 +1,45 @@
const express = require("express");
const path = require("path");
// Classes
const Wwws = require("../models/Wwws.js");
// Middlewares
const checkHeaders = require("../middlewares/checkHeaders");
const isAuthenticated = require("../middlewares/isAuthenticated");
const hasAccessrighton = require("../middlewares/hasAccessrighton");
const router = express.Router();
/**
* To manage an nginx conf
*
*/
router.get("/tribes/:tribeId", checkHeaders, isAuthenticated, (req, res) => {
/**
* @api {get} /www/tribes/:tribeId
* @apiName Get list of application Name
* @apiGroup Www
*
* @apiUse apxHeader
*
* @apiParam {String} tribeId Mandatory that have to exist in current town and
*
* @apiError (404) {string} status the folder does not exist
* @apiError (404) {string} ref objectmodel to get in the right language
* @apiError (404) {string} msg key to get template from objectmodel
* @apiError (404) {object} data use to www's model: 'Www' } );render lg/objectmodel_lg.json
*
* @apiSuccess (200) {object} data contains liste of www conf of a tribe
*
*/
res.send(Www.configlist(req.params.tribeId));
});
router.post("/:webappname", checkHeaders, isAuthenticated, (req, res) => {
/**
* Create a space web /tribes/www/webappname
*
*
* */
res.send(Wwws.create(req.params.tribeId));
});
module.exports = router;

View File

@ -1,137 +1,146 @@
const fs = require( 'fs-extra' );
const bodyParser = require( 'body-parser' );
const glob = require( 'glob' );
const path = require( 'path' );
const cors = require( 'cors' );
const express = require( 'express' );
const process = require('process');
const fs = require("fs-extra");
const bodyParser = require("body-parser");
const glob = require("glob");
const path = require("path");
const cors = require("cors");
const express = require("express");
const process = require("process");
/*******************************************
SEE https://gitea.ndda.fr/apxtrib/apxtrib/wiki/Devrules
To have a quick understanding and convention before doing deeply in source code
*/
// Global data : add here globale variable that take care between RAM space anf fs access
// to make absolute path with `${__base}relativepath`
global.__base = __dirname +'/';
global.__base = __dirname + "/";
// app.locals.tribeids is defined later in apixtrib.js and allow express app to always have in memory a dynamic of tribeId available in req.app.locals.tribeids
// check setup
if( !fs.existsSync( '/etc/nginx/nginx.conf' ) ) {
console.log( '\x1b[31m Check documentation, nginx have to be installed on this server first, no /etc/nginx/nginx.conf available, install then rerun yarn command.' );
process.exit();
if (!fs.existsSync("/etc/nginx/nginx.conf")) {
console.log(
"\x1b[31m Check documentation, nginx have to be installed on this server first, no /etc/nginx/nginx.conf available, install then rerun yarn command."
);
process.exit();
}
if( !fs.existsSync( './nationchains/tribes/conf.json' ) ) {
// this town is not set
console.log( `\x1b[42m############################################################################################\x1b[0m\n\x1b[42mWellcome into apxtrib, you must first init your town and tribes by a 'yarn setup'. \x1b[0m \n\x1b[42mThen 'yarn dev' or 'yarn startpm2' or 'yarn unittest'. Check README's project to learn more.\x1b[0m\n\x1b[42m############################################################################################\x1b[0m` );
process.exit();
if (!fs.existsSync(`${__base}nationchains/tribes/conf.json`)) {
// this town is not set
console.log(
`\x1b[42m############################################################################################\x1b[0m\n\x1b[42mWellcome into apxtrib, you must first init your town and tribes by a 'yarn setup'. \x1b[0m \n\x1b[42mThen 'yarn dev' or 'yarn startpm2' or 'yarn unittest'. Check README's project to learn more.\x1b[0m\n\x1b[42m############################################################################################\x1b[0m`
);
process.exit();
}
const conf = require( './nationchains/tribes/conf.json' );
const conf = require(`${__base}nationchains/tribes/conf.json`);
// To make public this conf, careffull this localconf will be public, this the only difference between all apxtrib node
const localconf={nationId:conf.nationId,townId:conf.townId,tribeId:conf.tribeId,comment:"Generate by apxtrib.js with minimum of information"};
fs.outputJsonSync('./nationchains/www/adminapx/static/tpldata/conf_en.json',localconf);
// Tribes allow to get local apxtrib instance context
const localconf = {
nationId: conf.nationId,
townId: conf.townId,
tribeId: conf.tribeId,
comment: "Generate by apxtrib.js with minimum of information",
};
fs.outputJsonSync(
`${__base}nationchains/www/adminapx/static/tpldata/setup_en.json`,
localconf
);
// Run main express process
// Each tribe has a context (domain, plugins route, website ) are all describe into idx tribeId_all.json
// {"tribename":{"tribeId":"tribename","dns":[array of domain],"status":"unchain","nationId":"ants","townId":"usbfarm"}}
// dataclient .tribeids [] .DOMs [] .routes (plugins {url:name route:path}) .appname {tribeid:[website]}
//const dataclient = require( './api/models/Tribes' ).init();
const tribelist=fs.readJsonSync(`./nationchains/tribes/idx/tribeId_all.json`);
let doms=conf.dns
let tribeIds=[]
let routes = glob.sync( './api/routes/*.js' )
.map( f => {
return { url: `/${path.basename(f,'.js')}`, route: f }
} );
//routes={url,route} check how to add plugin tribe route
Object.keys(tribelist).forEach(t=>{
tribelist[t].dns.forEach(d=>{
const dm=d.split('.').slice(-2).join('.')
if (!doms.includes(dm)) doms.push(dm)
})
tribeIds.push(t)
})
console.log('Allowed DOMs to access to this apxtrib server: ', doms )
const tribelist = fs.readJsonSync(
`${__base}/nationchains/tribes/idx/tribeId_all.json`
);
let doms = conf.dns; // only dns of town during the init process
let tribeIds = [];
let routes = glob.sync(`${__base}/api/routes/*.js`).map((f) => {
return { url: `/${path.basename(f, ".js")}`, route: f };
});
//routes={url,route} check how to add plugin tribe route later
// keep only the 2 last part (.) of domain name to validate cors with it (generic domain)
Object.keys(tribelist).forEach((t) => {
tribelist[t].dns.forEach((d) => {
const dm = d.split(".").slice(-2).join(".");
if (!doms.includes(dm)) doms.push(dm);
});
tribeIds.push(t);
});
console.log("Allowed DOMs to access to this apxtrib server: ", doms);
const app = express();
Object.keys(conf.api.appset).forEach(p=>{
app.set(p,conf.api.appset[p])
})
// load express parameter from conf
Object.keys(conf.api.appset).forEach((p) => {
app.set(p, conf.api.appset[p]);
});
// To set depending of data form or get size to send
app.use( bodyParser.urlencoded( conf.api.bodyparse.urlencoded ) );
app.use(bodyParser.urlencoded(conf.api.bodyparse.urlencoded));
// To set depending of post put json data size to send
app.use( express.json() )
app.use( bodyParser.json( conf.api.bodyparse.json ) );
app.use(express.json());
app.use(bodyParser.json(conf.api.bodyparse.json));
app.locals.tribeids = tribeIds;
console.log( 'app.locals.tribeids', app.locals.tribeids );
// token will be store in /tmp/token/pseudo_token to check if isauthenticated
// User token authentification and user init user search
/*const datauser = require( './api/models/Pagans' )
.init( dataclient.tribeids );
app.locals.tokens = datauser.tokens;
console.log( 'app.locals.tokens key ', Object.keys( app.locals.tokens ) )
*/
console.log("app.locals.tribeids", app.locals.tribeids);
// Cors management
const corsOptions = {
origin: ( origin, callback ) => {
if( origin === undefined ) {
callback( null, true );
} else if( origin.indexOf( 'chrome-extension' ) > -1 ) {
callback( null, true );
} else {
//console.log( 'origin', origin )
//marchais avant modif eslint const rematch = ( /^https?\:\/\/(.*)\:.*/g ).exec( origin )
const rematch = ( /^https?:\/\/(.*):.*/g )
.exec( origin )
//console.log( rematch )
let tmp = origin.replace( /http.?:\/\//g, '' )
.split( '.' )
origin: (origin, callback) => {
if (origin === undefined) {
callback(null, true);
} else if (origin.indexOf("chrome-extension") > -1) {
callback(null, true);
} else {
//console.log( 'origin', origin )
//marchais avant modif eslint const rematch = ( /^https?\:\/\/(.*)\:.*/g ).exec( origin )
const rematch = /^https?:\/\/(.*):.*/g.exec(origin);
//console.log( rematch )
let tmp = origin.replace(/http.?:\/\//g, "").split(".");
if( rematch && rematch.length > 1 ) tmp = rematch[ 1 ].split( '.' );
//console.log( 'tmp', tmp )
let dom = tmp[ tmp.length - 1 ];
if( tmp.length > 1 ) {
dom = `${tmp[tmp.length-2]}.${tmp[tmp.length-1]}`
}
console.log( `origin: ${origin}, dom:${dom}, CORS allowed? : ${dataclient.DOMs.includes( dom )}` );
if( dataclient.DOMs.includes( dom ) ) {
callback( null, true )
} else {
console.log( `Origin is not allowed by CORS` );
callback( new Error( 'Not allowed by CORS' ) );
}
}
},
exposedHeaders: Object.keys( conf.api.exposedHeaders )
if (rematch && rematch.length > 1) tmp = rematch[1].split(".");
//console.log( 'tmp', tmp )
let dom = tmp[tmp.length - 1];
if (tmp.length > 1) {
dom = `${tmp[tmp.length - 2]}.${tmp[tmp.length - 1]}`;
}
console.log(
`origin: ${origin}, dom:${dom}, CORS allowed? : ${doms.includes(dom)}`
);
if (doms.includes(dom)) {
callback(null, true);
} else {
console.log(`Origin is not allowed by CORS`);
callback(new Error("Not allowed by CORS"));
}
}
},
exposedHeaders: Object.keys(conf.api.exposedHeaders),
};
// CORS
app.use( cors( corsOptions ) );
// Static Routes
app.use(cors(corsOptions));
// Static Routes // try to use nginx route instead in comments
/*app.use( express.static( `${__dirname}/nationchains/tribes/${conf.mayorId}/www/cdn/public`, {
dotfiles: 'allow'
} ) );
*/
//Allow to public access a space dev delivered by apxtrib
// this is just a static open route for dev purpose,
// for production, we'll use a nginx static set to /www/app/appname
/*console.log( `${conf.dnsapxtrib}/space/tribeid/website`, dataclient.appname );
Object.keys( dataclient.appname )
.forEach( cid => {
dataclient.appname[ cid ].forEach( website => {
app.use( `/space/${cid}/${website}`, express.static( `${conf.tribes}/${cid}/spacedev/${website}` ) );
} )
} );
*/
// Routers add any routes from /routes and /plugins
console.log( 'Routes available on this apxtrib instance' );
console.log( routes );
// prefix only use for dev purpose in production a proxy nginx redirect /app/ to node apxtrib
console.log("Routes available on this apxtrib instance");
console.log(routes);
routes.forEach((r) => {
try {
app.use(r.url, require(r.route));
} catch (err) {
console.log(
`\x1b[31m!!! WARNING issue with route ${r.route} from ${r.url} check err if route is key then solve err, if not just be aware that this route won't work on your server. If you are not the maintainer and no turn around please contact the email maintainer.\x1b[0m`
);
console.log("raise err-:", err);
}
});
routes.forEach( r => {
try {
app.use( r.url, require( r.route ) );
} catch ( err ) {
console.log( `\x1b[31m!!! WARNING issue with route ${r.route} from ${r.url} check err if route is key then solve err, if not just be aware that this route won't work on your server. If you are not the maintainer and no turn around please contact the email maintainer.\x1b[0m` )
console.log( 'raise err-:', err );
}
} )
app.listen( conf.api.port, () => {
console.log( `check in your browser that api works http://${conf.dns}:${conf.api.port}` );
} );
console.log( "\x1b[42m\x1b[37m", "Made with love for people's freedom, enjoy !!!", "\x1b[0m" );
app.listen(conf.api.port, () => {
console.log(
`check in your browser that api works http://${conf.dns}:${conf.api.port}`
);
});
console.log(
"\x1b[42m\x1b[37m",
"Made with love for people's freedom, enjoy !!!",
"\x1b[0m"
);

1
electedtown.json Normal file
View File

@ -0,0 +1 @@
["https://wallants.ndda.fr/nations/synchro"]

View File

@ -0,0 +1,11 @@
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
client_max_body_size 10m;
client_body_buffer_size 128k;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffers 32 4k;
proxy_set_header X-NginX-Proxy true;

View File

@ -3,33 +3,38 @@
<head>
<title>setup apXtrib</title>
<link rel="icon" type="image/png" href="cdn/share/logo/favicon.png">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet">
<!-- fontawesome icon cdn -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.1.1/css/all.css">
<!-- fontawesome icon cdn -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.1.1/css/all.css">
<script>
const apxlocal={
headers:{xalias:"anonymous",xhash:"anonymous",xtribe:"devenv", xapp:"smatchapp", xlang:"en" },
firsttimeload:true,
forcereload:true,
tpl:{
title:"<h1>apXtrib </h1><p>Nation:{{nationId}} Town:{{townId}}</p><p><p> Manage an apXtrib</p></p>",
footer:"{{{msg}}}"
const apxlocal = {
headers: { xalias: "anonymous", xhash: "anonymous", xdays: 0, xtribe: "devenv", xapp: "adminapx", xlang: "en" },
firsttimeload: true,
forcereload: true,
tpl: {
title: "<h1>apXtrib </h1><p>Nation:{{nationId}} Town:{{townId}}</p><p><p> Manage an apXtrib</p></p>",
footer: "{{{msg}}}"
},
tpldata:{
footer:{msg:"<p>apXtrib, made with love for people freedom, enjoy!</p>"}
},
object:{}
tpldata: {
footer: { msg: "<p>apXtrib, made with love for people freedom, enjoy!</p>" },
apxmodal: { title: "exemple title", body: "exemple body", actions: [{ btndescription: "hello", onclick: "console.log('hello')" }] }
}
};
// @todo check version control to force a reload with forceload
</script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js"></script>
<script src="static/js/editor.js"></script>
<script src="static/js/openpgp.min.js"></script>
<script src="static/js/mustache.min.js"></script>
<script src="static/js/axios.min.js"></script>
<script src="cdn/share/js/dayjs.min.js"></script>
<script src="cdn/share/js/editor.js"></script>
<script src="cdn/share/js/openpgp.min.js"></script>
<script src="cdn/share/js/mustache.min.js"></script>
<script src="cdn/share/js/axios.min.js"></script>
<script src="static/js/apxtribcli.js"></script>
<script src="static/js/apxpagans.js"></script>
<script src="static/js/apxtribes.js"></script>
<script src="static/js/apxtowns.js"></script>
<script src="static/js/apxapp.js"></script>
<style>
.fakeimg {
@ -38,97 +43,113 @@
}
</style>
</head>
<body>
<div id="apxtitle" class="p-5 bg-primary text-white text-center" apptoload="app.load('apxtitle','title','conf')" add2data tpldata="static/tpldata/conf_en.json">
<h1>apXtrib</h1>
<p> Manage and understand apXtrib back-end</p>
</div>
<nav class="navbar navbar-expand-sm bg-dark navbar-dark">
<div class="container-fluid">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" add2data tpl="static/tpl/listofarticle_en.mustache" onclick="app.load('apxmain','listofarticle','listofarticle')" >Home</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" aria-expanded="false">Pagans</a>
<ul class="dropdown-menu">
<li><a class="dropdown-item" add2data tpl="static/tpl/pagancreate_en.mustache" object="nationchains/pagans/idx/alias_all.json" onclick="app.load('apxmain','pagancreate',{})">Create</a></li>
<li><a class="dropdown-item" add2data tpl="static/tpl/loginout_en.mustache" tpldata="static/tpldata/loginout_en.json" onclick="app.load('apxmain','loginout',{})">Login/Logout</a></li>
<li><hr class="dropdown-divider"></li>
<li><a class="dropdown-item" href="#">Cipher</a></li>
<li><a class="dropdown-item" href="#">AccessRights</a></li>
<li><hr class="dropdown-divider"></li>
<li><a class="dropdown-item" href="#">Wallet management</a></li>
<li><a class="dropdown-item" href="#">Signed Contracts</a></li>
<li><a class="dropdown-item" href="#">NFT generator</a></li>
</ul>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" aria-expanded="false">Mayor's Town</a>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="#">Chain a town</a></li>
<li><a class="dropdown-item" href="#">Create Tribe</a></li>
<li><a class="dropdown-item" href="#">Manage Druids</a></li>
<li><hr class="dropdown-divider"></li>
</ul>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" aria-expanded="false">Druid's Tribe</a>
<ul class="dropdown-menu ">
<li><a class="dropdown-item" tribe="" href="#">Manage Persons</a></li>
<li><a class="dropdown-item" tribe="" href="#">Manage web space</a></li>
<li><a class="dropdown-item" tribe="" href="#">Create Objects</a></li>
<li><a class="dropdown-item" tribe="" href="#">Manage Objects</a></li>
<li><hr class="dropdown-divider"></li>
</ul>
<ul class="dropdown-menu">
<li><a class="dropdown-item" onclick="" href="#">My Tribe nameA</a></li>
<li><a class="dropdown-item" onclick="" href="#">My tribe nameB</a></li>
<div id="apxtitle" class="p-5 bg-primary text-white text-center" apptoload="app.load('apxtitle','title','setup')"
add2data tpldata="static/tpldata/setup_en.json">
<h1>apXtrib</h1>
<p> Manage and understand apXtrib back-end</p>
</div>
<nav class="navbar navbar-expand-sm bg-dark navbar-dark">
<div class="container-fluid">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" add2data tpl="static/tpl/articleslist_en.mustache"
onclick="app.load('apxmain','articleslist','articleslist')"><i class="fa-solid fa-house"></i></a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button"
aria-expanded="false">Articles</a>
<ul class="dropdown-menu">
<li><a class="dropdown-item" add2data tpl="static/tpl/articleeditor_en.mustache"
onclick="app.load('apxmain','articleeditor',{})">Create</a></li>
<li><a class="dropdown-item" href="#">Manage Articles</a></li>
</ul>
</li>
<li class="nav-item dropdown">
<div class="" d-none" add2data object="nationchains/towns/idx/townId_all.json"></div>
<a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button"
aria-expanded="false">Pagan</a>
<ul class="dropdown-menu">
<li><a class="dropdown-item" add2data tpl="static/tpl/pagancreate_en.mustache"
object="nationchains/pagans/idx/alias_all.json"
onclick="app.load('apxmain','pagancreate',pagans.loadtpldata())">Create / Login / Logout</a></li>
<hr class="dropdown-divider">
</li>
<li><a class="dropdown-item" href="#">Cipher/Uncipher</a></li>
<li><a class="dropdown-item" href="#">My messages</a></li>
<li><a class="dropdown-item" href="#">Notifications</a></li>
<li><a class="dropdown-item" href="#">Wallet management</a></li>
<li><a class="dropdown-item" href="#">Signed Contracts</a></li>
</ul>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" aria-expanded="false">Person's Tribe</a>
<a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button"
aria-expanded="false">Mayor's Town</a>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="#">My tribes</a></li>
<li><a class="dropdown-item" href="#">My Profile</a></li>
<li><a class="dropdown-item" href="#">My Objects</a></li>
<li><a class="dropdown-item" href="#">Message</a></li>
<li><hr class="dropdown-divider"></li>
</ul>
<ul class="dropdown-menu">
<li><a class="dropdown-item" onclick="" href="#">My Tribe nameA</a></li>
<li><a class="dropdown-item" onclick="" href="#">My tribe nameB</a></li>
<li><a class="dropdown-item" add2data tpl="static/tpl/townsetup_en.mustache"
onclick="app.load('apxmain','townsetup','setup')">Chain a town</a></li>
<li><a class="dropdown-item" href="#">Create Tribe</a></li>
<li><a class="dropdown-item" href="#">Manage Tribes</a></li>
<li>
<hr class="dropdown-divider">
</li>
</ul>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" aria-expanded="false">DevOp's space</a>
<a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button"
aria-expanded="false">Druid's Tribe</a>
<ul class="dropdown-menu ">
<li><a class="dropdown-item" tribe="" href="#">Manage Persons</a></li>
<li><a class="dropdown-item" tribe="" href="#">Manage web space</a></li>
<li><a class="dropdown-item" tribe="" href="#">NFT generator</a></li>
<li><a class="dropdown-item" tribe="" href="#">Create Objects</a></li>
<li><a class="dropdown-item" tribe="" href="#">Manage Objects</a></li>
<li>
<hr class="dropdown-divider">
</li>
</ul>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button"
aria-expanded="false">Person's Tribe</a>
<ul class="dropdown-menu">
<li><a class="dropdown-item" onclick="" href="#">My Tribe A</a></li>
<li><a class="dropdown-item" onclick="" href="#">My tribe B</a></li>
<li><a class="dropdown-item" onclick="" href="#">My tribe X</a></li>
</ul>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button"
aria-expanded="false">DevOp's space</a>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="#">Odmdb Schema</a></li>
<li><a class="dropdown-item" href="#">Odmdb CRUD</a></li>
<li><a class="dropdown-item" href="#">Host a web app</a></li>
<li><hr class="dropdown-divider"></li>
<li>
<hr class="dropdown-divider">
</li>
</ul>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Utils</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#">Disabled</a>
</li>
</ul>
</div>
</nav>
<div id="apxmain" apptoload="app.load('apxmain','listofarticle','listofarticle')" class="container mt-5">
<div class="d-flex justify-content-center">
<div class="spinner-border" role="status">
<span class="visually-hidden">Loading...</span>
</ul>
</div>
</nav>
<div id="apxmain" apptoload="app.load('apxmain','articleslist','articleslist')" class="container mt-5">
<div class="d-flex justify-content-center">
<div class="spinner-border" role="status">
<span class="visually-hidden">Loading...</span>
</div>
</div>
</div>
</div>
<div id="apxfooter" apptoload="app.load('apxfooter','footer','footer')" class="mt-5 p-4 bg-dark text-white text-center">
</div>
<div id="apxfooter" apptoload="app.load('apxfooter','footer','footer')"
class="mt-5 p-4 bg-dark text-white text-center">
</div>
<div id="apxmodal" add2data tpl="static/tpl/apxmodal_en.mustache"></div>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

View File

@ -0,0 +1,168 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="74.422066mm"
height="39.408447mm"
viewBox="0 0 74.422066 39.408447"
version="1.1"
id="svg5"
inkscape:version="1.2.2 (732a01da63, 2022-12-09, custom)"
sodipodi:docname="planchelogoapXtrib.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview7"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="mm"
showgrid="false"
inkscape:zoom="2.3786088"
inkscape:cx="429.03231"
inkscape:cy="188.5556"
inkscape:window-width="1868"
inkscape:window-height="1141"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="layer1" />
<defs
id="defs2">
<inkscape:path-effect
effect="powerclip"
id="path-effect4281-6"
is_visible="true"
lpeversion="1"
inverse="true"
flatten="false"
hide_clip="false"
message="Utilise la règle de remplissage « fill-rule: evenodd » de la boîte de dialogue &lt;b&gt;Fond et contour&lt;/b&gt; en l'absence de résultat de mise à plat après une conversion en chemin." />
<inkscape:path-effect
effect="powerclip"
id="path-effect4223-1-5"
is_visible="true"
lpeversion="1"
inverse="true"
flatten="false"
hide_clip="false"
message="Utilise la règle de remplissage « fill-rule: evenodd » de la boîte de dialogue &lt;b&gt;Fond et contour&lt;/b&gt; en l'absence de résultat de mise à plat après une conversion en chemin." />
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipath_lpe_path-effect4281-6">
<rect
style="display:none;fill:none;stroke:#000000;stroke-width:2.965;stroke-miterlimit:5"
id="rect12221"
width="3.9103701"
height="17.277628"
x="72.929848"
y="18.71629"
d="m 72.929848,18.71629 h 3.91037 v 17.277627 h -3.91037 z" />
<path
id="lpe_path-effect4281-6"
style="fill:none;stroke:#000000;stroke-width:2.965;stroke-miterlimit:5"
class="powerclip"
d="M 39.612377,7.7145809 H 79.612633 V 47.714838 H 39.612377 Z M 72.929848,18.71629 v 17.277627 h 3.91037 V 18.71629 Z" />
</clipPath>
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipath_lpe_path-effect4223-1-5">
<rect
style="display:none;fill:none;stroke:#000000;stroke-width:0.890744;stroke-miterlimit:5;stroke-dasharray:none;stroke-opacity:1"
id="rect12226"
width="29.109257"
height="29.109257"
x="45.057877"
y="13.160081"
clip-path="none"
d="M 45.057877,13.160081 H 74.167133 V 42.269338 H 45.057877 Z" />
<path
id="lpe_path-effect4223-1-5"
style="fill:none;stroke:#000000;stroke-width:0.890744;stroke-miterlimit:5;stroke-dasharray:none;stroke-opacity:1"
class="powerclip"
d="M 35.399339,3.8513256 H 75.39934 V 43.851326 H 35.399339 Z m 9.658538,9.3087554 V 42.269338 H 74.167133 V 13.160081 Z" />
</clipPath>
</defs>
<g
inkscape:label="Calque 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-33.762223,-52.949721)">
<rect
style="fill:none;fill-opacity:1;stroke:none;stroke-width:0.264999;stroke-miterlimit:5;stroke-dasharray:none;stroke-opacity:1"
id="rect12066-9"
width="74.422066"
height="39.408443"
x="33.685085"
y="52.371716" />
<rect
style="fill:#ffffff;fill-opacity:0.0159938;stroke:none;stroke-width:0.264999;stroke-miterlimit:5;stroke-dasharray:none;stroke-opacity:1"
id="rect12066-6"
width="74.422066"
height="39.408443"
x="33.762222"
y="52.949718"
inkscape:export-filename="../6e81e123/logobglight.svg"
inkscape:export-xdpi="105.58897"
inkscape:export-ydpi="105.58897" />
<path
style="display:block;fill:none;stroke:#ffffff;stroke-width:0.891;stroke-miterlimit:5;stroke-dasharray:none;stroke-opacity:1"
id="rect4221-6"
width="29.109257"
height="29.109257"
x="45.057877"
y="13.160081"
clip-path="url(#clipath_lpe_path-effect4281-6)"
inkscape:path-effect="#path-effect4281-6"
d="M 45.057877,13.160081 H 74.167133 V 42.269338 H 45.057877 Z"
sodipodi:type="rect"
transform="translate(0.7877763,47.235812)" />
<path
style="display:block;fill:none;stroke:#ffffff;stroke-width:0.890744;stroke-miterlimit:5;stroke-dasharray:none;stroke-opacity:1"
id="rect4212-5-3"
width="29.109257"
height="29.109257"
x="40.844711"
y="9.2966976"
clip-path="url(#clipath_lpe_path-effect4223-1-5)"
inkscape:path-effect="#path-effect4223-1-5"
d="M 40.844711,9.2966976 H 69.953968 V 38.405954 H 40.844711 Z"
sodipodi:type="rect"
transform="translate(1.2107703,47.421564)" />
<text
xml:space="preserve"
style="font-size:3.175px;fill:#2e7fc8;fill-opacity:1;stroke-width:0.265;stroke-dasharray:none"
x="48.645107"
y="76.664268"
id="text168-9"
inkscape:highlight-color="#2e7fc8"><tspan
sodipodi:role="line"
id="tspan166-4"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:14.1111px;font-family:Quicksand;-inkscape-font-specification:'Quicksand, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;fill:#2e7fc8;fill-opacity:1;stroke-width:0.265;stroke-dasharray:none"
x="48.645107"
y="76.664268"><tspan
style="fill:#ffffff;fill-opacity:1"
id="tspan12445">ap</tspan><tspan
style="fill:#ffc332;fill-opacity:1"
id="tspan11889-8">X</tspan><tspan
style="fill:#ffffff;fill-opacity:0.985099"
id="tspan12341">trib</tspan></tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:2.82222px;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;fill:#2e7fc8;fill-opacity:1;stroke-width:0.264583"
x="54.550327"
y="82.090439"
id="text168-0-1"><tspan
sodipodi:role="line"
id="tspan166-9-2"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:2.82222px;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;fill:#ffffff;fill-opacity:1;stroke-width:0.264583"
x="54.550327"
y="82.090439">BLOCKCHAIN OF DEMOCRACY</tspan></text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View File

@ -0,0 +1,156 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="74.687065mm"
height="39.673443mm"
viewBox="0 0 74.687065 39.673443"
version="1.1"
id="svg5"
inkscape:version="1.2.2 (732a01da63, 2022-12-09, custom)"
sodipodi:docname="planchelogoapXtrib.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview7"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="mm"
showgrid="false"
inkscape:zoom="2.3786088"
inkscape:cx="429.03231"
inkscape:cy="188.5556"
inkscape:window-width="1868"
inkscape:window-height="1141"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="layer1" />
<defs
id="defs2">
<inkscape:path-effect
effect="powerclip"
id="path-effect4281"
is_visible="true"
lpeversion="1"
inverse="true"
flatten="false"
hide_clip="false"
message="Utilise la règle de remplissage « fill-rule: evenodd » de la boîte de dialogue &lt;b&gt;Fond et contour&lt;/b&gt; en l'absence de résultat de mise à plat après une conversion en chemin." />
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath4219-7">
<rect
style="display:none;fill:none;stroke:#000000;stroke-width:0.890744;stroke-miterlimit:5;stroke-dasharray:none;stroke-opacity:1"
id="rect4221-7"
width="29.109257"
height="29.109257"
x="45.057877"
y="13.160081"
clip-path="none"
d="M 45.057877,13.160081 H 74.167133 V 42.269338 H 45.057877 Z" />
<path
id="lpe_path-effect4223-1"
style="fill:none;stroke:#000000;stroke-width:0.890744;stroke-miterlimit:5;stroke-dasharray:none;stroke-opacity:1"
class="powerclip"
d="M 35.399339,3.8513256 H 75.39934 V 43.851326 H 35.399339 Z m 9.658538,9.3087554 V 42.269338 H 74.167133 V 13.160081 Z" />
</clipPath>
<inkscape:path-effect
effect="powerclip"
id="path-effect4223-1"
is_visible="true"
lpeversion="1"
inverse="true"
flatten="false"
hide_clip="false"
message="Utilise la règle de remplissage « fill-rule: evenodd » de la boîte de dialogue &lt;b&gt;Fond et contour&lt;/b&gt; en l'absence de résultat de mise à plat après une conversion en chemin." />
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath4277">
<rect
style="display:none;fill:none;stroke:#000000;stroke-width:2.965;stroke-miterlimit:5"
id="rect4279"
width="3.9103701"
height="17.277628"
x="72.929848"
y="18.71629"
d="m 72.929848,18.71629 h 3.91037 v 17.277627 h -3.91037 z" />
<path
id="lpe_path-effect4281"
style="fill:none;stroke:#000000;stroke-width:2.965;stroke-miterlimit:5"
class="powerclip"
d="M 39.612377,7.7145809 H 79.612633 V 47.714838 H 39.612377 Z M 72.929848,18.71629 v 17.277627 h 3.91037 V 18.71629 Z" />
</clipPath>
</defs>
<g
inkscape:label="Calque 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-32.764809,-5.0034045)">
<path
style="display:block;fill:none;stroke:#2e7fc8;stroke-width:0.891;stroke-miterlimit:5;stroke-dasharray:none;stroke-opacity:1"
id="rect4221"
width="29.109257"
height="29.109257"
x="45.057877"
y="13.160081"
clip-path="url(#clipPath4277)"
inkscape:path-effect="#path-effect4281"
d="M 45.057877,13.160081 H 74.167133 V 42.269338 H 45.057877 Z"
sodipodi:type="rect" />
<path
style="display:block;fill:none;stroke:#2e7fc8;stroke-width:0.890744;stroke-miterlimit:5;stroke-dasharray:none;stroke-opacity:1"
id="rect4212-5"
width="29.109257"
height="29.109257"
x="40.844711"
y="9.2966976"
clip-path="url(#clipPath4219-7)"
inkscape:path-effect="#path-effect4223-1"
d="M 40.844711,9.2966976 H 69.953968 V 38.405954 H 40.844711 Z"
sodipodi:type="rect"
transform="translate(0.42299389,0.18575204)" />
<text
xml:space="preserve"
style="font-size:3.175px;fill:#2e7fc8;fill-opacity:1;stroke-width:0.265;stroke-dasharray:none"
x="47.857334"
y="29.428459"
id="text168"
inkscape:highlight-color="#2e7fc8"><tspan
sodipodi:role="line"
id="tspan166"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:14.1111px;font-family:Quicksand;-inkscape-font-specification:'Quicksand, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;fill:#2e7fc8;fill-opacity:1;stroke-width:0.265;stroke-dasharray:none"
x="47.857334"
y="29.428459">ap<tspan
style="fill:#ffc332;fill-opacity:1"
id="tspan11889">X</tspan>trib</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:2.82222px;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;fill:#2e7fc8;fill-opacity:1;stroke-width:0.264583"
x="53.762562"
y="34.85463"
id="text168-0"><tspan
sodipodi:role="line"
id="tspan166-9"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:2.82222px;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;fill:#2e7fc8;fill-opacity:1;stroke-width:0.264583"
x="53.762562"
y="34.85463">BLOCKCHAIN OF DEMOCRACY</tspan></text>
<rect
style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:0.264999;stroke-miterlimit:5;stroke-dasharray:none;stroke-opacity:1"
id="rect12066"
width="74.422066"
height="39.408443"
x="32.897308"
y="5.1359038"
inkscape:export-filename="../6e81e123/logobglight.svg"
inkscape:export-xdpi="105.58897"
inkscape:export-ydpi="105.58897" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

@ -4,46 +4,61 @@
"use strict";
var app = app || {};
app.createIdentity=(alias,passphrase="")=>{
if (alias.length<3 || apx.data.object['index_pagans_alias_all'].includes(alias) ){
alert('Please chose another alias')
return;
}
const keys = apx.generateKey(alias,passphrase)
for(let tag of ['inputalias','inputpassphrase']){
document.getElementById(tag).classList.add('disabled')
}
document.getElementById('privatekey').setAttribute("key",keys.privateKey);
document.getElementById('publickey').setAttribute("key",keys.publicKey);
document.getElementById('generatekeys').classList.add('d-none');
document.getElementById('downloadkeys').classList.remove('d-none');
document.getElementById('createId').classList.remove('d-none');
}
app.registerIdentity=()=>{
const data={
alias:document.getElementById('inputalias').value,
privateKey:document.getElementById('privatekey').getAttribute('key'),
publicKey:document.getElementById('publickey').getAttribute('key'),
passphrase:document.getElementById('inputpassphrase').value
}
axios.post('api/pagans',data,apx.data.headers)
.then(rep=>{
// genere authentification headers.xalias, xhash store object.pagans_alias={privateKey, passphrase}; console.log(rep)})
// if check trust add data email recovery axios.post('api/persons,data, apx.data.headers)
app.runapirequest = (destmodalid, axiosreq, modalcontent) => {
/**
* Axios option
* {method: GET POST,...,
* url:'/relativepath'
* data:{anydata to pass}
* responseType:'json'}
*/
if (!modalcontent) {
modalcontent = {
title: "An axios request",
body: "",
actions: [],
};
}
modalcontent.body += JSON.stringify(axiosreq);
console.log(apx.data.headers);
axiosreq.headers = apx.data.headers;
axios(axiosreq)
.then((rep) => {
console.log(rep);
modalcontent.body += "<br>" + JSON.stringify(rep.data);
app.modalmanagement("reqaxios", apx.data.tpl.apxmodal, modalcontent);
})
.catch(err=>{
console.log('sorry',err);
})
}
.catch((err, rep) => {
console.log(err);
modalcontent.title += " - Status :" + err.response.status;
modalcontent.body += JSON.stringify(err.response.data);
app.modalmanagement("reqaxios", apx.data.tpl.apxmodal, modalcontent);
});
};
app.modalmanagement = (modalid, tpl, data, optionmodal) => {
/**
* Pre-request in hatml
* <div id="apxmodal" add2data tpl="static/tpl/apxmodal_en.mustache" ></div>
* data must be online with tpl
* optionmodal see https://getbootstrap.com/docs/5.0/components/modal/
*/
if (!optionmodal)
optionmodal = { backdrop: true, keyboard: true, focus: true };
if (document.getElementById(modalid)) {
document.getElementById(modalid).remove();
}
data.modalid = modalid;
document.getElementById("apxmodal").innerHTML += Mustache.render(tpl, data);
var currentmodal = new bootstrap.Modal(
document.getElementById(modalid),
optionmodal
);
//var currentmodal = bootstrap.Modal.getOrCreateInstance(modalid);
currentmodal.show();
};
app.search = (elt) => {
//@todo get search string from input then return tpldata.listofarticles={"search":[]}
//@todo get search string from input then return tpldata.articleslist={"search":[]}
console.log("A FAIRE");
};
app.downloadlink = (keys, object, prefix) => {
@ -81,14 +96,14 @@ app.downloadlink = (keys, object, prefix) => {
};
app.setupdata = () => {
//todo generate tpldata.listofarticle get html from /static/html
apx.data.tpldata.listofarticle = {
//todo generate tpldata.articleslist get html from /static/html
apx.data.tpldata.articleslist = {
mostread: [{}],
news: [{}],
search: [],
articles: "html",
};
const list = {}
const list = {};
document.querySelectorAll("[add2data]").forEach((e) => {
/** Collect from any tag with add2data url attribute (tpl tpldata object)
* name is the filename :
@ -102,29 +117,31 @@ app.setupdata = () => {
* for object item (/api/odmdb/objectname/itm/primarykey.json) name =objectname_primarykey
*/
if (e.getAttribute('object')){
const url = e.getAttribute('object')
const spliturlobj=url.split("/").slice(-3);
const objectname=spliturlobj[0];
const objecttype=spliturlobj[1];
const objectkey=spliturlobj[2].substring(0,spliturlobj[2].length-5)
if (!list[objectname]) list[objectname]={};
list[objectname][`${objecttype}${objectkey}`]= url;
};
for (let k of ["tpl", "tpldata"]) {
if (e.getAttribute(k)){
const url=e.getAttribute(k);
let localname=url.split('/').slice(-1)[0];
if (url.includes('.mustache')) localname=localname.substring(0,localname.length-12);
if (url.includes('.html') || url.includes('.json') ) localname=localname.substring(0,localname.length-8);
if (!list[k]) list[k]={};
list[k][localname]=url;
}
if (e.getAttribute("object")) {
const url = e.getAttribute("object");
const spliturlobj = url.split("/").slice(-3);
const objectname = spliturlobj[0];
const objecttype = spliturlobj[1];
const objectkey = spliturlobj[2].substring(0, spliturlobj[2].length - 5);
if (!list[objectname]) list[objectname] = {};
list[objectname][`${objecttype}${objectkey}`] = url;
}
});
for (let k of ["tpl", "tpldata"]) {
if (e.getAttribute(k)) {
const url = e.getAttribute(k);
let localname = url.split("/").slice(-1)[0];
if (url.includes(".mustache"))
localname = localname.substring(0, localname.length - 12);
if (url.includes(".html") || url.includes(".json"))
localname = localname.substring(0, localname.length - 8);
if (!list[k]) list[k] = {};
list[k][localname] = url;
}
}
});
// load external template and data
for (let k of Object.keys(list) ) {
for (let k of Object.keys(list)) {
console.log(k, list[k]);
apx.loadfile(list[k], k);
}
@ -132,21 +149,21 @@ app.setupdata = () => {
if (apx.data.firsttimeload) {
// Need to wait the first time apx.data fully load
setTimeout(() => {
app.setuppage();
}, 300);
app.setuppage();
}, 500);
delete apx.data.firsttimeload;
apx.save();
}else{
} else {
app.setuppage();
}
};
app.load = (idtoload, tplname, tpldata) => {
const tpl = apx.data.tpl[tplname]
? apx.data.tpl[tplname]
: `missing template ${tplname}`;
const data = typeof tpldata == "string" ? apx.data.tpldata[tpldata] : tpldata;
document.getElementById(idtoload).innerHTML = Mustache.render(tpl, data);
};
const tpl = apx.data.tpl[tplname]
? apx.data.tpl[tplname]
: `missing template ${tplname}`;
const data = typeof tpldata == "string" ? apx.data.tpldata[tpldata] : tpldata;
document.getElementById(idtoload).innerHTML = Mustache.render(tpl, data);
};
app.setuppage = () => {
// load partial template
document.querySelectorAll("[apptoload]").forEach((e) => {

View File

@ -0,0 +1,232 @@
/*eslint no-undef:0*/
/*eslint-env browser*/
"use strict";
var pagans = pagans || {};
/**
* pagans.generateKey(params) create a public/private key compatible with apXtrib backend and store it in apx.data
* pagans.detachedSignature(params) generate a detachedSignature for a Message that backend can check with the publicKey of the alias
* pagans.checkdetachedSignature(params) check a detachedSignature for a Message (used on the backend as well)
*
*
*/
pagans.loadtpldata = () => {
// adapte tpldata to template tpl
// get list of tribes from nationchains/towns/idx/townId_all.json
const datacreatepagan = { tribes: [] };
apx.data.towns.idxtownId_all[apx.data.tpldata.setup.townId].tribes.forEach(
(t) => {
if (t == apx.data.tpldata.setup.tribeId) {
datacreatepagan.tribes.push({ selected: true, tribeId: t });
} else {
datacreatepagan.tribes.push({ tribeId: t });
}
}
);
return datacreatepagan;
};
pagans.generateKey = async (alias, passphrase) => {
/**
* @param {string} alias a unique alias that identify an identity
* @param {string} passphrase a string to cipher the publicKey (can be empty, less secure but simpler)
* @return {publicKey,privateKey} with userIds = [{alias}]
*/
const pgpparam = {
type: "ecc", // Type of the key, defaults to ECC
curve: "curve25519", // ECC curve name, defaults to curve25519
userIDs: [{ alias: alias }], // you can pass multiple user IDs
passphrase: passphrase, // protects the private key
format: "armored", // output key format, defaults to 'armored' (other options: 'binary' or 'object')
};
const { privateKey, publicKey } = await openpgp.generateKey(pgpparam);
// key start by '-----BEGIN PGP PRIVATE KEY BLOCK ... '
// get liste of alias:pubklickey await axios.get('api/v0/pagans')
// check alias does not exist
return { alias, privateKey, publicKey };
};
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 });
let privateKey;
if (passphrase == "") {
privateKey = await openpgp.readPrivateKey({ armoredKey: privK });
} else {
privateKey = await openpgp.decryptKey({
privateKey: await openpgp.readPrivateKey({ armoredKey: privK }),
passphrase,
});
}
console.log(message);
const msg = await openpgp.createMessage({ text: message });
console.log(msg);
const sig = await openpgp.sign({
message: msg,
signingKeys: privateKey,
detached: true,
});
return btoa(sig);
};
pagans.authenticatedetachedSignature = async (
alias,
pubK,
detachedSignature,
message
) => {
/**
* Check that alias (pubkey) signe a message
* @alias {string} alias link to the publicKey
* @pubK {string} publiKey text format
* @detachedSignature {string} a detachedsignatured get from apx.detachedSignature
* @message {string} the message signed
* @return {boolean} true the message was signed by alias
* false the message was not signed by alias
*/
const publicKey = await openpgp.readKey({ armoredKey: pubK });
const msg = await openpgp.createMessage({ text: message });
const signature = await openpgp.readSignature({
armoredSignature: atob(detachedSignature), // parse detached signature
});
const verificationResult = await openpgp.verify({
msg, // Message object
signature,
verificationKeys: publicKey,
});
const { verified, keyID } = verificationResult.signatures[0];
try {
await verified; // throws on invalid signature
console.log("Signed by key id " + keyID.toHex());
return KeyId.toHex().alias == alias;
} catch (e) {
console.log("Signature could not be verified: " + e.message);
return false;
}
};
pagans.createIdentity = async (alias, passphrase = "") => {
console.log(Object.keys(apx.data.pagans["idxalias_all"]));
if (
alias.length < 3 ||
Object.keys(apx.data.pagans["idxalias_all"]).includes(alias)
) {
alert("Please chose another alias");
return;
}
const keys = await pagans.generateKey(alias, passphrase);
for (let tag of ["inputalias", "inputpassphrase"]) {
document.getElementById(tag).classList.add("disabled");
}
console.log(keys);
document.getElementById("privatekey").setAttribute("key", keys.privateKey);
document.getElementById("publickey").setAttribute("key", keys.publicKey);
document.getElementById("generatekeys").classList.add("d-none");
document.getElementById("trustintribe").classList.remove("d-none");
document.getElementById("downloadkeys").classList.remove("d-none");
document.getElementById("createId").classList.remove("d-none");
};
pagans.registerIdentity = async () => {
const emailregex =
/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
const data = {};
data.alias = document.getElementById("inputalias").value;
data.publickey = document.getElementById("publickey").getAttribute("key");
if (document.getElementById("inputemailrecovery").value != "") {
data.email = document.getElementById("inputemailrecovery").value;
}
if (data.email && !emailregex.test(data.email)) {
alert("Check your email");
return false;
}
var select = document.getElementById("trustedtribe");
if (document.getElementById("trustedcheck").checked) {
data.trustedtribe = select.options[select.selectedIndex].value;
data.privatekey = document.getElementById("privatekey").getAttribute("key");
data.passphrase = document.getElementById("inputpassphrase").value;
}
if (document.getElementById("trustedcheck").checked && !data.email) {
alert("Please provide a valid email");
return false;
}
console.log(data);
//store and create authentification by signing 'alias_timestamp'
/* const passp = data.passphrase ? data.passphrase : "";
apx.data.auth = {
alias: data.alias,
publickey: data.publickey,
privatekey: document.getElementById("privatekey").getAttribute("key"),
passphrase: passp,
};
apx.data.headers.xalias = data.alias;
apx.data.headers.xdays = dayjs().valueOf();
apx.save();
const msg = `${data.alias}_${apx.data.headers.xdays}`;
apx.data.headers.xhash = await pagans.detachedSignature(
apx.data.auth.publickey,
apx.data.auth.privatekey,
passp,
msg
);
apx.save();*/
await pagans.authentifyme(
data.alias,
data.passphrase,
document.getElementById("privatekey").getAttribute("key"),
document.getElementById("publickey").getAttribute("key")
);
console.log("header", apx.data.headers);
axios
.post("api/pagans", data, { headers: apx.data.headers })
.then((reppagan) => {
console.log(reppagan);
})
.catch((err) => {
console.log("sorry", err);
});
};
pagans.authentifyme = async (
alias,
passphrase,
privatekey,
publickeycreate
) => {
/**
* Set apx.data.auth with pub, priv, passphrase alias that allow authentification
* set headers with xdays (timestamp) and xhash of message: {alias}_{timestamp} generate with pub & priv key
*
* @Param {key} publickeycreate optional when alias does not exist
*/
console.log(alias, passphrase);
console.log(privatekey);
const passp = passphrase ? passphrase : "";
const publickey = publickeycreate
? publickeycreate
: apx.data.pagans.idxalias_all[alias].publicKey;
apx.data.auth = {
alias: alias,
publickey: publickey,
privatekey: privatekey,
passphrase: passp,
};
apx.data.headers.xalias = alias;
apx.data.headers.xdays = dayjs().valueOf();
apx.save();
const msg = `${alias}_${apx.data.headers.xdays}`;
apx.data.headers.xhash = await pagans.detachedSignature(
apx.data.auth.publickey,
apx.data.auth.privatekey,
passp,
msg
);
apx.save();
};

View File

@ -21,93 +21,12 @@ var apx = apx || {};
},
objects:{}
};
* apx.generateKey(params) create a public/private key compatible with apXtrib backend and store it in apx.data
* apx.detachedSignature(params) generate a detachedSignature for a Message that backend can check with the publicKey of the alias
* apx.checkdetachedSignature(params) check a detachedSignature for a Message (used on the backend as well)
* apx.ready(callback) equivalent of jquery Document.ready()
* apx.save() save apx.data as xapp value in localStorage
* apx.update() get localStorage up to date
* apx.loadfile({url:name},dest,axiosoptions) async that wait to load a list of relativ url and store it in a apx.data[dest]
*/
apx.generateKey = async (alias, passphrase) => {
/**
* @param {string} alias a unique alias that identify an identity
* @param {string} passphrase a string to cipher the publicKey (can be empty, less secure but simpler)
* @return {publicKey,privateKey} with userIds = [{alias}]
*/
const { privateKey, publicKey } = await openpgp.generateKey({
type: "ecc", // Type of the key, defaults to ECC
curve: "curve25519", // ECC curve name, defaults to curve25519
userIDs: [{ alias: alias }], // you can pass multiple user IDs
passphrase: passphrase, // protects the private key
format: "armored", // output key format, defaults to 'armored' (other options: 'binary' or 'object')
});
// key start by '-----BEGIN PGP PRIVATE KEY BLOCK ... '
// get liste of alias:pubklickey await axios.get('api/v0/pagans')
// check alias does not exist
return { alias, privateKey, publicKey };
/* document.getElementById('privatekey').innerHTML=privateKey;
document.getElementById('publickey').innerHTML=publicKey;
apx.data.pagans={}
apx.data.pagans.privateKey=privateKey;
apx.data.pagans.publicKey=publicKey;
apx.save();
console.log(apx.data)
*/
};
apx.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 });
const privateKey = await openpgp.decryptKey({
privateKey: await openpgp.readPrivateKey({ armoredKey: privK }),
passphrase,
});
const msg = await openpgp.createMessage({ text: message });
return await openpgp.sign({ msg, signinKeys: privK, detached: true });
};
apx.checkdetachedSignature = async (
alias,
pubK,
detachedSignature,
message
) => {
/**
* @alias {string} alias link to the publicKey
* @pubK {string} publiKey text format
* @detachedSignature {string} a detachedsignatured get from apx.detachedSignature
* @message {string} the message signed
* @return {boolean} true the message was signed by alias
* false the message was not signed by alias
*/
const publicKey = await openpgp.readKey({ armoredKey: pubK });
const msg = await openpgp.createMessage({ text: message });
const signature = await openpgp.readSignature({
armoredSignature: detachedSignature, // parse detached signature
});
const verificationResult = await openpgp.verify({
msg, // Message object
signature,
verificationKeys: publicKey
});
const { verified, keyID } = verificationResult.signatures[0];
try {
await verified; // throws on invalid signature
console.log("Signed by key id " + keyID.toHex());
return KeyId.toHex().alias == alias;
} catch (e) {
console.log("Signature could not be verified: " + e.message);
return false;
}
};
apx.ready = (callback) => {
/**
* Wait loading DOM, when ready run callback function
@ -156,13 +75,17 @@ apx.loadfile = async (list, dest, axiosoptions) => {
};
const urls = Object.keys(invertlist);
if (!axiosoptions) {
// force no cache browser
apx.data.headers["Cache-Control"] = "no-cache";
apx.data.headers["Pragma"] = "no-cache";
apx.data.headers["Expires"] = 0;
axiosoptions = { headers: apx.data.headers };
}
console.log('axiosiptions',axiosoptions)
console.log("axiosiptions", axiosoptions);
const promiseArray = urls.map((r) => fetchURL(r, axiosoptions));
await Promise.all(promiseArray)
.then((data) => {
console.log(data)
console.log(data);
for (let pos = 0; pos < urls.length; pos++) {
//console.log( 'url', urls[ pos ] )
//console.log( data[ pos ] );

View File

@ -0,0 +1,93 @@
Copyright 2011 The Quicksand Project Authors (https://github.com/andrew-paglinawan/QuicksandFamily), with Reserved Font Name “Quicksand”.
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.

View File

@ -0,0 +1,67 @@
Quicksand Variable Font
=======================
This download contains Quicksand as both a variable font and static fonts.
Quicksand is a variable font with this axis:
wght
This means all the styles are contained in a single file:
Quicksand-VariableFont_wght.ttf
If your app fully supports variable fonts, you can now pick intermediate styles
that arent available as static fonts. Not all apps support variable fonts, and
in those cases you can use the static font files for Quicksand:
static/Quicksand-Light.ttf
static/Quicksand-Regular.ttf
static/Quicksand-Medium.ttf
static/Quicksand-SemiBold.ttf
static/Quicksand-Bold.ttf
Get started
-----------
1. Install the font files you want to use
2. Use your app's font picker to view the font family and all the
available styles
Learn more about variable fonts
-------------------------------
https://developers.google.com/web/fundamentals/design-and-ux/typography/variable-fonts
https://variablefonts.typenetwork.com
https://medium.com/variable-fonts
In desktop apps
https://theblog.adobe.com/can-variable-fonts-illustrator-cc
https://helpx.adobe.com/nz/photoshop/using/fonts.html#variable_fonts
Online
https://developers.google.com/fonts/docs/getting_started
https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Fonts/Variable_Fonts_Guide
https://developer.microsoft.com/en-us/microsoft-edge/testdrive/demos/variable-fonts
Installing fonts
MacOS: https://support.apple.com/en-us/HT201749
Linux: https://www.google.com/search?q=how+to+install+a+font+on+gnu%2Blinux
Windows: https://support.microsoft.com/en-us/help/314960/how-to-install-or-remove-a-font-in-windows
Android Apps
https://developers.google.com/fonts/docs/android
https://developer.android.com/guide/topics/ui/look-and-feel/downloadable-fonts
License
-------
Please read the full license text (OFL.txt) to understand the permissions,
restrictions and requirements for usage, redistribution, and modification.
You can use them in your products & projects print or digital,
commercial or otherwise.
This isn't legal advice, please consider consulting a lawyer and see the full
license for all details.

View File

@ -0,0 +1,93 @@
Copyright 2011 The Questrial Project Authors (https://github.com/googlefonts/questrial)
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.

View File

@ -0,0 +1,5 @@
# Font Squirrel Font-face Generator Configuration File
# Upload this file to the generator to recreate the settings
# you used to create these fonts.
{"mode":"optimal","formats":["woff","woff2"],"tt_instructor":"default","fix_gasp":"xy","fix_vertical_metrics":"Y","metrics_ascent":"","metrics_descent":"","metrics_linegap":"","add_spaces":"Y","add_hyphens":"Y","fallback":"none","fallback_custom":"100","options_subset":"basic","subset_custom":"","subset_custom_range":"","subset_ot_features_list":"","css_stylesheet":"stylesheet.css","filename_suffix":"-webfont","emsquare":"2048","spacing_adjustment":"0"}

View File

@ -0,0 +1,706 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
(function($) {
$.fn.easyTabs = function(option) {
var param = jQuery.extend({ fadeSpeed: 'fast', defaultContent: 1, activeClass: 'active' }, option);
$(this).each(function() {
var thisId = '#' + this.id;
if ( param.defaultContent == '' )
{
param.defaultContent = 1;
}
if ( typeof param.defaultContent == 'number' )
{
var defaultTab = $(thisId + ' .tabs li:eq(' + (param.defaultContent - 1) + ') a').attr('href').substr(1);
}
else
{
var defaultTab = param.defaultContent;
}
$(thisId + ' .tabs li a').each(function() {
var tabToHide = $(this).attr('href').substr(1);
$('#' + tabToHide).addClass('easytabs-tab-content');
});
hideAll();
changeContent(defaultTab);
function hideAll() {$(thisId + ' .easytabs-tab-content').hide();}
function changeContent(tabId)
{
hideAll();
$(thisId + ' .tabs li').removeClass(param.activeClass);
$(thisId + ' .tabs li a[href=#' + tabId + ']').closest('li').addClass(param.activeClass);
if ( param.fadeSpeed != 'none' )
{
$(thisId + ' #' + tabId).fadeIn(param.fadeSpeed);
}
else
{
$(thisId + ' #' + tabId).show();
}
}
$(thisId + ' .tabs li').click(function() {
var tabId = $(this).find('a').attr('href').substr(1);
changeContent(tabId);
return false;
});
});
}
})(jQuery);
</script>
<link rel="stylesheet" href="specimen_files/specimen_stylesheet.css" type="text/css" charset="utf-8"/>
<link rel="stylesheet" href="stylesheet.css" type="text/css" charset="utf-8"/>
<style type="text/css">
body {
font-family: 'questrialregular';
}
</style>
<title>Questrial Regular Specimen</title>
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
$('#container').easyTabs({ defaultContent: 1 });
});
</script>
</head>
<body>
<div id="container">
<div id="header">
Questrial Regular </div>
<ul class="tabs">
<li><a href="#specimen">Specimen</a></li>
<li><a href="#layout">Sample Layout</a></li>
<li><a href="#glyphs">Glyphs &amp; Languages</a></li>
<li><a href="#installing">Installing Webfonts</a></li>
</ul>
<div id="main_content">
<div id="specimen">
<div class="section">
<div class="grid12 firstcol">
<div class="huge">AaBb</div>
</div>
</div>
<div class="section">
<div class="glyph_range">A&#x200B;B&#x200b;C&#x200b;D&#x200b;E&#x200b;F&#x200b;G&#x200b;H&#x200b;I&#x200b;J&#x200b;K&#x200b;L&#x200b;M&#x200b;N&#x200b;O&#x200b;P&#x200b;Q&#x200b;R&#x200b;S&#x200b;T&#x200b;U&#x200b;V&#x200b;W&#x200b;X&#x200b;Y&#x200b;Z&#x200b;a&#x200b;b&#x200b;c&#x200b;d&#x200b;e&#x200b;f&#x200b;g&#x200b;h&#x200b;i&#x200b;j&#x200b;k&#x200b;l&#x200b;m&#x200b;n&#x200b;o&#x200b;p&#x200b;q&#x200b;r&#x200b;s&#x200b;t&#x200b;u&#x200b;v&#x200b;w&#x200b;x&#x200b;y&#x200b;z&#x200b;1&#x200b;2&#x200b;3&#x200b;4&#x200b;5&#x200b;6&#x200b;7&#x200b;8&#x200b;9&#x200b;0&#x200b;&amp;&#x200b;.&#x200b;,&#x200b;?&#x200b;!&#x200b;&#64;&#x200b;(&#x200b;)&#x200b;#&#x200b;$&#x200b;%&#x200b;*&#x200b;+&#x200b;-&#x200b;=&#x200b;:&#x200b;;</div>
</div>
<div class="section">
<div class="grid12 firstcol">
<table class="sample_table">
<tr>
<td>10</td>
<td class="size10">abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ</td>
</tr>
<tr>
<td>11</td>
<td class="size11">abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ</td>
</tr>
<tr>
<td>12</td>
<td class="size12">abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ</td>
</tr>
<tr>
<td>13</td>
<td class="size13">abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ</td>
</tr>
<tr>
<td>14</td>
<td class="size14">abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ</td>
</tr>
<tr>
<td>16</td>
<td class="size16">abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ</td>
</tr>
<tr>
<td>18</td>
<td class="size18">abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ</td>
</tr>
<tr>
<td>20</td>
<td class="size20">abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ</td>
</tr>
<tr>
<td>24</td>
<td class="size24">abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ</td>
</tr>
<tr>
<td>30</td>
<td class="size30">abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ</td>
</tr>
<tr>
<td>36</td>
<td class="size36">abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ</td>
</tr>
<tr>
<td>48</td>
<td class="size48">abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ</td>
</tr>
<tr>
<td>60</td>
<td class="size60">abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ</td>
</tr>
<tr>
<td>72</td>
<td class="size72">abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ</td>
</tr>
<tr>
<td>90</td>
<td class="size90">abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ</td>
</tr>
</table>
</div>
</div>
<div class="section" id="bodycomparison">
<div id="xheight">
<div class="fontbody">&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;&#x25FC;body</div>
<div class="arialbody">body</div>
<div class="verdanabody">body</div>
<div class="georgiabody">body</div>
</div>
<div class="fontbody" style="z-index:1">
body<span>Questrial Regular</span>
</div>
<div class="arialbody" style="z-index:1">
body<span>Arial</span>
</div>
<div class="verdanabody" style="z-index:1">
body<span>Verdana</span>
</div>
<div class="georgiabody" style="z-index:1">
body<span>Georgia</span>
</div>
</div>
<div class="section psample psample_row1" id="">
<div class="grid2 firstcol">
<p class="size10"><span>10.</span>Aenean lacinia bibendum nulla sed consectetur. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla vitae elit libero, a pharetra augue.</p>
</div>
<div class="grid3">
<p class="size11"><span>11.</span>Aenean lacinia bibendum nulla sed consectetur. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla vitae elit libero, a pharetra augue.</p>
</div>
<div class="grid3">
<p class="size12"><span>12.</span>Aenean lacinia bibendum nulla sed consectetur. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla vitae elit libero, a pharetra augue.</p>
</div>
<div class="grid4">
<p class="size13"><span>13.</span>Aenean lacinia bibendum nulla sed consectetur. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla vitae elit libero, a pharetra augue.</p>
</div>
<div class="white_blend"></div>
</div>
<div class="section psample psample_row2" id="">
<div class="grid3 firstcol">
<p class="size14"><span>14.</span>Aenean lacinia bibendum nulla sed consectetur. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla vitae elit libero, a pharetra augue.</p>
</div>
<div class="grid4">
<p class="size16"><span>16.</span>Aenean lacinia bibendum nulla sed consectetur. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla vitae elit libero, a pharetra augue.</p>
</div>
<div class="grid5">
<p class="size18"><span>18.</span>Aenean lacinia bibendum nulla sed consectetur. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla vitae elit libero, a pharetra augue.</p>
</div>
<div class="white_blend"></div>
</div>
<div class="section psample psample_row3" id="">
<div class="grid5 firstcol">
<p class="size20"><span>20.</span>Aenean lacinia bibendum nulla sed consectetur. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla vitae elit libero, a pharetra augue.</p>
</div>
<div class="grid7">
<p class="size24"><span>24.</span>Aenean lacinia bibendum nulla sed consectetur. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla vitae elit libero, a pharetra augue.</p>
</div>
<div class="white_blend"></div>
</div>
<div class="section psample psample_row4" id="">
<div class="grid12 firstcol">
<p class="size30"><span>30.</span>Aenean lacinia bibendum nulla sed consectetur. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla vitae elit libero, a pharetra augue.</p>
</div>
<div class="white_blend"></div>
</div>
<div class="section psample psample_row1 fullreverse">
<div class="grid2 firstcol">
<p class="size10"><span>10.</span>Aenean lacinia bibendum nulla sed consectetur. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla vitae elit libero, a pharetra augue.</p>
</div>
<div class="grid3">
<p class="size11"><span>11.</span>Aenean lacinia bibendum nulla sed consectetur. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla vitae elit libero, a pharetra augue.</p>
</div>
<div class="grid3">
<p class="size12"><span>12.</span>Aenean lacinia bibendum nulla sed consectetur. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla vitae elit libero, a pharetra augue.</p>
</div>
<div class="grid4">
<p class="size13"><span>13.</span>Aenean lacinia bibendum nulla sed consectetur. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla vitae elit libero, a pharetra augue.</p>
</div>
<div class="black_blend"></div>
</div>
<div class="section psample psample_row2 fullreverse">
<div class="grid3 firstcol">
<p class="size14"><span>14.</span>Aenean lacinia bibendum nulla sed consectetur. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla vitae elit libero, a pharetra augue.</p>
</div>
<div class="grid4">
<p class="size16"><span>16.</span>Aenean lacinia bibendum nulla sed consectetur. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla vitae elit libero, a pharetra augue.</p>
</div>
<div class="grid5">
<p class="size18"><span>18.</span>Aenean lacinia bibendum nulla sed consectetur. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla vitae elit libero, a pharetra augue.</p>
</div>
<div class="black_blend"></div>
</div>
<div class="section psample fullreverse psample_row3" id="">
<div class="grid5 firstcol">
<p class="size20"><span>20.</span>Aenean lacinia bibendum nulla sed consectetur. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla vitae elit libero, a pharetra augue.</p>
</div>
<div class="grid7">
<p class="size24"><span>24.</span>Aenean lacinia bibendum nulla sed consectetur. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla vitae elit libero, a pharetra augue.</p>
</div>
<div class="black_blend"></div>
</div>
<div class="section psample fullreverse psample_row4" id="" style="border-bottom: 20px #000 solid;">
<div class="grid12 firstcol">
<p class="size30"><span>30.</span>Aenean lacinia bibendum nulla sed consectetur. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla vitae elit libero, a pharetra augue.</p>
</div>
<div class="black_blend"></div>
</div>
</div>
<div id="layout">
<div class="section">
<div class="grid12 firstcol">
<h1>Lorem Ipsum Dolor</h1>
<h2>Etiam porta sem malesuada magna mollis euismod</h2>
<p class="byline">By <a href="#link">Aenean Lacinia</a></p>
</div>
</div>
<div class="section">
<div class="grid8 firstcol">
<p class="large">Donec sed odio dui. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. </p>
<h3>Pellentesque ornare sem</h3>
<p>Maecenas sed diam eget risus varius blandit sit amet non magna. Maecenas faucibus mollis interdum. Donec ullamcorper nulla non metus auctor fringilla. Nullam id dolor id nibh ultricies vehicula ut id elit. Nullam id dolor id nibh ultricies vehicula ut id elit. </p>
<p>Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. </p>
<p>Nulla vitae elit libero, a pharetra augue. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Aenean lacinia bibendum nulla sed consectetur. </p>
<p>Nullam quis risus eget urna mollis ornare vel eu leo. Nullam quis risus eget urna mollis ornare vel eu leo. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec ullamcorper nulla non metus auctor fringilla. </p>
<h3>Cras mattis consectetur</h3>
<p>Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Aenean lacinia bibendum nulla sed consectetur. Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Cras mattis consectetur purus sit amet fermentum. </p>
<p>Nullam id dolor id nibh ultricies vehicula ut id elit. Nullam quis risus eget urna mollis ornare vel eu leo. Cras mattis consectetur purus sit amet fermentum.</p>
</div>
<div class="grid4 sidebar">
<div class="box reverse">
<p class="last">Nullam quis risus eget urna mollis ornare vel eu leo. Donec ullamcorper nulla non metus auctor fringilla. Cras mattis consectetur purus sit amet fermentum. Sed posuere consectetur est at lobortis. Lorem ipsum dolor sit amet, consectetur adipiscing elit. </p>
</div>
<p class="caption">Maecenas sed diam eget risus varius.</p>
<p>Vestibulum id ligula porta felis euismod semper. Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Vestibulum id ligula porta felis euismod semper. Sed posuere consectetur est at lobortis. Maecenas sed diam eget risus varius blandit sit amet non magna. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. </p>
<p>Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Aenean lacinia bibendum nulla sed consectetur. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Aenean lacinia bibendum nulla sed consectetur. Nullam quis risus eget urna mollis ornare vel eu leo. </p>
<p>Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec ullamcorper nulla non metus auctor fringilla. Maecenas faucibus mollis interdum. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. </p>
</div>
</div>
</div>
<div id="glyphs">
<div class="section">
<div class="grid12 firstcol">
<h1>Language Support</h1>
<p>The subset of Questrial Regular in this kit supports the following languages:<br/>
Albanian, Basque, Breton, Chamorro, Danish, Dutch, English, Faroese, Finnish, French, Frisian, Galician, German, Icelandic, Italian, Malagasy, Norwegian, Portuguese, Spanish, Alsatian, Aragonese, Arapaho, Arrernte, Asturian, Aymara, Bislama, Cebuano, Corsican, Fijian, French_creole, Genoese, Gilbertese, Greenlandic, Haitian_creole, Hiligaynon, Hmong, Hopi, Ibanag, Iloko_ilokano, Indonesian, Interglossa_glosa, Interlingua, Irish_gaelic, Jerriais, Lojban, Lombard, Luxembourgeois, Manx, Mohawk, Norfolk_pitcairnese, Occitan, Oromo, Pangasinan, Papiamento, Piedmontese, Potawatomi, Rhaeto-romance, Romansh, Rotokas, Sami_lule, Samoan, Sardinian, Scots_gaelic, Seychelles_creole, Shona, Sicilian, Somali, Southern_ndebele, Swahili, Swati_swazi, Tagalog_filipino_pilipino, Tetum, Tok_pisin, Uyghur_latinized, Volapuk, Walloon, Warlpiri, Xhosa, Yapese, Zulu, Latinbasic, Ubasic, Demo </p>
<h1>Glyph Chart</h1>
<p>The subset of Questrial Regular in this kit includes all the glyphs listed below. Unicode entities are included above each glyph to help you insert individual characters into your layout.</p>
<div id="glyph_chart">
<div><p>&amp;#13;</p>&#13;</div>
<div><p>&amp;#32;</p>&#32;</div>
<div><p>&amp;#33;</p>&#33;</div>
<div><p>&amp;#34;</p>&#34;</div>
<div><p>&amp;#35;</p>&#35;</div>
<div><p>&amp;#36;</p>&#36;</div>
<div><p>&amp;#37;</p>&#37;</div>
<div><p>&amp;#38;</p>&#38;</div>
<div><p>&amp;#39;</p>&#39;</div>
<div><p>&amp;#40;</p>&#40;</div>
<div><p>&amp;#41;</p>&#41;</div>
<div><p>&amp;#42;</p>&#42;</div>
<div><p>&amp;#43;</p>&#43;</div>
<div><p>&amp;#44;</p>&#44;</div>
<div><p>&amp;#45;</p>&#45;</div>
<div><p>&amp;#46;</p>&#46;</div>
<div><p>&amp;#47;</p>&#47;</div>
<div><p>&amp;#48;</p>&#48;</div>
<div><p>&amp;#49;</p>&#49;</div>
<div><p>&amp;#50;</p>&#50;</div>
<div><p>&amp;#51;</p>&#51;</div>
<div><p>&amp;#52;</p>&#52;</div>
<div><p>&amp;#53;</p>&#53;</div>
<div><p>&amp;#54;</p>&#54;</div>
<div><p>&amp;#55;</p>&#55;</div>
<div><p>&amp;#56;</p>&#56;</div>
<div><p>&amp;#57;</p>&#57;</div>
<div><p>&amp;#58;</p>&#58;</div>
<div><p>&amp;#59;</p>&#59;</div>
<div><p>&amp;#60;</p>&#60;</div>
<div><p>&amp;#61;</p>&#61;</div>
<div><p>&amp;#62;</p>&#62;</div>
<div><p>&amp;#63;</p>&#63;</div>
<div><p>&amp;#64;</p>&#64;</div>
<div><p>&amp;#65;</p>&#65;</div>
<div><p>&amp;#66;</p>&#66;</div>
<div><p>&amp;#67;</p>&#67;</div>
<div><p>&amp;#68;</p>&#68;</div>
<div><p>&amp;#69;</p>&#69;</div>
<div><p>&amp;#70;</p>&#70;</div>
<div><p>&amp;#71;</p>&#71;</div>
<div><p>&amp;#72;</p>&#72;</div>
<div><p>&amp;#73;</p>&#73;</div>
<div><p>&amp;#74;</p>&#74;</div>
<div><p>&amp;#75;</p>&#75;</div>
<div><p>&amp;#76;</p>&#76;</div>
<div><p>&amp;#77;</p>&#77;</div>
<div><p>&amp;#78;</p>&#78;</div>
<div><p>&amp;#79;</p>&#79;</div>
<div><p>&amp;#80;</p>&#80;</div>
<div><p>&amp;#81;</p>&#81;</div>
<div><p>&amp;#82;</p>&#82;</div>
<div><p>&amp;#83;</p>&#83;</div>
<div><p>&amp;#84;</p>&#84;</div>
<div><p>&amp;#85;</p>&#85;</div>
<div><p>&amp;#86;</p>&#86;</div>
<div><p>&amp;#87;</p>&#87;</div>
<div><p>&amp;#88;</p>&#88;</div>
<div><p>&amp;#89;</p>&#89;</div>
<div><p>&amp;#90;</p>&#90;</div>
<div><p>&amp;#91;</p>&#91;</div>
<div><p>&amp;#92;</p>&#92;</div>
<div><p>&amp;#93;</p>&#93;</div>
<div><p>&amp;#94;</p>&#94;</div>
<div><p>&amp;#95;</p>&#95;</div>
<div><p>&amp;#96;</p>&#96;</div>
<div><p>&amp;#97;</p>&#97;</div>
<div><p>&amp;#98;</p>&#98;</div>
<div><p>&amp;#99;</p>&#99;</div>
<div><p>&amp;#100;</p>&#100;</div>
<div><p>&amp;#101;</p>&#101;</div>
<div><p>&amp;#102;</p>&#102;</div>
<div><p>&amp;#103;</p>&#103;</div>
<div><p>&amp;#104;</p>&#104;</div>
<div><p>&amp;#105;</p>&#105;</div>
<div><p>&amp;#106;</p>&#106;</div>
<div><p>&amp;#107;</p>&#107;</div>
<div><p>&amp;#108;</p>&#108;</div>
<div><p>&amp;#109;</p>&#109;</div>
<div><p>&amp;#110;</p>&#110;</div>
<div><p>&amp;#111;</p>&#111;</div>
<div><p>&amp;#112;</p>&#112;</div>
<div><p>&amp;#113;</p>&#113;</div>
<div><p>&amp;#114;</p>&#114;</div>
<div><p>&amp;#115;</p>&#115;</div>
<div><p>&amp;#116;</p>&#116;</div>
<div><p>&amp;#117;</p>&#117;</div>
<div><p>&amp;#118;</p>&#118;</div>
<div><p>&amp;#119;</p>&#119;</div>
<div><p>&amp;#120;</p>&#120;</div>
<div><p>&amp;#121;</p>&#121;</div>
<div><p>&amp;#122;</p>&#122;</div>
<div><p>&amp;#123;</p>&#123;</div>
<div><p>&amp;#124;</p>&#124;</div>
<div><p>&amp;#125;</p>&#125;</div>
<div><p>&amp;#126;</p>&#126;</div>
<div><p>&amp;#160;</p>&#160;</div>
<div><p>&amp;#161;</p>&#161;</div>
<div><p>&amp;#162;</p>&#162;</div>
<div><p>&amp;#163;</p>&#163;</div>
<div><p>&amp;#164;</p>&#164;</div>
<div><p>&amp;#165;</p>&#165;</div>
<div><p>&amp;#166;</p>&#166;</div>
<div><p>&amp;#167;</p>&#167;</div>
<div><p>&amp;#168;</p>&#168;</div>
<div><p>&amp;#169;</p>&#169;</div>
<div><p>&amp;#170;</p>&#170;</div>
<div><p>&amp;#171;</p>&#171;</div>
<div><p>&amp;#172;</p>&#172;</div>
<div><p>&amp;#173;</p>&#173;</div>
<div><p>&amp;#174;</p>&#174;</div>
<div><p>&amp;#175;</p>&#175;</div>
<div><p>&amp;#176;</p>&#176;</div>
<div><p>&amp;#177;</p>&#177;</div>
<div><p>&amp;#178;</p>&#178;</div>
<div><p>&amp;#179;</p>&#179;</div>
<div><p>&amp;#180;</p>&#180;</div>
<div><p>&amp;#181;</p>&#181;</div>
<div><p>&amp;#182;</p>&#182;</div>
<div><p>&amp;#183;</p>&#183;</div>
<div><p>&amp;#184;</p>&#184;</div>
<div><p>&amp;#185;</p>&#185;</div>
<div><p>&amp;#186;</p>&#186;</div>
<div><p>&amp;#187;</p>&#187;</div>
<div><p>&amp;#188;</p>&#188;</div>
<div><p>&amp;#189;</p>&#189;</div>
<div><p>&amp;#190;</p>&#190;</div>
<div><p>&amp;#191;</p>&#191;</div>
<div><p>&amp;#192;</p>&#192;</div>
<div><p>&amp;#193;</p>&#193;</div>
<div><p>&amp;#194;</p>&#194;</div>
<div><p>&amp;#195;</p>&#195;</div>
<div><p>&amp;#196;</p>&#196;</div>
<div><p>&amp;#197;</p>&#197;</div>
<div><p>&amp;#198;</p>&#198;</div>
<div><p>&amp;#199;</p>&#199;</div>
<div><p>&amp;#200;</p>&#200;</div>
<div><p>&amp;#201;</p>&#201;</div>
<div><p>&amp;#202;</p>&#202;</div>
<div><p>&amp;#203;</p>&#203;</div>
<div><p>&amp;#204;</p>&#204;</div>
<div><p>&amp;#205;</p>&#205;</div>
<div><p>&amp;#206;</p>&#206;</div>
<div><p>&amp;#207;</p>&#207;</div>
<div><p>&amp;#208;</p>&#208;</div>
<div><p>&amp;#209;</p>&#209;</div>
<div><p>&amp;#210;</p>&#210;</div>
<div><p>&amp;#211;</p>&#211;</div>
<div><p>&amp;#212;</p>&#212;</div>
<div><p>&amp;#213;</p>&#213;</div>
<div><p>&amp;#214;</p>&#214;</div>
<div><p>&amp;#215;</p>&#215;</div>
<div><p>&amp;#216;</p>&#216;</div>
<div><p>&amp;#217;</p>&#217;</div>
<div><p>&amp;#218;</p>&#218;</div>
<div><p>&amp;#219;</p>&#219;</div>
<div><p>&amp;#220;</p>&#220;</div>
<div><p>&amp;#221;</p>&#221;</div>
<div><p>&amp;#222;</p>&#222;</div>
<div><p>&amp;#223;</p>&#223;</div>
<div><p>&amp;#224;</p>&#224;</div>
<div><p>&amp;#225;</p>&#225;</div>
<div><p>&amp;#226;</p>&#226;</div>
<div><p>&amp;#227;</p>&#227;</div>
<div><p>&amp;#228;</p>&#228;</div>
<div><p>&amp;#229;</p>&#229;</div>
<div><p>&amp;#230;</p>&#230;</div>
<div><p>&amp;#231;</p>&#231;</div>
<div><p>&amp;#232;</p>&#232;</div>
<div><p>&amp;#233;</p>&#233;</div>
<div><p>&amp;#234;</p>&#234;</div>
<div><p>&amp;#235;</p>&#235;</div>
<div><p>&amp;#236;</p>&#236;</div>
<div><p>&amp;#237;</p>&#237;</div>
<div><p>&amp;#238;</p>&#238;</div>
<div><p>&amp;#239;</p>&#239;</div>
<div><p>&amp;#240;</p>&#240;</div>
<div><p>&amp;#241;</p>&#241;</div>
<div><p>&amp;#242;</p>&#242;</div>
<div><p>&amp;#243;</p>&#243;</div>
<div><p>&amp;#244;</p>&#244;</div>
<div><p>&amp;#245;</p>&#245;</div>
<div><p>&amp;#246;</p>&#246;</div>
<div><p>&amp;#247;</p>&#247;</div>
<div><p>&amp;#248;</p>&#248;</div>
<div><p>&amp;#249;</p>&#249;</div>
<div><p>&amp;#250;</p>&#250;</div>
<div><p>&amp;#251;</p>&#251;</div>
<div><p>&amp;#252;</p>&#252;</div>
<div><p>&amp;#253;</p>&#253;</div>
<div><p>&amp;#254;</p>&#254;</div>
<div><p>&amp;#255;</p>&#255;</div>
<div><p>&amp;#338;</p>&#338;</div>
<div><p>&amp;#339;</p>&#339;</div>
<div><p>&amp;#376;</p>&#376;</div>
<div><p>&amp;#710;</p>&#710;</div>
<div><p>&amp;#732;</p>&#732;</div>
<div><p>&amp;#8192;</p>&#8192;</div>
<div><p>&amp;#8193;</p>&#8193;</div>
<div><p>&amp;#8194;</p>&#8194;</div>
<div><p>&amp;#8195;</p>&#8195;</div>
<div><p>&amp;#8196;</p>&#8196;</div>
<div><p>&amp;#8197;</p>&#8197;</div>
<div><p>&amp;#8198;</p>&#8198;</div>
<div><p>&amp;#8199;</p>&#8199;</div>
<div><p>&amp;#8200;</p>&#8200;</div>
<div><p>&amp;#8201;</p>&#8201;</div>
<div><p>&amp;#8202;</p>&#8202;</div>
<div><p>&amp;#8208;</p>&#8208;</div>
<div><p>&amp;#8209;</p>&#8209;</div>
<div><p>&amp;#8210;</p>&#8210;</div>
<div><p>&amp;#8211;</p>&#8211;</div>
<div><p>&amp;#8212;</p>&#8212;</div>
<div><p>&amp;#8216;</p>&#8216;</div>
<div><p>&amp;#8217;</p>&#8217;</div>
<div><p>&amp;#8218;</p>&#8218;</div>
<div><p>&amp;#8220;</p>&#8220;</div>
<div><p>&amp;#8221;</p>&#8221;</div>
<div><p>&amp;#8222;</p>&#8222;</div>
<div><p>&amp;#8226;</p>&#8226;</div>
<div><p>&amp;#8230;</p>&#8230;</div>
<div><p>&amp;#8239;</p>&#8239;</div>
<div><p>&amp;#8249;</p>&#8249;</div>
<div><p>&amp;#8250;</p>&#8250;</div>
<div><p>&amp;#8287;</p>&#8287;</div>
<div><p>&amp;#8364;</p>&#8364;</div>
<div><p>&amp;#8482;</p>&#8482;</div>
<div><p>&amp;#9724;</p>&#9724;</div>
<div><p>&amp;#64257;</p>&#64257;</div>
<div><p>&amp;#64258;</p>&#64258;</div>
<div><p>&amp;#64259;</p>&#64259;</div>
<div><p>&amp;#64260;</p>&#64260;</div>
</div>
</div>
</div>
</div>
<div id="specs">
</div>
<div id="installing">
<div class="section">
<div class="grid7 firstcol">
<h1>Installing Webfonts</h1>
<p>Webfonts are supported by all major browser platforms but not all in the same way. There are currently four different font formats that must be included in order to target all browsers. This includes TTF, WOFF, EOT and SVG.</p>
<h2>1. Upload your webfonts</h2>
<p>You must upload your webfont kit to your website. They should be in or near the same directory as your CSS files.</p>
<h2>2. Include the webfont stylesheet</h2>
<p>A special CSS @font-face declaration helps the various browsers select the appropriate font it needs without causing you a bunch of headaches. Learn more about this syntax by reading the <a href="https://www.fontspring.com/blog/further-hardening-of-the-bulletproof-syntax">Fontspring blog post</a> about it. The code for it is as follows:</p>
<code>
@font-face{
font-family: 'MyWebFont';
src: url('WebFont.eot');
src: url('WebFont.eot?#iefix') format('embedded-opentype'),
url('WebFont.woff') format('woff'),
url('WebFont.ttf') format('truetype'),
url('WebFont.svg#webfont') format('svg');
}
</code>
<p>We've already gone ahead and generated the code for you. All you have to do is link to the stylesheet in your HTML, like this:</p>
<code>&lt;link rel=&quot;stylesheet&quot; href=&quot;stylesheet.css&quot; type=&quot;text/css&quot; charset=&quot;utf-8&quot; /&gt;</code>
<h2>3. Modify your own stylesheet</h2>
<p>To take advantage of your new fonts, you must tell your stylesheet to use them. Look at the original @font-face declaration above and find the property called "font-family." The name linked there will be what you use to reference the font. Prepend that webfont name to the font stack in the "font-family" property, inside the selector you want to change. For example:</p>
<code>p { font-family: 'WebFont', Arial, sans-serif; }</code>
<h2>4. Test</h2>
<p>Getting webfonts to work cross-browser <em>can</em> be tricky. Use the information in the sidebar to help you if you find that fonts aren't loading in a particular browser.</p>
</div>
<div class="grid5 sidebar">
<div class="box">
<h2>Troubleshooting<br/>Font-Face Problems</h2>
<p>Having trouble getting your webfonts to load in your new website? Here are some tips to sort out what might be the problem.</p>
<h3>Fonts not showing in any browser</h3>
<p>This sounds like you need to work on the plumbing. You either did not upload the fonts to the correct directory, or you did not link the fonts properly in the CSS. If you've confirmed that all this is correct and you still have a problem, take a look at your .htaccess file and see if requests are getting intercepted.</p>
<h3>Fonts not loading in iPhone or iPad</h3>
<p>The most common problem here is that you are serving the fonts from an IIS server. IIS refuses to serve files that have unknown MIME types. If that is the case, you must set the MIME type for SVG to "image/svg+xml" in the server settings. Follow these instructions from Microsoft if you need help.</p>
<h3>Fonts not loading in Firefox</h3>
<p>The primary reason for this failure? You are still using a version Firefox older than 3.5. So upgrade already! If that isn't it, then you are very likely serving fonts from a different domain. Firefox requires that all font assets be served from the same domain. Lastly it is possible that you need to add WOFF to your list of MIME types (if you are serving via IIS.)</p>
<h3>Fonts not loading in IE</h3>
<p>Are you looking at Internet Explorer on an actual Windows machine or are you cheating by using a service like Adobe BrowserLab? Many of these screenshot services do not render @font-face for IE. Best to test it on a real machine.</p>
<h3>Fonts not loading in IE9</h3>
<p>IE9, like Firefox, requires that fonts be served from the same domain as the website. Make sure that is the case.</p>
</div>
</div>
</div>
</div>
</div>
<div id="footer">
<p>&copy;2010-2017 Font Squirrel. All rights reserved.</p>
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,370 @@
/*Notes about grid:
Columns: 12
Grid Width: 825px
Column Width: 55px
Gutter Width: 15px
-------------------------------*/
.section {
margin-bottom: 18px;
}
.section:after {
content: '.';
display: block;
height: 0;
clear: both;
visibility: hidden;
}
.section {
*zoom: 1;
}
.section .firstcolumn,
.section .firstcol {
margin-left: 0;
}
/* Border on left hand side of a column. */
.border {
padding-left: 7px;
margin-left: 7px;
border-left: 1px solid #eee;
}
/* Border with more whitespace, spans one column. */
.colborder {
padding-left: 42px;
margin-left: 42px;
border-left: 1px solid #eee;
}
/* The Grid Classes */
.grid1, .grid1_2cols, .grid1_3cols, .grid1_4cols, .grid2, .grid2_3cols, .grid2_4cols, .grid3, .grid3_2cols, .grid3_4cols, .grid4, .grid4_3cols, .grid5, .grid5_2cols, .grid5_3cols, .grid5_4cols, .grid6, .grid6_4cols, .grid7, .grid7_2cols, .grid7_3cols, .grid7_4cols, .grid8, .grid8_3cols, .grid9, .grid9_2cols, .grid9_4cols, .grid10, .grid10_3cols, .grid10_4cols, .grid11, .grid11_2cols, .grid11_3cols, .grid11_4cols, .grid12 {
margin-left: 15px;
float: left;
display: inline;
overflow: hidden;
}
.width1, .grid1, .span-1 {
width: 55px;
}
.width1_2cols, .grid1_2cols {
width: 20px;
}
.width1_3cols, .grid1_3cols {
width: 8px;
}
.width1_4cols, .grid1_4cols {
width: 2px;
}
.input_width1 {
width: 49px;
}
.width2, .grid2, .span-2 {
width: 125px;
}
.width2_3cols, .grid2_3cols {
width: 31px;
}
.width2_4cols, .grid2_4cols {
width: 20px;
}
.input_width2 {
width: 119px;
}
.width3, .grid3, .span-3 {
width: 195px;
}
.width3_2cols, .grid3_2cols {
width: 90px;
}
.width3_4cols, .grid3_4cols {
width: 37px;
}
.input_width3 {
width: 189px;
}
.width4, .grid4, .span-4 {
width: 265px;
}
.width4_3cols, .grid4_3cols {
width: 78px;
}
.input_width4 {
width: 259px;
}
.width5, .grid5, .span-5 {
width: 335px;
}
.width5_2cols, .grid5_2cols {
width: 160px;
}
.width5_3cols, .grid5_3cols {
width: 101px;
}
.width5_4cols, .grid5_4cols {
width: 72px;
}
.input_width5 {
width: 329px;
}
.width6, .grid6, .span-6 {
width: 405px;
}
.width6_4cols, .grid6_4cols {
width: 90px;
}
.input_width6 {
width: 399px;
}
.width7, .grid7, .span-7 {
width: 475px;
}
.width7_2cols, .grid7_2cols {
width: 230px;
}
.width7_3cols, .grid7_3cols {
width: 148px;
}
.width7_4cols, .grid7_4cols {
width: 107px;
}
.input_width7 {
width: 469px;
}
.width8, .grid8, .span-8 {
width: 545px;
}
.width8_3cols, .grid8_3cols {
width: 171px;
}
.input_width8 {
width: 539px;
}
.width9, .grid9, .span-9 {
width: 615px;
}
.width9_2cols, .grid9_2cols {
width: 300px;
}
.width9_4cols, .grid9_4cols {
width: 142px;
}
.input_width9 {
width: 609px;
}
.width10, .grid10, .span-10 {
width: 685px;
}
.width10_3cols, .grid10_3cols {
width: 218px;
}
.width10_4cols, .grid10_4cols {
width: 160px;
}
.input_width10 {
width: 679px;
}
.width11, .grid11, .span-11 {
width: 755px;
}
.width11_2cols, .grid11_2cols {
width: 370px;
}
.width11_3cols, .grid11_3cols {
width: 241px;
}
.width11_4cols, .grid11_4cols {
width: 177px;
}
.input_width11 {
width: 749px;
}
.width12, .grid12, .span-12 {
width: 825px;
}
.input_width12 {
width: 819px;
}
/* Subdivided grid spaces */
.emptycols_left1, .prepend-1 {
padding-left: 70px;
}
.emptycols_right1, .append-1 {
padding-right: 70px;
}
.emptycols_left2, .prepend-2 {
padding-left: 140px;
}
.emptycols_right2, .append-2 {
padding-right: 140px;
}
.emptycols_left3, .prepend-3 {
padding-left: 210px;
}
.emptycols_right3, .append-3 {
padding-right: 210px;
}
.emptycols_left4, .prepend-4 {
padding-left: 280px;
}
.emptycols_right4, .append-4 {
padding-right: 280px;
}
.emptycols_left5, .prepend-5 {
padding-left: 350px;
}
.emptycols_right5, .append-5 {
padding-right: 350px;
}
.emptycols_left6, .prepend-6 {
padding-left: 420px;
}
.emptycols_right6, .append-6 {
padding-right: 420px;
}
.emptycols_left7, .prepend-7 {
padding-left: 490px;
}
.emptycols_right7, .append-7 {
padding-right: 490px;
}
.emptycols_left8, .prepend-8 {
padding-left: 560px;
}
.emptycols_right8, .append-8 {
padding-right: 560px;
}
.emptycols_left9, .prepend-9 {
padding-left: 630px;
}
.emptycols_right9, .append-9 {
padding-right: 630px;
}
.emptycols_left10, .prepend-10 {
padding-left: 700px;
}
.emptycols_right10, .append-10 {
padding-right: 700px;
}
.emptycols_left11, .prepend-11 {
padding-left: 770px;
}
.emptycols_right11, .append-11 {
padding-right: 770px;
}
.pull-1 {
margin-left: -70px;
}
.push-1 {
margin-right: -70px;
margin-left: 18px;
float: right;
}
.pull-2 {
margin-left: -140px;
}
.push-2 {
margin-right: -140px;
margin-left: 18px;
float: right;
}
.pull-3 {
margin-left: -210px;
}
.push-3 {
margin-right: -210px;
margin-left: 18px;
float: right;
}
.pull-4 {
margin-left: -280px;
}
.push-4 {
margin-right: -280px;
margin-left: 18px;
float: right;
}

View File

@ -0,0 +1,502 @@
@import url('grid_12-825-55-15.css');
/*
CSS Reset by Eric Meyer - Released under Public Domain
http://meyerweb.com/eric/tools/css/reset/
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center, dl, dt, dd, ol, ul, li,
fieldset, form, label, legend, table,
caption, tbody, tfoot, thead, tr, th, td {
margin: 0;
padding: 0;
border: 0;
outline: 0;
font-size: 100%;
vertical-align: baseline;
background: transparent;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
:focus {
outline: 0;
}
ins {
text-decoration: none;
}
del {
text-decoration: line-through;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
body {
color: #000;
background-color: #dcdcdc;
}
a {
text-decoration: none;
color: #1883ba;
}
h1 {
font-size: 32px;
font-weight: normal;
font-style: normal;
margin-bottom: 18px;
}
h2 {
font-size: 18px;
}
#container {
width: 865px;
margin: 0px auto;
}
#header {
padding: 20px;
font-size: 36px;
background-color: #000;
color: #fff;
}
#header span {
color: #666;
}
#main_content {
background-color: #fff;
padding: 60px 20px 20px;
}
#footer p {
margin: 0;
padding-top: 10px;
padding-bottom: 50px;
color: #333;
font: 10px Arial, sans-serif;
}
.tabs {
width: 100%;
height: 31px;
background-color: #444;
}
.tabs li {
float: left;
margin: 0;
overflow: hidden;
background-color: #444;
}
.tabs li a {
display: block;
color: #fff;
text-decoration: none;
font: bold 11px/11px 'Arial';
text-transform: uppercase;
padding: 10px 15px;
border-right: 1px solid #fff;
}
.tabs li a:hover {
background-color: #00b3ff;
}
.tabs li.active a {
color: #000;
background-color: #fff;
}
div.huge {
font-size: 300px;
line-height: 1em;
padding: 0;
letter-spacing: -.02em;
overflow: hidden;
}
div.glyph_range {
font-size: 72px;
line-height: 1.1em;
}
.size10 {
font-size: 10px;
}
.size11 {
font-size: 11px;
}
.size12 {
font-size: 12px;
}
.size13 {
font-size: 13px;
}
.size14 {
font-size: 14px;
}
.size16 {
font-size: 16px;
}
.size18 {
font-size: 18px;
}
.size20 {
font-size: 20px;
}
.size24 {
font-size: 24px;
}
.size30 {
font-size: 30px;
}
.size36 {
font-size: 36px;
}
.size48 {
font-size: 48px;
}
.size60 {
font-size: 60px;
}
.size72 {
font-size: 72px;
}
.size90 {
font-size: 90px;
}
.psample_row1 {
height: 120px;
}
.psample_row1 {
height: 120px;
}
.psample_row2 {
height: 160px;
}
.psample_row3 {
height: 160px;
}
.psample_row4 {
height: 160px;
}
.psample {
overflow: hidden;
position: relative;
}
.psample p {
line-height: 1.3em;
display: block;
overflow: hidden;
margin: 0;
}
.psample span {
margin-right: .5em;
}
.white_blend {
width: 100%;
height: 61px;
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAVkAAAA9CAYAAAAH4BojAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAO1JREFUeNrs3TsKgFAMRUE/eer+NxztxMYuEWQG3ECKwwUF58ycAKixOAGAyAKILAAiCyCyACILgMgCiCyAyAIgsgAiCyCyAIgsgMgCiCwAIgsgsgAiC4DIAogsACIL0CWuZ3UGgLrIhjMA1EV2OAOAJQtgyQLwjOzmDAAiCyCyAIgsQFtkd2cAEFkAkQVAZAHaIns4A4AlC2DJAiCyACILILIAiCzAV5H1dQGAJQsgsgCILIDIAvwisl58AViyAJYsACILILIAIgvAe2T9EhxAZAFEFgCRBeiL7HAGgLrIhjMAWLIAliwAt1OAAQDwygTBulLIlQAAAABJRU5ErkJggg==);
position: absolute;
bottom: 0;
}
.black_blend {
width: 100%;
height: 61px;
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAVkAAAA9CAYAAAAH4BojAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAPJJREFUeNrs3TEKhTAQRVGjibr/9QoxhY2N3Ywo50A28IrLwP9g6b1PAMSYTQAgsgAiC4DIAogsgMgCILIAIgsgsgCILIDIAogsACILILIAIguAyAKILIDIAiCyACILgMgCZCnjLWYAiFGvB0BQZJsZAFyyAC5ZAO6RXc0AILIAIguAyAKkRXYzA4DIAogsACILkBbZ3QwALlkAlywAIgsgsgAiC4DIArwVWf8uAHDJAogsACILILIAv4isH74AXLIALlkARBZAZAFEFoDnyPokOIDIAogsACILkBfZZgaAuMhWMwC4ZAE+p4x3mAEgxinAAJ+XBbPWGkwAAAAAAElFTkSuQmCC);
position: absolute;
bottom: 0;
}
.fullreverse {
background: #000 !important;
color: #fff !important;
margin-left: -20px;
padding-left: 20px;
margin-right: -20px;
padding-right: 20px;
padding: 20px;
margin-bottom: 0;
}
.sample_table td {
padding-top: 3px;
padding-bottom: 5px;
padding-left: 5px;
vertical-align: middle;
line-height: 1.2em;
}
.sample_table td:first-child {
background-color: #eee;
text-align: right;
padding-right: 5px;
padding-left: 0;
padding: 5px;
font: 11px/12px 'Courier New', Courier, mono;
}
code {
white-space: pre;
background-color: #eee;
display: block;
padding: 10px;
margin-bottom: 18px;
overflow: auto;
}
.bottom, .last {
margin-bottom: 0 !important;
padding-bottom: 0 !important;
}
.box {
padding: 18px;
margin-bottom: 18px;
background: #eee;
}
.reverse, .reversed {
background: #000 !important;
color: #fff !important;
border: none !important;
}
#bodycomparison {
position: relative;
overflow: hidden;
font-size: 72px;
height: 90px;
white-space: nowrap;
}
#bodycomparison div {
font-size: 72px;
line-height: 90px;
display: inline;
margin: 0 15px 0 0;
padding: 0;
}
#bodycomparison div span {
font: 10px Arial;
position: absolute;
left: 0;
}
#xheight {
float: none;
position: absolute;
color: #d9f3ff;
font-size: 72px;
line-height: 90px;
}
.fontbody {
position: relative;
}
.arialbody {
font-family: Arial;
position: relative;
}
.verdanabody {
font-family: Verdana;
position: relative;
}
.georgiabody {
font-family: Georgia;
position: relative;
}
/* @group Layout page
*/
#layout h1 {
font-size: 36px;
line-height: 42px;
font-weight: normal;
font-style: normal;
}
#layout h2 {
font-size: 24px;
line-height: 23px;
font-weight: normal;
font-style: normal;
}
#layout h3 {
font-size: 22px;
line-height: 1.4em;
margin-top: 1em;
font-weight: normal;
font-style: normal;
}
#layout p.byline {
font-size: 12px;
margin-top: 18px;
line-height: 12px;
margin-bottom: 0;
}
#layout p {
font-size: 14px;
line-height: 21px;
margin-bottom: .5em;
}
#layout p.large {
font-size: 18px;
line-height: 26px;
}
#layout .sidebar p {
font-size: 12px;
line-height: 1.4em;
}
#layout p.caption {
font-size: 10px;
margin-top: -16px;
margin-bottom: 18px;
}
/* @end */
/* @group Glyphs */
#glyph_chart div {
background-color: #d9f3ff;
color: black;
float: left;
font-size: 36px;
height: 1.2em;
line-height: 1.2em;
margin-bottom: 1px;
margin-right: 1px;
text-align: center;
width: 1.2em;
position: relative;
padding: .6em .2em .2em;
}
#glyph_chart div p {
position: absolute;
left: 0;
top: 0;
display: block;
text-align: center;
font: bold 9px Arial, sans-serif;
background-color: #3a768f;
width: 100%;
color: #fff;
padding: 2px 0;
}
#glyphs h1 {
font-family: Arial, sans-serif;
}
/* @end */
/* @group Installing */
#installing {
font: 13px Arial, sans-serif;
}
#installing p,
#glyphs p {
line-height: 1.2em;
margin-bottom: 18px;
font: 13px Arial, sans-serif;
}
#installing h3 {
font-size: 15px;
margin-top: 18px;
}
/* @end */
#rendering h1 {
font-family: Arial, sans-serif;
}
.render_table td {
font: 11px 'Courier New', Courier, mono;
vertical-align: middle;
}

View File

@ -0,0 +1,12 @@
/*! Generated by Font Squirrel (https://www.fontsquirrel.com) on May 3, 2023 */
@font-face {
font-family: 'questrialregular';
src: url('questrial-regular-webfont.woff2') format('woff2'),
url('questrial-regular-webfont.woff') format('woff');
font-weight: normal;
font-style: normal;
}

View File

@ -0,0 +1,29 @@
<!-- Modal
To populate app.load('apxmodal','apxmodal',{title,body,actions[{btndescription:'xx',onclick:'js function'}]})
To activate show
<button type="button" class="btn btn-outline-success btn-sm" data-bs-toggle="modal" data-bs-target="#modalinfo">
-->
<div class="modal fade" id="{{{modalid}}}" tabindex="-1" aria-labelledby="{{{modalid}}}Label" aria-hidden="true">
<div class="modal-dialog {{classmodaldialog}}">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="{{{modalid}}}Label">{{{title}}}</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
{{{body}}}
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
{{#actions}}
<button type="button" onclick="{{{onclick}}}" class="btn btn-primary">{{btndescription}}</button>
{{/actions}}
</div>
</div>
</div>
</div>

View File

@ -0,0 +1 @@
<p>Set up editorjs here</p>

View File

@ -0,0 +1,17 @@
<h1>Your account is register</h1>
<p>Please find your confidential information in a safe space</p>
<p>Your alias: {{alias}}</p>
<p>Your passphrase: {{passphrase}}</p>
<p>Your public key that you can share with anyone:</p>
<textarea>{{pubk}}</textarea>
<p>Your private key that you keep secret and use to proove you own the public key:</p>
<textarea>{{privk}}</textarea>
{{#trustedtribe}}
<p>Thanks to trust us to keep your private key,
we'll be able to send back to this email address in case you need it</p>
{{/trustedtribe}}
{{^trustedtribe}}
<p>You decide to keep secret this private key,
Please save it in a safe place that noone else than you can access to proove you own it</p>
{{/trustedtribe}}
<p>Never share with someone else your privbatekey if someone can access, it will be possible to usurp your identity.</p>

View File

@ -0,0 +1,17 @@
Your account is register \n\r
Please find your confidential information in a safe space\n\r
Your alias: {{alias}}\n\r
Your passphrase: {{passphrase}}\n\r
Your public key that you can share with anyone:\n\r
<textarea>{{pubk}}</textarea>
Your private key that you keep secret and use to proove you own the public key:\n\r
<textarea>{{privk}}</textarea>
{{#trustedtribe}}
Thanks to trust us to keep your private key,
we'll be able to send back to this email address in case you need it\n\r
{{/trustedtribe}}
{{^trustedtribe}}
You decide to keep secret this private key,
Please save it in a safe place that noone else than you can access to proove you own it\n\r
{{/trustedtribe}}
Never share with someone else your privbatekey if someone can access, it will be possible to usurp your identity.\n\r

View File

@ -0,0 +1,34 @@
user {{{sudoerUser}}};
worker_processes auto;
error_log {{{ }}}/var/log/nginx/error.log notice;
pid /var/run/nginx.pid;
#include /etc/nginx/modules-enabled/*.conf;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '[$time_local]##"$http_x_forwarded_for"##"$request" '
'"$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;
sendfile on;
keepalive_timeout 65;
gzip on;
##
# Virtual Host Configs
##
{{#nginx.include}}
include {{{.}}};
{{/nginx.include}}
}

View File

@ -0,0 +1,11 @@
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
client_max_body_size 10m;
client_body_buffer_size 128k;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffers 32 4k;
proxy_set_header X-NginX-Proxy true;

View File

@ -1,57 +1,130 @@
<div class="row">
<div class="col-sm-6" data-spacename="explain">
<div class="col-sm-6" data-spacename="explain">
<h2>How it works</h2>
<p> Alias is a unique string that humainly help to match a PublicKey to check existing alias</p>
<code>
GET /api/odmdb/idx/pagans/pagans_alias_all.json with a correct headers
RESULT
data:{alias:publicKey}
</code>
<p>
Run
<p class="small">
Mandatory: apixtrib header have to set with:<br>
* {xalias,xhash,xdays,xtribe,xlang,xapp}<br>
* xhash is a detached signature done with public and private key of message: 'alias_xdays' where xdays is a time
stamp
a xhash has an elapse of 24hours after it has to be recreate.<br>
We need in local storage auth for this example {alias,passphrase,privatekey, publickey} to be able to create a
detached signature<br>
On the server side we check that signature xhash of alias_timestamp is valid with the public key
</p>
<p> Alias is a unique string that humainly help to find a PublicKey that is the real identity.
To get the list of existing alias</p>
<button type="button" class="btn btn-outline-success btn-sm"
onclick="app.runapirequest('modalinfo',{method:'GET',url:'nationchains/pagans/idx/alias_all.json'},{title:'Alias list',body:'',actions:[], classmodaldialog:'modal-xl'})">show
it</button>
</p>
<code>
GET nationchains/pagans/idx/alias_all.json -> data:{alias:{alias:publicKey}}
</code>
<p>To allow trustable Tribe to store the Private and Passphrase Key, you get from the townId_all.json key:tribes</p>
<button type="button" class="btn btn-outline-success btn-sm"
onclick="app.runapirequest('modalinfo',{method:'GET',url:'nationchains/towns/idx/townId_all.json'},{title:'Tribes list',body:'',actions:[], classmodaldialog:'modal-xl'})">show
it</button>
<code>
GET /nationchains/towns/idx/townId_all.json -> data:{townId:{tribes:[list of tribeId inside a town]}}
</code>
</div>
<div class="col-sm-6" data-spacename="userinterface">
</div>
<div class="col-sm-6" data-spacename="userinterface">
<div class="row g-3">
<h3>A decentralized Identity</h3>
<p>apXtrib allow you to create keys to identify yourself with a universal alias</p>
<div class="col-md-6">
<label for="inputalias" class="form-label">Your alias</label>
<input type="text" class="form-control" id="inputalias" placeholder="A public alias that any one see">
</div>
<div class="col-md-6">
<label for="inputemailrecovery" class="form-label">Email Recovery</label>
<input type="email" class="form-control" id="inputemailrecovery" placeholder="optional, if you want to receive by mail your keys">
</div>
<div class="col-12">
<label for="inputpassphrase" class="form-label">A passphrase</label>
<input type="text" class="form-control" id="inputpassphrase" placeholder="optional, a passphrase to remember, each time something try to use your privateKey this passphrase will be requested">
</div>
<div class="col-12">
<button type="button" id="generatekeys" onclick="app.createIdentity(document.getElementById('inputalias').value,document.getElementById('inputpassphrase').value)" class="btn btn-primary">Generate keys</button>
</div>
<div class="col-12">
<div class="form-check">
<input class="form-check-input" type="checkbox" id="gridCheck">
<label class="form-check-label small" for="gridCheck">
<b>I trust smatchit to keep my private key and email </b><br>
<b>If i don't trust</b> please download your keys (be aware, none than you can have access to your cipher data).<br>
If you set a correct email then you will receive your keys on your mailbox (Carefull by sending email, smatchit and anyone that access to your email can see your keys).<br>
The safer to be sure no one else than your local browser can see it, just download localy and save it on a personnal cold support (usb key).<br>
If you use a browser that <b>can be accessible by someone else, don't forget to "logout"</b> to clean up any trace.<br>
If you have any suspicious please
</label>
<h3>Am i authenticated to api?</h3>
<button type="button" id="btntestauth" class="btn btn-outline-success btn-sm"
onclick="app.runapirequest('modalinfo',{method:'GET',url:'api/pagans/isauth'},{title:'Am i authenticated',body:'',actions:[], classmodaldialog:'modal-xl'})">
Test it</button>
<code>
GET 'api/pagans/isauth' -> status 200 : Well authenticated with alias, status 400: not authenticated
</code>
<hr>
<h3>Logout</h3>
<button type="button" class="btn btn-outline-success btn-sm"
onclick="delete apx.data.auth;apx.data.headers=apxlocal.headers;apx.save();alert('delete apx.data.auth and reinit apx.data.header')">
Remove headers</button>
<hr>
<h3>I proove that i own this alias</h3>
<div class="col-md-6">
<label for="inputaliasauth" class="form-label">Your alias</label>
<input type="text" class="form-control" id="inputaliasauth" placeholder="A public alias that any one see">
</div>
<div class="col-12">
<label for="inputpassphraseauth" class="form-label">A passphrase</label>
<input type="text" class="form-control" id="inputpassphraseauth"
placeholder="optional, a passphrase to remember, each time something try to use your privateKey this passphrase will be requested">
</div>
<textarea rows="5" id="privatekeyauth"></textarea>
<button class="btn btn-primary"
onclick="pagans.authentifyme(document.getElementById('inputaliasauth').value,document.getElementById('inputpassphraseauth').value,document.getElementById('privatekeyauth').value);document.getElementById('btntestauth').click()">I
am alias</button>
<hr>
<h3>Create a decentralized Identity</h3>
<p>apXtrib allow you to create keys to identify yourself with a universal alias</p>
<div class="col-md-6">
<label for="inputalias" class="form-label">Your alias</label>
<input type="text" class="form-control" id="inputalias" placeholder="A public alias that any one see">
</div>
<div class="col-md-6">
<label for="inputemailrecovery" class="form-label">Email Recovery</label>
<input type="email" class="form-control" id="inputemailrecovery"
placeholder="optional, if you want to receive by mail your keys">
</div>
<div class="col-12">
<label for="inputpassphrase" class="form-label">A passphrase</label>
<input type="text" class="form-control" id="inputpassphrase"
placeholder="optional, a passphrase to remember, each time something try to use your privateKey this passphrase will be requested">
</div>
<button type="button" id="generatekeys"
onclick="pagans.createIdentity(document.getElementById('inputalias').value,document.getElementById('inputpassphrase').value)"
class="btn btn-primary">Generate keys</button>
<div id="trustintribe" class="d-none">
<div class="mb-3 row">
<div class="col-12">
<div class="form-check">
<input class="form-check-input" type="checkbox" id="trustedcheck"
onclick="document.getElementById('selecttrusttribe').classList.toggle('d-none');">
<label class="form-check-label small" for="trustedcheck">
<b>I trust a tribe to keep my private key and email, doing this i automaticaly create a Person space in
tribe i trust. </b>
I understand that someone with tribe accessrights(druid) from this tribe can read my personnal data by
unciphering my
data.<br>
<b>If i don't trust</b> i understand that if i loose my privatekey i also loose my data.<br>
If you set a correct email then you will receive your keys on your mailbox, this email is not store if
you do not trust<br>
If you use a browser that <b>can be accessible by someone else, don't forget to "logout"</b> to clean up
any trace.<br>
<b>In any case please download your keys and move it on a usb key or/and print it</b><br>
</label>
</div>
</div>
<div id="selecttrusttribe" class="d-none">
<label for="selectnationid" class="col-12 col-form-label">If you want to trust in a Tribe to store your
private key, please chose a tribe which you trust in</label>
<div class="col-12">
<select class="form-select" id="trustedtribe" aria-label="" placeholder="A tribe to store my private key">
{{#tribes}}
<option {{#selected}}selected{{/selected}} value="{{tribeId}}">{{tribeId}}</option>
{{/tribes}}
</select>
<input class="d-none" id="inputtribeId" value="{{tribeId}}">
</div>
</div>
</div>
<div id="downloadkeys" class="btn-group d-none">
<p>Download your keys at least PrivateKey this have to save in a secret place</p>
<button id="privatekey" key="" class="btn btn-outline-primary" onclick="app.downloadlink('pagans.privateKey',apx.data,apx.data.headers.xapp);" >Download PrivateKey</button>
<button id="publickey" key="" class="btn btn-outline-primary" onclick="app.downloadlink('publicKey',this.getAttribute('key'),apx.data.headers.xapp);">Download PublicKey</button>
</div>
<div id="createId" class="col-12 d-none">
<button class="btn btn-primary" onclick="app.registerIdentity()">Create this identity</button>
</div>
</div>
<div id="downloadkeys" class="btn-group d-none">
<p>Download your keys at least PrivateKey this have to save in a secret place</p>
<button id="privatekey" key="" class="btn btn-outline-primary"
onclick="app.downloadlink('auth.privateKey',apx.data,apx.data.headers.xapp);">Download PrivateKey</button>
<button id="publickey" key="" class="btn btn-outline-primary"
onclick="app.downloadlink('auth.publicKey',this.getAttribute('key'),apx.data.headers.xapp);">Download
PublicKey</button>
</div>
<div id="createId" class="col-12 d-none">
<button class="btn btn-primary" onclick="pagans.registerIdentity();">Create
this identity</button>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,50 @@
<div class="container">
<div class="row">
<h4> Setup a new town</h4>
<p>This form let you start joining a nation.</p>
<p>For dev you can stay like this and use http instead of https. To join a nation you need:</p>
<ul>
<li> Get a domain name register to a publicIP that route web traffic from 80 and 443 to this machine</li>
<li> Get a pagan identity and be authenticated <a onclick="app.load('apxmain','pagancreate',{})"> click here to create or authentify yoursefl</a>
<li> Synchronize the nations, to update your nationchains (carefful all your local stuff will be deleted)</li>
<li> Ready to your new mayor role of this town</li>
<li> Start saling your hosting</li>
</ul>
<div class="col-sm-2">
</div>
<div class="col-sm-10">
<div class="mb-3 row">
<label for="selectnationid" class="col-sm-6 col-form-label">Select the nation to join</label>
<div class="col-sm-6">
<select class="form-select" data-nationId="{{nationId}}" aria-label="" placeholder="A nation">
{{#nations}}
<option {{#selected}}selected{{/selected}} value="{{nationId}}">{{nationId}}</option>
{{/nations}}
</select>
<input class="d-none" id="inputnationId" value="{{nationId}}">
</div>
</div>
<div class="mb-3 row">
<label for="inputtownid" class="col-sm-6 col-form-label">Your Town</label>
<div class="col-sm-6">
<input type="text" value="{{townId}}" class="form-control" id="inputtownid">
</div>
</div>
<div class="mb-3 row">
<label for="inputtribeid" class="col-sm-6 col-form-label">Your Tribes</label>
<div class="col-sm-6">
<input type="text" value="{{tribeId}}" class="form-control" id="inputreibeid">
</div>
</div>
<div class="mb-3 row">
<label for="inputdnstown" class="col-sm-6 col-form-label">Domain name of your town (to access this app from the web)</label>
<div class="col-sm-6">
<input type="text" value="{{dns}}" class="form-control" id="inputdnstown">
</div>
</div>
<div class="col-auto">
<button onclick="setup.lauchtown(document.getElementById('inputnationId').value, document.getElementById('inputtownId').value,document.getElementById('inputdns').value)" class="btn btn-primary mb-3">Launch this town</button>
</div>
</div>
</div>
</div>

View File

@ -1,9 +1,9 @@
{
"nationId": "ants",
"townId": "wall",
"IP":"213.32.65.213",
"townId": "usbfarm",
"IP":"192.168.1.1",
"tribeId":"ndda",
"dns": ["wallant.ndda.fr"],
"dns": ["wallant.ndda.fr","adminapx"],
"mayorId":"philc",
"passphrase":"",
"api": {

View File

@ -0,0 +1,31 @@
{
"dns": ["adminapx"],
"api": {
"port": 3020,
"languages": ["en", "fr"],
"exposedHeaders": ["xdays", "xhash", "xalias", "xlang", "xtribe", "xapp"],
"nationObjects": [
"schema",
"blocks",
"nations",
"towns",
"tribes",
"pagans"
],
"unittesting": ["middlewares", "models", "routes", "nationchains"],
"appset": { "trust proxy": true },
"bodyparse": {
"urlencoded": {
"limit": "50mb",
"extended": true
},
"json": { "limit": "500mb" }
}
},
"nginx": {
"restart": "sudo systemctl restart nginx",
"worker_connections": 1024,
"include": ["/etc/nginx/conf.d/*.conf"],
"pageindex": "index_en.html"
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

View File

@ -0,0 +1,168 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="74.422066mm"
height="39.408447mm"
viewBox="0 0 74.422066 39.408447"
version="1.1"
id="svg5"
inkscape:version="1.2.2 (732a01da63, 2022-12-09, custom)"
sodipodi:docname="planchelogoapXtrib.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview7"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="mm"
showgrid="false"
inkscape:zoom="2.3786088"
inkscape:cx="429.03231"
inkscape:cy="188.5556"
inkscape:window-width="1868"
inkscape:window-height="1141"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="layer1" />
<defs
id="defs2">
<inkscape:path-effect
effect="powerclip"
id="path-effect4281-6"
is_visible="true"
lpeversion="1"
inverse="true"
flatten="false"
hide_clip="false"
message="Utilise la règle de remplissage « fill-rule: evenodd » de la boîte de dialogue &lt;b&gt;Fond et contour&lt;/b&gt; en l'absence de résultat de mise à plat après une conversion en chemin." />
<inkscape:path-effect
effect="powerclip"
id="path-effect4223-1-5"
is_visible="true"
lpeversion="1"
inverse="true"
flatten="false"
hide_clip="false"
message="Utilise la règle de remplissage « fill-rule: evenodd » de la boîte de dialogue &lt;b&gt;Fond et contour&lt;/b&gt; en l'absence de résultat de mise à plat après une conversion en chemin." />
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipath_lpe_path-effect4281-6">
<rect
style="display:none;fill:none;stroke:#000000;stroke-width:2.965;stroke-miterlimit:5"
id="rect12221"
width="3.9103701"
height="17.277628"
x="72.929848"
y="18.71629"
d="m 72.929848,18.71629 h 3.91037 v 17.277627 h -3.91037 z" />
<path
id="lpe_path-effect4281-6"
style="fill:none;stroke:#000000;stroke-width:2.965;stroke-miterlimit:5"
class="powerclip"
d="M 39.612377,7.7145809 H 79.612633 V 47.714838 H 39.612377 Z M 72.929848,18.71629 v 17.277627 h 3.91037 V 18.71629 Z" />
</clipPath>
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipath_lpe_path-effect4223-1-5">
<rect
style="display:none;fill:none;stroke:#000000;stroke-width:0.890744;stroke-miterlimit:5;stroke-dasharray:none;stroke-opacity:1"
id="rect12226"
width="29.109257"
height="29.109257"
x="45.057877"
y="13.160081"
clip-path="none"
d="M 45.057877,13.160081 H 74.167133 V 42.269338 H 45.057877 Z" />
<path
id="lpe_path-effect4223-1-5"
style="fill:none;stroke:#000000;stroke-width:0.890744;stroke-miterlimit:5;stroke-dasharray:none;stroke-opacity:1"
class="powerclip"
d="M 35.399339,3.8513256 H 75.39934 V 43.851326 H 35.399339 Z m 9.658538,9.3087554 V 42.269338 H 74.167133 V 13.160081 Z" />
</clipPath>
</defs>
<g
inkscape:label="Calque 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-33.762223,-52.949721)">
<rect
style="fill:none;fill-opacity:1;stroke:none;stroke-width:0.264999;stroke-miterlimit:5;stroke-dasharray:none;stroke-opacity:1"
id="rect12066-9"
width="74.422066"
height="39.408443"
x="33.685085"
y="52.371716" />
<rect
style="fill:#ffffff;fill-opacity:0.0159938;stroke:none;stroke-width:0.264999;stroke-miterlimit:5;stroke-dasharray:none;stroke-opacity:1"
id="rect12066-6"
width="74.422066"
height="39.408443"
x="33.762222"
y="52.949718"
inkscape:export-filename="../6e81e123/logobglight.svg"
inkscape:export-xdpi="105.58897"
inkscape:export-ydpi="105.58897" />
<path
style="display:block;fill:none;stroke:#ffffff;stroke-width:0.891;stroke-miterlimit:5;stroke-dasharray:none;stroke-opacity:1"
id="rect4221-6"
width="29.109257"
height="29.109257"
x="45.057877"
y="13.160081"
clip-path="url(#clipath_lpe_path-effect4281-6)"
inkscape:path-effect="#path-effect4281-6"
d="M 45.057877,13.160081 H 74.167133 V 42.269338 H 45.057877 Z"
sodipodi:type="rect"
transform="translate(0.7877763,47.235812)" />
<path
style="display:block;fill:none;stroke:#ffffff;stroke-width:0.890744;stroke-miterlimit:5;stroke-dasharray:none;stroke-opacity:1"
id="rect4212-5-3"
width="29.109257"
height="29.109257"
x="40.844711"
y="9.2966976"
clip-path="url(#clipath_lpe_path-effect4223-1-5)"
inkscape:path-effect="#path-effect4223-1-5"
d="M 40.844711,9.2966976 H 69.953968 V 38.405954 H 40.844711 Z"
sodipodi:type="rect"
transform="translate(1.2107703,47.421564)" />
<text
xml:space="preserve"
style="font-size:3.175px;fill:#2e7fc8;fill-opacity:1;stroke-width:0.265;stroke-dasharray:none"
x="48.645107"
y="76.664268"
id="text168-9"
inkscape:highlight-color="#2e7fc8"><tspan
sodipodi:role="line"
id="tspan166-4"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:14.1111px;font-family:Quicksand;-inkscape-font-specification:'Quicksand, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;fill:#2e7fc8;fill-opacity:1;stroke-width:0.265;stroke-dasharray:none"
x="48.645107"
y="76.664268"><tspan
style="fill:#ffffff;fill-opacity:1"
id="tspan12445">ap</tspan><tspan
style="fill:#ffc332;fill-opacity:1"
id="tspan11889-8">X</tspan><tspan
style="fill:#ffffff;fill-opacity:0.985099"
id="tspan12341">trib</tspan></tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:2.82222px;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;fill:#2e7fc8;fill-opacity:1;stroke-width:0.264583"
x="54.550327"
y="82.090439"
id="text168-0-1"><tspan
sodipodi:role="line"
id="tspan166-9-2"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:2.82222px;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;fill:#ffffff;fill-opacity:1;stroke-width:0.264583"
x="54.550327"
y="82.090439">BLOCKCHAIN OF DEMOCRACY</tspan></text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View File

@ -0,0 +1,156 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="74.687065mm"
height="39.673443mm"
viewBox="0 0 74.687065 39.673443"
version="1.1"
id="svg5"
inkscape:version="1.2.2 (732a01da63, 2022-12-09, custom)"
sodipodi:docname="planchelogoapXtrib.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview7"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="mm"
showgrid="false"
inkscape:zoom="2.3786088"
inkscape:cx="429.03231"
inkscape:cy="188.5556"
inkscape:window-width="1868"
inkscape:window-height="1141"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="layer1" />
<defs
id="defs2">
<inkscape:path-effect
effect="powerclip"
id="path-effect4281"
is_visible="true"
lpeversion="1"
inverse="true"
flatten="false"
hide_clip="false"
message="Utilise la règle de remplissage « fill-rule: evenodd » de la boîte de dialogue &lt;b&gt;Fond et contour&lt;/b&gt; en l'absence de résultat de mise à plat après une conversion en chemin." />
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath4219-7">
<rect
style="display:none;fill:none;stroke:#000000;stroke-width:0.890744;stroke-miterlimit:5;stroke-dasharray:none;stroke-opacity:1"
id="rect4221-7"
width="29.109257"
height="29.109257"
x="45.057877"
y="13.160081"
clip-path="none"
d="M 45.057877,13.160081 H 74.167133 V 42.269338 H 45.057877 Z" />
<path
id="lpe_path-effect4223-1"
style="fill:none;stroke:#000000;stroke-width:0.890744;stroke-miterlimit:5;stroke-dasharray:none;stroke-opacity:1"
class="powerclip"
d="M 35.399339,3.8513256 H 75.39934 V 43.851326 H 35.399339 Z m 9.658538,9.3087554 V 42.269338 H 74.167133 V 13.160081 Z" />
</clipPath>
<inkscape:path-effect
effect="powerclip"
id="path-effect4223-1"
is_visible="true"
lpeversion="1"
inverse="true"
flatten="false"
hide_clip="false"
message="Utilise la règle de remplissage « fill-rule: evenodd » de la boîte de dialogue &lt;b&gt;Fond et contour&lt;/b&gt; en l'absence de résultat de mise à plat après une conversion en chemin." />
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath4277">
<rect
style="display:none;fill:none;stroke:#000000;stroke-width:2.965;stroke-miterlimit:5"
id="rect4279"
width="3.9103701"
height="17.277628"
x="72.929848"
y="18.71629"
d="m 72.929848,18.71629 h 3.91037 v 17.277627 h -3.91037 z" />
<path
id="lpe_path-effect4281"
style="fill:none;stroke:#000000;stroke-width:2.965;stroke-miterlimit:5"
class="powerclip"
d="M 39.612377,7.7145809 H 79.612633 V 47.714838 H 39.612377 Z M 72.929848,18.71629 v 17.277627 h 3.91037 V 18.71629 Z" />
</clipPath>
</defs>
<g
inkscape:label="Calque 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-32.764809,-5.0034045)">
<path
style="display:block;fill:none;stroke:#2e7fc8;stroke-width:0.891;stroke-miterlimit:5;stroke-dasharray:none;stroke-opacity:1"
id="rect4221"
width="29.109257"
height="29.109257"
x="45.057877"
y="13.160081"
clip-path="url(#clipPath4277)"
inkscape:path-effect="#path-effect4281"
d="M 45.057877,13.160081 H 74.167133 V 42.269338 H 45.057877 Z"
sodipodi:type="rect" />
<path
style="display:block;fill:none;stroke:#2e7fc8;stroke-width:0.890744;stroke-miterlimit:5;stroke-dasharray:none;stroke-opacity:1"
id="rect4212-5"
width="29.109257"
height="29.109257"
x="40.844711"
y="9.2966976"
clip-path="url(#clipPath4219-7)"
inkscape:path-effect="#path-effect4223-1"
d="M 40.844711,9.2966976 H 69.953968 V 38.405954 H 40.844711 Z"
sodipodi:type="rect"
transform="translate(0.42299389,0.18575204)" />
<text
xml:space="preserve"
style="font-size:3.175px;fill:#2e7fc8;fill-opacity:1;stroke-width:0.265;stroke-dasharray:none"
x="47.857334"
y="29.428459"
id="text168"
inkscape:highlight-color="#2e7fc8"><tspan
sodipodi:role="line"
id="tspan166"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:14.1111px;font-family:Quicksand;-inkscape-font-specification:'Quicksand, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;fill:#2e7fc8;fill-opacity:1;stroke-width:0.265;stroke-dasharray:none"
x="47.857334"
y="29.428459">ap<tspan
style="fill:#ffc332;fill-opacity:1"
id="tspan11889">X</tspan>trib</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:2.82222px;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;fill:#2e7fc8;fill-opacity:1;stroke-width:0.264583"
x="53.762562"
y="34.85463"
id="text168-0"><tspan
sodipodi:role="line"
id="tspan166-9"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:2.82222px;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;fill:#2e7fc8;fill-opacity:1;stroke-width:0.264583"
x="53.762562"
y="34.85463">BLOCKCHAIN OF DEMOCRACY</tspan></text>
<rect
style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:0.264999;stroke-miterlimit:5;stroke-dasharray:none;stroke-opacity:1"
id="rect12066"
width="74.422066"
height="39.408443"
x="32.897308"
y="5.1359038"
inkscape:export-filename="../6e81e123/logobglight.svg"
inkscape:export-xdpi="105.58897"
inkscape:export-ydpi="105.58897" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

@ -1,18 +1,18 @@
server {
server_name wallants.ndda.fr ;
access_log /home/phil/workspace/apxtrib/nationchains/logs/nginx/adminapx.town.access.log main;
server_name adminapx wallant.ndda.fr;
access_log /media/phil/usbfarm/apxtrib/nationchains/logs/nginx/adminapx.town.access.log main;
location ~* /nationchains/(schema|blocks|pagans|towns|nations)/ {
# Warning: never add tribes for keeping it private
root /home/phil/workspace/apxtrib/;
root /media/phil/usbfarm/apxtrib/;
}
# /plugins/pluginame/components/xxx?plugin=pluginname&pluginkey=key
# acess if exist pluginkey
location /plugins/ {
add_header X-debug "plugins local $arg_plugin/keys/$arg_pluginkey sent";
root /home/phil/workspace/apxtrib/nationchains//plugins/;
if (-f /home/phil/workspace/apxtrib/nationchains//plugins/$arg_plugin/keys/$arg_pluginkey) {
root /media/phil/usbfarm/apxtrib/nationchains//plugins/;
if (-f /media/phil/usbfarm/apxtrib/nationchains//plugins/$arg_plugin/keys/$arg_pluginkey) {
rewrite /plugins/([^/]+)/components/([^\?]+) /$1/components/$2 break;
}
return 403 "No valid token access for plugin:$arg_plugin with token:$arg_pluginkey please ask your admin";
@ -20,12 +20,12 @@ server {
location /cdn/ {
rewrite /cdn/(.*$) /$1 break;
root /home/phil/workspace/apxtrib/nationchains/www/cdn/;
root /media/phil/usbfarm/apxtrib/nationchains/www/cdn/;
}
location /spacedev/ {
rewrite /spacedev/(.*$) /$1 break;
root /home/phil/workspace/apxtrib/nationchains/spacedev/adminapx/dist/;
root /media/phil/usbfarm/apxtrib/nationchains/spacedev/adminapx/dist/;
}
location /api/ {
@ -36,7 +36,7 @@ server {
}
location / {
root /home/phil/workspace/apxtrib/nationchains/www/adminapx;
root /media/phil/usbfarm/apxtrib/nationchains/www/adminapx;
index index.html index_en.html;
}
error_page 404 /404.html;
@ -46,24 +46,4 @@ server {
location = /50x.html {
root /usr/local/nginx/html;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/wallants.ndda.fr/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/wallants.ndda.fr/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = wallants.ndda.fr) {
return 301 https://$host$request_uri;
} # managed by Certbot
server_name wallants.ndda.fr ;
listen 80;
return 404; # managed by Certbot
}

View File

@ -0,0 +1 @@
{"alias":"testerC","dt_create":"2023-05-11T22:24:52.415Z","accessrights":{"profil":"user"},"recovery":{"alias":"testerC","publickey":"-----BEGIN PGP PUBLIC KEY BLOCK-----\n\nxjMEZF1jnhYJKwYBBAHaRw8BAQdAk+vWTLhIdrKmkDCs5JFfJ2/nlEaKfi6w\nC2RMVjV2od/NAMKMBBAWCgA+BYJkXWOeBAsJBwgJkA1+VJX1lEhqAxUICgQW\nAAIBAhkBApsDAh4BFiEEjtlC0YBMG5A+5hfsDX5UlfWUSGoAAO+NAP4jOgmP\ns7HvHfUp94EOc3w2QzyFuNJ2JA3Y60H/6JbEogD/b5eMgdWlwB9CuxRHdFnB\noLWKl4GrcYuAmeHlboN+lALOOARkXWOeEgorBgEEAZdVAQUBAQdADY96UpTX\nqzYlNVaRYtqqUiv2N9MhXJGvMwDhEvm6jWkDAQgHwngEGBYIACoFgmRdY54J\nkA1+VJX1lEhqApsMFiEEjtlC0YBMG5A+5hfsDX5UlfWUSGoAAHSdAP9GqJZ/\ncbgv3K+tXVDjmDsXl7E4sNwQVPsoXvGfzeGOpwD/VyrB9a4O+9peLnuxBad9\nyEa5D2PAxVAXkKySOhH8BA8=\n=aCoC\n-----END PGP PUBLIC KEY BLOCK-----\n","email":"phc@ndda.fr","privatekey":"-----BEGIN PGP PRIVATE KEY BLOCK-----\n\nxVgEZF1jnhYJKwYBBAHaRw8BAQdAk+vWTLhIdrKmkDCs5JFfJ2/nlEaKfi6w\nC2RMVjV2od8AAQDxcHGEzdDOSI2Jk/pE55gHLh8eAv0B2chn9r7Axj9C3xGE\nzQDCjAQQFgoAPgWCZF1jngQLCQcICZANflSV9ZRIagMVCAoEFgACAQIZAQKb\nAwIeARYhBI7ZQtGATBuQPuYX7A1+VJX1lEhqAADvjQD+IzoJj7Ox7x31KfeB\nDnN8NkM8hbjSdiQN2OtB/+iWxKIA/2+XjIHVpcAfQrsUR3RZwaC1ipeBq3GL\ngJnh5W6DfpQCx10EZF1jnhIKKwYBBAGXVQEFAQEHQA2PelKU16s2JTVWkWLa\nqlIr9jfTIVyRrzMA4RL5uo1pAwEIBwAA/1N4ewKv9m1cHOzm+Ukgx+1GQg0K\nfM5BFhYAHkXrm8FoDyHCeAQYFggAKgWCZF1jngmQDX5UlfWUSGoCmwwWIQSO\n2ULRgEwbkD7mF+wNflSV9ZRIagAAdJ0A/0aoln9xuC/cr61dUOOYOxeXsTiw\n3BBU+yhe8Z/N4Y6nAP9XKsH1rg772l4ue7EFp33IRrkPY8DFUBeQrJI6EfwE\nDw==\n=XbiQ\n-----END PGP PRIVATE KEY BLOCK-----\n","passphrase":""},"dt_update":"2023-05-11T22:27:24.499Z"}