From 05a11712890b1d1e37d1eb3dfe881b6d0ec6efa1 Mon Sep 17 00:00:00 2001 From: anarsec Date: Fri, 22 Nov 2024 13:04:27 -0500 Subject: [PATCH] layout fr --- content/posts/e2ee/index.md | 4 +- content/posts/grapheneos/index.md | 4 +- content/posts/linux/index.md | 4 +- content/posts/metadata/index.md | 4 +- content/posts/nophones/index.fr.md | 4 +- content/posts/nophones/index.md | 4 +- content/posts/qubes/index.md | 4 +- content/posts/router/index.md | 4 +- content/posts/tails-best/index.md | 4 +- content/posts/tails/index.md | 4 +- content/posts/tamper/index.md | 4 +- content/series/_index.fr.md | 12 +++--- layout/anarsec_article.typ | 23 +++++++++-- layout/python/anarsec_article_to_pdf.py | 51 ++++++++++++++++++++----- 14 files changed, 88 insertions(+), 42 deletions(-) diff --git a/content/posts/e2ee/index.md b/content/posts/e2ee/index.md index 6f965fc..c2a7e0f 100644 --- a/content/posts/e2ee/index.md +++ b/content/posts/e2ee/index.md @@ -10,8 +10,8 @@ tags = ["intro", "e2ee", "beginner"] blogimage="/images/cwtch-dither.png" toc=true dateedit=2024-04-19 -a4="e2ee-a4.pdf" -letter = "e2ee-letter.pdf" +a4="e2ee-a4-en.pdf" +letter = "e2ee-letter-en.pdf" +++ There are several different options for [end-to-end encrypted](/glossary/#end-to-end-encryption-e2ee) communication, each with different trade-offs. This article provides an overview and installation instructions for Tails, Qubes OS, and GrapheneOS. diff --git a/content/posts/grapheneos/index.md b/content/posts/grapheneos/index.md index 3434ff2..12af565 100644 --- a/content/posts/grapheneos/index.md +++ b/content/posts/grapheneos/index.md @@ -10,8 +10,8 @@ tags = ["intro", "mobile", "beginner"] toc = true blogimage="/images/graphene-pink.png" dateedit=2024-04-22 -a4="grapheneos-a4.pdf" -letter="grapheneos-letter.pdf" +a4="grapheneos-a4-en.pdf" +letter="grapheneos-letter-en.pdf" +++ While [anarchists should minimize the presence of phones in their lives](/posts/nophones/), if you do decide to use a phone, make it as difficult as possible for an adversary to geotrack it, intercept its messages, or hack it. This means using GrapheneOS. diff --git a/content/posts/linux/index.md b/content/posts/linux/index.md index f20d579..141270c 100644 --- a/content/posts/linux/index.md +++ b/content/posts/linux/index.md @@ -11,8 +11,8 @@ blogimage="/gifs/destroy2.gif" blogimagepng="/images/destroy.png" toc=true dateedit=2024-04-21 -a4="linux-a4.pdf" -letter="linux-letter.pdf" +a4="linux-a4-en.pdf" +letter="linux-letter-en.pdf" +++ As an anarchist, someone's probably recommended that you use a Linux computer at some point. This article is intended to get you started by giving you a brief overview of what you need to know. diff --git a/content/posts/metadata/index.md b/content/posts/metadata/index.md index ef11666..9f8e9c6 100644 --- a/content/posts/metadata/index.md +++ b/content/posts/metadata/index.md @@ -10,8 +10,8 @@ tags = ["metadata", "tails", "qubes", "beginner"] blogimage="/images/app-dither.png" toc=true dateedit=2024-04-20 -a4="metadata-a4.pdf" -letter="metadata-letter.pdf" +a4="metadata-a4-en.pdf" +letter="metadata-letter-en.pdf" +++ diff --git a/content/posts/nophones/index.fr.md b/content/posts/nophones/index.fr.md index e94c91b..fd9495b 100644 --- a/content/posts/nophones/index.fr.md +++ b/content/posts/nophones/index.fr.md @@ -10,8 +10,8 @@ tags = ["mobile"] blogimage="/images/prison-pink.jpg" toc=true dateedit=2024-04-23 -a4="nophones-a4.pdf" -letter="nophones-letter.pdf" +a4="nophones-a4-fr.pdf" +letter="nophones-letter-fr.pdf" +++ La [culture de la sécurité et la sécurité opérationnelle](https://notrace.how/fr/blog/a-base-to-stand-on/une-base-sur-laquelle-s-appuyer.html), quand elles sont efficaces, empêchent les forces répressives de se renseigner sur nos activités criminelles, mais aussi sur nos vies, nos [relations](https://notrace.how/threat-library/fr/techniques/network-mapping.html), nos déplacements, et ainsi de suite. Ces renseignements sont un énorme atout pour préciser une liste de suspects et mettre en place de la surveillance ciblée. Cet article va présenter quelques stratégies pour tuer le flic dans ta poche. diff --git a/content/posts/nophones/index.md b/content/posts/nophones/index.md index 98be243..9c179b3 100644 --- a/content/posts/nophones/index.md +++ b/content/posts/nophones/index.md @@ -10,8 +10,8 @@ tags = ["mobile"] blogimage="/images/prison-pink.jpg" toc=true dateedit=2024-04-23 -a4="nophones-a4.pdf" -letter="nophones-letter.pdf" +a4="nophones-a4-en.pdf" +letter="nophones-letter-en.pdf" +++ Effective [security culture and operational security](https://www.notrace.how/fr/blog/a-base-to-stand-on/a-base-to-stand-on.html) prevents the forces of repression from knowing about our specific criminal activities, but also about our lives, [relationships](https://notrace.how/threat-library/techniques/network-mapping.html), movement patterns, and so on. This knowledge is a huge advantage in narrowing down suspects and conducting targeted surveillance. This article will outline some strategies for killing the cop in your pocket. diff --git a/content/posts/qubes/index.md b/content/posts/qubes/index.md index 78adda2..e3bc02a 100644 --- a/content/posts/qubes/index.md +++ b/content/posts/qubes/index.md @@ -10,8 +10,8 @@ tags = ["intro", "linux", "windows", "qubes", "intermediate"] blogimage="/images/qubes-dither.png" toc=true dateedit=2024-04-24 -a4="qubes-a4.pdf" -letter="qubes-letter.pdf" +a4="qubes-a4-en.pdf" +letter="qubes-letter-en.pdf" +++ Qubes OS is a security-oriented [operating system](/glossary#operating-system-os) (OS), which means it is an operating system designed from the ground up to be more difficult to hack. This is achieved through [compartmentalization](https://www.qubes-os.org/faq/#how-does-qubes-os-provide-security), where the base system is divided into compartments called "qubes". All other Linux systems like [Tails](/tags/tails/) are *monolithic*, which means that they are not compartmentalized, so if a hack succeeds anywhere on the system, it can more easily take over. In Qubes OS, if one qube is compromised, the others remain safe. You can think of using Qubes OS as having many different computers on your desk, each for a different activity, but with the convenience of a single physical machine and a set of tools for securely using them all together as a unified system. diff --git a/content/posts/router/index.md b/content/posts/router/index.md index f9a4b22..d289534 100644 --- a/content/posts/router/index.md +++ b/content/posts/router/index.md @@ -11,8 +11,8 @@ tags = ["linux", "router", "beginner"] blogimage="/images/bestpractices-dither.png" toc=true dateedit=2024-04-10 -a4="router-a4.pdf" -letter="router-letter.pdf" +a4="router-a4-en.pdf" +letter="router-letter-en.pdf" +++ The security of your home network matters because a malicious network device can be [used to attack any devices that connect to it](https://hak5.org/products/wifi-pineapple) and [State-sponsored malware campaigns are known to compromise network devices](https://arstechnica.com/information-technology/2022/06/a-wide-range-of-routers-are-under-attack-by-new-unusually-sophisticated-malware/). diff --git a/content/posts/tails-best/index.md b/content/posts/tails-best/index.md index fa91295..5c87157 100644 --- a/content/posts/tails-best/index.md +++ b/content/posts/tails-best/index.md @@ -10,8 +10,8 @@ tags = ["linux", "tails", "beginner"] blogimage="/images/bestpractices-dither.png" toc=true dateedit=2024-04-25 -a4="tails-best-a4.pdf" -letter="tails-best-letter.pdf" +a4="tails-best-a4-en.pdf" +letter="tails-best-letter-en.pdf" +++ All anarchists should know how to use Tails — this text describes some additional precautions you can take that are relevant to an anarchist [threat model](/glossary/#threat-model). Not all anarchist threat models are the same, and only you can decide which mitigations are worth putting into practice for your activities, but we aim to provide advice that is appropriate for high-risk activities like claiming an action. If you are new to Tails, start with [Tails for Anarchists](/posts/tails/). diff --git a/content/posts/tails/index.md b/content/posts/tails/index.md index 7d1c137..099506c 100644 --- a/content/posts/tails/index.md +++ b/content/posts/tails/index.md @@ -10,8 +10,8 @@ tags = ["intro", "linux", "tails", "beginner"] blogimage="/images/tails-dither.png" toc=true dateedit=2024-04-26 -a4="tails-a4.pdf" -letter="tails-letter.pdf" +a4="tails-a4-en.pdf" +letter="tails-letter-en.pdf" +++ Tails is an [operating system](/glossary/#operating-system-os) that makes anonymous computer use accessible to everyone. Tails is [designed](https://tails.net/about/index.en.html) to leave no trace of your activity on your computer unless you explicitly configure it to save specific data. It accomplishes this by running from a DVD or USB, independent of the operating system installed on the computer. Tails comes with [several built-in applications](https://tails.net/doc/about/features/index.en.html) preconfigured with security in mind, and all anarchists should know how to use it for secure communication, research, editing, and publishing sensitive content. diff --git a/content/posts/tamper/index.md b/content/posts/tamper/index.md index 0e3030c..9aa59fd 100644 --- a/content/posts/tamper/index.md +++ b/content/posts/tamper/index.md @@ -10,8 +10,8 @@ tags = ["opsec", "beginner"] blogimage="/images/beads-pink.jpg" toc=true dateedit=2024-04-18 -a4="tamper-a4.pdf" -letter="tamper-letter.pdf" +a4="tamper-a4-en.pdf" +letter="tamper-letter-en.pdf" +++ If the police ever have [physical access](/glossary/#physical-attacks) to an electronic device like a laptop, even [for five minutes](https://www.vice.com/en/article/a3q374/hacker-bios-firmware-backdoor-evil-maid-attack-laptop-5-minutes), they can install hardware keyloggers, create images of the storage media, or otherwise trivially compromise it at the hardware, firmware, or software level. One way to minimize this risk is to make devices tamper-evident. As the Threat Library [notes](https://notrace.how/threat-library/mitigations/tamper-evident-preparation.html), "Tamper-evident preparation is the process of taking precautionary measures to make it possible to detect when something has been physically accessed by an adversary." diff --git a/content/series/_index.fr.md b/content/series/_index.fr.md index bb590ec..7531789 100644 --- a/content/series/_index.fr.md +++ b/content/series/_index.fr.md @@ -7,9 +7,9 @@ paginate_by = 5
-AnarSec is a resource designed to help anarchists navigate the hostile terrain of technology — defensive guides for digital security and anonymity, as well as offensive guides for hacking. All guides are available in booklet format for printing and will be kept up to date. +AnarSec est une ressource conçue pour aider les anarchistes à se frayer un chemin à travers le terrain hostile de la technologie — des guides défensifs sur la sécurité numérique et l'anonymat, et des guides offensifs sur le piratage informatique. Tous les guides sont disponibles sous forme de brochures à imprimer et seront maintenus à jour. -## Defensive +## Défensif ### Tails * [Tails for Anarchists](/posts/tails/) @@ -18,17 +18,17 @@ AnarSec is a resource designed to help anarchists navigate the hostile terrain o ### Qubes OS * [Qubes OS for Anarchists](/posts/qubes/) -### Phones -* [Kill the Cop in Your Pocket](/posts/nophones/) +### Téléphonie +* [**Tue le flic dans ta poche**](/fr/posts/nophones/) * [GrapheneOS for Anarchists](/posts/grapheneos/) -### General +### Général * [Linux Essentials](/posts/linux/) * [Remove Identifying Metadata From Files](/posts/metadata/) * [Encrypted Messaging for Anarchists](/posts/e2ee/) * [Make Your Electronics Tamper-Evident](/posts/tamper/) -## Offensive +## Offensif *Coming soon* diff --git a/layout/anarsec_article.typ b/layout/anarsec_article.typ index 140d896..628b94d 100644 --- a/layout/anarsec_article.typ +++ b/layout/anarsec_article.typ @@ -7,6 +7,7 @@ subtitle: none, category: none, backcoverinsidecontent: none, + lang: none, content ) = { @@ -43,18 +44,32 @@ dy: -20pt, )[ #set text(font: "Jost") - #text(18pt)[Series: #category] + #if lang == "en" [ + #text(18pt)[Series: #category] + ] + #if lang == "fr" [ + #text(18pt)[Séries: #category] + ] ] ] // inside cover page()[ - #set align(center + bottom) + #if lang == "en" [ + #set align(center + bottom) - #text()[This version of the zine was last edited on #lastediteddate. Visit anarsec.guide to see whether it has been updated since.] + #text()[This version of the zine was last edited on #lastediteddate. Visit anarsec.guide to see whether it has been updated since.] - #text()[The dagger symbol #super[†] on a word means that there is a glossary entry for it. Ai ferri corti.] + #text()[The dagger symbol #super[†] on a word means that there is a glossary entry for it. Ai ferri corti.] + ] + #if lang == "fr" [ + #set align(center + bottom) + + #text()[Cette version de la brochure a été modifiée pour la dernière fois le #lastediteddate. Visitez anarsec.guide/fr pour savoir si elle a été mise à jour depuis.] + + #text()[Le symbole de dague #super[†] près d'un mot indique qu'une entrée existe dans le glossaire pour ce mot. Ai ferri corti.] + ] ] // set headings diff --git a/layout/python/anarsec_article_to_pdf.py b/layout/python/anarsec_article_to_pdf.py index 1d52ff0..70197bf 100644 --- a/layout/python/anarsec_article_to_pdf.py +++ b/layout/python/anarsec_article_to_pdf.py @@ -22,7 +22,8 @@ class Converter: self.pandoc_binary = pandoc_binary self.typst_binary = typst_binary self.anarsec_root = anarsec_root - self.post_id = post_id + self.post_id = post_id.split('.',1)[0] + self.post_lang = post_id.split('.',1)[1] self.force = force self.verbose = verbose @@ -43,22 +44,34 @@ class Converter: """Convert the input file to the output file. This method should only be run once.""" # Set glossary file - glossary_file = self.anarsec_root / "content" / "glossary" / "_index.md" + if self.post_lang == 'en': + glossary_file = self.anarsec_root / "content" / "glossary" / "_index.md" + else: + glossary_file = self.anarsec_root / "content" / "glossary" / f"_index.{self.post_lang}.md" if not glossary_file.exists() or not glossary_file.is_file(): raise RuntimeError(f"Glossary file '{glossary_file}' doesn't exist or isn't a file.") # Set recommendations file - recommendations_file = self.anarsec_root / "content" / "recommendations" / "_index.md" + if self.post_lang == 'en': + recommendations_file = self.anarsec_root / "content" / "recommendations" / "_index.md" + else: + recommendations_file = self.anarsec_root / "content" / "recommendations" / f"_index.{self.post_lang}.md" if not recommendations_file.exists() or not recommendations_file.is_file(): raise RuntimeError(f"Recommendations file '{recommendations_file}' doesn't exist or isn't a file.") # Set series file - series_file = self.anarsec_root / "content" / "series" / "_index.md" + if self.post_lang == 'en': + series_file = self.anarsec_root / "content" / "series" / "_index.md" + else: + series_file = self.anarsec_root / "content" / "series" / f"_index.{self.post_lang}.md" if not series_file.exists() or not series_file.is_file(): raise RuntimeError(f"Series file '{series_file}' doesn't exist or isn't a file.") # Set input path - input_path = self.post_directory / "index.md" + if self.post_lang == 'en': + input_path = self.post_directory / "index.md" + else: + input_path = self.post_directory / f"index.{self.post_lang}.md" if not input_path.exists() or not input_path.is_file(): raise RuntimeError(f"Post Markdown file '{input_path}' doesn't exist or isn't a file.") @@ -73,7 +86,10 @@ class Converter: # For each paper size for paper_size in ["a4", "letter"]: # Set the output path - output_path = self.post_directory / f"{self.post_id}-{paper_size}.pdf" + if self.post_lang == 'en': + output_path = self.anarsec_root / "static" / "posts" / self.post_id / f"{self.post_id}-{paper_size}-{self.post_lang}.pdf" + else: + output_path = self.anarsec_root / "static" / self.post_lang / "posts" / self.post_id / f"{self.post_id}-{paper_size}-{self.post_lang}.pdf" if not self.force and output_path.exists(): raise RuntimeError(f"Output file '{output_path}' already exists.") @@ -122,7 +138,10 @@ class Converter: # Add recommendations to the Markdown content recommendations = re.search(r'\+{3}.*?\+{3}(.*)', recommendations_file.open().read(), re.MULTILINE | re.DOTALL).group(1) - markdown_content += f"\n\n# Appendix: Recommendations\n\n{recommendations}\n\n" + if self.post_lang == 'en': + markdown_content += f"\n\n# Appendix: Recommendations\n\n{recommendations}\n\n" + if self.post_lang == 'fr': + markdown_content += f"\n\n# Annexe: Recommendations\n\n{recommendations}\n\n" # Make all images paths relative in the Markdown content for extension in ["jpg", "png", "webp", "jpeg", "gif"]: @@ -138,7 +157,10 @@ class Converter: # Add glossary entries to the Markdown content if glossary_entries: - markdown_content += "\n\n# Appendix: Glossary\n\n" + if self.post_lang == 'en': + markdown_content += "\n\n# Appendix: Glossary\n\n" + if self.post_lang == 'fr': + markdown_content += "\n\n# Annexe: Glossaire\n\n" for entry, entry_content in glossary.items(): if entry in glossary_entries: markdown_content += f"## {entry_content[0]}\n\n{entry_content[1]}\n\n" @@ -159,6 +181,14 @@ class Converter: series_typst_path = pathlib.Path(workingDirectory) / f"series.typ" subprocess.check_call([str(self.pandoc_binary), "-f", "markdown", "-t", "typst", "--columns", "999999", "-o", series_typst_path, series_markdown_path]) + # mutlilingual categories + category = toml_front_matter["taxonomies"]["categories"][0] + if self.post_lang == 'fr': + if category == 'Defensive': + category = 'Défensif' + if category == 'Offensive': + category = 'Offensif' + # Build the full typst file full_typst_path = pathlib.Path(workingDirectory) / f"{self.post_id}-full.typ" full_typst = f""" @@ -173,8 +203,9 @@ class Converter: lastediteddate: "{toml_front_matter["extra"]["dateedit"]}", description: "{description}", subtitle: "{toml_front_matter.get("description")}", - category: "{toml_front_matter["taxonomies"]["categories"][0]}", + category: "{category}", backcoverinsidecontent: [{series_typst_path.open().read()}], + lang: "{self.post_lang}", content ) {typst_path.open().read()} @@ -225,7 +256,7 @@ if __name__ == "__main__": parser.add_argument("--pandoc-binary", type = pathlib.Path, required = True, help = "Path to the Pandoc binary. Minimum required version is 3.1.5.") parser.add_argument("--typst-binary", type = pathlib.Path, required = True, help = "Path to the typst binary. Minimum required version is 0.6.0.") parser.add_argument("--anarsec-root", type = pathlib.Path, required = True, help = "Root of the Anarsec repository.") - parser.add_argument("--post-id", type = str, required = True, help = "ID of the Anarsec post to convert, i.e. the name of the post folder in '/content/posts'.") + parser.add_argument("--post-id", type = str, required = True, help = "ID of the Anarsec post to convert with language added after a period, i.e. 'nophones.en' and 'nophones.fr', where 'nophones' is the name of the post folder in '/content/posts'.") parser.add_argument("-f", "--force", dest = "force", default = False, action = "store_true", help = "Replace the output files if they already exist.") parser.add_argument("-v", "--verbose", dest = "verbose", default = False, action = "store_true", help = "Print messages when the output files are created.") arguments = parser.parse_args()