Skip to content

Commit d6e0cd0

Browse files
committed
replace & copy
1 parent 9d01755 commit d6e0cd0

File tree

13 files changed

+87
-66
lines changed

13 files changed

+87
-66
lines changed

.env.development

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
WS = 'ws://localhost:11111/ws/'
2-
SRV = 'http://localhost:6699/'
1+
WS = "ws://localhost:2112/ws/"
2+
SRV = "http://localhost:6699/"
33
DEBUG = true
4-
MODE = 'development'
4+
MODE = "development"
5+
VERSION = "0.2.2"
56

6-
TITLE = 'iYZoZ.com / incripto ::: crypto tunnel'
7-
DESCRIPTION = 'Peer 2 Peer Crypto Instant Messanger'
8-
H1 = 'iYZoZ.com ::: crypto tunnel'
9-
H2 = 'incripto_0.2'
10-
H3 = 'No Nothing'
7+
TITLE = "iYZoZ.com / incripto ::: crypto tunnel"
8+
DESCRIPTION = "Peer 2 Peer Crypto Instant Messanger"
9+
H1 = "iYZoZ.com ::: crypto tunnel"
10+
H2 = "incripto_0.2"
11+
H3 = "No Nothing"
1112
TAGLINE = '<p>no e-mail, no phone number, no password, no ip... just:::</p><img class="logo" src="/img/yzoz.png" alt="YZoZ" /><p>I suggest that the most savvy one should try to write me at:<br /><a href="https://yzoz.com/user/653644f1d879a00427c69c81b6e52c9e889ae2c8354650bba33249be4b503b15">653644f1d879a00427c69c81b6e52c9e889ae2c8354650bba33249be4b503b15</a><br />I will try to be online as often as possible. Why is this so important? Because your messages are not stored anywhere, but only pass through the server. Peer 2 Peer. At the same time, they are exposed to transparent and reliable encryption using the Elliptical Curve Curve25519 directly in your browser. The Name and Status are also stored there (:not so thick yet, because yzoz.com is still so young:)<br />But in the vast majority of cases, people are texting online, and there is no need to re-read the message. Actually, yzoz.com is just a site, and the concept has received the modest name <strong>incripto</strong>.</p>'
12-
LINKS = '<a href="https://github.com/yzoz/incripto">source</a> | <a href="https://vk.com/incripto">vk</a> | <a href="https://xn--b1agi6atw.xn--p1ai/">blog</a>'
13+
LINKS = '<a href="https://github.com/incripto">source</a> | <a href="https://vk.com/incripto">vk</a> | <a href="https://xn--b1agi6atw.xn--p1ai/">blog</a>'
1314
WTF = '<h5>Add shortcut from any browser</h5><img src="/img/firefox-mobile.png" alt="firefox mobile" /><h5>Use DevTools</h5><img src="/img/chromium-devtools.png" alt="chromium devtools" /><h5>Minimize your window</h5><img src="/img/firefox-minimized.png" alt="firefox minimized" />'

.env.production

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
WS = 'wss://i.yzoz.com/ws/'
2-
SRV = 'https://i.yzoz.com/'
1+
WS = "wss://i.yzoz.com/ws/"
2+
SRV = "https://i.yzoz.com/"
33
DEBUG = false
4-
MODE = 'production'
4+
MODE = "production"
5+
VERSION = "0.2"
56

6-
TITLE = 'iYZoZ.com / incripto ::: crypto tunnel'
7-
DESCRIPTION = 'Peer 2 Peer Crypto Instant Messanger'
8-
H1 = 'iYZoZ.com ::: crypto tunnel'
9-
H2 = 'incripto_0.2'
10-
H3 = 'No Nothing'
7+
TITLE = "iYZoZ.com / incripto ::: crypto tunnel"
8+
DESCRIPTION = "Peer 2 Peer Crypto Instant Messanger"
9+
H1 = "iYZoZ.com ::: crypto tunnel"
10+
H2 = "incripto_0.2"
11+
H3 = "No Nothing"
1112
TAGLINE = '<p>no e-mail, no phone number, no password, no ip... just:::</p><img class="logo" src="/img/yzoz.png" alt="YZoZ" /><p>I suggest that the most savvy one should try to write me at:<br /><a href="https://yzoz.com/user/653644f1d879a00427c69c81b6e52c9e889ae2c8354650bba33249be4b503b15">653644f1d879a00427c69c81b6e52c9e889ae2c8354650bba33249be4b503b15</a><br />I will try to be online as often as possible. Why is this so important? Because your messages are not stored anywhere, but only pass through the server. Peer 2 Peer. At the same time, they are exposed to transparent and reliable encryption using the Elliptical Curve Curve25519 directly in your browser. The Name and Status are also stored there (:not so thick yet, because yzoz.com is still so young:)<br />But in the vast majority of cases, people are texting online, and there is no need to re-read the message. Actually, yzoz.com is just a site, and the concept has received the modest name <strong>incripto</strong>.</p>'
12-
LINKS = '<a href="https://github.com/yzoz/incripto">source</a> | <a href="https://vk.com/incripto">vk</a> | <a href="https://xn--b1agi6atw.xn--p1ai/">blog</a>'
13+
LINKS = '<a href="https://github.com/incripto">source</a> | <a href="https://vk.com/incripto">vk</a> | <a href="https://xn--b1agi6atw.xn--p1ai/">blog</a>'
1314
WTF = '<h5>Add shortcut from any browser</h5><img src="/img/firefox-mobile.png" alt="firefox mobile" /><h5>Use DevTools</h5><img src="/img/chromium-devtools.png" alt="chromium devtools" /><h5>Minimize your window</h5><img src="/img/firefox-minimized.png" alt="firefox minimized" />'

