Torah as the measure
++ Torah is not one compartment among many. Its wisdom and + obligations shape how we understand every part of life. +
+diff --git a/README.md b/README.md index d886e0a..891c051 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,17 @@ # TIDE -TIDE is the NixOS module for the Torah Im Derech Eretz forum. It deploys the -forum with NixOS Discourse and configures its production Borg backup. +TIDE is the website and NixOS module for the Torah Im Derech Eretz community. +It serves the static landing page at `torahimderecheretz.com`, deploys the +forum with NixOS Discourse, and configures its production Borg backup. + +## Landing page + +The landing page is a static HTML and CSS site in [`site`](./site). Build its +deployment package with: + +```console +nix build .#landing-page +``` ## NixOS module @@ -21,8 +31,9 @@ services.tide = { }; ``` -The module owns the forum hostname, site identity, SMTP configuration, and -backup policy. The importing host owns secret provisioning. +The module owns the landing page and forum hostnames, site identity, SMTP +configuration, and backup policy. The importing host owns secret provisioning +and ACME account configuration. See [RECOVERY.md](./RECOVERY.md) for the database and state restoration procedure. diff --git a/flake.nix b/flake.nix index b6c7f93..d2b5550 100644 --- a/flake.nix +++ b/flake.nix @@ -11,6 +11,7 @@ let system = "x86_64-linux"; pkgs = nixpkgs.legacyPackages.${system}; + landingPage = import ./nix/site.nix { inherit pkgs; }; in { nixosModules.tide = import ./nix/module.nix; @@ -20,6 +21,8 @@ inherit nixpkgs self system; }; + packages.${system}.landing-page = landingPage; + formatter.${system} = pkgs.nixfmt-tree; devShells.${system}.default = pkgs.mkShell { diff --git a/nix/module.nix b/nix/module.nix index f2d66b6..d3966ca 100644 --- a/nix/module.nix +++ b/nix/module.nix @@ -6,6 +6,17 @@ }: let cfg = config.services.tide; + landingPage = import ./site.nix { inherit pkgs; }; + contentSecurityPolicy = lib.concatStringsSep " " [ + "default-src 'self';" + "base-uri 'self';" + "font-src 'self';" + "form-action 'self';" + "frame-ancestors 'none';" + "img-src 'self' data:;" + "object-src 'none';" + "style-src 'self';" + ]; dumpCommand = lib.concatStringsSep " " [ "${config.services.postgresql.package}/bin/pg_dump" "--format=custom" @@ -32,6 +43,25 @@ in }; config = lib.mkIf cfg.enable { + services.nginx = { + enable = true; + virtualHosts."torahimderecheretz.com" = { + enableACME = true; + forceSSL = true; + root = landingPage; + + locations."/" = { + tryFiles = "$uri $uri/ =404"; + extraConfig = '' + add_header Content-Security-Policy "${contentSecurityPolicy}" always; + add_header Permissions-Policy "camera=(), geolocation=(), microphone=()" always; + add_header Referrer-Policy "strict-origin-when-cross-origin" always; + add_header X-Content-Type-Options "nosniff" always; + ''; + }; + }; + }; + services.discourse = { enable = true; admin = { diff --git a/nix/site.nix b/nix/site.nix new file mode 100644 index 0000000..c5950b1 --- /dev/null +++ b/nix/site.nix @@ -0,0 +1,18 @@ +{ pkgs }: + +pkgs.stdenvNoCC.mkDerivation { + pname = "tide-landing-page"; + version = "1.0.0"; + src = ../site; + + dontBuild = true; + + installPhase = '' + runHook preInstall + + mkdir -p "$out" + cp -R . "$out" + + runHook postInstall + ''; +} diff --git a/nix/tests/module.nix b/nix/tests/module.nix index 2e0a880..5561d17 100644 --- a/nix/tests/module.nix +++ b/nix/tests/module.nix @@ -25,8 +25,7 @@ let }; evaluatedConfig = evaluatedSystem.config; landingPage = self.packages.${system}.landing-page; - landingVirtualHost = - evaluatedConfig.services.nginx.virtualHosts."torahimderecheretz.com"; + landingVirtualHost = evaluatedConfig.services.nginx.virtualHosts."torahimderecheretz.com"; discourseConfig = evaluatedConfig.services.discourse; backupConfig = evaluatedConfig.services.borgbackup.jobs.discourse; backupService = evaluatedConfig.systemd.services.borgbackup-job-discourse; @@ -37,10 +36,8 @@ assert discourseConfig.admin.email == "yisroel.d.baum@gmail.com"; assert discourseConfig.admin.fullName == "Yisroel Baum"; assert discourseConfig.admin.username == "yisroeldbaum"; assert discourseConfig.admin.passwordFile == "/run/secrets/tide-admin-password"; -assert discourseConfig.mail.notificationEmailAddress == - "system@torahimderecheretz.com"; -assert discourseConfig.mail.contactEmailAddress == - "system@torahimderecheretz.com"; +assert discourseConfig.mail.notificationEmailAddress == "system@torahimderecheretz.com"; +assert discourseConfig.mail.contactEmailAddress == "system@torahimderecheretz.com"; assert discourseConfig.mail.outgoing.passwordFile == "/run/secrets/tide-mail-password"; assert discourseConfig.mail.outgoing.serverAddress == "in-v3.mailjet.com"; assert discourseConfig.mail.outgoing.port == 587; @@ -48,7 +45,7 @@ assert discourseConfig.mail.outgoing.authentication == "login"; assert discourseConfig.siteSettings.required.title == "Torah Im Derech Eretz"; assert discourseConfig.secretKeyBaseFile == "/run/secrets/tide-secret-key-base"; assert evaluatedConfig.services.nginx.enable; -assert landingVirtualHost.root == "${landingPage}"; +assert landingVirtualHost.root == landingPage; assert landingVirtualHost.enableACME; assert landingVirtualHost.forceSSL; assert landingVirtualHost.locations."/".tryFiles == "$uri $uri/ =404"; @@ -68,6 +65,7 @@ pkgs.runCommand "tide-module-test" { } '' test -f ${landingPage}/styles.css test -f ${landingPage}/robots.txt test -f ${landingPage}/assets/rav-hirsch-1847.jpg + test -f ${landingPage}/assets/rav-hirsch-1847.webp ${pkgs.gnugrep}/bin/grep -F \ "A Torah vision for the whole of life." \ ${landingPage}/index.html diff --git a/site/assets/fonts/OFL-Libre-Baskerville.txt b/site/assets/fonts/OFL-Libre-Baskerville.txt new file mode 100644 index 0000000..5804419 --- /dev/null +++ b/site/assets/fonts/OFL-Libre-Baskerville.txt @@ -0,0 +1,93 @@ +Copyright 2012 The Libre Baskerville Project Authors (https://github.com/impallari/Libre-Baskerville) with Reserved Font Name Libre Baskerville. + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +https://openfontlicense.org + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/site/assets/fonts/OFL-Noto-Serif-Hebrew.txt b/site/assets/fonts/OFL-Noto-Serif-Hebrew.txt new file mode 100644 index 0000000..aa7598b --- /dev/null +++ b/site/assets/fonts/OFL-Noto-Serif-Hebrew.txt @@ -0,0 +1,93 @@ +Copyright 2022 The Noto Project Authors (https://github.com/notofonts/hebrew) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +https://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/site/assets/fonts/OFL-Source-Sans-3.txt b/site/assets/fonts/OFL-Source-Sans-3.txt new file mode 100644 index 0000000..a04c13f --- /dev/null +++ b/site/assets/fonts/OFL-Source-Sans-3.txt @@ -0,0 +1,93 @@ +Copyright 2010-2020 Adobe (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe in the United States and/or other countries. + +This Font Software is licensed under the SIL Open Font License, Version 1.1. + +This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/site/assets/fonts/libre-baskerville-latin.woff2 b/site/assets/fonts/libre-baskerville-latin.woff2 new file mode 100644 index 0000000..2d44bee Binary files /dev/null and b/site/assets/fonts/libre-baskerville-latin.woff2 differ diff --git a/site/assets/fonts/noto-serif-hebrew.woff2 b/site/assets/fonts/noto-serif-hebrew.woff2 new file mode 100644 index 0000000..08738b2 Binary files /dev/null and b/site/assets/fonts/noto-serif-hebrew.woff2 differ diff --git a/site/assets/fonts/source-sans-3-latin.woff2 b/site/assets/fonts/source-sans-3-latin.woff2 new file mode 100644 index 0000000..864cc41 Binary files /dev/null and b/site/assets/fonts/source-sans-3-latin.woff2 differ diff --git a/site/assets/rav-hirsch-1847.jpg b/site/assets/rav-hirsch-1847.jpg new file mode 100644 index 0000000..0fd136a Binary files /dev/null and b/site/assets/rav-hirsch-1847.jpg differ diff --git a/site/assets/rav-hirsch-1847.webp b/site/assets/rav-hirsch-1847.webp new file mode 100644 index 0000000..4b0f701 Binary files /dev/null and b/site/assets/rav-hirsch-1847.webp differ diff --git a/site/assets/social-preview.png b/site/assets/social-preview.png new file mode 100644 index 0000000..8765eb2 Binary files /dev/null and b/site/assets/social-preview.png differ diff --git a/site/assets/social-preview.svg b/site/assets/social-preview.svg new file mode 100644 index 0000000..862b588 --- /dev/null +++ b/site/assets/social-preview.svg @@ -0,0 +1,50 @@ + diff --git a/site/favicon.svg b/site/favicon.svg new file mode 100644 index 0000000..3ac77a0 --- /dev/null +++ b/site/favicon.svg @@ -0,0 +1,12 @@ + diff --git a/site/index.html b/site/index.html new file mode 100644 index 0000000..8e70e5f --- /dev/null +++ b/site/index.html @@ -0,0 +1,290 @@ + + +
+ + +תורה עם דרך ארץ
++ Discover and discuss Rav Samson Raphael Hirsch’s enduring + approach to Torah, work, education, culture, and communal + responsibility. +
+ ++ A community devoted to learning, living, and sharing the + teachings of Rav Hirsch. +
+
+ The Vision
++ Torah Im Derech Eretz is not a division between sacred and + ordinary life. It is a way of allowing Torah to give direction + and purpose to every human pursuit. +
++ Torah is not one compartment among many. Its wisdom and + obligations shape how we understand every part of life. +
++ Work, education, culture, and society become arenas for + responsible service of God and the fulfillment of our task. +
++ Serious learning is carried into practice through thoughtful + conversation, shared resources, and respectful disagreement. +
+Rav Hirsch
++ Rav Samson Raphael Hirsch was a nineteenth-century rabbi, + commentator, educator, and communal leader. In an age of rapid + social change, he articulated a Judaism of unwavering Torah + commitment and serious engagement with the wider world. +
++ Through works such as The Nineteen Letters, + Horeb, and his Torah commentary, Rav Hirsch taught + that every dimension of human life could be directed toward + avodas Hashem, the service of God. +
+The Community
++ Join a thoughtful forum for discussing Rav Hirsch’s writings, + applying his ideas, sharing resources, and learning with others + who believe Torah speaks to the whole of life. +
+