mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-15 01:52:42 +03:00
Merge branch 'test' of https://github.com/urbit/urbit into test
This commit is contained in:
commit
daa0a70d2b
@ -86,10 +86,10 @@ Sometimes things are just easy.
|
||||
|
||||
###3. Run
|
||||
|
||||
Run `bin/vere -c mypier` in the urbit directory, where `mypier` is a directory that doesn't yet exist. All your state (an append-only log and a memory checkpoint) will live in this directory. The name of your pier doesn't matter and is not visible internally.
|
||||
Run `bin/urbit -c mypier` in the urbit directory, where `mypier` is a directory that doesn't yet exist. All your state (an append-only log and a memory checkpoint) will live in this directory. The name of your pier doesn't matter and is not visible internally.
|
||||
|
||||
A _pier_ is an Urbit virtual machine that hosts one or more Urbit identities,
|
||||
or _ships_. When you run `bin/vere -c`, it automatically creates a 128-bit ship, or `submarine`. Your name (a hash of a randomly-generated public key) will look something like:
|
||||
or _ships_. When you run `bin/urbit -c`, it automatically creates a 128-bit ship, or `submarine`. Your name (a hash of a randomly-generated public key) will look something like:
|
||||
|
||||
~hinfet-rovler-labheb-laddev--ladner-pillur-divmun-tamfur
|
||||
|
||||
@ -140,7 +140,7 @@ Once that is finished, you will be dropped into the main application, the `:dojo
|
||||
If you would like to safely bring this ship back into port (End the Unix process),
|
||||
just enter Control-V to switch to the task manager, then Control-D.
|
||||
|
||||
To re-launch your pier after creation run `bin/vere mypier` (exclude the `-c`)
|
||||
To re-launch your pier after creation run `bin/urbit mypier` (exclude the `-c`)
|
||||
|
||||
###4. Registration
|
||||
|
||||
@ -373,9 +373,9 @@ line will log out - as in Unix:
|
||||
cyarvin:~/urbit;
|
||||
|
||||
Then you can restart and be right back where you were - just
|
||||
run `bin/vere` without `-c`:
|
||||
run `bin/urbit` without `-c`:
|
||||
|
||||
cyarvin:~/urbit; bin/vere mypier
|
||||
cyarvin:~/urbit; bin/urbit mypier
|
||||
vere: urbit home is mypier
|
||||
vere: hostname is cyarvin
|
||||
loom: mapped 2048MB
|
||||
@ -427,7 +427,7 @@ every so often to get the latest Urbit source code. You'll need to run:
|
||||
|
||||
make clean; make
|
||||
|
||||
before executing `bin/vere mypier` again.
|
||||
before executing `bin/urbit mypier` again.
|
||||
|
||||
|
||||
###6. Talk
|
||||
|
2
i/n/a.h
2
i/n/a.h
@ -10,7 +10,7 @@
|
||||
|
||||
/* U3_CELLOC_TOGGLE: enable toggling of the custum cell allocator
|
||||
* via -g. This slightly slows down the cell allocator even when
|
||||
* it's on. Note that toggling -g breaks the image. If
|
||||
* it's on. Note that toggling -g breaks (maybe?) the image. If
|
||||
* U3_MEMORY_DEBUG is on, this should generally be on as well.
|
||||
*/
|
||||
# undef U3_CELLOC_TOGGLE
|
||||
|
45
v/cttp.c
45
v/cttp.c
@ -971,7 +971,10 @@ _cttp_ccon_kick_write_cb(uv_write_t* wri_u, c3_i sas_i)
|
||||
static void
|
||||
_cttp_ccon_kick_write_cryp(u3_ccon* coc_u)
|
||||
{
|
||||
if (!SSL_is_init_finished(coc_u->ssl.ssl_u)) {
|
||||
if ( NULL == coc_u->ssl.ssl_u ) {
|
||||
c3_assert(!"ssl_u is null\r\n");
|
||||
}
|
||||
if ( !SSL_is_init_finished(coc_u->ssl.ssl_u)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1076,6 +1079,7 @@ _cttp_ccon_cryp_hurr(u3_ccon* coc_u, int rev)
|
||||
|
||||
switch ( err ) {
|
||||
default:
|
||||
fprintf(stderr, "cttp: wasted: %p\r\n", coc_u->ssl.ssl_u);
|
||||
_cttp_ccon_waste(coc_u, "ssl lost");
|
||||
break;
|
||||
case SSL_ERROR_NONE:
|
||||
@ -1086,6 +1090,27 @@ _cttp_ccon_cryp_hurr(u3_ccon* coc_u, int rev)
|
||||
case SSL_ERROR_WANT_READ:
|
||||
_cttp_ccon_cryp_rout(coc_u);
|
||||
break;
|
||||
case SSL_ERROR_WANT_CONNECT:
|
||||
fprintf(stderr, "cttp: want connect: %p\r\n", coc_u->ssl.ssl_u);
|
||||
break;
|
||||
case SSL_ERROR_WANT_ACCEPT:
|
||||
fprintf(stderr, "cttp: want accept: %p\r\n", coc_u->ssl.ssl_u);
|
||||
break;
|
||||
case SSL_ERROR_WANT_X509_LOOKUP:
|
||||
fprintf(stderr, "cttp: want x509 lookup: %p\r\n", coc_u->ssl.ssl_u);
|
||||
break;
|
||||
case SSL_ERROR_SYSCALL:
|
||||
fprintf(stderr, "cttp: syscall: %p\r\n", coc_u->ssl.ssl_u);
|
||||
break;
|
||||
case SSL_ERROR_SSL:
|
||||
fprintf(stderr, "cttp: error_ssl: %p\r\n", coc_u->ssl.ssl_u);
|
||||
c3_i err;
|
||||
while ( 0 != (err = ERR_get_error()) ) {
|
||||
c3_c ero[500];
|
||||
ERR_error_string_n(err, ero, 500);
|
||||
fprintf(stderr, "error code: %x\r\n%s\r\n", err, ero);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1133,6 +1158,7 @@ _cttp_ccon_cryp_pull(u3_ccon* coc_u)
|
||||
}
|
||||
else {
|
||||
// not connected
|
||||
ERR_clear_error();
|
||||
c3_i r = SSL_connect(coc_u->ssl.ssl_u);
|
||||
if ( 0 > r ) {
|
||||
_cttp_ccon_cryp_hurr(coc_u, r);
|
||||
@ -1180,6 +1206,7 @@ _cttp_ccon_kick_read_cryp_cb(uv_stream_t* tcp_u,
|
||||
}
|
||||
else {
|
||||
BIO_write(coc_u->ssl.rio_u, (c3_c*)buf_u->base, siz_w);
|
||||
|
||||
_cttp_ccon_cryp_pull(coc_u);
|
||||
}
|
||||
}
|
||||
@ -1270,7 +1297,14 @@ _cttp_ccon_kick_handshake(u3_ccon* coc_u)
|
||||
coc_u->ssl.wio_u);
|
||||
|
||||
SSL_set_connect_state(coc_u->ssl.ssl_u);
|
||||
SSL_do_handshake(coc_u->ssl.ssl_u);
|
||||
c3_i r = SSL_do_handshake(coc_u->ssl.ssl_u);
|
||||
if ( 0 > r ) {
|
||||
_cttp_ccon_cryp_hurr(coc_u, r);
|
||||
}
|
||||
else {
|
||||
coc_u->sat_e = u3_csat_cryp;
|
||||
_cttp_ccon_kick(coc_u);
|
||||
}
|
||||
|
||||
coc_u->sat_e = u3_csat_sing;
|
||||
_cttp_ccon_kick(coc_u);
|
||||
@ -1603,6 +1637,13 @@ u3_cttp_io_init()
|
||||
SSL_CTX_set_options(u3S, SSL_OP_NO_SSLv2);
|
||||
SSL_CTX_set_verify(u3S, SSL_VERIFY_PEER, NULL);
|
||||
SSL_CTX_set_default_verify_paths(u3S);
|
||||
// if ( 0 == SSL_CTX_load_verify_locations(u3S,
|
||||
// "/etc/ssl/certs/ca-certificates.crt", NULL) ) {
|
||||
// fprintf(stderr, "\tload-error\r\n");
|
||||
// } else {
|
||||
// fprintf(stderr, "\tload-good\r\n");
|
||||
// }
|
||||
|
||||
SSL_CTX_set_session_cache_mode(u3S, SSL_SESS_CACHE_OFF);
|
||||
SSL_CTX_set_cipher_list(u3S, "ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:"
|
||||
"ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:"
|
||||
|
50
v/unix.c
50
v/unix.c
@ -585,7 +585,7 @@ _unix_load(u3_ufil* fil_u)
|
||||
pad_y = c3_malloc(fln_w);
|
||||
|
||||
red_w = read(fid_i, pad_y, fln_w);
|
||||
close(fid_i);
|
||||
close(fid_i); // should probably check the return value
|
||||
|
||||
if ( fln_w != red_w ) {
|
||||
free(pad_y);
|
||||
@ -706,12 +706,13 @@ _unix_dir_khan_file(u3_noun pam, u3_noun wib, u3_noun woz)
|
||||
if ( c3n == u3du(wib) ) {
|
||||
ole = u3kdb_get(u3k(pam), u3k(wib));
|
||||
|
||||
if ( u3_none == ole ) {
|
||||
ole = u3nc(woz, u3_nul);
|
||||
if ( u3_none == ole ||
|
||||
u3_nul == ole ) {
|
||||
ole = u3nt(u3_nul, woz, u3_nul);
|
||||
} else {
|
||||
u3_noun elo;
|
||||
|
||||
elo = u3nc(woz, u3k(u3t(ole)));
|
||||
elo = u3nt(u3_nul, woz, u3k(u3t(u3t(ole))));
|
||||
u3z(ole);
|
||||
|
||||
ole = elo;
|
||||
@ -724,29 +725,31 @@ _unix_dir_khan_file(u3_noun pam, u3_noun wib, u3_noun woz)
|
||||
|
||||
ole = u3kdb_get(u3k(pam), u3k(fid));
|
||||
|
||||
if ( u3_none == ole ) {
|
||||
ole = u3nc(u3_nul,
|
||||
if ( u3_none == ole ||
|
||||
u3_nul == ole ) {
|
||||
ole = u3nt(u3_nul,
|
||||
u3_nul,
|
||||
u3kdb_put(u3_nul,
|
||||
u3k(har),
|
||||
u3nc(woz, u3_nul)));
|
||||
u3nt(u3_nul, woz, u3_nul)));
|
||||
}
|
||||
else {
|
||||
u3_noun roo = u3t(ole);
|
||||
u3_weak tup = u3kdb_get(u3k(roo), u3k(har));
|
||||
u3_noun oor, elo;
|
||||
u3_noun roo = u3t(u3t(ole));
|
||||
u3_weak tup = u3kdb_get(u3k(roo), u3k(har));
|
||||
|
||||
if ( u3_none == tup ) {
|
||||
tup = u3nc(woz, u3_nul);
|
||||
tup = u3nt(u3_nul, woz, u3_nul);
|
||||
} else {
|
||||
u3_noun upt;
|
||||
|
||||
upt = u3nc(woz, u3k(u3t(tup)));
|
||||
upt = u3nt(u3_nul, woz, u3k(u3t(tup)));
|
||||
u3z(tup);
|
||||
|
||||
tup = upt;
|
||||
}
|
||||
oor = u3kdb_put(u3k(roo), u3k(har), tup);
|
||||
elo = u3nc(u3k(u3h(ole)), oor);
|
||||
elo = u3nt(u3_nul, u3k(u3h(u3t(ole))), oor);
|
||||
|
||||
u3z(ole); ole = elo;
|
||||
}
|
||||
@ -761,6 +764,10 @@ _unix_dir_khan_file(u3_noun pam, u3_noun wib, u3_noun woz)
|
||||
static u3_noun
|
||||
_unix_dir_khan(u3_udir* dir_u)
|
||||
{
|
||||
if ( c3y == dir_u->dry ) {
|
||||
return u3_nul;
|
||||
}
|
||||
|
||||
u3_udir* dis_u;
|
||||
u3_ufil* fil_u;
|
||||
u3_noun pam = u3_nul;
|
||||
@ -770,7 +777,7 @@ _unix_dir_khan(u3_udir* dir_u)
|
||||
u3_noun kan = _unix_dir_khan(dis_u);
|
||||
|
||||
// uL(fprintf(uH, "dir %s\n", u3r_string(pre)));
|
||||
if ( u3_nul != u3h(kan) || u3_nul != u3t(kan) ) {
|
||||
if ( u3_nul == kan || u3_nul != u3h(u3t(kan)) || u3_nul != u3t(u3t(kan)) ) {
|
||||
pam = u3kdb_put(pam, pre, kan);
|
||||
}
|
||||
else {
|
||||
@ -803,7 +810,7 @@ _unix_dir_khan(u3_udir* dir_u)
|
||||
u3nt(u3_nul, u3_nul, baw));
|
||||
pam = _unix_dir_khan_file(pam, wib, wol);
|
||||
}
|
||||
return u3nc(u3_nul, pam);
|
||||
return u3nt(u3_nul, u3_nul, pam);
|
||||
}
|
||||
|
||||
/* _find_mug(): find a noun with a given mug. retain. DELETEME
|
||||
@ -940,12 +947,19 @@ _unix_desk_sync_into(u3_noun who,
|
||||
|
||||
xun = _unix_dir_khan(dir_u);
|
||||
|
||||
pax = u3nq(u3_blip, c3__sync, u3k(u3A->sen), u3_nul);
|
||||
fav = u3nq(c3__into, who, syd, xun);
|
||||
if ( _(u3ud(xun)) ) {
|
||||
u3z(who); u3z(hox); u3z(syd); u3z(xun);
|
||||
return;
|
||||
}
|
||||
else {
|
||||
pax = u3nq(u3_blip, c3__sync, u3k(u3A->sen), u3_nul);
|
||||
fav = u3nq(c3__into, who, syd, u3k(u3t(xun)));
|
||||
|
||||
u3v_plan(pax, fav);
|
||||
u3v_plan(pax, fav);
|
||||
|
||||
u3z(hox);
|
||||
u3z(hox); u3z(xun);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/* _unix_ship_update(): update top level ship.
|
||||
|
Loading…
Reference in New Issue
Block a user