nomad

HCL and Docker files for Nomad deployments
git clone https://git.in0rdr.ch/nomad.git
Log | Files | Refs | Pull requests |Archive

commit 13d23fd1bef696abcefdcf09db4f79dd580616e3
parent e4146310f154cf4629482106bb0d2793ed665571
Author: Andreas Gruhler <agruhl@gmx.ch>
Date:   Thu, 14 Aug 2025 00:07:19 +0200

feat(snibox): bump content length

Diffstat:
Mhcl/default/snibox/snibox.nomad | 9+++++++++
Ahcl/default/snibox/templates/snippet_file.rb.tmpl | 10++++++++++
2 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/hcl/default/snibox/snibox.nomad b/hcl/default/snibox/snibox.nomad @@ -85,6 +85,10 @@ EOT command = "/bin/sh" args = ["-c", "rm -rf tmp/pids && ./bin/rails s -p 3000 -b '0.0.0.0'"] ports = ["server"] + volumes = [ + # mount the templated config from the task directory to the container + "local/snippet_file.rb:/app/app/models/snippet_file.rb", + ] } volume_mount { @@ -92,6 +96,11 @@ EOT destination = "/app/public" } + template { + destination = "${NOMAD_TASK_DIR}/snippet_file.rb" + data = file("./templates/snippet_file.rb.tmpl") + } + resources { memory = 50 memory_max = 256 diff --git a/hcl/default/snibox/templates/snippet_file.rb.tmpl b/hcl/default/snibox/templates/snippet_file.rb.tmpl @@ -0,0 +1,10 @@ +class SnippetFile < ApplicationRecord + belongs_to :snippet + + counter_culture :snippet + + validates :title, presence: true, length: { maximum: 40 } + validates :content, presence: true, length: { maximum: 200000 } + validates :language, presence: true, inclusion: { in: Editor.languages.keys.map(&:to_s) } + validates :tabs, numericality: { only_integer: true }, inclusion: { in: [2, 4, 8] } +end