Compare commits

...

3 Commits

Author SHA1 Message Date
72c519a23a lint 2024-07-02 13:33:29 -03:00
9997cdaeaf Tweaks to proxy config 2024-07-02 13:33:09 -03:00
d506a7250a Mount secrets into containers 2024-07-02 13:01:07 -03:00
7 changed files with 21 additions and 9 deletions

View File

@ -1,5 +1,5 @@
# This configuration file was generated by `ameba --gen-config`
# on 2024-07-01 18:57:31 UTC using Ameba version 1.6.1.
# on 2024-07-02 16:33:24 UTC using Ameba version 1.6.1.
# The point is for the user to remove these configuration records
# one by one as the reported problems are removed from the code base.
@ -21,7 +21,7 @@ Documentation/DocumentationAdmonition:
Enabled: true
Severity: Warning
# Problems found: 1
# Problems found: 3
# Run `ameba --only Naming/BlockParameterName` for details
Naming/BlockParameterName:
Description: Disallows non-descriptive block parameter names
@ -29,6 +29,7 @@ Naming/BlockParameterName:
AllowNamesEndingInNumbers: true
Excluded:
- src/faaso.cr
- src/daemon/funkos.cr
AllowedNames:
- _
- e

View File

@ -25,4 +25,4 @@ COPY --from=build /home/app/bin/faaso-daemon /home/app/bin/faaso /usr/bin/
RUN mkdir /secrets
RUN echo "sarasa" > /secrets/sarlanga
CMD ["/usr/bin/multirun", "faaso-daemon", "tinyproxy -d -c tinyproxy.conf"]
CMD ["/usr/bin/multirun", "-v", "faaso-daemon", "tinyproxy -d -c tinyproxy.conf"]

View File

@ -3,7 +3,7 @@ build: shard.yml $(wildcard src/**/*cr)
proxy: build
docker build . -t faaso-proxy --no-cache
start-proxy:
docker run --network=faaso-net -v /var/run/docker.sock:/var/run/docker.sock -p 8888:8888 faaso-proxy
docker run --network=faaso-net -v /var/run/docker.sock:/var/run/docker.sock -v secrets:/home/app/secrets -p 8888:8888 faaso-proxy
.PHONY: build proxy-image start-proxy

View File

@ -23,7 +23,7 @@ module Funkos
funkos.sort! { |a, b| a.name <=> b.name }
if env.params.query.fetch("format", "json") == "html"
render "src/views/funkos.ecr"
render "src/views/funkos.ecr"
else
funkos.to_json
end

View File

@ -30,7 +30,8 @@ module Proxy
funkos.sort!
config = %(
UserName nobody
User nobody
Group nogroup
Port 8888
Listen 0.0.0.0
Timeout 600

View File

@ -161,12 +161,21 @@ class Funko
# Create a container for this funko
def create_container(autostart : Bool = true) : String
secrets_mount = "#{Dir.current}/secrets/#{name}"
Dir.mkdir_p(secrets_mount)
conf = Docr::Types::CreateContainerConfig.new(
image: "#{name}:latest",
hostname: name,
# Port in the container side
host_config: Docr::Types::HostConfig.new(
network_mode: "faaso-net",
mounts: [
Docr::Types::Mount.new(
source: secrets_mount,
target: "/secrets",
type: "bind"
),
]
)
)

View File

@ -1,5 +1,6 @@
UserName nobody
User nobody
Group nogroup
LogLevel Info
Port 8888
Listen 0.0.0.0
Timeout 600