Check-in [b13dfe3b17]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Bump version number
Timelines: family | ancestors | descendants | both | trunk | 0.8.5-20181220
Files: files | file ages | folders
SHA1: b13dfe3b172c63f38b0236aad269989898249842
User & Date: bernd 2018-12-20 12:44:19
Context
2018-12-21
22:18
Start adding id to GUI entry screen check-in: 5a0865b281 user: bernd tags: trunk
2018-12-20
12:44
Bump version number check-in: b13dfe3b17 user: bernd tags: trunk, 0.8.5-20181220
2018-12-17
21:13
color palette code adaption check-in: 10c6ced4ff user: bernd tags: trunk
Changes
Hide Diffs Unified Diffs Show Whitespace Changes Patch

Changes to cmd.fs.

336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
:noname  cmd$ $off ; to cmdreset
' true to maxstring \ really maxuint = -1 = true
:noname ( addr u -- ) cmd$ $+! ; to +cmdbuf
:noname ( n -- )  cmd$ $@len + cmd$ $!len ; to -cmdbuf
:noname ( -- 64dest ) 64#0 ; to cmddest

: gen-cmd ( xt -- $addr )
    cmdbuf-o @ >r code-buf$ 0 cmd$ !@ >r
    catch
    r> cmd$ !@ r> cmdbuf-o !  swap throw ;
: gen-cmd$ ( xt -- addr u )
    gen-cmd  1 tmp$# +!  tmp$ $!buf  tmp$ $@ ;

code0-buf \ reset default

:noname ( -- addr u ) cmd0buf cmdbuf# @ ; to cmdbuf$
' cmd0lock to cmdlock







|

|







336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
:noname  cmd$ $off ; to cmdreset
' true to maxstring \ really maxuint = -1 = true
:noname ( addr u -- ) cmd$ $+! ; to +cmdbuf
:noname ( n -- )  cmd$ $@len + cmd$ $!len ; to -cmdbuf
:noname ( -- 64dest ) 64#0 ; to cmddest

: gen-cmd ( xt -- $addr )
    cmdbuf-o @ >r code-buf$ 0 cmd$ !@ >r cmdbuf# @ >r
    catch
    r> cmdbuf# !  r> cmd$ !@ r> cmdbuf-o !  swap throw ;
: gen-cmd$ ( xt -- addr u )
    gen-cmd  1 tmp$# +!  tmp$ $!buf  tmp$ $@ ;

code0-buf \ reset default

:noname ( -- addr u ) cmd0buf cmdbuf# @ ; to cmdbuf$
' cmd0lock to cmdlock

Changes to configure.ac.

11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Affero General Public License for more details.

# You should have received a copy of the GNU Affero General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

