Skip to content

Commit 38657eb

Browse files
committed
Update
1 parent 396bf87 commit 38657eb

2 files changed

Lines changed: 32 additions & 4 deletions

File tree

_do.cr

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ OPUS_BITRATE_KBPS = 256
5454
BANDWIDTH_MB_PER_SEC = 20
5555
IGNORE_HOSTS = ["personal.tracker.com", "tracker.novage.com.ua", "www.googletagmanager.com"]
5656

57+
CERTBOT_DOMAINS = ["media.codonaft.com", "nostr.codonaft.com", "test.codonaft.com"]
58+
5759
MAIN_SITE_CONFIG = Path["_config.yml"]
5860

5961
HOSTS_DIR = Path["_hosts"]
@@ -235,6 +237,8 @@ def build
235237
version: RNOSTR_VERSION,
236238
dependencies: ["g++", "openssl-dev", "openssl-libs-static"],
237239
)
240+
241+
generate_certbot_script(MEDIA_HOST)
238242
end
239243

240244
def configure(config)
@@ -660,6 +664,27 @@ def configure_rnostr(host, config)
660664
ssh(host, add_user_commands("rnostr"))
661665
end
662666

667+
def generate_certbot_script(host)
668+
domains = CERTBOT_DOMAINS.join(',')
669+
user = ssh(host, ["echo -n ${USER}"])
670+
home_dir = BUILD_DIR.join(host).join("home").join(user)
671+
cron_dir = home_dir.join(".periodic/weekly")
672+
output = cron_dir.join("certbot-prod.sh")
673+
674+
Dir.mkdir_p(cron_dir)
675+
File.write(
676+
output,
677+
<<-STRING
678+
#!/usr/bin/env bash
679+
680+
logger 'certbot PROD'
681+
PROD=1 certbot-renew-or-create.sh '#{domains}' 'alopatindev@codonaft.com' /etc/nginx/ssl/codonaft.com/ 2>>/dev/stdout | logger
682+
683+
STRING
684+
)
685+
File.chmod(output, 0o755)
686+
end
687+
663688
def check_icmp(host)
664689
output = `ping -c1 #{host} 2>&1 | grep --extended-regexp '(^ping:|100%|time=[0-9\\.]*)' | sed 's!.*time=!!;s!.*transmitted, !!'`.strip
665690
if output.starts_with?("ping:") || output.includes?("100%")
@@ -1191,8 +1216,7 @@ def filtered_sync(host : String, local_dir : Path, *,
11911216
end
11921217

11931218
def synchronizable(path : Path)
1194-
dir = path.parts[0]
1195-
dir != "home" && path != Path["etc/conf.d/nginx"]
1219+
!path.parts.includes?("USERNAME_WILL_BE_AUTOMATICALLY_REPLACED") && path != Path["etc/conf.d/nginx"]
11961220
end
11971221

11981222
def rsync(source_dir : Path, files : Enumerable(Path), args : Enumerable(String))

sitemap.xml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1+
---
2+
permalink: /sitemap.xml
3+
---
4+
15
<?xml version="1.0" encoding="UTF-8"?>
26
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">
37
<url>
4-
<loc>https://codonaft.com/</loc>
8+
<loc>{{ site.url }}/</loc>
59
<changefreq>daily</changefreq>
6-
<xhtml:link rel="alternate" hreflang="ru" href="https://codonaft.com/ru/"/>
10+
<xhtml:link rel="alternate" hreflang="ru" href="{{ site.url }}/ru/"/>
711
</url>
812
</urlset>

0 commit comments

Comments
 (0)