1 <?xml version=
"1.0" encoding=
"ISO-8859-1"?>
2 <rss version='
2.0' xmlns:lj='http://www.livejournal.org/rss/lj/
1.0/'
>
4 <title>Petter Reinholdtsen - Entries from October
2018</title>
5 <description>Entries from October
2018</description>
6 <link>http://people.skolelinux.org/pere/blog/
</link>
10 <title>Release
0.2 of free software archive system Nikita announced
</title>
11 <link>http://people.skolelinux.org/pere/blog/Release_0_2_of_free_software_archive_system_Nikita_announced.html
</link>
12 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Release_0_2_of_free_software_archive_system_Nikita_announced.html
</guid>
13 <pubDate>Thu,
18 Oct
2018 14:
40:
00 +
0200</pubDate>
14 <description><p
>This morning, the new release of the
15 <a href=
"https://gitlab.com/OsloMet-ABI/nikita-noark5-core/
">Nikita
16 Noark
5 core project
</a
> was
17 <a href=
"https://lists.nuug.no/pipermail/nikita-noark/
2018-October/
000406.html
">announced
18 on the project mailing list
</a
>. The free software solution is an
19 implementation of the Norwegian archive standard Noark
5 used by
20 government offices in Norway. These were the changes in version
0.2
21 since version
0.1.1 (from NEWS.md):
24 <li
>Fix typos in REL names
</li
>
25 <li
>Tidy up error message reporting
</li
>
26 <li
>Fix issue where we used Integer.valueOf(), not Integer.getInteger()
</li
>
27 <li
>Change some String handling to StringBuffer
</li
>
28 <li
>Fix error reporting
</li
>
29 <li
>Code tidy-up
</li
>
30 <li
>Fix issue using static non-synchronized SimpleDateFormat to avoid
31 race conditions
</li
>
32 <li
>Fix problem where deserialisers were treating integers as strings
</li
>
33 <li
>Update methods to make them null-safe
</li
>
34 <li
>Fix many issues reported by coverity
</li
>
35 <li
>Improve equals(), compareTo() and hash() in domain model
</li
>
36 <li
>Improvements to the domain model for metadata classes
</li
>
37 <li
>Fix CORS issues when downloading document
</li
>
38 <li
>Implementation of case-handling with registryEntry and document upload
</li
>
39 <li
>Better support in Javascript for OPTIONS
</li
>
40 <li
>Adding concept description of mail integration
</li
>
41 <li
>Improve setting of default values for GET on ny-journalpost
</li
>
42 <li
>Better handling of required values during deserialisation
</li
>
43 <li
>Changed tilknyttetDato (M620) from date to dateTime
</li
>
44 <li
>Corrected some opprettetDato (M600) (de)serialisation errors.
</li
>
45 <li
>Improve parse error reporting.
</li
>
46 <li
>Started on OData search and filtering.
</li
>
47 <li
>Added Contributor Covenant Code of Conduct to project.
</li
>
48 <li
>Moved repository and project from Github to Gitlab.
</li
>
49 <li
>Restructured repository, moved code into src/ and web/.
</li
>
50 <li
>Updated code to use Spring Boot version
2.
</li
>
51 <li
>Added support for OAuth2 authentication.
</li
>
52 <li
>Fixed several bugs discovered by Coverity.
</li
>
53 <li
>Corrected handling of date/datetime fields.
</li
>
54 <li
>Improved error reporting when rejecting during deserializatoin.
</li
>
55 <li
>Adjusted default values provided for ny-arkivdel, ny-mappe,
56 ny-saksmappe, ny-journalpost and ny-dokumentbeskrivelse.
</li
>
57 <li
>Several fixes for korrespondansepart*.
</li
>
58 <li
>Updated web GUI:
60 <li
>Now handle both file upload and download.
</li
>
61 <li
>Uses new OAuth2 authentication for login.
</li
>
62 <li
>Forms now fetches default values from API using GET.
</li
>
63 <li
>Added RFC
822 (email), TIFF and JPEG to list of possible file formats.
</li
>
64 </ul
></li
>
67 <p
>The changes and improvements are extensive. Running diffstat on
68 the changes between git tab
0.1.1 and
0.2 show
1098 files changed,
69 108666 insertions(+),
54066 deletions(-).
</p
>
71 <p
>If free and open standardized archiving API sound interesting to
72 you, please contact us on IRC
73 (
<a href=
"irc://irc.freenode.net/%
23nikita
">#nikita on
74 irc.freenode.net
</a
>) or email
75 (
<a href=
"https://lists.nuug.no/mailman/listinfo/nikita-noark
">nikita-noark
76 mailing list
</a
>).
</p
>
78 <p
>As usual, if you use Bitcoin and want to show your support of my
79 activities, please send Bitcoin donations to my address
80 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>.
</p
>
85 <title>Fetching trusted timestamps using the rfc3161ng python module
</title>
86 <link>http://people.skolelinux.org/pere/blog/Fetching_trusted_timestamps_using_the_rfc3161ng_python_module.html
</link>
87 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Fetching_trusted_timestamps_using_the_rfc3161ng_python_module.html
</guid>
88 <pubDate>Mon,
8 Oct
2018 12:
30:
00 +
0200</pubDate>
89 <description><p
>I have earlier covered the basics of trusted timestamping using the
90 'openssl ts
' client. See blog post for
91 <a href=
"http://people.skolelinux.org/pere/blog/Public_Trusted_Timestamping_services_for_everyone.html
">2014</a
>,
92 <a href=
"http://people.skolelinux.org/pere/blog/syslog_trusted_timestamp___chain_of_trusted_timestamps_for_your_syslog.html
">2016</a
>
94 <a href=
"http://people.skolelinux.org/pere/blog/Idea_for_storing_trusted_timestamps_in_a_Noark_5_archive.html
">2017</a
>
95 for those stories. But some times I want to integrate the timestamping
96 in other code, and recently I needed to integrate it into Python.
97 After searching a bit, I found
98 <a href=
"https://dev.entrouvert.org/projects/python-rfc3161
">the
99 rfc3161 library
</a
> which seemed like a good fit, but I soon
100 discovered it only worked for python version
2, and I needed something
101 that work with python version
3. Luckily I next came across
102 <a href=
"https://github.com/trbs/rfc3161ng/
">the rfc3161ng library
</a
>,
103 a fork of the original rfc3161 library. Not only is it working with
104 python
3, it have fixed a few of the bugs in the original library, and
105 it has an active maintainer. I decided to wrap it up and make it
106 <a href=
"https://tracker.debian.org/pkg/python-rfc3161ng
">available in
107 Debian
</a
>, and a few days ago it entered Debian unstable and testing.
</p
>
109 <p
>Using the library is fairly straight forward. The only slightly
110 problematic step is to fetch the required certificates to verify the
111 timestamp. For some services it is straight forward, while for others
112 I have not yet figured out how to do it. Here is a small standalone
113 code example based on of the integration tests in the library code:
</p
>
120 Python
3 script demonstrating how to use the rfc3161ng module to
121 get trusted timestamps.
123 The license of this code is the same as the license of the rfc3161ng
129 import pyasn1.codec.der
133 import urllib.request
140 def fetch(url, f=None):
141 response = urllib.request.urlopen(url)
142 data = response.read()
148 with tempfile.NamedTemporaryFile() as cert_f,\
149 tempfile.NamedTemporaryFile() as ca_f,\
150 tempfile.NamedTemporaryFile() as msg_f,\
151 tempfile.NamedTemporaryFile() as tsr_f:
153 # First fetch certificates used by service
154 certificate_data = fetch(
'https://freetsa.org/files/tsa.crt
', cert_f)
155 ca_data_data = fetch(
'https://freetsa.org/files/cacert.pem
', ca_f)
157 # Then timestamp the message
159 rfc3161ng.RemoteTimestamper(
'http://freetsa.org/tsr
',
160 certificate=certificate_data)
161 data = b
"Python forever!\n
"
162 tsr = timestamper(data=data, return_tsr=True)
164 # Finally, convert message and response to something
'openssl ts
' can verify
166 store(tsr_f, pyasn1.codec.der.encoder.encode(tsr))
167 args = [
"openssl
",
"ts
",
"-verify
",
168 "-data
", msg_f.name,
169 "-in
", tsr_f.name,
170 "-CAfile
", ca_f.name,
171 "-untrusted
", cert_f.name]
172 subprocess.check_call(args)
174 if
'__main__
' == __name__:
178 <p
>The code fetches the required certificates, store them as temporary
179 files, timestamp a simple message, store the message and timestamp to
180 disk and ask
'openssl ts
' to verify the timestamp. A timestamp is
181 around
1.5 kiB in size, and should be fairly easy to store for future
184 <p
>As usual, if you use Bitcoin and want to show your support of my
185 activities, please send Bitcoin donations to my address
186 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>.
</p
>
191 <title>Automatic Google Drive sync using grive in Debian
</title>
192 <link>http://people.skolelinux.org/pere/blog/Automatic_Google_Drive_sync_using_grive_in_Debian.html
</link>
193 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Automatic_Google_Drive_sync_using_grive_in_Debian.html
</guid>
194 <pubDate>Thu,
4 Oct
2018 15:
20:
00 +
0200</pubDate>
195 <description><p
>A few days, I rescued a Windows victim over to Debian. To try to
196 rescue the remains, I helped set up automatic sync with Google Drive.
197 I did not find any sensible Debian package handling this
198 automatically, so I rebuild the grive2 source from
199 <a href=
"http://www.webupd8.org/
">the Ubuntu UPD8 PPA
</a
> to do the
200 task and added a autostart desktop entry and a small shell script to
201 run in the background while the user is logged in to do the sync.
202 Here is a sketch of the setup for future reference.
</p
>
204 <p
>I first created
<tt
>~/googledrive
</tt
>, entered the directory and
205 ran
'<tt
>grive -a
</tt
>' to authenticate the machine/user. Next, I
206 created a autostart hook in
<tt
>~/.config/autostart/grive.desktop
</tt
>
207 to start the sync when the user log in:
</p
>
209 <p
><blockquote
><pre
>
211 Name=Google drive autosync
213 Exec=/home/user/bin/grive-sync
214 </pre
></blockquote
></p
>
216 <p
>Finally, I wrote the
<tt
>~/bin/grive-sync
</tt
> script to sync
217 ~/googledrive/ with the files in Google Drive.
</p
>
219 <p
><blockquote
><pre
>
224 if [
"$syncpid
" ] ; then
228 trap cleanup EXIT INT QUIT
229 /usr/lib/grive/grive-sync.sh listen googledrive
2>&1 | sed
"s%^%$
0:%
" &
232 if ! xhost
>/dev/null
2>&1 ; then
233 echo
"no DISPLAY, exiting as the user probably logged out
"
236 if [ ! -e /run/user/
1000/grive-sync.sh_googledrive ] ; then
237 /usr/lib/grive/grive-sync.sh sync googledrive
240 done
2>&1 | sed
"s%^%$
0:%
"
241 </pre
></blockquote
></p
>
243 <p
>Feel free to use the setup if you want. It can be assumed to be
244 GNU GPL v2 licensed (or any later version, at your leisure), but I
245 doubt this code is possible to claim copyright on.
</p
>
247 <p
>As usual, if you use Bitcoin and want to show your support of my
248 activities, please send Bitcoin donations to my address
249 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>.
</p
>