AC_INIT([net2o], [0.8.4-20181213], [bernd@net2o.de], [net2o], [https://fossil.net2o.de/net2o/reportlist])
AC_PREREQ([2.59])
AC_CONFIG_MACRO_DIR([m4])
AC_USE_SYSTEM_EXTENSIONS
LT_INIT

AC_MSG_CHECKING([for gforth])








|







11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Affero General Public License for more details.

# You should have received a copy of the GNU Affero General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

AC_INIT([net2o], [0.8.5-20181220], [bernd@net2o.de], [net2o], [https://fossil.net2o.de/net2o/reportlist])
AC_PREREQ([2.59])
AC_CONFIG_MACRO_DIR([m4])
AC_USE_SYSTEM_EXTENSIONS
LT_INIT

AC_MSG_CHECKING([for gforth])

Changes to do.

1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/bash

echo "This script builds net2o from scratch"

GFORTH=gforth-0.7.9_20181213

if [ "$(uname -o)" = "Cygwin" ]
then
    CONFOPT="--prefix=/usr $*"
else
    CONFOPT="$*"
fi




|







1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/bash

echo "This script builds net2o from scratch"

GFORTH=gforth-0.7.9_20181220

if [ "$(uname -o)" = "Cygwin" ]
then
    CONFOPT="--prefix=/usr $*"
else
    CONFOPT="$*"
fi

Changes to dvcs.fs.

168
169
170
171
172
173
174

175
176
177
178
179

180
181
182
183
184
185
186
...
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
...
731
732
733
734
735
736
737
738

739
740
741
742
743
744
745
746
747

748
749
750
751
752
753
754
    endcase ;

\ encrypted hash stuff, using signature secret as PSK

\ probably needs padding...

: write-enc-hashed ( addr1 u1 -- addrhash85 u2 )

    keyed-hash-out hash#128 ['] 85type $tmp 2>r
    enchash  2>r
    save-mem 2dup c:encrypt  over swap
    ?.net2o/objects  2r> hash>filename  spit-file
    free throw  2r> ;


: enchash>filename ( hash1 u1 -- filename u2 )
    keyed-hash-out hash#128 smove
    enchash hash>filename ;

Variable patch-in$

................................................................................

Variable id-files[]

: dvcs-gen-id ( -- addr u )
    id-files[] $[]off
    dvcs:files# [: dup cell+ $@ 2>r $@ 2r> [: forth:type forth:type ;] $tmp
	id-files[] $ins[] drop ;] #map \ sort filenames
    [: id-files[] [:
	    over hash#128 $, dvcs-read hash#128 /string
	    0 dvcs:perm /string 2dup $,
	    2 /string file-lsize@ lit, dvcs-write
	;] $[]map ;] gen-cmd$
    dup IF  >file-hash  THEN ;

previous

................................................................................
    c:0key >hash hashtmp hash#128 85type ;
 
: (dvcs-ci) ( addr u o:dvcs -- ) dvcs:message$ $!
    dvcs:oldid$ dvcs-readin
    ref-files[] $[]# new-files[] $[]# del-files[] $[]# or or 0= IF
	." Nothing to do" cr
    ELSE
	['] compute-diff gen-cmd$ \ 2dup net2o:see

	dvcs( ." ===== patch len: " dvcs:patch$ $@len . ." =====" cr )
	del-files[] ['] -fileentry $[]map
	new-files[] ['] +fileentry $[]map
	ref-files[] ['] +fileentry $[]map
	>id-revision  dvcs-newsentry
	['] dvcs-sig$ project:chain$ dup $free $exec
	save-project  filelist-out
	"~+/.n2o/newfiles" ?delete-file
	"~+/.n2o/reffiles" ?delete-file

    THEN  clean-up ;

: dvcs-ci ( addr u -- ) \ checkin command
    dvcs:new-dvcs >o now>never (dvcs-ci)  dvcs:dispose-dvcs o> ;

: dvcs-diff ( -- )
    dvcs:new-dvcs >o dvcs:oldid$ dvcs-readin







>


|

<
>







 







|
|







 







|
>









>







168
169
170
171
172
173
174
175
176
177
178
179

180
181
182
183
184
185
186
187
...
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
...
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
    endcase ;

\ encrypted hash stuff, using signature secret as PSK

\ probably needs padding...

: write-enc-hashed ( addr1 u1 -- addrhash85 u2 )
    $make { w^ enc-pad$ } enc-pad$ $@
    keyed-hash-out hash#128 ['] 85type $tmp 2>r
    enchash  2>r
    2dup c:encrypt
    ?.net2o/objects  2r> hash>filename  spit-file

    enc-pad$ $free 2r> ;

: enchash>filename ( hash1 u1 -- filename u2 )
    keyed-hash-out hash#128 smove
    enchash hash>filename ;

Variable patch-in$

................................................................................

Variable id-files[]

: dvcs-gen-id ( -- addr u )
    id-files[] $[]off
    dvcs:files# [: dup cell+ $@ 2>r $@ 2r> [: forth:type forth:type ;] $tmp
	id-files[] $ins[] drop ;] #map \ sort filenames
    [:  id-files[] [: drop hash#128 $, dvcs-read ;] $[]map
	id-files[] [: hash#128 /string
	    0 dvcs:perm /string 2dup $,
	    2 /string file-lsize@ lit, dvcs-write
	;] $[]map ;] gen-cmd$
    dup IF  >file-hash  THEN ;

previous

................................................................................
    c:0key >hash hashtmp hash#128 85type ;
 
: (dvcs-ci) ( addr u o:dvcs -- ) dvcs:message$ $!
    dvcs:oldid$ dvcs-readin
    ref-files[] $[]# new-files[] $[]# del-files[] $[]# or or 0= IF
	." Nothing to do" cr
    ELSE
	['] compute-diff gen-cmd$
	$make { w^ diff$ } diff$ $@ \ 2dup net2o:see
	dvcs( ." ===== patch len: " dvcs:patch$ $@len . ." =====" cr )
	del-files[] ['] -fileentry $[]map
	new-files[] ['] +fileentry $[]map
	ref-files[] ['] +fileentry $[]map
	>id-revision  dvcs-newsentry
	['] dvcs-sig$ project:chain$ dup $free $exec
	save-project  filelist-out
	"~+/.n2o/newfiles" ?delete-file
	"~+/.n2o/reffiles" ?delete-file
	diff$ $free
    THEN  clean-up ;

: dvcs-ci ( addr u -- ) \ checkin command
    dvcs:new-dvcs >o now>never (dvcs-ci)  dvcs:dispose-dvcs o> ;

: dvcs-diff ( -- )
    dvcs:new-dvcs >o dvcs:oldid$ dvcs-readin

Changes to file.fs.

197
198
199
200
201
202
203

204
205

206
207
208
209
210
211
212
    c:key@ >r
    over >r fs:fs-read
    fs-cryptkey $@ drop c:key!
    r> over c:decrypt
    r> c:key! ; hashfs-class to fs-read
:noname ( addr u -- n )
    dup 0= IF  nip  EXIT  THEN

    c:key@ >r  fs-cryptkey $@ drop c:key!
    save-mem 2dup c:encrypt over >r fs:fs-write r> free throw

    r> c:key! ; hashfs-class to fs-write
:noname ( -- )
    fs:fs-close
    fs-cryptkey $free ; hashfs-class to fs-close

\ subclassing for other sorts of files








>

<
>







197
198
199
200
201
202
203
204
205

206
207
208
209
210
211
212
213
    c:key@ >r
    over >r fs:fs-read
    fs-cryptkey $@ drop c:key!
    r> over c:decrypt
    r> c:key! ; hashfs-class to fs-read
:noname ( addr u -- n )
    dup 0= IF  nip  EXIT  THEN
    $make { w^ file-pad$ } file-pad$ $@
    c:key@ >r  fs-cryptkey $@ drop c:key!

    2dup c:encrypt fs:fs-write file-pad$ $free
    r> c:key! ; hashfs-class to fs-write
:noname ( -- )
    fs:fs-close
    fs-cryptkey $free ; hashfs-class to fs-close

\ subclassing for other sorts of files

Changes to json/g+-import.fs.

144
145
146
147
148
149
150

151
152
153
154
155
156
157
158
159
160
161

162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
: add-comment ( dvcs -- )
    [: ." comment-" 1 comment# +!@ 0 <# # # # #> type ." .md" ;] $tmp add-file ;

: create>never ( o:comments -- )
    comments:creationTime! comments:updateTime! 64umax 64#-1 sigdate le-128! ;

: add-comments { dvcs -- }

    comments:comments[] $@ bounds U+DO
	I @ >o
	dvcs add-comment
	comments:media{} ?dup-IF  >o dvcs add-media o>  THEN
	comments:author{} .author:mapped-key dvcs >o to my-key o>
	create>never
	"comment" dvcs .(dvcs-ci)  last-msg 2@ post-ref 2!
	dvcs add-plusones
	dvcs add-reshares
	o>
    cell +LOOP ;


: write-out-article ( o:comment -- )
    >dir redate-mode on  comment# off
    dvcs:new-dvcs { dvcsp }
    comments:url$ basename [: ." posts/" type ." /.n2o" ;] $tmp
    .net2o-cache/ 2dup $1FF init-dir drop dirname set-dir throw
    ".n2o/files" touch
    comments:url$ basename dvcsp >o project:project$ $!
    "master" project:branch$ $! save-project o>
    dvcsp add-post
    dvcsp add-album
    comments:media{} ?dup-IF  >o dvcsp add-media o>  THEN
    create>never
    "post" dvcsp .(dvcs-ci)  last-msg 2@ ~~ post-ref 2!
    dvcsp add-plusones
    dvcsp add-reshares
    dvcsp add-comments
    dvcsp .dvcs:dispose-dvcs
    dir> redate-mode off ;







>




|


|
|

|
>













|





144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
: add-comment ( dvcs -- )
    [: ." comment-" 1 comment# +!@ 0 <# # # # #> type ." .md" ;] $tmp add-file ;

: create>never ( o:comments -- )
    comments:creationTime! comments:updateTime! 64umax 64#-1 sigdate le-128! ;

: add-comments { dvcs -- }
    my-key-default >r
    comments:comments[] $@ bounds U+DO
	I @ >o
	dvcs add-comment
	comments:media{} ?dup-IF  >o dvcs add-media o>  THEN
	comments:author{} .author:mapped-key to my-key-default
	create>never
	"comment" dvcs .(dvcs-ci)  last-msg 2@ post-ref 2!
	dvcs add-plusones \ plusones not exported at the moment
	\ dvcs add-reshares \ reshares of comments not possible
	o>
    cell +LOOP
    r> to my-key-default ;

: write-out-article ( o:comment -- )
    >dir redate-mode on  comment# off
    dvcs:new-dvcs { dvcsp }
    comments:url$ basename [: ." posts/" type ." /.n2o" ;] $tmp
    .net2o-cache/ 2dup $1FF init-dir drop dirname set-dir throw
    ".n2o/files" touch
    comments:url$ basename dvcsp >o project:project$ $!
    "master" project:branch$ $! save-project o>
    dvcsp add-post
    dvcsp add-album
    comments:media{} ?dup-IF  >o dvcsp add-media o>  THEN
    create>never
    "post" dvcsp .(dvcs-ci)  last-msg 2@ post-ref 2!
    dvcsp add-plusones
    dvcsp add-reshares
    dvcsp add-comments
    dvcsp .dvcs:dispose-dvcs
    dir> redate-mode off ;

Changes to keys.fs.

342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
...
430
431
432
433
434
435
436
437

438
439
440
441
442
443
444
....
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
	dup cells 85colors + @ attr! 1+
	I 4 85type  dup cells 85colors + @ attr! 1+
    I 4 + 4 85type <default> cr 8 +LOOP  drop ;
: .import85 ( addr u -- )
    ke-imports @ >im-color 85type <default> ;
: .rsk ( nick u -- )
    skrev $20 .stripe85 space type ."  (keep offline copy!)" cr ;
: .key ( addr u -- ) drop cell+ >o
    ." nick:   " .nick cr
    ." pubkey: " ke-pk $@ 85type cr
    ke-sk @ IF
	." seckey: " ke-sk sec@ .black85 ."  (keep secret!)" cr  THEN
    ke-wallet @ IF
	." wallet: " ke-wallet sec@ .black85 ."  (keep secret!)" cr  THEN
    ." valid:  " ke-selfsig $@ .sigdates cr
    ." groups: " ke-groups $@ .in-groups cr
    ." perm:   " ke-mask @ .perm cr
    o> ;
: .key-rest ( o:key -- o:key )
    ke-pk $@ key| .import85
    ke-wallet sec@ nip IF
	wallet( space ke-wallet sec@ .black85 )else( ."  W" )
    ELSE  wallet( $15 )else( 2 ) spaces THEN
    ke-selfsig $@ space .sigdates
    ke-groups $@ 2dup .in-groups groups>mask invert
................................................................................
: dumpkey ( addr u -- ) drop cell+ >o
    .\" x\" " ke-pk $@ 85type .\" \" key?new" cr
    ke-sk @ IF  .\" x\" " ke-sk @ keysize 85type .\" \" ke-sk sec! +seckey" cr  THEN
    '"' emit .nick .\" \" ke-nick $! "
    ke-selfsig $@ drop 64@ 64>d [: '$' emit 0 ud.r ;] $10 base-execute
    ." . d>64 ke-first! " ke-type @ . ." ke-type !"  cr o> ;

: .keys ( -- ) key# [: ." index: " dup $@ 85type cr cell+ $@ .key ;] #map ;

: dumpkeys ( -- ) key# [: cell+ $@ dumpkey ;] #map ;

: key>o ( addrkey u1 -- o / 0 )
    key| key# #@ 0= IF  drop 0  EXIT  THEN  cell+ ;
: key>nick ( addrkey u1 -- nick u2 )
    \G convert key to nick
    key>o dup IF  .ke-nick $@  ELSE  0  THEN ;
................................................................................
: dest-pk ( addr u -- ) key2| 2dup key| key# #@ 0= IF
	drop  perm%unknown
    ELSE  cell+ >o 2drop
	ke-pk $@ ke-mask @ o>  THEN
    perm-mask ! pubkey $! ;

: replace-key 1 /string { rev-addr u -- o } \ revocation ticket
    key( ." Replace:" cr o cell- 0 .key )
    import#self import-type !
    s" #revoked" dup >r ke-nick $+!
    ke-nick $@ r> - ke-prof $@ ke-sigs[] ke-type @
    rev-addr pkrk# key?new >o
    ke-type ! [: ke-sigs[] $+[]! ;] $[]map ke-prof $! ke-nick $!
    rev-addr pkrk# ke-pk $!
    rev-addr u + 1- dup c@ 2* - $10 - $10 ke-selfsig $!
    key( ." with:" cr o cell- 0 .key ) o o>
    import#new import-type ! ;

: renew-key ( revaddr u1 keyaddr u2 -- o )
    current-key >o replace-key o>
    >o skc keysize ke-sk sec! o o> ;

\ generate new key







|








|
<







 







|
>







 







|







|







342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358

359
360
361
362
363
364
365
...
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
....
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
	dup cells 85colors + @ attr! 1+
	I 4 85type  dup cells 85colors + @ attr! 1+
    I 4 + 4 85type <default> cr 8 +LOOP  drop ;
: .import85 ( addr u -- )
    ke-imports @ >im-color 85type <default> ;
: .rsk ( nick u -- )
    skrev $20 .stripe85 space type ."  (keep offline copy!)" cr ;
: .key ( addr u -- )
    ." nick:   " .nick cr
    ." pubkey: " ke-pk $@ 85type cr
    ke-sk @ IF
	." seckey: " ke-sk sec@ .black85 ."  (keep secret!)" cr  THEN
    ke-wallet @ IF
	." wallet: " ke-wallet sec@ .black85 ."  (keep secret!)" cr  THEN
    ." valid:  " ke-selfsig $@ .sigdates cr
    ." groups: " ke-groups $@ .in-groups cr
    ." perm:   " ke-mask @ .perm cr ;

: .key-rest ( o:key -- o:key )
    ke-pk $@ key| .import85
    ke-wallet sec@ nip IF
	wallet( space ke-wallet sec@ .black85 )else( ."  W" )
    ELSE  wallet( $15 )else( 2 ) spaces THEN
    ke-selfsig $@ space .sigdates
    ke-groups $@ 2dup .in-groups groups>mask invert
................................................................................
: dumpkey ( addr u -- ) drop cell+ >o
    .\" x\" " ke-pk $@ 85type .\" \" key?new" cr
    ke-sk @ IF  .\" x\" " ke-sk @ keysize 85type .\" \" ke-sk sec! +seckey" cr  THEN
    '"' emit .nick .\" \" ke-nick $! "
    ke-selfsig $@ drop 64@ 64>d [: '$' emit 0 ud.r ;] $10 base-execute
    ." . d>64 ke-first! " ke-type @ . ." ke-type !"  cr o> ;

: .keys ( -- ) key# [: ." index: " dup $@ 85type cr cell+ $@
	 drop cell+ ..key ;] #map ;
: dumpkeys ( -- ) key# [: cell+ $@ dumpkey ;] #map ;

: key>o ( addrkey u1 -- o / 0 )
    key| key# #@ 0= IF  drop 0  EXIT  THEN  cell+ ;
: key>nick ( addrkey u1 -- nick u2 )
    \G convert key to nick
    key>o dup IF  .ke-nick $@  ELSE  0  THEN ;
................................................................................
: dest-pk ( addr u -- ) key2| 2dup key| key# #@ 0= IF
	drop  perm%unknown
    ELSE  cell+ >o 2drop
	ke-pk $@ ke-mask @ o>  THEN
    perm-mask ! pubkey $! ;

: replace-key 1 /string { rev-addr u -- o } \ revocation ticket
    key( ." Replace:" cr .key )
    import#self import-type !
    s" #revoked" dup >r ke-nick $+!
    ke-nick $@ r> - ke-prof $@ ke-sigs[] ke-type @
    rev-addr pkrk# key?new >o
    ke-type ! [: ke-sigs[] $+[]! ;] $[]map ke-prof $! ke-nick $!
    rev-addr pkrk# ke-pk $!
    rev-addr u + 1- dup c@ 2* - $10 - $10 ke-selfsig $!
    key( ." with:" cr .key ) o o>
    import#new import-type ! ;

: renew-key ( revaddr u1 keyaddr u2 -- o )
    current-key >o replace-key o>
    >o skc keysize ke-sk sec! o o> ;

\ generate new key

Changes to wiki/commands.md.

1
2
3
4
5
6
7
8
9
10
# Commands #

Version 0.8.4-20181213.

net2o separates data and commands.  Data is passed through to higher
layers, commands are interpreted when they arrive.  For connection
requests, a special bit is set, and the address then isn't used as
address, but as IV for the opportunistic encoding.

The command interpreter is a stack machine with two data types: 64


|







1
2
3
4
5
6
7
8
9
10
# Commands #

Version 0.8.5-20181220.

net2o separates data and commands.  Data is passed through to higher
layers, commands are interpreted when they arrive.  For connection
requests, a special bit is set, and the address then isn't used as
address, but as IV for the opportunistic encoding.

The command interpreter is a stack machine with two data types: 64