assets/arrow-right.png

100755100644
File mode changed.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@
2020
},
2121
"devDependencies": {
2222
"babel-minify": "^0.5.0",
23+
"copy": "^0.3.2",
2324
"dotenv-flow": "^3.0.0",
2425
"postcss": "^7.0.17",
26+
"replace-in-file": "^4.1.2",
2527
"rollup": "^1.18.0",
2628
"rollup-plugin-commonjs": "^10.0.1",
27-
"rollup-plugin-copy": "^3.1.0",
2829
"rollup-plugin-less": "^1.1.2",
2930
"rollup-plugin-node-resolve": "^5.2.0",
3031
"rollup-plugin-postcss": "^2.0.3",
3132
"rollup-plugin-replace": "^2.2.0",
32-
"rollup-plugin-replace-html-vars": "^1.0.3",
3333
"rollup-plugin-vue": "^5.0.1",
3434
"vue-template-compiler": "^2.6.10"
3535
}

rollup.config.js

Lines changed: 37 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,45 @@ import vue from 'rollup-plugin-vue';
33
import commonjs from 'rollup-plugin-commonjs';
44
import replace from 'rollup-plugin-replace';
55
import less from 'rollup-plugin-less';
6-
import replaceHtmlVars from 'rollup-plugin-replace-html-vars';
7-
import copy from 'rollup-plugin-copy';
6+
import copy from 'copy';
87
import * as dotenv from 'dotenv-flow';
8+
import * as fileReplace from 'replace-in-file';
99

1010
dotenv.config();
1111

12+
copy(['assets/**/*'], 'dist/static/', {flatten: true}, (e, f) => {
13+
if (e) throw e;
14+
f.forEach( (f) => {
15+
console.log(`Copying to ${f.relative}`);
16+
});
17+
});
18+
19+
let copy2replace = new Promise( (resolve) => {
20+
copy.each(['src/index.html', 'src/manifest.webmanifest', 'src/robots.txt', 'src/sw.js'], 'dist/', {flatten: true}, (e, f) => {
21+
if (e) throw e;
22+
resolve(f);
23+
});
24+
});
25+
26+
const options = {
27+
files: ['dist/index.html', 'dist/manifest.webmanifest', 'dist/robots.txt', 'dist/sw.js'],
28+
from: ['I-TITLE-I', 'I-DESCRIPTION-I', 'I-H1-I', 'I-H2-I', 'I-H3-I', 'I-TAGLINE-I', 'I-LINKS-I', 'I-VERSION-I'],
29+
to: [process.env.TITLE, process.env.DESCRIPTION, process.env.H1, process.env.H2, process.env.H3, process.env.TAGLINE, process.env.LINKS, process.env.VERSION],
30+
};
31+
32+
copy2replace.then( (f) => {
33+
f.forEach( (f) => {
34+
console.log(`Copying to ${f.relative}`);
35+
});
36+
try {
37+
const results = fileReplace.sync(options);
38+
console.log('Replacement results:', results);
39+
}
40+
catch (e) {
41+
console.error('Error occurred:', e);
42+
}
43+
});
44+
1245
const plugins = [
1346
less({
1447
include: 'src/index.less',
@@ -27,11 +60,6 @@ const plugins = [
2760
'idb': ['openDB']
2861
}
2962
}),
30-
replaceHtmlVars({
31-
files: ['src/index.html', 'src/manifest.webmanifest'],
32-
from: ['I-TITLE-I', 'I-DESCRIPTION-I', 'I-H1-I', 'I-H2-I', 'I-H3-I', 'I-TAGLINE-I', 'I-LINKS-I'],
33-
to: [process.env.TITLE, process.env.DESCRIPTION, process.env.H1, process.env.H2, process.env.H3, process.env.TAGLINE, process.env.LINKS],
34-
}),
3563
replace({
3664
'process.env.NODE_ENV': JSON.stringify(process.env.MODE),
3765
'process.env.DEBUG_MODE': process.env.TITLE,
@@ -43,13 +71,7 @@ const plugins = [
4371
'I-TAGLINE-I': process.env.TAGLINE,
4472
'I-LINKS-I': process.env.LINKS,
4573
'I-WTF-I': process.env.WTF
46-
}),
47-
copy({
48-
targets: [
49-
{ src: ['src/index.html', 'src/manifest.webmanifest', 'src/robots.txt', 'src/sw.js'], dest: 'dist/'},
50-
{ src: 'assets/**/*', dest: 'dist/static/' }
51-
]
52-
})
74+
})
5375
];
5476

