├── .github
└── FUNDING.yml
├── LICENSE
├── README.md
├── SECURITY.md
├── journo-qubes-tasks
├── README.md
├── journo-qubes-tasks
├── journo-qubes-tasks-gui
├── journo-qubes-tasks-gui.py
└── journo-qubes-tasks.spec
├── minion.d
└── qujourno.conf
├── salt
├── README.md
├── dangerzone
│ ├── README.md
│ └── create.sls
├── files
│ └── qubes-shared-folders-dom0-0.2.1-53.fc37.noarch.rpm
├── proton-mail
│ ├── README.md
│ └── create.sls
├── proton-vpn
│ ├── README.md
│ └── create.sls
├── securedrop-viewer
│ ├── README.md
│ └── create.sls
├── signal
│ ├── README.md
│ └── create.sls
├── telegram
│ ├── README.md
│ └── create.sls
├── tor-browser
│ ├── README.md
│ └── create.sls
├── video-conferencing
│ ├── README.md
│ └── create.sls
├── whatsapp
│ ├── README.md
│ └── create.sls
├── work
│ ├── README.md
│ └── create.sls
└── writing
│ ├── README.md
│ ├── create.sls
│ └── files
│ ├── qubes-contrib-vm-r4.2.repo
│ └── qubes-shared-folders-0.3.1-63.fc39.x86_64.rpm
├── setup
├── setup-full
└── specs
└── example.spec
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | # These are supported funding model platforms
2 |
3 | github: kennethrrosen
4 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 |
9 | Preamble
10 |
11 | The GNU General Public License is a free, copyleft license for
12 | software and other kinds of works.
13 |
14 | The licenses for most software and other practical works are designed
15 | to take away your freedom to share and change the works. By contrast,
16 | the GNU General Public License is intended to guarantee your freedom to
17 | share and change all versions of a program--to make sure it remains free
18 | software for all its users. We, the Free Software Foundation, use the
19 | GNU General Public License for most of our software; it applies also to
20 | any other work released this way by its authors. You can apply it to
21 | your programs, too.
22 |
23 | When we speak of free software, we are referring to freedom, not
24 | price. Our General Public Licenses are designed to make sure that you
25 | have the freedom to distribute copies of free software (and charge for
26 | them if you wish), that you receive source code or can get it if you
27 | want it, that you can change the software or use pieces of it in new
28 | free programs, and that you know you can do these things.
29 |
30 | To protect your rights, we need to prevent others from denying you
31 | these rights or asking you to surrender the rights. Therefore, you have
32 | certain responsibilities if you distribute copies of the software, or if
33 | you modify it: responsibilities to respect the freedom of others.
34 |
35 | For example, if you distribute copies of such a program, whether
36 | gratis or for a fee, you must pass on to the recipients the same
37 | freedoms that you received. You must make sure that they, too, receive
38 | or can get the source code. And you must show them these terms so they
39 | know their rights.
40 |
41 | Developers that use the GNU GPL protect your rights with two steps:
42 | (1) assert copyright on the software, and (2) offer you this License
43 | giving you legal permission to copy, distribute and/or modify it.
44 |
45 | For the developers' and authors' protection, the GPL clearly explains
46 | that there is no warranty for this free software. For both users' and
47 | authors' sake, the GPL requires that modified versions be marked as
48 | changed, so that their problems will not be attributed erroneously to
49 | authors of previous versions.
50 |
51 | Some devices are designed to deny users access to install or run
52 | modified versions of the software inside them, although the manufacturer
53 | can do so. This is fundamentally incompatible with the aim of
54 | protecting users' freedom to change the software. The systematic
55 | pattern of such abuse occurs in the area of products for individuals to
56 | use, which is precisely where it is most unacceptable. Therefore, we
57 | have designed this version of the GPL to prohibit the practice for those
58 | products. If such problems arise substantially in other domains, we
59 | stand ready to extend this provision to those domains in future versions
60 | of the GPL, as needed to protect the freedom of users.
61 |
62 | Finally, every program is threatened constantly by software patents.
63 | States should not allow patents to restrict development and use of
64 | software on general-purpose computers, but in those that do, we wish to
65 | avoid the special danger that patents applied to a free program could
66 | make it effectively proprietary. To prevent this, the GPL assures that
67 | patents cannot be used to render the program non-free.
68 |
69 | The precise terms and conditions for copying, distribution and
70 | modification follow.
71 |
72 | TERMS AND CONDITIONS
73 |
74 | 0. Definitions.
75 |
76 | "This License" refers to version 3 of the GNU General Public License.
77 |
78 | "Copyright" also means copyright-like laws that apply to other kinds of
79 | works, such as semiconductor masks.
80 |
81 | "The Program" refers to any copyrightable work licensed under this
82 | License. Each licensee is addressed as "you". "Licensees" and
83 | "recipients" may be individuals or organizations.
84 |
85 | To "modify" a work means to copy from or adapt all or part of the work
86 | in a fashion requiring copyright permission, other than the making of an
87 | exact copy. The resulting work is called a "modified version" of the
88 | earlier work or a work "based on" the earlier work.
89 |
90 | A "covered work" means either the unmodified Program or a work based
91 | on the Program.
92 |
93 | To "propagate" a work means to do anything with it that, without
94 | permission, would make you directly or secondarily liable for
95 | infringement under applicable copyright law, except executing it on a
96 | computer or modifying a private copy. Propagation includes copying,
97 | distribution (with or without modification), making available to the
98 | public, and in some countries other activities as well.
99 |
100 | To "convey" a work means any kind of propagation that enables other
101 | parties to make or receive copies. Mere interaction with a user through
102 | a computer network, with no transfer of a copy, is not conveying.
103 |
104 | An interactive user interface displays "Appropriate Legal Notices"
105 | to the extent that it includes a convenient and prominently visible
106 | feature that (1) displays an appropriate copyright notice, and (2)
107 | tells the user that there is no warranty for the work (except to the
108 | extent that warranties are provided), that licensees may convey the
109 | work under this License, and how to view a copy of this License. If
110 | the interface presents a list of user commands or options, such as a
111 | menu, a prominent item in the list meets this criterion.
112 |
113 | 1. Source Code.
114 |
115 | The "source code" for a work means the preferred form of the work
116 | for making modifications to it. "Object code" means any non-source
117 | form of a work.
118 |
119 | A "Standard Interface" means an interface that either is an official
120 | standard defined by a recognized standards body, or, in the case of
121 | interfaces specified for a particular programming language, one that
122 | is widely used among developers working in that language.
123 |
124 | The "System Libraries" of an executable work include anything, other
125 | than the work as a whole, that (a) is included in the normal form of
126 | packaging a Major Component, but which is not part of that Major
127 | Component, and (b) serves only to enable use of the work with that
128 | Major Component, or to implement a Standard Interface for which an
129 | implementation is available to the public in source code form. A
130 | "Major Component", in this context, means a major essential component
131 | (kernel, window system, and so on) of the specific operating system
132 | (if any) on which the executable work runs, or a compiler used to
133 | produce the work, or an object code interpreter used to run it.
134 |
135 | The "Corresponding Source" for a work in object code form means all
136 | the source code needed to generate, install, and (for an executable
137 | work) run the object code and to modify the work, including scripts to
138 | control those activities. However, it does not include the work's
139 | System Libraries, or general-purpose tools or generally available free
140 | programs which are used unmodified in performing those activities but
141 | which are not part of the work. For example, Corresponding Source
142 | includes interface definition files associated with source files for
143 | the work, and the source code for shared libraries and dynamically
144 | linked subprograms that the work is specifically designed to require,
145 | such as by intimate data communication or control flow between those
146 | subprograms and other parts of the work.
147 |
148 | The Corresponding Source need not include anything that users
149 | can regenerate automatically from other parts of the Corresponding
150 | Source.
151 |
152 | The Corresponding Source for a work in source code form is that
153 | same work.
154 |
155 | 2. Basic Permissions.
156 |
157 | All rights granted under this License are granted for the term of
158 | copyright on the Program, and are irrevocable provided the stated
159 | conditions are met. This License explicitly affirms your unlimited
160 | permission to run the unmodified Program. The output from running a
161 | covered work is covered by this License only if the output, given its
162 | content, constitutes a covered work. This License acknowledges your
163 | rights of fair use or other equivalent, as provided by copyright law.
164 |
165 | You may make, run and propagate covered works that you do not
166 | convey, without conditions so long as your license otherwise remains
167 | in force. You may convey covered works to others for the sole purpose
168 | of having them make modifications exclusively for you, or provide you
169 | with facilities for running those works, provided that you comply with
170 | the terms of this License in conveying all material for which you do
171 | not control copyright. Those thus making or running the covered works
172 | for you must do so exclusively on your behalf, under your direction
173 | and control, on terms that prohibit them from making any copies of
174 | your copyrighted material outside their relationship with you.
175 |
176 | Conveying under any other circumstances is permitted solely under
177 | the conditions stated below. Sublicensing is not allowed; section 10
178 | makes it unnecessary.
179 |
180 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
181 |
182 | No covered work shall be deemed part of an effective technological
183 | measure under any applicable law fulfilling obligations under article
184 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
185 | similar laws prohibiting or restricting circumvention of such
186 | measures.
187 |
188 | When you convey a covered work, you waive any legal power to forbid
189 | circumvention of technological measures to the extent such circumvention
190 | is effected by exercising rights under this License with respect to
191 | the covered work, and you disclaim any intention to limit operation or
192 | modification of the work as a means of enforcing, against the work's
193 | users, your or third parties' legal rights to forbid circumvention of
194 | technological measures.
195 |
196 | 4. Conveying Verbatim Copies.
197 |
198 | You may convey verbatim copies of the Program's source code as you
199 | receive it, in any medium, provided that you conspicuously and
200 | appropriately publish on each copy an appropriate copyright notice;
201 | keep intact all notices stating that this License and any
202 | non-permissive terms added in accord with section 7 apply to the code;
203 | keep intact all notices of the absence of any warranty; and give all
204 | recipients a copy of this License along with the Program.
205 |
206 | You may charge any price or no price for each copy that you convey,
207 | and you may offer support or warranty protection for a fee.
208 |
209 | 5. Conveying Modified Source Versions.
210 |
211 | You may convey a work based on the Program, or the modifications to
212 | produce it from the Program, in the form of source code under the
213 | terms of section 4, provided that you also meet all of these conditions:
214 |
215 | a) The work must carry prominent notices stating that you modified
216 | it, and giving a relevant date.
217 |
218 | b) The work must carry prominent notices stating that it is
219 | released under this License and any conditions added under section
220 | 7. This requirement modifies the requirement in section 4 to
221 | "keep intact all notices".
222 |
223 | c) You must license the entire work, as a whole, under this
224 | License to anyone who comes into possession of a copy. This
225 | License will therefore apply, along with any applicable section 7
226 | additional terms, to the whole of the work, and all its parts,
227 | regardless of how they are packaged. This License gives no
228 | permission to license the work in any other way, but it does not
229 | invalidate such permission if you have separately received it.
230 |
231 | d) If the work has interactive user interfaces, each must display
232 | Appropriate Legal Notices; however, if the Program has interactive
233 | interfaces that do not display Appropriate Legal Notices, your
234 | work need not make them do so.
235 |
236 | A compilation of a covered work with other separate and independent
237 | works, which are not by their nature extensions of the covered work,
238 | and which are not combined with it such as to form a larger program,
239 | in or on a volume of a storage or distribution medium, is called an
240 | "aggregate" if the compilation and its resulting copyright are not
241 | used to limit the access or legal rights of the compilation's users
242 | beyond what the individual works permit. Inclusion of a covered work
243 | in an aggregate does not cause this License to apply to the other
244 | parts of the aggregate.
245 |
246 | 6. Conveying Non-Source Forms.
247 |
248 | You may convey a covered work in object code form under the terms
249 | of sections 4 and 5, provided that you also convey the
250 | machine-readable Corresponding Source under the terms of this License,
251 | in one of these ways:
252 |
253 | a) Convey the object code in, or embodied in, a physical product
254 | (including a physical distribution medium), accompanied by the
255 | Corresponding Source fixed on a durable physical medium
256 | customarily used for software interchange.
257 |
258 | b) Convey the object code in, or embodied in, a physical product
259 | (including a physical distribution medium), accompanied by a
260 | written offer, valid for at least three years and valid for as
261 | long as you offer spare parts or customer support for that product
262 | model, to give anyone who possesses the object code either (1) a
263 | copy of the Corresponding Source for all the software in the
264 | product that is covered by this License, on a durable physical
265 | medium customarily used for software interchange, for a price no
266 | more than your reasonable cost of physically performing this
267 | conveying of source, or (2) access to copy the
268 | Corresponding Source from a network server at no charge.
269 |
270 | c) Convey individual copies of the object code with a copy of the
271 | written offer to provide the Corresponding Source. This
272 | alternative is allowed only occasionally and noncommercially, and
273 | only if you received the object code with such an offer, in accord
274 | with subsection 6b.
275 |
276 | d) Convey the object code by offering access from a designated
277 | place (gratis or for a charge), and offer equivalent access to the
278 | Corresponding Source in the same way through the same place at no
279 | further charge. You need not require recipients to copy the
280 | Corresponding Source along with the object code. If the place to
281 | copy the object code is a network server, the Corresponding Source
282 | may be on a different server (operated by you or a third party)
283 | that supports equivalent copying facilities, provided you maintain
284 | clear directions next to the object code saying where to find the
285 | Corresponding Source. Regardless of what server hosts the
286 | Corresponding Source, you remain obligated to ensure that it is
287 | available for as long as needed to satisfy these requirements.
288 |
289 | e) Convey the object code using peer-to-peer transmission, provided
290 | you inform other peers where the object code and Corresponding
291 | Source of the work are being offered to the general public at no
292 | charge under subsection 6d.
293 |
294 | A separable portion of the object code, whose source code is excluded
295 | from the Corresponding Source as a System Library, need not be
296 | included in conveying the object code work.
297 |
298 | A "User Product" is either (1) a "consumer product", which means any
299 | tangible personal property which is normally used for personal, family,
300 | or household purposes, or (2) anything designed or sold for incorporation
301 | into a dwelling. In determining whether a product is a consumer product,
302 | doubtful cases shall be resolved in favor of coverage. For a particular
303 | product received by a particular user, "normally used" refers to a
304 | typical or common use of that class of product, regardless of the status
305 | of the particular user or of the way in which the particular user
306 | actually uses, or expects or is expected to use, the product. A product
307 | is a consumer product regardless of whether the product has substantial
308 | commercial, industrial or non-consumer uses, unless such uses represent
309 | the only significant mode of use of the product.
310 |
311 | "Installation Information" for a User Product means any methods,
312 | procedures, authorization keys, or other information required to install
313 | and execute modified versions of a covered work in that User Product from
314 | a modified version of its Corresponding Source. The information must
315 | suffice to ensure that the continued functioning of the modified object
316 | code is in no case prevented or interfered with solely because
317 | modification has been made.
318 |
319 | If you convey an object code work under this section in, or with, or
320 | specifically for use in, a User Product, and the conveying occurs as
321 | part of a transaction in which the right of possession and use of the
322 | User Product is transferred to the recipient in perpetuity or for a
323 | fixed term (regardless of how the transaction is characterized), the
324 | Corresponding Source conveyed under this section must be accompanied
325 | by the Installation Information. But this requirement does not apply
326 | if neither you nor any third party retains the ability to install
327 | modified object code on the User Product (for example, the work has
328 | been installed in ROM).
329 |
330 | The requirement to provide Installation Information does not include a
331 | requirement to continue to provide support service, warranty, or updates
332 | for a work that has been modified or installed by the recipient, or for
333 | the User Product in which it has been modified or installed. Access to a
334 | network may be denied when the modification itself materially and
335 | adversely affects the operation of the network or violates the rules and
336 | protocols for communication across the network.
337 |
338 | Corresponding Source conveyed, and Installation Information provided,
339 | in accord with this section must be in a format that is publicly
340 | documented (and with an implementation available to the public in
341 | source code form), and must require no special password or key for
342 | unpacking, reading or copying.
343 |
344 | 7. Additional Terms.
345 |
346 | "Additional permissions" are terms that supplement the terms of this
347 | License by making exceptions from one or more of its conditions.
348 | Additional permissions that are applicable to the entire Program shall
349 | be treated as though they were included in this License, to the extent
350 | that they are valid under applicable law. If additional permissions
351 | apply only to part of the Program, that part may be used separately
352 | under those permissions, but the entire Program remains governed by
353 | this License without regard to the additional permissions.
354 |
355 | When you convey a copy of a covered work, you may at your option
356 | remove any additional permissions from that copy, or from any part of
357 | it. (Additional permissions may be written to require their own
358 | removal in certain cases when you modify the work.) You may place
359 | additional permissions on material, added by you to a covered work,
360 | for which you have or can give appropriate copyright permission.
361 |
362 | Notwithstanding any other provision of this License, for material you
363 | add to a covered work, you may (if authorized by the copyright holders of
364 | that material) supplement the terms of this License with terms:
365 |
366 | a) Disclaiming warranty or limiting liability differently from the
367 | terms of sections 15 and 16 of this License; or
368 |
369 | b) Requiring preservation of specified reasonable legal notices or
370 | author attributions in that material or in the Appropriate Legal
371 | Notices displayed by works containing it; or
372 |
373 | c) Prohibiting misrepresentation of the origin of that material, or
374 | requiring that modified versions of such material be marked in
375 | reasonable ways as different from the original version; or
376 |
377 | d) Limiting the use for publicity purposes of names of licensors or
378 | authors of the material; or
379 |
380 | e) Declining to grant rights under trademark law for use of some
381 | trade names, trademarks, or service marks; or
382 |
383 | f) Requiring indemnification of licensors and authors of that
384 | material by anyone who conveys the material (or modified versions of
385 | it) with contractual assumptions of liability to the recipient, for
386 | any liability that these contractual assumptions directly impose on
387 | those licensors and authors.
388 |
389 | All other non-permissive additional terms are considered "further
390 | restrictions" within the meaning of section 10. If the Program as you
391 | received it, or any part of it, contains a notice stating that it is
392 | governed by this License along with a term that is a further
393 | restriction, you may remove that term. If a license document contains
394 | a further restriction but permits relicensing or conveying under this
395 | License, you may add to a covered work material governed by the terms
396 | of that license document, provided that the further restriction does
397 | not survive such relicensing or conveying.
398 |
399 | If you add terms to a covered work in accord with this section, you
400 | must place, in the relevant source files, a statement of the
401 | additional terms that apply to those files, or a notice indicating
402 | where to find the applicable terms.
403 |
404 | Additional terms, permissive or non-permissive, may be stated in the
405 | form of a separately written license, or stated as exceptions;
406 | the above requirements apply either way.
407 |
408 | 8. Termination.
409 |
410 | You may not propagate or modify a covered work except as expressly
411 | provided under this License. Any attempt otherwise to propagate or
412 | modify it is void, and will automatically terminate your rights under
413 | this License (including any patent licenses granted under the third
414 | paragraph of section 11).
415 |
416 | However, if you cease all violation of this License, then your
417 | license from a particular copyright holder is reinstated (a)
418 | provisionally, unless and until the copyright holder explicitly and
419 | finally terminates your license, and (b) permanently, if the copyright
420 | holder fails to notify you of the violation by some reasonable means
421 | prior to 60 days after the cessation.
422 |
423 | Moreover, your license from a particular copyright holder is
424 | reinstated permanently if the copyright holder notifies you of the
425 | violation by some reasonable means, this is the first time you have
426 | received notice of violation of this License (for any work) from that
427 | copyright holder, and you cure the violation prior to 30 days after
428 | your receipt of the notice.
429 |
430 | Termination of your rights under this section does not terminate the
431 | licenses of parties who have received copies or rights from you under
432 | this License. If your rights have been terminated and not permanently
433 | reinstated, you do not qualify to receive new licenses for the same
434 | material under section 10.
435 |
436 | 9. Acceptance Not Required for Having Copies.
437 |
438 | You are not required to accept this License in order to receive or
439 | run a copy of the Program. Ancillary propagation of a covered work
440 | occurring solely as a consequence of using peer-to-peer transmission
441 | to receive a copy likewise does not require acceptance. However,
442 | nothing other than this License grants you permission to propagate or
443 | modify any covered work. These actions infringe copyright if you do
444 | not accept this License. Therefore, by modifying or propagating a
445 | covered work, you indicate your acceptance of this License to do so.
446 |
447 | 10. Automatic Licensing of Downstream Recipients.
448 |
449 | Each time you convey a covered work, the recipient automatically
450 | receives a license from the original licensors, to run, modify and
451 | propagate that work, subject to this License. You are not responsible
452 | for enforcing compliance by third parties with this License.
453 |
454 | An "entity transaction" is a transaction transferring control of an
455 | organization, or substantially all assets of one, or subdividing an
456 | organization, or merging organizations. If propagation of a covered
457 | work results from an entity transaction, each party to that
458 | transaction who receives a copy of the work also receives whatever
459 | licenses to the work the party's predecessor in interest had or could
460 | give under the previous paragraph, plus a right to possession of the
461 | Corresponding Source of the work from the predecessor in interest, if
462 | the predecessor has it or can get it with reasonable efforts.
463 |
464 | You may not impose any further restrictions on the exercise of the
465 | rights granted or affirmed under this License. For example, you may
466 | not impose a license fee, royalty, or other charge for exercise of
467 | rights granted under this License, and you may not initiate litigation
468 | (including a cross-claim or counterclaim in a lawsuit) alleging that
469 | any patent claim is infringed by making, using, selling, offering for
470 | sale, or importing the Program or any portion of it.
471 |
472 | 11. Patents.
473 |
474 | A "contributor" is a copyright holder who authorizes use under this
475 | License of the Program or a work on which the Program is based. The
476 | work thus licensed is called the contributor's "contributor version".
477 |
478 | A contributor's "essential patent claims" are all patent claims
479 | owned or controlled by the contributor, whether already acquired or
480 | hereafter acquired, that would be infringed by some manner, permitted
481 | by this License, of making, using, or selling its contributor version,
482 | but do not include claims that would be infringed only as a
483 | consequence of further modification of the contributor version. For
484 | purposes of this definition, "control" includes the right to grant
485 | patent sublicenses in a manner consistent with the requirements of
486 | this License.
487 |
488 | Each contributor grants you a non-exclusive, worldwide, royalty-free
489 | patent license under the contributor's essential patent claims, to
490 | make, use, sell, offer for sale, import and otherwise run, modify and
491 | propagate the contents of its contributor version.
492 |
493 | In the following three paragraphs, a "patent license" is any express
494 | agreement or commitment, however denominated, not to enforce a patent
495 | (such as an express permission to practice a patent or covenant not to
496 | sue for patent infringement). To "grant" such a patent license to a
497 | party means to make such an agreement or commitment not to enforce a
498 | patent against the party.
499 |
500 | If you convey a covered work, knowingly relying on a patent license,
501 | and the Corresponding Source of the work is not available for anyone
502 | to copy, free of charge and under the terms of this License, through a
503 | publicly available network server or other readily accessible means,
504 | then you must either (1) cause the Corresponding Source to be so
505 | available, or (2) arrange to deprive yourself of the benefit of the
506 | patent license for this particular work, or (3) arrange, in a manner
507 | consistent with the requirements of this License, to extend the patent
508 | license to downstream recipients. "Knowingly relying" means you have
509 | actual knowledge that, but for the patent license, your conveying the
510 | covered work in a country, or your recipient's use of the covered work
511 | in a country, would infringe one or more identifiable patents in that
512 | country that you have reason to believe are valid.
513 |
514 | If, pursuant to or in connection with a single transaction or
515 | arrangement, you convey, or propagate by procuring conveyance of, a
516 | covered work, and grant a patent license to some of the parties
517 | receiving the covered work authorizing them to use, propagate, modify
518 | or convey a specific copy of the covered work, then the patent license
519 | you grant is automatically extended to all recipients of the covered
520 | work and works based on it.
521 |
522 | A patent license is "discriminatory" if it does not include within
523 | the scope of its coverage, prohibits the exercise of, or is
524 | conditioned on the non-exercise of one or more of the rights that are
525 | specifically granted under this License. You may not convey a covered
526 | work if you are a party to an arrangement with a third party that is
527 | in the business of distributing software, under which you make payment
528 | to the third party based on the extent of your activity of conveying
529 | the work, and under which the third party grants, to any of the
530 | parties who would receive the covered work from you, a discriminatory
531 | patent license (a) in connection with copies of the covered work
532 | conveyed by you (or copies made from those copies), or (b) primarily
533 | for and in connection with specific products or compilations that
534 | contain the covered work, unless you entered into that arrangement,
535 | or that patent license was granted, prior to 28 March 2007.
536 |
537 | Nothing in this License shall be construed as excluding or limiting
538 | any implied license or other defenses to infringement that may
539 | otherwise be available to you under applicable patent law.
540 |
541 | 12. No Surrender of Others' Freedom.
542 |
543 | If conditions are imposed on you (whether by court order, agreement or
544 | otherwise) that contradict the conditions of this License, they do not
545 | excuse you from the conditions of this License. If you cannot convey a
546 | covered work so as to satisfy simultaneously your obligations under this
547 | License and any other pertinent obligations, then as a consequence you may
548 | not convey it at all. For example, if you agree to terms that obligate you
549 | to collect a royalty for further conveying from those to whom you convey
550 | the Program, the only way you could satisfy both those terms and this
551 | License would be to refrain entirely from conveying the Program.
552 |
553 | 13. Use with the GNU Affero General Public License.
554 |
555 | Notwithstanding any other provision of this License, you have
556 | permission to link or combine any covered work with a work licensed
557 | under version 3 of the GNU Affero General Public License into a single
558 | combined work, and to convey the resulting work. The terms of this
559 | License will continue to apply to the part which is the covered work,
560 | but the special requirements of the GNU Affero General Public License,
561 | section 13, concerning interaction through a network will apply to the
562 | combination as such.
563 |
564 | 14. Revised Versions of this License.
565 |
566 | The Free Software Foundation may publish revised and/or new versions of
567 | the GNU General Public License from time to time. Such new versions will
568 | be similar in spirit to the present version, but may differ in detail to
569 | address new problems or concerns.
570 |
571 | Each version is given a distinguishing version number. If the
572 | Program specifies that a certain numbered version of the GNU General
573 | Public License "or any later version" applies to it, you have the
574 | option of following the terms and conditions either of that numbered
575 | version or of any later version published by the Free Software
576 | Foundation. If the Program does not specify a version number of the
577 | GNU General Public License, you may choose any version ever published
578 | by the Free Software Foundation.
579 |
580 | If the Program specifies that a proxy can decide which future
581 | versions of the GNU General Public License can be used, that proxy's
582 | public statement of acceptance of a version permanently authorizes you
583 | to choose that version for the Program.
584 |
585 | Later license versions may give you additional or different
586 | permissions. However, no additional obligations are imposed on any
587 | author or copyright holder as a result of your choosing to follow a
588 | later version.
589 |
590 | 15. Disclaimer of Warranty.
591 |
592 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
593 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
594 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
595 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
596 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
597 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
598 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
599 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
600 |
601 | 16. Limitation of Liability.
602 |
603 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
604 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
605 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
606 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
607 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
608 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
609 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
610 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
611 | SUCH DAMAGES.
612 |
613 | 17. Interpretation of Sections 15 and 16.
614 |
615 | If the disclaimer of warranty and limitation of liability provided
616 | above cannot be given local legal effect according to their terms,
617 | reviewing courts shall apply local law that most closely approximates
618 | an absolute waiver of all civil liability in connection with the
619 | Program, unless a warranty or assumption of liability accompanies a
620 | copy of the Program in return for a fee.
621 |
622 | END OF TERMS AND CONDITIONS
623 |
624 | How to Apply These Terms to Your New Programs
625 |
626 | If you develop a new program, and you want it to be of the greatest
627 | possible use to the public, the best way to achieve this is to make it
628 | free software which everyone can redistribute and change under these terms.
629 |
630 | To do so, attach the following notices to the program. It is safest
631 | to attach them to the start of each source file to most effectively
632 | state the exclusion of warranty; and each file should have at least
633 | the "copyright" line and a pointer to where the full notice is found.
634 |
635 |
636 | Copyright (C)
637 |
638 | This program is free software: you can redistribute it and/or modify
639 | it under the terms of the GNU General Public License as published by
640 | the Free Software Foundation, either version 3 of the License, or
641 | (at your option) any later version.
642 |
643 | This program is distributed in the hope that it will be useful,
644 | but WITHOUT ANY WARRANTY; without even the implied warranty of
645 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
646 | GNU General Public License for more details.
647 |
648 | You should have received a copy of the GNU General Public License
649 | along with this program. If not, see .
650 |
651 | Also add information on how to contact you by electronic and paper mail.
652 |
653 | If the program does terminal interaction, make it output a short
654 | notice like this when it starts in an interactive mode:
655 |
656 | Copyright (C)
657 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
658 | This is free software, and you are welcome to redistribute it
659 | under certain conditions; type `show c' for details.
660 |
661 | The hypothetical commands `show w' and `show c' should show the appropriate
662 | parts of the General Public License. Of course, your program's commands
663 | might be different; for a GUI interface, you would use an "about box".
664 |
665 | You should also get your employer (if you work as a programmer) or school,
666 | if any, to sign a "copyright disclaimer" for the program, if necessary.
667 | For more information on this, and how to apply and follow the GNU GPL, see
668 | .
669 |
670 | The GNU General Public License does not permit incorporating your program
671 | into proprietary programs. If your program is a subroutine library, you
672 | may consider it more useful to permit linking proprietary applications with
673 | the library. If this is what you want to do, use the GNU Lesser General
674 | Public License instead of this License. But first, please read
675 | .
676 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | qubes-for-journalists
2 | =========================
3 |
4 | *NOTE: as of April 2024, the journo-qubes-tasks rpm and GUI are not ready for production*
5 |
6 | Existing guides and infrastructure for journalists insufficiently prepares them for digitally interacting with sources, working on sensitive stories while protecting sensitive materials offline and online, and traveling cross borders with personal and professional data.
7 |
8 | There are myriad good resources for online anonymity,[^1] online privacy,[^2] and circumventing authoritarian regime strangleholds on internet restrictions.[^3] But the job of keeping a secure digital environment is a marathon, not a race,[^4] one which is difficult to maintain while operating in mass media structures reliant on poor digital security infrastructure and loose guidelines for digital health.
9 |
10 | Most journalists do not fundamentally understand how networks associate with their technology. [^5] Not for a lack of care or concern. There is simply a choice to be made: get the story, or dawdle learning Linux, coding, and the demands of jobs which often offer only tools distributed by the news or media organization.
11 |
12 | Researchers have also concluded similar failings of existing tools for journalists not primarily because of usability and integration issues, but that they actively hinder reporting, most sources dictate how communication is handled, and not least of all financial and timing constraints. [^6]
13 |
14 | Attacks on journalists and freedom of the press have increased markedly over the past several
15 | years around the globe.[^7] According to a paper published by the UC Berkely Center for Long-Term Cybersecurity a reason why "journalists do not take sufficient action to protect themselves online is that there is an overwhelming amount of security advice on the internet, most of which is difficult for journalist-readers to understand or translate into practice, and difficult for the authors of the advice to keep up to date."
16 |
17 | The author, Kristen Berdan, continues:
18 |
19 | >Most guides do not account for journalists’ busy schedules and time-pressured work cycles. Journalists also operate in an increasingly hostile environment, even in countries with democratic governments and some historical guarantees of freedom of the press and rule of law.
20 |
21 | Berdan concludes advice available online "provide[s] no clear path for users to improve their security in a time-efficient way."[^8]
22 |
23 | This guide — which curates and streamlines the myriad viable online sources to focus primarily on use by working investigative journalists, conflict reporters, and war correspondents — aims to help journalists a) understand their threat model and b) assist in easily integrating security practices into their workflow, despite hurdles presented by company-proffered equipment and systems and c) ultimately hopes to migrate journalists to such software as QubesOS for their work while gradually imparting best-practices and a greater understanding of how to mitigate threats (seen and unseen).
24 |
25 | *This guide takes the view that none of these implementation should be ignored and that risk assessments and physical security are never under-served in conflict zones; the internet is just another hostile environment.*
26 |
27 | ### 🟧 how to use this guide/repository
28 | 1. Introduces journalist threat models and the partitioning practices outlined in this guide. (Full stop. If the first section of the Wiki is all you have time for, that's all you'll need for now.)
29 | 2. Evaluates your current practices against the basic, necessary digital security measures listed here. This step introduces basic concepts and helps migrate to easy and simple workflow changes. (Subjects include fieldwork best practices, browser choices, and initial work/personal phone compartmentalization)
30 | 3. Furthers implementation what changes you've made in Step. 2 to secure your workstation and devices, encouraging you to introduce new layers of security, trading a few conveniences for greater safety and control. (Subjects include password managers, device encryption, secure communications, VPN, backup and restore practices, and writing software.)
31 | 4. Introduces you to resources and software to take full advantage and further streamline what steps you took in 2 and 3. (Subjects include amnesiac operating systems, Tor, DNS sinkholes, 2FA and keyfobs, GrapheneOS, and further reading.)
32 | 5. Configures and migrates workstation/latop to QubesOS (using helpful salt scripts and GUI).
33 |
34 | Please reach out with any questions, comments or suggestions: kennethrrosen@proton.me (or through any number of other secure channels: https://kennethrrosen.com/tips). Journalists under threat of violence, surveillance or other immediate danger, I will provide free assistance in implementing your threat model mitigations
35 |
36 | Remember: you can go as deep into digital and personal security as any internet rabbit hole. Take those steps which allow you to continue you work with a peace of mind, making you more aware of common pitfalls and adversarial tactics, and limit any distractions or obstacles to getting and publishing the story.
37 |
38 | ### 🟧 sitemap
39 | - [wiki](https://github.com/kennethrrosen/journoSEC/wiki)
40 | - [common questions and answers](TKTK)
41 | - [about the author](https://www.kennethrrosen.com/)
42 |
43 | ### 🟧 acknowledgments
44 | Literally thousands of sources, mentors, guides, books and my own failures. Many thanks to all, but especially:
45 |
46 | - [Unman](https://github.com/unman/)
47 | - [Ben Grande](https://github.com/ben-grande/qusal)
48 | - [Deeplow](https://github.com/deeplow/)
49 |
50 | ### 🟧 errata
51 | "Oh?", from my profile bio, is a nod to the moment when a source or story line becomes apparent and an investigation begins.
52 |
53 | [^1]: https://anonymousplanet.org/guide.html
54 | [^2]: https://www.privacyguides.org/
55 | [^3]: https://thenewoil.org/
56 | [^4]: https://www.amazon.com/Extreme-Privacy-What-Takes-Disappear/dp/B0898YGR58
57 | [^5]: Quote by Edward Snowden, on Twitter (looking for source)
58 | [^6]: 2015, "Investigating the Computer Security Practices and Needs of Journalists" https://www.franziroesner.com/pdf/journalism-sec15.pdf
59 | [^7]: https://news.un.org/en/story/2020/09/1071492
60 | [^8]: 2021, "An Evaluation of Online Security Guides for Journalists" https://cltc.berkeley.edu/wp-content/uploads/2021/01/Online_Security_Guides_for_Journalists.pdf
61 |
--------------------------------------------------------------------------------
/SECURITY.md:
--------------------------------------------------------------------------------
1 | # Security Policy
2 |
3 | ## Reporting a Vulnerability
4 |
5 | To report a vulnerability, create a pull request or send an email to kennethrrosen@proton.me
6 |
--------------------------------------------------------------------------------
/journo-qubes-tasks/README.md:
--------------------------------------------------------------------------------
1 | # journo-qubes-task
2 | *This is a work-in-progress. I anticipate the salt files to be completed first, then RPM packages, and lastly this manager*
3 | Journalist-specific QubesOS task-manager, modified from [unman's](https://github.com/unman/qubes-task) own.
4 |
--------------------------------------------------------------------------------
/journo-qubes-tasks/journo-qubes-tasks:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3
2 | from qubesadmin.tools.journo_qubes_tasks import main
3 | import sys
4 | if __name__ == '__main__':
5 | sys.exit(main())
6 |
--------------------------------------------------------------------------------
/journo-qubes-tasks/journo-qubes-tasks-gui:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3
2 | # journo-qubes-tasks-gui.py
3 | import subprocess
4 | import sys
5 |
6 | from PyQt5 import QtWidgets, QtGui, uic
7 | from PyQt5.QtWidgets import (
8 | QWidget, QApplication, QButtonGroup, QHBoxLayout, QVBoxLayout,
9 | QCheckBox, QLabel, QLineEdit, QMainWindow, QPushButton, QScrollArea,
10 | QSizePolicy, QSpacerItem )
11 |
12 | from PyQt5.QtCore import QObject, Qt, pyqtSignal, QProcess
13 | from PyQt5.QtGui import QPainter, QFont, QColor, QPen
14 | #from row import TaskRowWidget
15 | from qubesadmin.tools.qubes-journo-tasks import *
16 | from qubesadmin.tools.qvm_template import Template as Task
17 |
18 | appl = qubesadmin.Qubes()
19 | args=['dict']
20 | p_args, args = parser.parse_known_args(args)
21 | p_args = parser.parse_args(args, p_args)
22 | p_args.repo_files = REPO_FILE
23 | p_args.updatevm = appl.updatevm
24 | outputs={}
25 | outputs=list_tasks(p_args ,appl, 'dict')
26 | widget_names = outputs.keys()
27 |
28 | class TaskRowWidget(QWidget):
29 |
30 | def __init__(self, parent, name, summary):
31 | super(TaskRowWidget, self).__init__()
32 | self.parent = parent
33 | self.name = name # Name of widget used for searching.
34 | self.summary = summary
35 | self.is_on = False
36 |
37 | self.setAccessibleName = name
38 | self.lbl2 = QLabel(self.summary)
39 | self.checked = QCheckBox(self.name)
40 | parent.taskGroup.addButton(self.checked)
41 | self.btn_details = QPushButton("Details")
42 | self.btn_details.setAccessibleName(name)
43 | self.btn_details.setCheckable(False)
44 | self.btn_details.clicked.connect(parent.details_clicked)
45 |
46 | self.hbox = QHBoxLayout()
47 | self.hbox.addWidget(self.checked,20)
48 | self.hbox.addWidget(self.lbl2,60)
49 | self.hbox.addWidget(self.btn_details)
50 | self.setLayout(self.hbox)
51 |
52 |
53 | class MainWindow(QMainWindow):
54 |
55 |
56 | def __init__(self, command='dict', *args, **kwargs):
57 | super().__init__()
58 |
59 | self.tasks = QWidget() # Tasks container widget.
60 | self.tasksLayout = QVBoxLayout() # Tasks container layout.
61 | self.taskGroup = QButtonGroup()
62 | self.taskGroup.setExclusive(False)
63 |
64 | self.widgets = []
65 |
66 | for name in widget_names:
67 | detail = outputs[name]['summary']
68 | item = TaskRowWidget(self, name, detail)
69 | self.tasksLayout.addWidget(item)
70 | self.widgets.append(item)
71 |
72 | spacer = QSpacerItem(1, 1, QSizePolicy.Minimum, QSizePolicy.Expanding)
73 | self.tasksLayout.addItem(spacer)
74 | self.tasks.setLayout(self.tasksLayout)
75 | self.lbl = QLabel(""" Description
76 | """)
77 | self.lbl.setAlignment(Qt.AlignTop)
78 | # Scroll Area Properties.
79 | self.scroll = QScrollArea()
80 | self.scroll.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOn)
81 | self.scroll.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
82 | self.scroll.setWidgetResizable(True)
83 | self.scroll.setWidget(self.tasks)
84 |
85 | self.scroll2 = QScrollArea()
86 | self.scroll2.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOn)
87 | self.scroll2.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
88 | self.scroll2.setWidgetResizable(True)
89 | self.scroll2.setWidget(self.lbl)
90 |
91 | self.searchbar = QLineEdit()
92 | self.btn_install = QPushButton("Install")
93 | self.btn_install.setCheckable(False)
94 | self.btn_install.clicked.connect(self.install_tasks)
95 |
96 | # Add the items to VBoxLayout (applied to container widget)
97 | # which encompasses the whole window.
98 | container = QWidget()
99 | containerLayout = QVBoxLayout()
100 | #containerLayout.addWidget(self.searchbar)
101 | containerLayout.addWidget(self.btn_install)
102 | containerLayout.addWidget(self.scroll,60)
103 | containerLayout.addWidget(self.scroll2,40)
104 |
105 | container.setLayout(containerLayout)
106 | self.setCentralWidget(container)
107 |
108 | self.setGeometry(600, 100, 900, 600)
109 | self.setWindowTitle('Journo-Qubes Task Manager')
110 | self.setWindowIcon = QtGui.QIcon.fromTheme("journo-qubes-manager")
111 |
112 | def details_clicked(widget,state):
113 | sending_widget = widget.sender()
114 | name = (sending_widget.accessibleName())
115 | desc = outputs[name]['description']
116 | w.lbl.setText(desc)
117 |
118 | def install_tasks(widget,state):
119 | update_cmd = "sudo qubes-dom0-update "
120 | prefix = "journo-qubes-"
121 | checked_buttons = [i for i, button in enumerate(w.taskGroup.buttons()) if button.isChecked()]
122 | pkgs_to_install = []
123 | for i in checked_buttons:
124 | pkgs_to_install.append(prefix+w.taskGroup.buttons()[i].text())
125 | try:
126 | install_list = " ".join(pkgs_to_install)
127 | child = subprocess.Popen(update_cmd + install_list,shell=True)
128 | output = child.communicate()[0]
129 | except Exception as e: # pylint: disable=broad-except
130 | #output = child.communicate()[0]
131 | return 1
132 | return 0
133 |
134 | app = QtWidgets.QApplication(sys.argv)
135 | w = MainWindow()
136 | w.show()
137 | sys.exit(app.exec_())
138 |
--------------------------------------------------------------------------------
/journo-qubes-tasks/journo-qubes-tasks-gui.py:
--------------------------------------------------------------------------------
1 | #
2 | # Reuses code from The Qubes OS Project, https://www.qubes-os.org/
3 | #
4 | # Copyright (C) 2022 unman ***EDITED BY KRR
5 | #
6 | # Reuses code from qvm-template.py
7 | # Copyright (C) 2019 WillyPillow
8 | #
9 | # This program is free software; you can redistribute it and/or modify
10 | # it under the terms of the GNU Lesser General Public License as published by
11 | # the Free Software Foundation; either version 2.1 of the License, or
12 | # (at your option) any later version.
13 | #
14 | # This program is distributed in the hope that it will be useful,
15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | # GNU Lesser General Public License for more details.
18 | #
19 | # You should have received a copy of the GNU Lesser General Public License along
20 | # with this program; if not, write to the Free Software Foundation, Inc.,
21 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 |
23 | """Tool for managing Journo Qubes Tasks."""
24 |
25 | import argparse
26 | import collections
27 | import configparser
28 | import datetime
29 | import enum
30 | import fcntl
31 | import fnmatch
32 | import functools
33 | import glob
34 | import itertools
35 | import operator
36 | import os
37 | import re
38 | import rpm
39 | import subprocess
40 | import sys
41 | import typing
42 | import qubesadmin
43 |
44 | from qubesadmin.tools.qvm_template import is_match_spec
45 | from qubesadmin.tools.qvm_template import qrexec_popen
46 | from qubesadmin.tools.qvm_template import qubes_release
47 | from qubesadmin.tools.qvm_template import Template as Package
48 |
49 | DATE_FMT = '%Y-%m-%d %H:%M:%S'
50 | LOCK_FILE = '/var/tmp/qvm-task.lck'
51 | UPDATEVM = str('global UpdateVM')
52 | PACKAGE_NAME_PREFIX = 'journo-qubes-'
53 | ##REPO_FILE = ['/etc/yum.repos.d/3isec-dom0.repo'] ##NEED TO UPDATE TO INCLUDE OWN REPO
54 |
55 |
56 | class AlreadyRunning(Exception):
57 | """Another qvm-task is already running"""
58 |
59 |
60 | def get_parser() -> argparse.ArgumentParser:
61 | formatter = argparse.ArgumentDefaultsHelpFormatter
62 | parser_main = qubesadmin.tools.QubesArgumentParser(
63 | description=__doc__, formatter_class=formatter)
64 | parser_main.register(
65 | 'action', 'parsers', qubesadmin.tools.AliasedSubParsersAction)
66 | subparsers = parser_main.add_subparsers(
67 | dest='command', description='Command to run.')
68 |
69 | def parser_add_command(cmd, help_str):
70 | return subparsers.add_parser(
71 | cmd,
72 | formatter_class=formatter,
73 | help=help_str,
74 | description=help_str)
75 |
76 | parser_install = parser_add_command('install',
77 | help_str='Install tasks.')
78 | parser_list = parser_add_command('list',
79 | help_str='List Tasks.')
80 | parser_info = parser_add_command('info',
81 | help_str='Display details about Task.')
82 | parser_dict = parser_add_command('dict',
83 | help_str='Return dict of details about Task.')
84 | parser_install.add_argument('pkgs', nargs='*', metavar='PATTERN')
85 | for parser_x in [parser_list, parser_info, parser_dict]:
86 | parser_x.add_argument('--all', action='store_true',
87 | help='Show all tasks (default).')
88 | parser_x.add_argument('tasks', nargs='*')
89 |
90 | parser_search = parser_add_command('search',
91 | help_str='Search template details for the given string.')
92 | parser_search.add_argument('--all', action='store_true',
93 | help=('Search also in the template description and URL. In addition,'
94 | ' the criterion are evaluated with OR instead of AND.'))
95 | parser_search.add_argument('tasks', nargs='*', metavar='PATTERN')
96 |
97 | return parser_main
98 |
99 |
100 | parser = get_parser()
101 |
102 |
103 | class TaskState(enum.Enum):
104 | """Enum representing the state of a task."""
105 | INSTALLED = 'installed'
106 | AVAILABLE = 'available'
107 |
108 | def title(self) -> str:
109 | """Return a long description of the state. Can be used as headings."""
110 | # pylint: disable=invalid-name
111 | TASK_TITLES = {
112 | TaskState.INSTALLED: 'Installed Tasks',
113 | TaskState.AVAILABLE: 'Available Tasks',
114 | }
115 | return TASK_TITLES[self]
116 |
117 |
118 | def qrexec_payload(args: argparse.Namespace, app: qubesadmin.app.QubesBase,
119 | spec: str, refresh: bool) -> str:
120 | """Return payload string for the ``qubes.Template*`` qrexec calls.
121 | :param args: Arguments received by the application. Specifically,
122 | ``args.{enablerepo,disablerepo,repoid,releasever,repo_files}`` are used
123 | :param app: Qubes application object
124 | :param spec: Package spec to query (refer to ```` in the
125 | DNF documentation)
126 | :param refresh: Whether to force refresh repo metadata
127 | :return: Payload string
128 | :raises: Parser error if spec equals ``---`` or input contains ``\\n``
129 | """
130 | _ = app # unused
131 |
132 | if spec == '---':
133 | parser.error("Malformed template name: argument should not be '---'.")
134 |
135 | def check_newline(string, name):
136 | if '\n' in string:
137 | parser.error(f"Malformed {name}:" +
138 | " argument should not contain '\\n'.")
139 |
140 | payload = ''
141 | payload += '--refresh\n'
142 | args.releasever = qubes_release()
143 | check_newline(args.releasever, '--releasever')
144 | payload += f'--releasever={args.releasever}\n'
145 | check_newline(spec, 'template name')
146 | payload += spec + '\n'
147 | payload += '---\n'
148 | for path in args.repo_files:
149 | with open(path, 'r', encoding='utf-8') as fd:
150 | payload += fd.read() + '\n'
151 | return payload
152 |
153 |
154 | def qrexec_repoquery(
155 | args: argparse.Namespace,
156 | app: qubesadmin.app.QubesBase,
157 | spec: str = '*',
158 | refresh: bool = False) -> typing.List[Package]:
159 | """Query template information from repositories.
160 | :param args: Arguments received by the application. Specifically,
161 | ``args.{enablerepo,disablerepo,repoid,releasever,repo_files,updatevm}``
162 | are used
163 | :param app: Qubes application object
164 | :param spec: Package spec to query (refer to ```` in the
165 | DNF documentation). Defaults to ``*``
166 | :param refresh: Whether to force refresh repo metadata. Defaults to False
167 | :raises ConnectionError: if the qrexec call fails
168 | :return: List of ``Package`` objects representing the result of the query
169 | """
170 | payload = qrexec_payload(args, app, spec, refresh)
171 | proc = qrexec_popen(args, app, 'qubes.TemplateSearch')
172 | proc.stdin.write(payload.encode('UTF-8'))
173 | proc.stdin.close()
174 | stdout = proc.stdout.read(1 << 20).decode('ascii', 'strict')
175 | proc.stdout.close()
176 | stderr = proc.stderr.read(1 << 10).decode('ascii', 'strict')
177 | proc.stderr.close()
178 | if proc.wait() != 0:
179 | for line in stderr.rstrip().split('\n'):
180 | print(f"[Qrexec] {line}", file=sys.stderr)
181 | raise ConnectionError("qrexec call 'qubes.TemplateSearch' failed.")
182 | name_re = re.compile(r'\A[A-Za-z0-9._+][A-Za-z0-9._+-]*\Z')
183 | evr_re = re.compile(r'\A[A-Za-z0-9._+~]*\Z')
184 | date_re = re.compile(r'\A\d{4}-\d{1,2}-\d{1,2} \d{1,2}:\d{1,2}\Z')
185 | licence_re = re.compile(r'\A[A-Za-z0-9._+()][A-Za-z0-9._+()-]*\Z')
186 | result = []
187 | # FIXME: This breaks when \n is the first character of the description
188 | for line in stdout.split('|\n'):
189 | # Note that there's an empty entry at the end as .strip() is not used.
190 | # This is because if .strip() is used, the .split() will not work.
191 | if line == '':
192 | continue
193 | entry = line.split('|')
194 | try:
195 | # If there is an incorrect number of entries, raise an error
196 | # Unpack manually instead of stuffing into `Package` right away
197 | # so that it's easier to mutate stuff.
198 | name, epoch, version, release, reponame, dlsize, \
199 | buildtime, licence, url, summary, description = entry
200 |
201 | # Ignore packages that are not tasks
202 | if not name.startswith(PACKAGE_NAME_PREFIX):
203 | continue
204 | name = name[len(PACKAGE_NAME_PREFIX):]
205 |
206 | # Check that the values make sense
207 | if not re.fullmatch(name_re, name):
208 | raise ValueError
209 | for val in [epoch, version, release]:
210 | if not re.fullmatch(evr_re, val):
211 | raise ValueError
212 | if not re.fullmatch(name_re, reponame):
213 | raise ValueError
214 | dlsize = int(dlsize)
215 | # First verify that the date does not look weird, then parse it
216 | if not re.fullmatch(date_re, buildtime):
217 | raise ValueError
218 | buildtime = datetime.datetime.strptime(buildtime, '%Y-%m-%d %H:%M')
219 | # XXX: Perhaps whitelist licenses directly?
220 | if not re.fullmatch(licence_re, licence):
221 | raise ValueError
222 | # Check name actually matches spec
223 | if not is_match_spec(PACKAGE_NAME_PREFIX + name,
224 | epoch, version, release, spec)[0]:
225 | continue
226 |
227 | result.append(Package(name, epoch, version, release, reponame,
228 | dlsize, buildtime, licence, url, summary,
229 | description))
230 | except (TypeError, ValueError):
231 | raise ConnectionError("qrexec call 'qubes.TemplateSearch' failed:"
232 | " unexpected data format.")
233 | return result
234 |
235 |
236 | def locked(func):
237 | @functools.wraps(func)
238 | def wrapper(*args, **kwargs):
239 | with open(LOCK_FILE, 'w', encoding='ascii') as lock:
240 | try:
241 | fcntl.flock(lock.fileno(), fcntl.LOCK_EX | fcntl.LOCK_NB)
242 | except OSError:
243 | raise AlreadyRunning(
244 | f"Cannot get lock on {LOCK_FILE}. Perhaps another instance "
245 | f"of qvm-task is running?")
246 | try:
247 | return func(*args, **kwargs)
248 | finally:
249 | os.remove(LOCK_FILE)
250 | return wrapper
251 |
252 |
253 | @locked
254 |
255 |
256 | def install(args: argparse.Namespace) -> None:
257 | pkgs_to_install = [PACKAGE_NAME_PREFIX + pkg for pkg in args.pkgs ]
258 | install_list = " ".join(pkgs_to_install)
259 | update_cmd = "sudo qubes-dom0-update "
260 | try:
261 | child = subprocess.Popen(update_cmd + install_list,shell=True)
262 | output = child.communicate()[0]
263 | except Exception as e: # pylint: disable=broad-except
264 | print('ERROR: ' + str(e), file=sys.stderr)
265 | return 1
266 |
267 | return 0
268 |
269 |
270 | def list_tasks(args: argparse.Namespace,
271 | app: qubesadmin.app.QubesBase, command: str) -> None:
272 | """Command that lists tasks.
273 | :param args: Arguments received by the application.
274 | :param app: Qubes application object
275 | :param command: If set to ``list``, display a listing similar to ``dnf
276 | list``. If set to ``info``, display detailed template information
277 | similar to ``dnf info``. Otherwise, an ``AssertionError`` is raised.
278 | """
279 | task_list = []
280 |
281 | def append_list(data, status, install_time=None):
282 | _ = install_time # unused
283 | task_list.append((status, data.name))
284 |
285 | def append_info(data, status, install_time=None):
286 | task_list.append((status, data, install_time))
287 |
288 | def list_to_human_output(tpls):
289 | outputs = []
290 | for status, grp in itertools.groupby(tpls, lambda x: x[0]):
291 | def convert(row):
292 | return row[1:]
293 | outputs.append((status, list(map(convert, grp))))
294 | return outputs
295 |
296 | def info_to_human_output(tpls):
297 | outputs = []
298 | for status, grp in itertools.groupby(tpls, lambda x: x[0]):
299 | output = []
300 | for _, data, install_time in grp:
301 | output.append(('Name', ':', data.name))
302 | output.append(('Summary', ':', data.summary))
303 | # Only show "Description" for the first line
304 | title = 'Description'
305 | for line in data.description.splitlines():
306 | output.append((title, ':', line))
307 | title = ''
308 | output.append((' ', ' ', ' ')) # empty line
309 | outputs.append((status, output))
310 | return outputs
311 |
312 | def info_to_dict(pkgs):
313 | outputs = {}
314 | for status, grp in itertools.groupby(pkgs, lambda x: x[0]):
315 | for _, data, install_time in grp:
316 | outputs[data.name] = {
317 | 'summary' : data.summary ,
318 | 'description' : data.description
319 | }
320 | return outputs
321 |
322 | if command == 'list':
323 | append = append_list
324 | elif command == 'info':
325 | append = append_info
326 | elif command == 'dict':
327 | append = append_info
328 | else:
329 | assert False, 'Unknown command'
330 |
331 | def check_append(name, evr):
332 | return not args.tasks or \
333 | any(is_match_spec(name, *evr, spec)[0]
334 | for spec in args.tasks)
335 |
336 | args.all = True
337 |
338 | if args.all :
339 | if args.tasks:
340 | query_res_set: typing.Set[Package] = set()
341 | for spec in args.tasks:
342 | query_res_set |= set(qrexec_repoquery(
343 | args, app, PACKAGE_NAME_PREFIX + spec))
344 | query_res = list(query_res_set)
345 | else:
346 | query_res = qrexec_repoquery(args, app)
347 | if args.all:
348 | # Spec should already be checked by repoquery
349 | for data in query_res:
350 | append(data, TaskState.AVAILABLE)
351 | query_res = qrexec_repoquery(args, app)
352 | if len(task_list) == 0:
353 | parser.error('No matching tasks to list')
354 | elif command == 'dict':
355 | task_list = info_to_dict(task_list)
356 | return task_list
357 | else:
358 | if command == 'info':
359 | task_list = info_to_human_output(task_list)
360 | elif command == 'list':
361 | task_list = list_to_human_output(task_list)
362 | for status, grp in task_list:
363 | print(status.title())
364 | qubesadmin.tools.print_table(grp)
365 |
366 |
367 | def search(args: argparse.Namespace, app: qubesadmin.app.QubesBase) -> None:
368 | """Command that searches task details for given patterns.
369 | :param args: Arguments received by the application.
370 | :param app: Qubes application object
371 | """
372 | # Search in both installed and available tasks
373 | query_res = qrexec_repoquery(args, app)
374 |
375 | # pylint: disable=invalid-name
376 | WEIGHT_NAME_EXACT = 1 << 4
377 | WEIGHT_NAME = 1 << 3
378 | WEIGHT_SUMMARY = 1 << 2
379 | WEIGHT_DESCRIPTION = 1 << 1
380 | WEIGHT_URL = 1 << 0
381 |
382 | WEIGHT_TO_FIELD = [
383 | (WEIGHT_NAME_EXACT, 'Name'),
384 | (WEIGHT_NAME, 'Name'),
385 | (WEIGHT_SUMMARY, 'Summary'),
386 | (WEIGHT_DESCRIPTION, 'Description'),
387 | (WEIGHT_URL, 'URL')]
388 |
389 | search_res_by_idx: \
390 | typing.Dict[int, typing.List[typing.Tuple[int, str, bool]]] = \
391 | collections.defaultdict(list)
392 | for keyword in args.tasks:
393 | for idx, entry in enumerate(query_res):
394 | needle_types = \
395 | [(entry.name, WEIGHT_NAME), (entry.summary, WEIGHT_SUMMARY)]
396 | if args.all:
397 | needle_types += [(entry.description, WEIGHT_DESCRIPTION),
398 | (entry.url, WEIGHT_URL)]
399 | for key, weight in needle_types:
400 | if fnmatch.fnmatch(key, '*' + keyword + '*'):
401 | exact = keyword == key
402 | if exact and weight == WEIGHT_NAME:
403 | weight = WEIGHT_NAME_EXACT
404 | search_res_by_idx[idx].append((weight, keyword, exact))
405 |
406 | if not args.all:
407 | keywords = set(args.tasks)
408 | idxs = list(search_res_by_idx.keys())
409 | for idx in idxs:
410 | if keywords != set(x[1] for x in search_res_by_idx[idx]):
411 | del search_res_by_idx[idx]
412 |
413 | def key_func(x):
414 | # ORDER BY weight DESC, list_of_needles ASC, name ASC
415 | idx, needles = x
416 | weight = sum(t[0] for t in needles)
417 | name = query_res[idx][0]
418 | return -weight, needles, name
419 |
420 | search_res = sorted(search_res_by_idx.items(), key=key_func)
421 |
422 | def gen_header(needles):
423 | fields = []
424 | weight_types = set(x[0] for x in needles)
425 | for weight, field in WEIGHT_TO_FIELD:
426 | if weight in weight_types:
427 | fields.append(field)
428 | exact = all(x[-1] for x in needles)
429 | match = 'Exactly Matched' if exact else 'Matched'
430 | keywords = sorted(list(set(x[1] for x in needles)))
431 | return ' & '.join(fields) + ' ' + match + ': ' + ', '.join(keywords)
432 |
433 | last_header = ''
434 | for idx, needles in search_res:
435 | # Print headers
436 | cur_header = gen_header(needles)
437 | if last_header != cur_header:
438 | last_header = cur_header
439 | # XXX: The style is different from that of DNF
440 | print('===', cur_header, '===')
441 | print(query_res[idx].name, ':', query_res[idx].summary)
442 |
443 |
444 | def main(args: typing.Optional[typing.Sequence[str]] = None,
445 | app: typing.Optional[qubesadmin.app.QubesBase] = None) -> int:
446 | """Main routine of **qvm-task**.
447 | :param args: Override arguments received by the application. Optional
448 | :param app: Override Qubes application object. Optional
449 | :return: Return code of the application
450 | """
451 | # do two passes to allow global options after command name too
452 | p_args, args = parser.parse_known_args(args)
453 | p_args = parser.parse_args(args, p_args)
454 |
455 | if not p_args.command:
456 | parser.error('A command needs to be specified.')
457 |
458 | p_args.repo_files = REPO_FILE
459 | if app is None:
460 | app = qubesadmin.Qubes()
461 |
462 | p_args.updatevm = app.updatevm
463 |
464 | try:
465 | if p_args.command == 'install':
466 | install(p_args)
467 | elif p_args.command == 'list':
468 | list_tasks(p_args, app, 'list')
469 | elif p_args.command == 'info':
470 | list_tasks(p_args, app, 'info')
471 | elif p_args.command == 'dict':
472 | list_tasks(p_args, app, 'dict')
473 | elif p_args.command == 'search':
474 | search(p_args, app)
475 | else:
476 | parser.error(f'Command \'{p_args.command}\' not supported.')
477 | except Exception as e: # pylint: disable=broad-except
478 | print('ERROR: ' + str(e), file=sys.stderr)
479 | app.log.debug(str(e), exc_info=sys.exc_info())
480 | return 1
481 |
482 | return 0
483 |
484 |
485 | if __name__ == '__main__':
486 | sys.exit(main())
487 |
--------------------------------------------------------------------------------
/journo-qubes-tasks/journo-qubes-tasks.spec:
--------------------------------------------------------------------------------
1 | # or, build your own RPM
2 | # tar czf qubes-for-journalists-0.1.tar.gz qubes-for-journalists/
3 | # mv qubes-for-journalists-0.1.tar.gz ~/rpmbuild/SOURCES/
4 | # rpmbuild -ba qubes-for-journalists.spec
5 |
6 |
7 | Name: qubes-for-journalists
8 | Version: 0.1
9 | Release: 1
10 | Summary: A suite of tools and configurations for journalists using Qubes OS
11 |
12 | Group: Applications/System
13 | Vendor: Kenneth R. Rosen
14 | License: GPL
15 | URL: https://www.kennethrrosen.com/
16 |
17 | Source0: %{name}-%{version}.tar.gz
18 |
19 | BuildArch: noarch
20 | Requires: python3, qubesadmin
21 |
22 | %description
23 | A suite of tools, including a task manager and various configurations, tailored for journalists using Qubes OS. Integrates with Qubes OS Salt management for easy deployment of journalist-focused configurations and templates.
24 |
25 | %prep
26 | %setup -q
27 |
28 | %build
29 | # Placeholder for any build steps (compilation, etc.)
30 |
31 | %install
32 | rm -rf %{buildroot}
33 | # Install Python scripts
34 | mkdir -p %{buildroot}/usr/bin
35 | mkdir -p %{buildroot}/usr/lib/python3.8/site-packages/qubesadmin/journo-tools
36 | cp journo-qubes-tasks/journo-qubes-tasks* %{buildroot}/usr/bin/
37 | cp journo-qubes-tasks/journo-qubes-tasks-gui.py %{buildroot}/usr/lib/python3.8/site-packages/qubesadmin/journo-tools/
38 |
39 | # Install Salt scripts
40 | mkdir -p %{buildroot}/srv/salt/qujourno
41 | cp -r salt/* %{buildroot}/srv/salt/qujourno/
42 |
43 | %files
44 | %defattr(-,root,root,-)
45 | /usr/bin/journo-qubes-tasks
46 | /usr/bin/journo-qubes-tasks-gui
47 | /usr/lib/python3.8/site-packages/qubesadmin/journo-tools/journo-qubes-tasks-gui.py
48 | /srv/salt/qujourno/*
49 |
50 | %changelog
51 | * Tue Apr 4 2024 Kenneth R. Rosen - 0.1-1
52 | - Initial release of qubes-for-journalists package
53 |
--------------------------------------------------------------------------------
/minion.d/qujourno.conf:
--------------------------------------------------------------------------------
1 | # vim:ft=yaml
2 | ---
3 | file_roots:
4 | base:
5 | - /srv/salt/qujourno
6 |
--------------------------------------------------------------------------------
/salt/README.md:
--------------------------------------------------------------------------------
1 | qujourno (salt states for journalists)
2 | =========================
3 |
4 | Journalists rarely have the time to learn and navigate a new operating system. But they are familiar with many of the privacy- and security-focused tools and applications which Qubes hosts so well. QubesOS does a great many things, none of which (as yet) I explain here or in the Wiki. These scripts offer exactly what a journalist might use, in an environment that does not require a learning curve.
5 |
6 | If you have suggestions for other applications you, or the journalists you work, with use frequently, please open an `issue` orn write me direcly.
7 |
8 | ### 🟧 some notes on some decisions I've made
9 | - **Autostart of apps:** All apps automatically start on qube boot. Simply go to the menu, start the qube and the application will launch. Or use one of the menu buttons.
10 | - **Gnome instead of XFCE:** Recently Qubes switched the default templates to the XFCE windows manager. Gnome is better-suited to newcomers to Qubes, so I've created all qubes with Debian and Fedora templates based on Gnome. This may take extra time to download the base templates (Fedora-39, Debian-12), but the end-user experience will be easier.
11 | - **No minimal templates:** Minimal templates offer a smaller footprint on computers with less storage, and lessen the potential attack surface. For useability, these are not used.
12 | - **Packages installed in AdminVM (dom0):** Don't trust me. Read the scripts, or ask an admin to review. In some scripts I've installed `qubes-shared-folders` into dom0, but this is not strictly necessary. Always review the packages before installing. When possible, I've tried to package the remote applications into files here to make the installation quicker, but it is possible to use `curl` or `wget` from trusted sources instead, though this may take longer.
13 | - **All communications apps connect through Tor:** Since most journalists are familiar with the tenants and benefits of the Tor network, all communications (Signal, WhatsApp, Telegram, Proton Mail) are served over Tor through the `sys-whonix` qube.
14 | - **Individual READMEs:** Please familiarize yourself with the `README`s including in each salt subdirectory before installing. They provide additional information on what to expect after the qube is installed.
15 |
16 | ### 🟧 how to install the salt scripts
17 | - Ask a network admin or security admin in your newsroom to assist. Buy a new laptop for QubesOS only. (A $150 Lenovo x230 with 8gb of memory and a 250GB harddrive is a great choice.)
18 | - Write to me kennethrrosen@proton.me
19 | - There is a helpful `setup` script, but first you must (trust) and then clone this repository to a disp-vm in Qubes, [then transfer to dom0](https://www.qubes-os.org/doc/how-to-copy-from-dom0/#copying-to-dom0), then run the `setup` script. Presently (April, 2024) the setup script does not assume you wish all qubes/applications to be installed, so those commands to install them separately are provided in each README of the various subdirectories.
20 | - A `setup-full` script is included to blindly install all the qubes and applications found in this repository.
21 |
22 | ### 🟧 todo
23 | - discuss in plain language what a "threat model" looks like for most journalists, and what that would look like for those working in conflict zones.
24 | - strip non-intuitive abbreviations and names to make .desktop files and VMs more accessible to newcomers
25 | - add `qubes-idle-shutdown-app` in templates
26 | - add Mac-inspired XFCE tray
27 | - remove/replace gnome-keyring prompt in `proton-vpn`
28 | - favor `sys-rsync` data qube for faster backups, replacing some of the below items
29 | - implement "optional" weekly dom0 backup prompt
30 | - implement SD power-saving configurations
31 | - add `syncthingtray` rpm to `writing` qube
32 | - add `qubes-shared-folders` policies to `dom0`
33 | - add `crossover` rpm to `writing` files
34 | - reevaluate `set-menu-items` in each salt config
35 | - ensure all apps autostart on qubes start
36 |
--------------------------------------------------------------------------------
/salt/dangerzone/README.md:
--------------------------------------------------------------------------------
1 | ## Dangerzone for journalists
2 |
3 | This script will create a Dangerzone disposable. Dangerzone enables you to take potentially dangerous PDFs, office documents, or images and convert them to a safe PDF.
4 |
5 | ```
6 | sudo qubesctl state.apply --targets=tpl-dangerzone qujourno.dangerzone.create
7 | ```
8 |
9 | An overview of the qubes you'll create:
10 |
11 | | qube | type | purpose |
12 | |--------------|----------|---------|
13 | | dz-dvm | app qube | offline disposable template for performing conversions |
14 |
15 |
16 | Learn more [here](https://github.com/freedomofpress/dangerzone/blob/main/INSTALL.md)
17 |
18 |
--------------------------------------------------------------------------------
/salt/dangerzone/create.sls:
--------------------------------------------------------------------------------
1 | {#
2 | SPDX-FileCopyrightText: 2024 Kenneth R. Rosen
3 | SPDX-License-Identifier: GPL-3.0-or-later
4 | #}
5 |
6 | {% if grains['id'] == 'dom0' %}
7 |
8 | vms-depends:
9 | qvm.template_installed:
10 | - name: fedora-40
11 |
12 | dangerzone-present-id:
13 | qvm.clone:
14 | - name: sd-dangerzone-template
15 | - source: fedora-40
16 |
17 | dangerzone-features-id:
18 | qvm.features:
19 | - name: sd-dangerzone-template
20 | - enable:
21 | - appmenus-dispvm
22 |
23 | dz-dvm-present-id:
24 | qvm.present:
25 | - name: sd-dangerzone-dvm
26 | - label: red
27 | - template: sd-dangerzone-template
28 | - class: AppVM
29 |
30 | dz-dvm-prefs-id:
31 | qvm.prefs:
32 | - name: sd-dangerzone-dvm
33 | - netvm: ''
34 | - template_for_dispvms: True
35 | - default_dispvm: sd-dangerzone-dvm
36 |
37 | dz-dvm-features-id
38 | qvm.features:
39 | - name: sd-dangerzone-dvm
40 | - set:
41 | - menu-items: press.freedom.dangerzone.desktop
42 |
43 | dz-disp-present-id:
44 | qvm.present:
45 | - name: disp-sd-dangerzone
46 | - label: red
47 | - template: sd-dangerzone-dvm
48 | - default_dispvm: sd-dangerzone-dvm
49 | - class: DispVM
50 |
51 | create-rpc-policy:
52 | file.managed:
53 | - name: /etc/qubes/policy.d/50-dangerzone.policy
54 | - contents: |
55 | dz.Convert * @anyvm @dispvm:dz-dvm allow
56 |
57 | {% elif grains['id'] == 'sd-dangerzone-template' %}
58 |
59 | install-dangerzone:
60 | cmd.run:
61 | - name: |
62 | sudo dnf config-manager --add-repo=https://packages.freedom.press/yum-tools-prod/dangerzone/dangerzone.repo
63 | sudo dnf install -y --nogpgcheck dangerzone-qubes
64 |
65 | {% elif grains['id'] == 'disp-sd-dangerzone' %}
66 |
67 | qvm.features:
68 | - name: sd-dangerzone-dvm
69 | - set:
70 | - menu-items: press.freedom.dangerzone.desktop
71 |
72 | {% endif %}
73 |
--------------------------------------------------------------------------------
/salt/files/qubes-shared-folders-dom0-0.2.1-53.fc37.noarch.rpm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kennethrrosen/qubes-for-journalists/e3c2cdb2a24486c14340b37239fa826336527e98/salt/files/qubes-shared-folders-dom0-0.2.1-53.fc37.noarch.rpm
--------------------------------------------------------------------------------
/salt/proton-mail/README.md:
--------------------------------------------------------------------------------
1 | ### proton-mail
2 |
3 | Installs a Proton Mail qube (accounts are free), for exchanging end-to-end encrypted email that not even the provider has access to.
4 |
5 | This application is served over the Tor network.
6 |
7 | ```
8 | sudo qubesctl --targets=proton-mail state.apply qujourno.proton-mail.create
9 | ```
10 |
--------------------------------------------------------------------------------
/salt/proton-mail/create.sls:
--------------------------------------------------------------------------------
1 | {#
2 | SPDX-FileCopyrightText: 2024 Kenneth R. Rosen
3 | SPDX-License-Identifier: GPL-3.0-or-later
4 | #}
5 |
6 | {% if grains['id'] == 'dom0' %}
7 |
8 | vms-depends:
9 | qvm.template_installed:
10 | - name: fedora-39
11 |
12 | protonmail-present-id:
13 | qvm.present:
14 | - name: proton-mail
15 | - template: fedora-39
16 | - label: blue
17 | - class: StandaloneVM
18 |
19 | protonmail-prefs-id:
20 | qvm.prefs:
21 | - name: proton-mail
22 | - netvm: sys-whonix
23 |
24 | protonmail-features-id:
25 | qvm.features:
26 | - set:
27 | - menu-items: qubes-start.desktop proton-mail.desktop
28 |
29 | {% elif grains['id'] == 'proton-mail' %}
30 |
31 | protonmail-install-deps:
32 | pkg.installed:
33 | - pkgs:
34 | - curl
35 | - wget
36 | - pkg.uptodate:
37 | - refresh: True
38 |
39 | protonmail-install:
40 | cmd.run:
41 | - name: |
42 | wget https://proton.me/download/mail/linux/ProtonMail-desktop-beta.rpm
43 | dnf install -y ProtonMail-desktop-beta.rpm
44 |
45 | setup-autostart:
46 | file.symlink:
47 | - name: /home/user/.config/autostart/proton-mail.desktop
48 | - target: /usr/share/applications/proton-mail.desktop
49 | - user: user
50 | - group: user
51 | - force: True
52 | - makedirs: True
53 |
54 | {% endif %}
55 |
--------------------------------------------------------------------------------
/salt/proton-vpn/README.md:
--------------------------------------------------------------------------------
1 | ### proton-vpn
2 |
3 | Installs a ProtonVPN qube (accounts are free) to which other VMs can be connected; potentially your default-disposable or an unsafe browsing qube.
4 |
5 | This application is served over the Tor network.
6 |
7 | ```
8 | sudo qubesctl --targets=proton-vpn state.apply qujourno.proton-vpn.create
9 | ```
10 |
--------------------------------------------------------------------------------
/salt/proton-vpn/create.sls:
--------------------------------------------------------------------------------
1 | {#
2 | SPDX-FileCopyrightText: 2024 Kenneth R. Rosen
3 | SPDX-License-Identifier: GPL-3.0-or-later
4 | #}
5 |
6 | {% if grains['id'] == 'dom0' %}
7 |
8 | vms-depends:
9 | qvm.template_installed:
10 | - name: fedora-39
11 |
12 | protonvpn-present-id:
13 | qvm.present:
14 | - name: proton-vpn
15 | - template: fedora-39
16 | - label: gray
17 | - class: StandaloneVM
18 |
19 | protonvpn-prefs-id:
20 | qvm.prefs:
21 | - name: proton-vpn
22 | - netvm: sys-firewall
23 | - memory: 800
24 | - maxmem: 800
25 | - autostart: True
26 | - provides-network: True
27 |
28 | protonvpn-features-id
29 | qvm.features:
30 | - name: proton-vpn
31 | - disable:
32 | - service.cups
33 | - service.cups-browsed
34 | - service.tinyproxy
35 | - enable:
36 | - service.network-manager
37 | - service.qubes-firewall
38 | - set:
39 | - menu-items: protonvpn-app.desktop
40 |
41 | {% elif grains['id'] == 'proton-vpn' %}
42 |
43 | protonvpn-install-deps:
44 | pkg.installed:
45 | - pkgs:
46 | - curl
47 | - wget
48 | - pkg.uptodate:
49 | - refresh: True
50 |
51 | protonvpn-install:
52 | cmd.run:
53 | - name: |
54 | wget https://repo.protonvpn.com/fedora-39-stable/protonvpn-stable-release/protonvpn-stable-release-1.0.1-2.noarch.rpm
55 | dnf install -y ./protonvpn-stable-release-1.0.1-2.noarch.rpm
56 | dnf install -y --refresh proton-vpn-gnome-desktop
57 | dnf install -y libappindicator-gtk3 gnome-shell-extension-appindicator gnome-extensions-app
58 |
59 | setup-autostart:
60 | file.symlink:
61 | - name: /home/user/.config/autostart/protonvpn-app.desktop
62 | - target: /usr/share/applications/protonvpn-app.desktop
63 | - user: user
64 | - group: user
65 | - force: True
66 | - makedirs: True
67 |
68 | {% endif %}
69 |
--------------------------------------------------------------------------------
/salt/securedrop-viewer/README.md:
--------------------------------------------------------------------------------
1 | ### Securedrop journalist viewer
2 |
3 | Work-in-progress: A tunnel to the securedrop journalists viewing station. **IMPORTANT:** The admin will have to modify this script locally to ammend the tor link to the journalist login page for their [securedrop](https://securedrop.org/) instance.
4 |
5 | ```
6 | ```
7 |
--------------------------------------------------------------------------------
/salt/securedrop-viewer/create.sls:
--------------------------------------------------------------------------------
1 | {#
2 | SPDX-FileCopyrightText: 2024 Kenneth R. Rosen
3 | SPDX-License-Identifier: GPL-3.0-or-later
4 | #}
5 |
6 | {% if grains['id'] == 'dom0' %}
7 |
8 | {% set tpl_vm = 'tpl-securedrop' %}
9 | {% set source_vm = 'whonix-wokrstation-17' %}
10 | {% set external_url = 'YOUR_SECUREDROP_TOR_LINK_HERE %}
11 |
12 | clone_whonix_ws:
13 | qvm.clone:
14 | - name: {{ tpl_vm }}
15 | - source: {{ source_vm }}
16 |
17 | securedrop-features-id:
18 | qvm.features:
19 | - name: {{ tpl_vm }}
20 | - enable:
21 | - appmenus-dispvm
22 |
23 | decuredrop-present-id:
24 | qvm.present:
25 | - name: securedrop-viewer
26 | - label: green
27 | - template: tpl-securedrop
28 | - class: AppVM
29 |
30 | dz-dvm-prefs-id:
31 | qvm.prefs:
32 | - name: securedrop-viewer
33 | - netvm: sys-whonix
34 | - default_dispvm: tpl-securedrop
35 |
36 | modify_html_pages:
37 | cmd.run:
38 | - names: |
39 | qvm-run -p {{ tpl_vm }} "sed -i 's|file:///usr/share/doc/homepage/whonix-welcome-page/whonix.html|{{ external_url }}|g' /usr/share/doc/homepage/whonix-welcome-page/whonix.html"
40 | qvm-run -p {{ tpl_vm }} "sed -i 's|file:///usr/share/qubes/xdg-override/doc/homepage/whonix-welcome-page/whonix.html|{{ external_url }}|g' /usr/share/qubes/xdg-override/doc/homepage/whonix-welcome-page/whonix.html"
41 |
--------------------------------------------------------------------------------
/salt/signal/README.md:
--------------------------------------------------------------------------------
1 | ### signal messenger
2 |
3 | This will create a Signal qube where you can link your Signal account. It will also create a template (tpl-signal) so that you can use multiple instances (and numbers) of Signal simultaenously.
4 |
5 | This application is served over the Tor network.
6 |
7 | ```
8 | sudo qubesctl --targets=tpl-signal,signal state.apply qujourno.signal.create
9 | ```
10 |
--------------------------------------------------------------------------------
/salt/signal/create.sls:
--------------------------------------------------------------------------------
1 | {#
2 | SPDX-FileCopyrightText: 2024 Kenneth R. Rosen
3 | SPDX-License-Identifier: GPL-3.0-or-later
4 | #}
5 |
6 | {% if grains['id'] == 'dom0' %}
7 |
8 | vms-depends:
9 | qvm.template_installed:
10 | - name: debian-12
11 |
12 | signal-create-template-id:
13 | qvm.clone:
14 | - name: tpl-signal
15 | - source: debian-12
16 |
17 | signal-create-appvm-id:
18 | qvm.present:
19 | - name: signal
20 | - template: tpl-signal
21 | - label: yellow
22 | - class: AppVM
23 |
24 | signal-prefs-id:
25 | qvm.prefs:
26 | - name: signal
27 | - netvm: sys-whonix
28 |
29 | signal-features-id:
30 | qvm.features:
31 | - name: signal
32 | - disable:
33 | - service.cups
34 | - service.cups-browsed
35 | - service.tinyproxy
36 | - service.tracker
37 | - service.evolution-data-server
38 | - set:
39 | - menu-items: qubes-start.desktop signal-desktop.desktop
40 |
41 | setup-signal-firewall:
42 | cmd.run:
43 | - name: |
44 | qvm-check -q --running signal
45 | qvm-pause signal
46 | qvm-firewall signal reset
47 | qvm-firewall signal del --rule-no 0
48 | qvm-check -q --running signal
49 | qvm-unpause signal
50 | qvm-firewall signal add accept signal.org
51 | qvm-firewall signal add accept storage.signal.org
52 | qvm-firewall signal add accept chat.signal.org
53 | qvm-firewall signal add accept cdn.signal.org
54 | qvm-firewall signal add accept cdn2.signal.org
55 | qvm-firewall signal add accept sfu.voip.signal.org
56 | qvm-firewall signal add accept turn.voip.signal.org
57 | qvm-firewall signal add accept turn2.voip.signal.org
58 | qvm-firewall signal add accept turn3.voip.signal.org
59 |
60 | {% elif grains['id'] == 'tpl-signal' %}
61 |
62 | install-signal-keyring:
63 | cmd.run:
64 | - name: |
65 | curl --proxy http://127.0.0.1:8082/ --tlsv1.2 --proto =https --max-time 180 -0 https://updates.signal.org/desktop/apt/keys.asc | gpg --dearmor > /usr/share/keyrings/signal-desktop-keyring.gpg
66 | - unless: test -f /usr/share/keyrings/signal-desktop-keyring.gpg
67 |
68 | add-signal-repo:
69 | file.managed:
70 | - name: /etc/apt/sources.list.d/signal-xenial.list
71 | - contents: deb [arch=amd64 signed-by=/usr/share/keyrings/signal-desktop-keyring.gpg] https://updates.signal.org/desktop/apt xenial main
72 | - mode: '0644'
73 | - user: root
74 | - group: root
75 |
76 | update-and-install-signal:
77 | pkg.installed:
78 | - pkgs:
79 | - signal-desktop
80 | - refresh: True
81 |
82 | {% elif grains['id'] == 'signal' %}
83 |
84 | setup-desktop-autostart:
85 | file.symlink:
86 | - name: /home/user/.config/autostart/signal-desktop.desktop
87 | - target: /usr/share/applications/signal-desktop.desktop
88 | - user: user
89 | - group: user
90 | - force: True
91 | - makedirs: True
92 |
93 | {% endif %}
94 |
--------------------------------------------------------------------------------
/salt/telegram/README.md:
--------------------------------------------------------------------------------
1 | ### telegram-desktop
2 |
3 | Telegram application qube, served over the Tor network. With the template you may clone additional appvms (qubes) and use separate accounts simultaneously.
4 |
5 | ```
6 | sudo qubesctl --targets=tpl-telegram state.apply qujourno.telegram.create
7 | ```
8 |
9 | Credit: [Leo](https://forum.qubes-os.org/t/qubes-salt-beginners-guide/20126)
10 |
--------------------------------------------------------------------------------
/salt/telegram/create.sls:
--------------------------------------------------------------------------------
1 | {#
2 | SPDX-FileCopyrightText: 2024 Kenneth R. Rosen
3 | SPDX-License-Identifier: GPL-3.0-or-later
4 | #}
5 |
6 | {% if grains['id'] == 'dom0' %}
7 |
8 | vms-depends:
9 | qvm.template_installed:
10 | - name: debian-12
11 |
12 | clone-telegram:
13 | qvm.clone:
14 | - name: tpl-telegram
15 | - source: debian-12
16 |
17 | telegram-present-id:
18 | qvm.present:
19 | - name: telegram
20 | - template: tpl-telegram
21 | - label: yellow
22 | - class: AppVM
23 |
24 | telegram-prefs-id:
25 | qvm.prefs:
26 | - name: telegram
27 | - netvm: sys-whonix
28 |
29 | telegram-features-id:
30 | qvm.features:
31 | - name: telegram
32 | - set
33 | - menu-items: org.telegram.desktop.desktop
34 |
35 | {% elif grains['id'] == 'tpl-telegram' %}
36 |
37 | telegram-install-apps-in-template:
38 | pkg.installed:
39 | - pkgs:
40 | - telegram-desktop
41 | - pkg.uptodate:
42 | - refresh: True
43 |
44 | {% endif %}
45 |
--------------------------------------------------------------------------------
/salt/tor-browser/README.md:
--------------------------------------------------------------------------------
1 | ### tor-browser
2 |
3 | Everyone's heard of the Tor network. It helps maintain a semblence of anonymity at the cost of being rather slow. It is also somewhat amnesiatic. Thanks to this configured browser, though, you can still save bookmarks and logins (to websites like X or Facebook) and still browse elsewhere anonymously.
4 |
5 | (Note: A split browser varient is also installed in `writing` so that you may still reference links and source material in a web-connected browser. You may also use `anon-whonix` as an alternative)
6 |
7 | ```
8 | sudo qubesctl --targets=fedora-39,whonix-workstation-17 state.apply qujourno.tor-browser.create
9 | ```
10 |
11 | # Keyboard shortcuts
12 |
13 | The bold ones override standard browser shortcuts:
14 |
15 | Combination | Function
16 | -----------------|--------------------------------------------------------------
17 | **Alt-b** | Open bookmarks
18 | **Ctrl-d** | Bookmark current page
19 | Ctrl-Shift-Enter | Log into current page
20 | Ctrl-Shift-s | Move downloads to a qube of your choice
21 | **Ctrl-Shift-u** | `New Identity` on steroids: Quit and restart the browser in a new disposable, with fresh Tor circuits.
22 |
23 | Credit: [Rustybird](https://github.com/rustybird/qubes-app-split-browser)
24 |
--------------------------------------------------------------------------------
/salt/tor-browser/create.sls:
--------------------------------------------------------------------------------
1 | {#
2 | SPDX-FileCopyrightText: 2024 Kenneth R. Rosen
3 | SPDX-License-Identifier: GPL-3.0-or-later
4 | #}
5 |
6 | {% if grains['id'] == 'dom0' %}
7 |
8 | vms-depends:
9 | qvm.template_installed:
10 | - name: whonix-workstation-17
11 |
12 | tor-browser-present-id:
13 | qvm.present:
14 | - name: tor-browser
15 | - label: purple
16 | - template: fedora-39
17 | - class: AppVM
18 |
19 | tor-browser-prefs-id:
20 | qvm.prefs:
21 | - name: tor-browser
22 | - netvm: ''
23 | - autostart: false
24 |
25 | tor-browser-features-id:
26 | qvm.features:
27 | - name: tor-browser
28 | - set:
29 | - menu-items: split-browser.desktop split-browser-safest.desktop
30 |
31 | {% elif grains['id'] == 'whonix-workstation-17' %}
32 |
33 | whonix-refresh-nonroot:
34 | cmd.run:
35 | - name: upgrade-nonroot
36 | - runas: user
37 |
38 | whonix-install-contrib-packages:
39 | pkg.installed:
40 | - pkgs:
41 | - qubes-repo-contrib
42 | - pkg.uptodate:
43 | - refresh: True
44 |
45 | whonix-install-split:
46 | pkg.installed:
47 | - pkgs:
48 | - qubes-split-browser-disp
49 |
50 | {% elif grains['id'] == 'fedora-39' %}
51 |
52 | install-tor-split-contrib-packages:
53 | pkg.installed:
54 | - pkgs:
55 | - qubes-repo-contrib
56 | - qubes-split-browser
57 | - torbrowser-launcher
58 | - ca-certificates
59 | - pkg.update:
60 | - refresh: True
61 |
62 | {% endif %}
63 |
--------------------------------------------------------------------------------
/salt/video-conferencing/README.md:
--------------------------------------------------------------------------------
1 | ### todo
2 |
3 | ```
4 | ```
5 |
--------------------------------------------------------------------------------
/salt/video-conferencing/create.sls:
--------------------------------------------------------------------------------
1 | {#
2 | SPDX-FileCopyrightText: 2024 Kenneth R. Rosen
3 | SPDX-License-Identifier: GPL-3.0-or-later
4 | #}
5 |
6 |
7 | {% if grains['id'] == 'dom0' %}
8 |
9 | ensure_template_exists:
10 | qvm.clone:
11 | - name: fedora-39
12 | - clone_name: tpl-video
13 | - label: black
14 |
15 | ensure_video_vm_exists:
16 | qvm.present:
17 | - name: video
18 | - label: red
19 | - template: tpl-video
20 | - netvm: proton-vpn
21 | - require:
22 | - qvm: ensure_template_exists
23 |
24 | {% elif grains['id'] == 'tpl-video' %}
25 |
26 | install_zoom:
27 | pkg.installed:
28 | - names:
29 | - wget
30 | cmd.run:
31 | - name: |
32 | wget https://zoom.us/client/latest/zoom_x86_64.rpm
33 | sudo dnf install -y zoom_x86_64.rpm
34 |
35 | google-chrome-download-key:
36 | cmd.run:
37 | - name: rpm --import https://packages.microsoft.com/keys/microsoft.asc
38 | - creates:
39 | - /etc/pki/rpm-gpg/MICROSOFT-GPG-KEY
40 |
41 | google-chrome-add-repository:
42 | pkgrepo.managed:
43 | - name: google-chrome
44 | - humanname: Google Chrome
45 | - baseurl: http://dl.google.com/linux/chrome/rpm/stable/x86_64
46 | - gpgcheck: 1
47 | - gpgkey: file:///etc/pki/rpm-gpg/MICROSOFT-GPG-KEY
48 | - require:
49 | - cmd: google-chrome--download-key
50 |
51 | google-chrome-install-apps:
52 | pkg.installed:
53 | - pkgs:
54 | - google-chrome-stable
55 | - require:
56 | - pkgrepo: google-chrome--add-repository
57 |
58 | install_teams:
59 | pkg.installed:
60 | - names:
61 | - wget
62 | cmd.run:
63 | - name: |
64 | wget https://packages.microsoft.com/yumrepos/ms-teams/teams-1.3.00.5153-1.x86_64.rpm
65 | sudo dnf install -y teams-1.3.00.5153-1.x86_64.rpm
66 | sudo dnf install -y libXScrnSaver
67 |
68 |
69 | {% endif %}
70 |
71 |
--------------------------------------------------------------------------------
/salt/whatsapp/README.md:
--------------------------------------------------------------------------------
1 | ### whatsapp (whatsdesk)
2 |
3 | Creates a WhatsApp qube and templates, served over the Tor network, allowing you to create multiple instances and numbers if you have seperate numbers for work, personal, and sources.
4 |
5 | ```
6 | sudo qubesctl --targets=whatsapp,tpl-whatsapp state.apply qujourno.whatsapp.create
7 | ```
8 |
--------------------------------------------------------------------------------
/salt/whatsapp/create.sls:
--------------------------------------------------------------------------------
1 | {#
2 | SPDX-FileCopyrightText: 2024 Kenneth R. Rosen
3 | SPDX-License-Identifier: GPL-3.0-or-later
4 | #}
5 |
6 | {% if grains['id'] == 'dom0' %}
7 |
8 | vms-depends:
9 | qvm.template_installed:
10 | - name: fedora-39
11 |
12 | clone-whatsapp:
13 | qvm.clone:
14 | - name: tpl-whatsapp
15 | - source: fedora-39
16 |
17 | whatsapp-present-id:
18 | qvm.present:
19 | - name: whatsapp
20 | - template: tpl-whatsapp
21 | - label: yellow
22 | - class: AppVM
23 |
24 | whatsapp-prefs-id:
25 | qvm.prefs:
26 | - name: whatsapp
27 | - netvm: sys-whonix
28 |
29 | whatsapp-features-id:
30 | qvm.features:
31 | - name: whatsapp
32 | - set:
33 | - menu-items: whatsdesk_whatsdesk.desktop
34 |
35 | {% elif grains['id'] == 'tpl-whatsapp' %}
36 |
37 | whatsapp-install-app-depends:
38 | pkg.installed:
39 | - pkgs:
40 | - qubes-snapd-helper
41 | - snapd
42 | - pkg.uptodate:
43 | - refresh: True
44 |
45 | {% elif grains['id'] == 'whatsapp' %}
46 |
47 | snapd-service-running:
48 | service.running:
49 | - name: snapd.service
50 |
51 | whatsapp-snap-core-install:
52 | cmd.run:
53 | - name: |
54 | snap install core
55 | snap install whatsdesk
56 | # snap install whatsapp-for-linux
57 |
58 | {% endif %}
59 |
--------------------------------------------------------------------------------
/salt/work/README.md:
--------------------------------------------------------------------------------
1 | ### work (slack & google chrome)
2 |
3 | Creates a work appvm (qube) wherein you can use Google Chrome and Slack without needing to use the Qubes' global-copy-paste function. Save all your passwords in the `vault` qube, or have the browser remember them here and here alone.
4 |
5 | Google Chrome is configured to launch at startup. Please ignore the `gnome-keyring` password prompt and it should go away thereafter.
6 |
7 | **CAUTION**: The default is with a VPN connection through Proton, for which you must first install the proton vpn servicevm (qube). Otherwise the script will fail.
8 |
9 | ```
10 | sudo qubesctl --targets=tpl-work,work state.apply qujourno.work.create
11 | ```
12 |
--------------------------------------------------------------------------------
/salt/work/create.sls:
--------------------------------------------------------------------------------
1 | {#
2 | SPDX-FileCopyrightText: 2024 Kenneth R. Rosen
3 | SPDX-License-Identifier: GPL-3.0-or-later
4 | #}
5 |
6 | {% if grains['id'] == 'dom0' %}
7 |
8 | vms-depends:
9 | qvm.template_installed:
10 | - name: fedora-39
11 |
12 | clone-work:
13 | qvm.clone:
14 | - name: tpl-work
15 | - source: fedora-39
16 |
17 | work-present-id:
18 | qvm.present:
19 | - name: work
20 | - label: purple
21 | - template: tpl-work
22 | - class: AppVM
23 |
24 | work-prefs-id:
25 | qvm.prefs:
26 | - name: work
27 | - netvm: proton-vpn
28 |
29 | work-features-id:
30 | qvm.features:
31 | - name: work
32 | - set:
33 | - menu-items: qubes-start.desktop google-chrome.desktop slack.desktop
34 |
35 | {% elif grains['id'] == 'tpl-work' %}
36 |
37 | google-chrome-install-deps:
38 | pkg.installed:
39 | - pkgs:
40 | - fedora-workstation-repositories
41 | - pkg.uptodate:
42 | - refresh: True
43 |
44 | google-chrome-setup:
45 | cmd.run:
46 | - name: |
47 | dnf config-manager --set-enabled google-chrome
48 | dnf install -y --nogpgcheck google-chrome-stable
49 |
50 | slack-install:
51 | cmd.run:
52 | - name: |
53 | curl --proxy http://127.0.0.1:8082/ --tlsv1.2 --proto =https --max-time 180 -0 https://downloads.slack-edge.com/releases/linux/4.35.126/prod/x64/slack-4.35.126-0.1.el8.x86_64.rpm --output slack.rpm
54 | dnf install -y ./slack.rpm
55 | dnf update -y
56 |
57 | {% elif grains['id'] == 'work' %}
58 |
59 | setup-slack-autostart:
60 | file.symlink:
61 | - name: /home/user/.config/autostart/slack.desktop
62 | - target: /usr/share/applications/slack.desktop
63 | - user: user
64 | - group: user
65 | - force: True
66 | - makedirs: True
67 |
68 | setup-chrome-autostart:
69 | file.symlink:
70 | - name: /home/user/.config/autostart/google-chrome.desktop
71 | - target: /usr/share/applications/google-chrome.desktop
72 | - user: user
73 | - group: user
74 | - force: True
75 | - makedirs: True
76 |
77 | {% endif %}
78 |
--------------------------------------------------------------------------------
/salt/writing/README.md:
--------------------------------------------------------------------------------
1 | ### writing
2 |
3 | This salt stack creates two qubes, both standalones: a `writing` qube and a `syncthing` qube. The `writing` qube is entirely offline, inacessible to anyone but you. It connects through an internal QubesOS mechanism called qrexec to `syncthing` through a one-way tunnel that you control. `Syncthing` provides incremental backups of your writing through a one-way tunnel, and makes accessing those files from your phone or other computers easy.
4 |
5 | The `writing` qube comes preinstalled with:
6 | - libreoffice, a Microsoft Office replacement
7 | - Wine (free) and Crossover (paid) for use with Windows software such as Scrivener
8 |
9 | ```
10 | sudo qubesctl --targets=writing,syncthing state.apply qujourno.writing.create
11 | ```
12 |
13 |
--------------------------------------------------------------------------------
/salt/writing/create.sls:
--------------------------------------------------------------------------------
1 | {#
2 | SPDX-FileCopyrightText: 2024 Kenneth R. Rosen
3 | SPDX-License-Identifier: GPL-3.0-or-later
4 | #}
5 |
6 | {% if grains['id'] == 'dom0' %}
7 |
8 | vms-depends:
9 | qvm.template_installed:
10 | - name: fedora-39
11 |
12 | writing-present-id:
13 | qvm.present:
14 | - name: writing
15 | - template: fedora-39
16 | - label: blue
17 | - class: StandaloneVM
18 |
19 | writing-prefs-id:
20 | qvm.prefs:
21 | - name: writing
22 | - netvm: ''
23 | - disk: 75G
24 | - memory: 8000
25 | - maxmem: 8000
26 | - vcpus: 2
27 | - autostart: false
28 |
29 | writing-features-id:
30 | qvm.features:
31 | - name: writing
32 | - disable:
33 | - service.qubes-update-check
34 | - enable:
35 | - service.cupsd
36 | - syncthing
37 | - service.cups
38 | - set:
39 | - menu-items: libreoffice-writer.desktop split-browser.desktop split-browser-safest.desktop
40 |
41 | syncthing-present-id:
42 | qvm.present:
43 | - name: syncthing
44 | - template: fedora-39
45 | - label: orange
46 | - class: StandaloneVM
47 |
48 | syncthing-prefs-id:
49 | qvm.prefs:
50 | - name: syncthing
51 | - netvm: sys-firewall
52 | - disk: 75G
53 | - memory: 800
54 | - maxmem: 800
55 | - vcpus: 1
56 |
57 | /etc/qubes/policy.d:
58 | file.directory:
59 | - user: root
60 | - group: root
61 | - mode: '0755'
62 |
63 | /etc/qubes/policy.d/30-user.policy:
64 | file.append:
65 | - name: /etc/qubes/policy.d/30-user.policy
66 | - text: |
67 | #syncthing
68 | admin.vm.Start + writing syncthing allow target=dom0
69 | admin.vm.Shutdown + writing syncthing allow target=dom0
70 | service.CheckSyncthing + syncthing writing allow target=dom0
71 | #todo shared-folders-permissions
72 |
73 | ensure-qubes-shared-folders-dom0-exists:
74 | file.managed:
75 | - name: /qubes-shared-folders-dom0.rpm
76 | - source: salt://files/qubes-shared-folders-dom0-0.2.1-53.fc37.noarch.rpm
77 |
78 | install-dom0-qubes-shared-folders:
79 | cmd.run:
80 | - name: sudo dnf install -y /qubes-shared-folders-dom0.rpm
81 |
82 | {% elif grains['id'] == 'writing' %}
83 |
84 | install-contrib-repos:
85 | file.managed:
86 | - name: /etc/yum.repos.d/qubes-contrib-vm-r4.2.repo
87 | - source: salt://writing/files/qubes-contrib-vm-r4.2.repo
88 | - user: root
89 | - group: root
90 | - mode: '0644'
91 |
92 | writing-install-packages:
93 | pkg.installed:
94 | - pkgs:
95 | - qubes-split-browser
96 | - libreoffice
97 | # - wine64
98 | - winetricks
99 | # - wine32:i386
100 | # - winbind
101 | - pkg.uptodate:
102 | - refresh: True
103 |
104 | #todo
105 | install-crossover:
106 | cmd.run:
107 | - name: |
108 | curl --proxy http://127.0.0.1:8082/ --tlsv1.2 --proto =https --max-time 180 -0 http://crossover.codeweavers.com/redirect/crossover.rpm --output crossover.rpm
109 | dnf install -y ./crossover.rpm
110 |
111 | ensure-qubes-shared-folders-writ-exists:
112 | file.managed:
113 | - name: /qubes-shared-folders.rpm
114 | - source: salt://writing/files/qubes-shared-folders-0.3.1-63.fc39.x86_64.rpm
115 |
116 | install-writ-qubes-shared-folders:
117 | cmd.run:
118 | - name: sudo dnf install -y ./qubes-shared-folders.rpm
119 |
120 | manage-syncthing-code:
121 | file.managed:
122 | - name: /usr/bin/syncthing-mount
123 | - contents: |
124 | #!/bin/sh
125 | # service.CheckSyncthing deprecated because it's not being run by systemd
126 | # Log file location
127 | LOG_FILE=/var/log/syncthing-mount.log
128 |
129 | TIMEOUT=300 # Timeout in seconds
130 | START_TIME=$(date +%s)
131 |
132 | echo "Beginning script" >> $LOG_FILE
133 | sleep 2
134 |
135 | while true; do
136 | if qrexec-client-vm syncthing admin.vm.Start > $LOG_FILE
138 | break # Exit the loop if Syncthing is active
139 | else
140 | echo "Syncthing service is not active, waiting" >> $LOG_FILE
141 | fi
142 |
143 | CURRENT_TIME=$(date +%s)
144 | if [ $((CURRENT_TIME - START_TIME)) -ge $TIMEOUT ]; then
145 | echo "Timeout waiting for Syncthing to be ready" >> $LOG_FILE
146 | break # Exit the loop on timeout
147 | fi
148 | sleep 5 # Check every 5 seconds
149 | done
150 |
151 | sleep 5
152 | # Mount Syncthing folder
153 | echo "Creating mount point" >> $LOG_FILE
154 | mkdir -p /home/user/mnt
155 | echo "Attempting to mount Syncthing folder" >> $LOG_FILE
156 | systemctl start syncthing-mount.timer
157 | qvm-mount-folder syncthing /home/user/Sync /home/user/mnt
158 | sleep 5
159 | # Check if mount was successful and log
160 | if mount | grep -q '/home/user/mnt'; then
161 | echo "Mount operation successful" >> $LOG_FILE
162 | # Copy Documents
163 | echo "Copying Documents to mounted folder" >> $LOG_FILE
164 | sudo cp -r /home/user/Documents/* /home/user/mnt
165 | echo "Copy operation completed" >> $LOG_FILE
166 | else
167 | echo "Mount operation failed" >> $LOG_FILE
168 | fi
169 |
170 | sudo umount /home/user/mnt
171 | sudo rm -rf /home/user/mnt
172 | - mode: '0755'
173 |
174 | manage-syncthing-mount-service:
175 | file.managed:
176 | - name: /etc/systemd/system/syncthing-mount.service
177 | - contents: |
178 | [Unit]
179 | Description=Mount Syncthing Folder and Copy Documents
180 | After=network.target
181 |
182 | [Service]
183 | Type=oneshot
184 | ExecStart=/usr/bin/syncthing-mount
185 |
186 | [Install]
187 | WantedBy=multi-user.target
188 | - mode: '0755'
189 |
190 | manage-syncthing-mount-timer:
191 | file.managed:
192 | - name: /etc/systemd/system/syncthing-mount.timer
193 | - contents: |
194 | [Unit]
195 | Description=Run Syncthing copy service every hour
196 |
197 | [Timer]
198 | OnCalendar=*:0/30
199 | Persistent=true
200 |
201 | [Install]
202 | WantedBy=timers.target
203 | - mode: '0755'
204 |
205 | manage-syncthing-mount-shutdown:
206 | file.managed:
207 | - name: /etc/systemd/system/syncthing-shutdown.service
208 | - contents: |
209 | [Unit]
210 | Description=Shutdown Syncthing VM
211 | After=qubes-qrexec-agent.service
212 |
213 | [Service]
214 | Type=oneshot
215 | RemainAfterExit=true
216 | ExecStop=qrexec-client-vm syncthing admin.vm.Shutdown -v
217 |
218 | [Install]
219 | WantedBy=default.target
220 | - mode: '0755'
221 |
222 | manage-syncthing-mount-service-enable:
223 | service.enabled:
224 | - name: syncthing-mount.service
225 |
226 | manage-syncthing-mount-timer-enable:
227 | service.enabled:
228 | - name: syncthing-mount.timer
229 |
230 | manage-syncthing-mount-shutdown-enable:
231 | service.enabled:
232 | - name: syncthing-shutdown.service
233 |
234 | ensure-autostart-directory:
235 | file.directory:
236 | - name: /home/user/.config/autostart
237 | - user: user
238 | - group: user
239 | - mode: '0755'
240 | - makedirs: True
241 |
242 | {% elif grains['id'] == 'syncthing' %}
243 |
244 | ensure-qubes-shared-folders-syncthing-exists:
245 | file.managed:
246 | - name: /qubes-shared-folders.rpm
247 | - source: salt://writing/files/qubes-shared-folders-0.3.1-63.fc39.x86_64.rpm
248 |
249 | install-syncthing-qubes-shared-folders:
250 | cmd.run:
251 | - name: sudo dnf install -y /qubes-shared-folders.rpm
252 |
253 | install-syncthing-suite:
254 | pkg.installed:
255 | - pkgs:
256 | - syncthing
257 | # - syncthingtray
258 | - pkg.uptodate:
259 | - refresh: True
260 |
261 | manage-syncthing-rc-local:
262 | file.managed:
263 | - name: /rw/config/rc.local
264 | - contents: |
265 | #!/bin/sh
266 | syncthing
267 | # syncthingtray
268 | - mode: '0755'
269 |
270 | {% endif %}
271 |
--------------------------------------------------------------------------------
/salt/writing/files/qubes-contrib-vm-r4.2.repo:
--------------------------------------------------------------------------------
1 | [qubes-contrib-vm-r4.2-current]
2 | name = Qubes OS Contrib Repository for VM (updates)
3 | baseurl = https://contrib.qubes-os.org/yum/r4.2/current/vm/fc$releasever
4 | gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-qubes-4-contrib-fedora
5 | gpgcheck = 1
6 | enabled=1
7 |
8 | [qubes-contrib-vm-r4.2-current-testing]
9 | name = Qubes OS Contrib Repository for VM (updates-testing)
10 | baseurl = https://contrib.qubes-os.org/yum/r4.2/current-testing/vm/fc$releasever
11 | gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-qubes-4-contrib-fedora
12 | gpgcheck = 1
13 | enabled=0
14 |
--------------------------------------------------------------------------------
/salt/writing/files/qubes-shared-folders-0.3.1-63.fc39.x86_64.rpm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kennethrrosen/qubes-for-journalists/e3c2cdb2a24486c14340b37239fa826336527e98/salt/writing/files/qubes-shared-folders-0.3.1-63.fc39.x86_64.rpm
--------------------------------------------------------------------------------
/setup:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | ## SPDX-FileCopyrightText: 2024 Kenneth R. Rosen
3 | ## SPDX-License-Identifier: GPL-3.0-or-later
4 |
5 | set -eu
6 |
7 | test "$(hostname)" = "dom0" || { echo "Must be run from dom0" >&2; exit 1; }
8 | test "$(id -u)" = "0" || exec sudo "${0}"
9 |
10 | group="qujourno"
11 | file_roots="/srv/salt/${group}"
12 |
13 | rm -rf "${file_roots}"
14 | cp -f ./minion.d/qujourno.conf /etc/salt/minion.d/
15 | mkdir -p "${file_roots}"
16 | cp -r salt/* "${file_roots}"
17 |
--------------------------------------------------------------------------------
/setup-full:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | ## SPDX-FileCopyrightText: 2024 Kenneth R. Rosen
3 | ## SPDX-License-Identifier: GPL-3.0-or-later
4 |
5 | set -eu
6 |
7 | test "$(hostname)" = "dom0" || { echo "Must be run from dom0" >&2; exit 1; }
8 | test "$(id -u)" = "0" || exec sudo "$0"
9 |
10 | group="qujourno"
11 | file_roots="/srv/salt/${group}"
12 |
13 | rm -rf "${file_roots}"
14 | cp -f ./minion.d/qujourno.conf /etc/salt/minion.d/
15 | mkdir -p "${file_roots}"
16 | cp -r salt/* "${file_roots}"
17 |
18 | cd "${file_roots}"
19 |
20 | for directory in */ ; do
21 | journoqubes=${directory%/}
22 | echo "Applying state for $directoryname"
23 | qubesctl --show-progress state.apply qujourno.${journoqubes}.create
24 | done
25 |
--------------------------------------------------------------------------------
/specs/example.spec:
--------------------------------------------------------------------------------
1 | Name: writ
2 | Version: 1.0
3 | Release: 1%{?dist}
4 | Summary: Salt writ and syncthing qubes
5 |
6 | License: GPLv3+
7 | SOURCE0: templates
8 |
9 | %description
10 | Salt state to implement debian-11 template in Qubes
11 |
12 | %install
13 | rm -rf %{buildroot}
14 | mkdir -p %{buildroot}/srv/salt
15 | cp -rv %{SOURCE0}/* %{buildroot}/srv/salt
16 |
17 | %files
18 | %defattr(-,root,root,-)
19 | /srv/salt/*
20 |
21 | %post
22 | if [ $1 -eq 1 ]; then
23 | qubesctl state.apply template-debian-11
24 | fi
25 |
26 |
27 | %changelog
28 | * Sun May 15 2022 unman - 1.0
29 | - First Build
30 |
--------------------------------------------------------------------------------