This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Change YOUR_TOKEN to your prerender token | |
# Change example.com (server_name) to your website url | |
# Change /path/to/your/root to the correct value | |
server { | |
listen 80; | |
server_name YOUR_DOMAIN.COM; | |
root /usr/share/nginx/html; | |
index index.html index.htm; | |
location / { | |
try_files $uri @prerender; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM nginx | |
RUN apt-get update && apt-get install -y python curl && curl -O <https://bootstrap.pypa.io/get-pip.py> && \\ | |
python get-pip.py | |
RUN update-ca-certificates | |
WORKDIR /nginx | |
ADD default.conf /etc/nginx/conf.d/default.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const encryptionConfig = { | |
JsonWebTokenKey: 'unity-super-long-secret', | |
ChaChaEncryptionKey: 'f2ZWDvhBXFSxKXpCl0wg9aEZnuXfA+B2c+5RU8wWbfQ=', | |
ChaChaSigPublicKey: '6T7iL581iPWn1X/Nm8AD2PNRFDqGyGlRfslNy0SD63M=', | |
ChaChaSigPrivateKey: 'UDPW1Td0BfG4bFINTU85mrwRp9ipd2iqKg/0n8hkFWbpPuIvnzWI9afVf82bwAPY81EUOobIaVF+yU3LRIPrcw==', | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const encryptionConfig = { | |
JsonWebTokenKey: 'unity-super-long-secret', | |
ChaChaEncryptionKey: 'f2ZWDvhBXFSxKXpCl0wg9aEZnuXfA+B2c+5RU8wWbfQ=', | |
ChaChaSigPublicKey: '6T7iL581iPWn1X/Nm8AD2PNRFDqGyGlRfslNy0SD63M=', | |
ChaChaSigPrivateKey: 'UDPW1Td0BfG4bFINTU85mrwRp9ipd2iqKg/0n8hkFWbpPuIvnzWI9afVf82bwAPY81EUOobIaVF+yU3LRIPrcw==', | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// encryptionService | |
import * as config from '../config/EncryptionConfig' | |
import * as sodium from 'sodium-native'; | |
import * as md5 from 'md5'; | |
import * as crypto from 'crypto'; | |
export class EncryptionService { | |
public nonce: number = 0; | |
public timeout: number; | |
public lastRequest: number; | |
private sodium: any; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {assert} from "chai"; | |
import {EncryptionService} from "../Services/EncryptionService"; | |
import * as crypto from 'crypto'; | |
describe('encryption', () => { | |
const encryptionService: EncryptionService = new EncryptionService(); | |
// 1000 * 10 Loops: 5.2 seconds | |
it('encryption performance test', () => { | |
const loop = 1000 * 10; // should use 1000 * 10 |