5577
let config = {
@@ -71,4 +93,4 @@ if (process.env.MODE == 'production') {
7193
config.output.sourcemap = false;
7294
};
7395

74-
export default config;
96+
export default config;

src/App.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@
183183
let m = pack.data;
184184
let n = pack.nonce;
185185
let s = pack.snd;
186-
let r = this.$store.state.sec;
186+
let r = this.$store.state.priv;
187187
188188
let txt;
189189
try {
@@ -311,7 +311,9 @@
311311
window.scrollTo(0, 999999);
312312
},
313313
reload () {
314-
document.location.reload(true);
314+
//document.location.reload(true);
315+
this.$disconnect();
316+
this.$connect(this.$store.state.ws, { format: 'json' });
315317
}
316318
},
317319
components: { Online }

src/index.html

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<!DOCTYPE html>
22
<html lang="en">
33
<head>
4-
<title>iYZoZ.com / incripto ::: crypto tunnel</title>
4+
<title>I-TITLE-I</title>
55
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
66
<meta http-equiv="Pragma" content="no-cache" />
77
<meta http-equiv="Expires" content="0" />
88
<meta charset="utf-8" />
9-
<meta name="description" content="Peer 2 Peer Crypto Instant Messanger" />
9+
<meta name="description" content="I-DESCRIPTION-I" />
1010
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
1111
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no" />
1212
<meta name="theme-color" content="#000000" />
@@ -21,21 +21,12 @@
2121
</head>
2222
<body>
2323
<data>
24-
<h1>iYZoZ.com ::: crypto tunnel</h1>
25-
<h2>incripto_0.2</h2>
26-
<h3>No Nothing</h3>
27-
<div class="content">
28-
<p>no e-mail, no phone number, no password, no ip... just:::</p>
29-
<img class="logo" src="/img/yzoz.png" alt="YZoZ" />
30-
<p>Use JavaScript :)</p>
31-
<p>I suggest that the most savvy one should try to write me at:<br />
32-
<a href="https://yzoz.com/user/653644f1d879a00427c69c81b6e52c9e889ae2c8354650bba33249be4b503b15">653644f1d879a00427c69c81b6e52c9e889ae2c8354650bba33249be4b503b15</a><br />
33-
I will try to be online as often as possible. Why is this so important? Because your messages are not stored anywhere, but only pass through the server. Peer 2 Peer. At the same time, they are exposed to transparent and reliable encryption using the Elliptical Curve Curve25519 directly in your browser. The Name and Status are also stored there (:not so thick yet, because yzoz.com is still so young:)<br />
34-
But in the vast majority of cases, people are texting online, and there is no need to re-read the message. Actually, yzoz.com is just a site, and the concept has received the modest name <strong>incripto</strong>.</p>
35-
</div>
36-
<div class="links">
37-
<a href="https://github.com/yzoz/incripto">source</a> | <a href="https://vk.com/incripto">vk</a> | <a href="https://xn--b1agi6atw.xn--p1ai/">blog</a>
24+
<h1>I-H1-I</h1>
25+
<h2>I-H2-I</h2>
26+
<h3>I-H3-I</h3>
27+
<div class="content">I-TAGLINE-I</p>
3828
</div>
29+
<div class="links">I-LINKS-I</div>
3930
</data>
4031
<script type="text/javascript" src="/index.js"></script>
4132
</body>

src/lib/crypt.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { box, randomBytes } from "tweetnacl";
55
const crypt = {
66

77
nonce () {
8-
return randomBytes(16)
8+
return randomBytes(16);
99
},
1010

1111
b2h (b) {

src/lib/proto.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,15 @@ syncyarnlock -s -k // updates package.json with versions installed from yarn.loc
6565
yarn install // updates yarn.lock with current version constraint from package.json
6666
6767
*/
68+
`
69+
copyfiles(['assets/**/*', 'dist/static/'], {
70+
up: true,
71+
verbose: true,
72+
flat: true
73+
}, (e) => {
74+
if (e) throw e;
75+
});
76+
`
6877

6978
out = {
7079
m: 'get',

src/manifest.webmanifest

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"background_color": "black",
33
"theme_color": "#000000",
4-
"description": "Peer 2 Peer Crypto Instant Messanger",
4+
"description": "I-DESCRIPTION-I",
55
"display": "standalone",
6-
"name": "iYZoZ.com ::: crypto tunnel",
7-
"short_name": "incripto_0.2",
6+
"name": "I-H1-I",
7+
"short_name": "I-H2-I",
88
"start_url": "/",
99
"orientation": "portrait",
1010
"icons": [{

0 commit comments

Comments
 (0)