toddsundsted / ktistec

Single user ActivityPub (https://www.w3.org/TR/activitypub/) server.
GNU Affero General Public License v3.0
367 stars 21 forks source link

Embed content.rules #20

Closed GeopJr closed 2 years ago

GeopJr commented 2 years ago

This PR embeds ./etc/rules/content.rules

fixes: #19

toddsundsted commented 2 years ago

@GeopJr thanks for the PR. clever fix!

GeopJr commented 2 years ago

I've been playing with Ktistec locally and mainly focusing on making it as portable as possible so here's what I ended up doing so it creates content.rules if it doesn't exist else read it:

content_rules_path = File.join(Dir.current, "etc", "rules", "content.rules")
File.write(content_rules_path, {{read_file("#{__DIR__}/../../etc/rules/content.rules")}}) unless File.exists?(content_rules_path)

definition = File.read(content_rules_path)

(I switched from slang back to ecr and trying to clean everything up before publishing my changes 😅)

Thanks for creating Ktistec by the way 🙏, I've been meaning to get into it for a long time and finally had the chance! (I think I was the 8th person who starred it(?))

toddsundsted commented 2 years ago

👍