Skip to content

Commit ff20471

Browse files
committed
Update
1 parent f5a1db6 commit ff20471

10 files changed

Lines changed: 86 additions & 36 deletions

File tree

_config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ theme_settings:
135135
nostr:
136136
enabled: true
137137
npub: npub1alptdev5srcw2hxg03567p4k6xs3lgj7f6545suc0rzp0xw98svse7rg94
138+
nprofile: nprofile1qqswls4kuk2gpu89tny8c6d0q6mdrggl5f0ya226gwv833qhn8zncxgprpmhxue69uhkummnw3ezucm0v3hkuctxwshxxmmdqywhwumn8ghj7mn0wd68yttsw43zuam9d3kx7unyv4ezumn9wsq3vamnwvaz7tmjv4kxz7fwdehhxarj9e3xzmnyrks2sw
138139
community: codonaft
139140
max_comment_length: 5000
140141
min_read_pow: 7

_do.cr

Lines changed: 56 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,16 @@ MIRROR_FROM_TO = [
7272

7373
USER_AGENT = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36"
7474

75+
NAMESERVER = "1.1.1.1"
76+
7577
def main
7678
repo_dir = Path[File.dirname(File.realpath(__FILE__))]
7779
Dir.cd(repo_dir)
7880

7981
ps = processes()
80-
check(ps)
81-
8282
config = YAML.parse(File.read(MAIN_SITE_CONFIG))
83+
check(config, ps)
84+
8385
if ARGV.empty? || ARGV.includes?("-h") || ARGV.includes?("--help")
8486
usage
8587
elsif ARGV.size == 1 && ARGV[0] == "sync"
@@ -483,10 +485,20 @@ def health(config)
483485

484486
all_hosts().each { |host|
485487
step(host)
488+
486489
ssh(host, ["sudo /etc/init.d/nginx checkconfig", "sudo hdparm -t /dev/sd[a-z] | sed \"s!.*= !!\""], tty: true)
490+
491+
distro_version = alpine_version(host)
492+
latest_distro_version = YAML.parse(HTTP::Client.get("https://dl-cdn.alpinelinux.org/alpine/latest-stable/releases/x86_64/latest-releases.yaml").body)[0]["version"].as_s
493+
warn("alpine #{host} version #{distro_version} != #{latest_distro_version}") unless distro_version == latest_distro_version
487494
}
488495

489-
warn("github commit hash is different\n") unless JSON.parse(HTTP::Client.get("https://api.github.com/repos/codonaft/codonaft.github.io/commits").body)[0]["sha"].as_s == `git rev-parse HEAD`.strip
496+
commits = JSON.parse(HTTP::Client.get("https://api.github.com/repos/codonaft/codonaft.github.io/commits").body)
497+
if commits.as_a?.nil?
498+
error("#{commits["message"]}\n")
499+
else
500+
warn("github commit hash is different\n") unless commits[0]["sha"].as_s == `git rev-parse HEAD`.strip
501+
end
490502

491503
banlists =
492504
if nonempty_exists?(BANLISTS) && File.info(BANLISTS).modification_time + 1.days > Time.utc
@@ -521,8 +533,6 @@ def health(config)
521533
warn("#{broken_post_urls.size} broken post URLs: #{broken_post_urls}\n")
522534
end
523535

524-
check_domain(site_url)
525-
526536
bancheck = "_bancheck.txt"
527537
custom_hosts =
528538
if File::Info.readable?(bancheck)
@@ -558,7 +568,7 @@ def health(config)
558568
.reject { |i| i.empty? }
559569
.map { |i| URI.parse(i) }
560570
.reject { |i| i.hostname.nil? || i.hostname == "localhost" } + relay_mirrors
561-
wss_uris = (trackers + other_relays + `git grep --only-matching 'wss://[a-zA-Z0-9/._-]*'`
571+
wss_uris = (trackers + other_relays + `git grep --only-matching 'wss://[a-zA-Z0-9/._-]*' | grep -vE '(^|/)(relays|allowed|blocked)\\.json'`
562572
.split('\n')
563573
.map { |i| i.strip.gsub(/.*wss:\/\//, "") }
564574
.reject { |i| i.empty? || IGNORE_HOSTS.any? { |ignored| i.includes?(ignored) } }
@@ -576,20 +586,22 @@ def health(config)
576586
print("#{i} ")
577587
check_icmp(i)
578588
check_ban(i, banlists)
579-
puts
580-
}
581-
wss_uris.each { |i|
582-
print("#{i} ")
583-
check_ban(i.hostname.not_nil!, banlists)
584-
check_ws(i, proxy)
589+
check_domain(i)
585590
puts
586591
}
587592
https_hosts.each { |i|
588593
https_uri = URI.parse("https://#{i}")
589594
check_certificate(https_uri, proxy)
595+
# TODO: check_response_code(https_uri, proxy)
590596
check_ech(https_uri)
591597
puts
592598
}
599+
wss_uris.each { |i|
600+
print("#{i} ")
601+
check_ban(i.hostname.not_nil!, banlists)
602+
check_ws(i, proxy)
603+
puts
604+
}
593605
})
594606
end
595607

@@ -692,12 +704,13 @@ def check_certificate(host : URI, proxy : URI)
692704
end
693705
end
694706

695-
def check_domain(url : URI)
696-
domain = url.hostname
707+
def check_domain(domain)
708+
return unless domain.count('.') == 1
709+
puts
697710
print("domain #{domain} expires on ")
698711
time = `whois #{domain}`
699712
.split("\n")
700-
.select { |i| i.includes?("Expiry Date:") || i.includes?("Expiration Date:") }
713+
.select { |i| i.includes?("Expiry Date:") || i.includes?("Expiration Date:") || i.includes?("paid-till:") }
701714
.map { |i|
702715
start = i.index(": ")
703716
if start.nil?
@@ -710,7 +723,8 @@ def check_domain(url : URI)
710723
.map { |i| Time.parse_rfc3339(i.not_nil!) }
711724
.min
712725
print_expiration(time)
713-
puts
726+
print(" ")
727+
print_dnssec_status(domain)
714728
end
715729

716730
def check_ban(host : String, banlists : Set(String))
@@ -720,7 +734,7 @@ def check_ban(host : String, banlists : Set(String))
720734
end
721735

722736
def resolve_domain(host) : Array(String)
723-
`nslookup #{host}`
737+
`nslookup #{host} #{NAMESERVER}`
724738
.split('\n')
725739
.skip(3)
726740
.select { |i| i.starts_with?("Address: ") }
@@ -885,7 +899,7 @@ def is_in_net(ip, net)
885899
$?.success?
886900
end
887901

888-
def check(ps : Array(Tuple(Int64, String)))
902+
def check(config, ps : Array(Tuple(Int64, String)))
889903
current_ps_name = "/#{Path[__FILE__].basename}"
890904
raise "other instance keeps running" if ps
891905
.select { |(_, i)| i.includes?("crystal") && i.includes?(current_ps_name) }
@@ -902,6 +916,11 @@ def check(ps : Array(Tuple(Int64, String)))
902916
.map { |i| i.split(':')[0] }
903917
.select { |i| File.read(i).includes?('\n') }
904918
raise "unexpected newline in #{files_with_unexpected_newlines}" unless files_with_unexpected_newlines.empty?
919+
920+
nostr_config = config["theme_settings"]["nostr"]
921+
npub = nostr_config["npub"].as_s
922+
nprofile = nostr_config["nprofile"].as_s
923+
raise "#{npub} is not #{nprofile}" unless decode_pk(npub)[0] == decode_pk(nprofile)[0]
905924
end
906925

907926
def build_rust_app(
@@ -928,9 +947,8 @@ def build_rust_app(
928947
trace("building #{crate}\n")
929948
Dir.mkdir_p(bin_dir, 0o755)
930949

931-
alpine_version = ssh(host, ["cat /etc/alpine-release"])
932-
alpine_version = ALPINE_VERSION if alpine_version.empty?
933-
warn("alpine #{host} version #{alpine_version} != alpine build version #{ALPINE_VERSION}") unless alpine_version == ALPINE_VERSION
950+
distro_version = alpine_version(host)
951+
warn("alpine #{host} version #{distro_version} != alpine build version #{ALPINE_VERSION}") unless distro_version == ALPINE_VERSION
934952
target_cpu = TARGET_CPU[host]
935953

936954
cargo_args =
@@ -949,7 +967,7 @@ def build_rust_app(
949967
.join("\n")
950968

951969
system(<<-STRING
952-
podman run --rm -it -v "#{bin_dir}:/build" "alpine:#{alpine_version}" /bin/sh -c "
970+
podman run --rm -it -v "#{bin_dir}:/build" "alpine:#{distro_version}" /bin/sh -c "
953971
set -xeuo pipefail
954972
955973
apk add --update --no-cache 'cargo>=#{RUST_VERSION}' 'rust>=#{RUST_VERSION}' || {
@@ -1827,6 +1845,11 @@ def git_ls(dir : Path)
18271845
.to_set
18281846
end
18291847

1848+
def alpine_version(host : String)
1849+
version = ssh(host, ["cat /etc/alpine-release"])
1850+
version.empty? ? ALPINE_VERSION : version
1851+
end
1852+
18301853
def nonempty_exists?(path : Path)
18311854
File.file?(path) && !File.empty?(path)
18321855
end
@@ -1844,6 +1867,17 @@ def print_expiration(time)
18441867
end
18451868
end
18461869

1870+
def print_dnssec_status(domain)
1871+
valid = ["A", "AAAA"].all? { |qtype|
1872+
`delv @#{NAMESERVER} #{domain} #{qtype}`.split("\n").includes?("; fully validated")
1873+
}
1874+
if valid
1875+
ok("dnssec is ok")
1876+
else
1877+
error("invalid dnssec")
1878+
end
1879+
end
1880+
18471881
def trace(text)
18481882
Colorize.with.dark_gray.surround(STDOUT) do
18491883
puts(text)

_hosts/media.codonaft/etc/nginx/http.d/media.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ server {
136136

137137
upstream tracker {
138138
server 127.0.0.1:3443;
139-
server [::ffff:127.0.0.1]:3443;
139+
#server [::ffff:127.0.0.1]:3443;
140140
}
141141

142142
#map $ssl_early_data $tls1_3_early_data {

_includes/footer.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
<ul>
1414
<li><a href="{% if page.lang-en-uri %}{{ page.lang-en-uri }}{% else %}/{% endif %}">&#127760; EN</a></li>
1515
<li><a href="{% if page.lang-ru-uri %}{{ page.lang-ru-uri }}{% else %}/ru{% endif %}">&#127760; RU</a></li>
16-
<li><a href="/terms-and-privacy">⚖️ Terms + Privacy</a></li>
16+
<li><a href="/sponsor">&#9889; Sponsor</a></li>
17+
<li><a href="/terms-and-privacy">&#9878; Terms + Privacy</a></li>
1718
</ul>
1819
</div>
1920

_includes/icons.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
{% endif %}
8181

8282
{% if site.theme_settings.nostr %}
83-
<li><a href="https://yakihonne.com/users/{{ site.theme_settings.nostr.npub }}" title="Nostr" target="_blank">{% include icons/nostr.svg %}</a></li>
83+
<li><a href="https://coracle.social/people/{{ site.theme_settings.nostr.nprofile }}" title="Nostr" target="_blank">{% include icons/nostr.svg %}</a></li>
8484
{% endif %}
8585

8686
{% if site.theme_settings.instagram %}

_posts/2018-01-14-how-to-take-notes-like-a-programmer.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ Another approach could be a use of some tricky **fuzzy search** engine.
134134

135135
**UPDATE**: Actually the problem was my confusion about
136136
the [terminology](https://en.wikipedia.org/wiki/Quantile#Specialized_quantiles).
137-
So in *this* case the right solution is to add «quantile» keyword.
137+
So in *this* case the right solution is to add "quantile" keyword.
138138

139139
### Update Structure According to Your Mind Image
140140
Suppose you ain't able to find your note quickly, **even manually**. Possible reasons:

_posts/2024-09-26-installing-alpine-linux-on-pain-in-the-ass-hosting-providers.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ iso="alpine-virt-${VERSION}-${ARCH}.iso"
3434
url="${MIRROR}/v${short_version}/releases/${ARCH}/${iso}"
3535

3636
apt -y install wget
37-
wget "${url}" "${url}.sha256" "${url}.asc" "https://alpinelinux.org/keys/ncopa.asc"
37+
wget "${url}"{,.sha256,.asc} "https://alpinelinux.org/keys/ncopa.asc"
3838
sha256sum -c "${iso}.sha256"
3939
gpg --import < ncopa.asc
40-
gpg --verify "${iso}.asc" "${iso}"
40+
gpg --verify "${iso}"{.asc,}
4141

4242
mount -t iso9660 "${iso}" /mnt
4343
cp -a /mnt/* /

_sass/includes/_share_buttons.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ ul.share-buttons {
6565

6666
@keyframes pulse {
6767
from {
68-
opacity: 0.7;
68+
opacity: 1;
6969
}
7070
to {
71-
opacity: 1;
71+
opacity: 0.7;
7272
}
7373
}

pages/sponsor.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,16 @@ Proprietary software they make is currently at its peak of
161161
[manipulative](https://www.reddit.com/r/paypal/comments/1hfg3jr/paypal_refuses_to_change_to_local_currency_at/)
162162
[practices](https://youtu.be/citnomJHr6I).
163163

164+
These "solutions" are no longer usable, at least not
165+
[without](https://github.com/ungoogled-software/ungoogled-chromium#readme)
166+
[tons](https://github.com/OhMyGuus/I-Still-Dont-Care-About-Cookies#readme)
167+
[of](https://github.com/dessant/buster#readme)
168+
[heavy](https://github.com/nang-dev/hover-paywalls-browser-extension#readme)
169+
[workarounds](https://github.com/jswanner/DontF-WithPaste#readme)!
170+
164171
[They](https://youtu.be/7LqaotiGWjQ?t=3426s) are so stuck
165172
in capitalistic [values](https://www.snopes.com/fact-check/sony-patent-mcdonalds)
166-
that barely leave room for long-term delivery of *real* innovations and positive life quality changes.
173+
and self-defense that they barely leave room for long-term delivery of *real* innovations and positive life quality changes.
167174

168175
Typical "new" software products are not new; it's basically blind mediocre ideas copy-pasting.
169176
Truly new software should attempt to introduce innovations that
@@ -178,9 +185,9 @@ When these companies make something that *seems* to be healthy and innovative—
178185
Independent FOSS developers can do something better. I'm targeting the following **principles**:
179186
- **Distraction Minimization**
180187
- 🧠 software must be [mentally](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4183915/) [ecological](https://youtu.be/Iy7i9ru7HB8?t=15s) and intuitive; it should never intentionally <a href="/how-to-take-notes-like-a-programmer/#whats-the-point" target="_blank">interrupt</a> the creative process!
181-
- 🚫 no more popup traps, mental resource-wasting on CAPTCHA [imitation](https://futurism.com/ai-model-turing-test), sudden unwanted tutorials, [absurdly](https://www.facebook.com/help/124895950923762) <span class='no-wrap'>over-detailed</span> manuals and so on!
188+
- 🚫 no more mental resource-wasting on popup traps, CAPTCHA [{% include span_with_tooltip.html large="true" body="imitation" tooltip="CAPTCHA is useless: bots basically became indistinguishable from humans.<br>Time to change strategy: unexpected spammy load should be transformed into useful computations, with no harm to users, environment, or even businesses!" %}](https://futurism.com/ai-model-turing-test), sudden unwanted tutorials, absurdly <span class='no-wrap'>over-detailed</span> [{% include span_with_tooltip.html large="true" body="manuals" tooltip="Stop building the outdated and overcomplicated UI!<br>Well-designed, intuitive, AI-driven software <i>ideally</i> doesn't require any documentation!" %}](https://www.facebook.com/help/124895950923762) and so on!
182189
- **Data Sovereignty**
183-
- 🔒 *you* own your data, not third parties!
190+
- 🔒 *you* own your [data](https://martin.kleppmann.com/2019/10/23/local-first-at-onward.html), not third parties!
184191

185192
{::options parse_block_html="false" /}
186193
</div>

ru/pages/sponsor.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,15 @@ lang-en-uri: /sponsor/
162162
[манипулятивных](https://www.reddit.com/r/paypal/comments/1hfg3jr/paypal_refuses_to_change_to_local_currency_at/)
163163
<a href="/ru/ideas-for-foss-projects/?t=975" target="_blank">практик</a>.
164164

165+
Этими «решениями» уже стало невыносимо пользоваться, по крайней
166+
[мере](https://github.com/jswanner/DontF-WithPaste#readme)
167+
[без](https://github.com/ungoogled-software/ungoogled-chromium#readme)
168+
[кучи](https://github.com/OhMyGuus/I-Still-Dont-Care-About-Cookies#readme)
169+
[тяжеловесных](https://github.com/dessant/buster#readme)
170+
[костылей](https://github.com/nang-dev/hover-paywalls-browser-extension#readme)!
171+
165172
[Они](https://youtu.be/7LqaotiGWjQ?t=3426s) слишком зациклились
166-
на капиталистических [ценностях](https://www.snopes.com/fact-check/sony-patent-mcdonalds),
173+
на капиталистических [ценностях](https://www.snopes.com/fact-check/sony-patent-mcdonalds) и самозащите,
167174
едва ли оставляя возможность длительно предоставлять *реальные* инновации и позитивные изменения качества жизни.
168175

169176
Типичные «новые» программные продукты на самом деле не новые — это в основном слепое копирование идей сомнительного качества.
@@ -181,9 +188,9 @@ lang-en-uri: /sponsor/
181188

182189
- **Минимизация отвлечения внимания**
183190
- 🧠 ПО должно быть [экологичным](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4183915/) [ментально](https://youtu.be/Iy7i9ru7HB8?t=15s) и понятным интуитивно; оно никогда не должно намеренно <a href="/how-to-take-notes-like-a-programmer/#whats-the-point" target="_blank">прерывать</a> творческий процесс!
184-
- 🚫 больше никаких всплывающих ловушек, трат ментальных ресурсов на решение [имитации](https://futurism.com/ai-model-turing-test) CAPTCHA, внезапных нежелательных туториалов, [абсурдно](https://www.facebook.com/help/124895950923762) подробных руководств и так далее!
191+
- 🚫 больше никаких трат ментальных ресурсов на всплывающие ловушки, [{% include span_with_tooltip.html large="true" body="имитацию" tooltip="Капча бесполезна: боты в основном уже <span class='no-wrap'>неотличимы от людей.</span><br>Время сменить стратегию: потенциально спамную нагрузку нужно превращать в полезные вычисления, не причиняя вред ни пользователям, ни окружающей среде, ни даже бизнесам!" %}](https://futurism.com/ai-model-turing-test) CAPTCHA, внезапные нежелательные туториалы, абсурдно подробные [{% include span_with_tooltip.html large="true" body="руководства" tooltip="Хватит плодить устаревшие и переусложненные UI!<br>Хорошо спроектированное и интуитивно-понятное ПО с ИИ <i>в идеале</i> вообще не нуждается в документации!" %}](https://www.facebook.com/help/124895950923762) и так далее!
185192
- **Суверенитет данных**
186-
- 🔒 *ты* владеешь своими данными, а не третьи лица!
193+
- 🔒 *ты* владеешь своими [данными](https://martin.kleppmann.com/2019/10/23/local-first-at-onward.html), а не третьи лица!
187194

188195
{::options parse_block_html="false" /}
189196
</div>

0 commit comments

Comments
 (0)