Compare commits

..

No commits in common. "72c519a23a59efbb4d7e7d51e69982fc56f73597" and "4371444fa4d9ef859f7b765cf91439bd9baa1572" have entirely different histories.

7 changed files with 9 additions and 21 deletions

View File

@ -1,5 +1,5 @@
# This configuration file was generated by `ameba --gen-config` # This configuration file was generated by `ameba --gen-config`
# on 2024-07-02 16:33:24 UTC using Ameba version 1.6.1. # on 2024-07-01 18:57:31 UTC using Ameba version 1.6.1.
# The point is for the user to remove these configuration records # The point is for the user to remove these configuration records
# one by one as the reported problems are removed from the code base. # one by one as the reported problems are removed from the code base.
@ -21,7 +21,7 @@ Documentation/DocumentationAdmonition:
Enabled: true Enabled: true
Severity: Warning Severity: Warning
# Problems found: 3 # Problems found: 1
# Run `ameba --only Naming/BlockParameterName` for details # Run `ameba --only Naming/BlockParameterName` for details
Naming/BlockParameterName: Naming/BlockParameterName:
Description: Disallows non-descriptive block parameter names Description: Disallows non-descriptive block parameter names
@ -29,7 +29,6 @@ Naming/BlockParameterName:
AllowNamesEndingInNumbers: true AllowNamesEndingInNumbers: true
Excluded: Excluded:
- src/faaso.cr - src/faaso.cr
- src/daemon/funkos.cr
AllowedNames: AllowedNames:
- _ - _
- e - 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 mkdir /secrets
RUN echo "sarasa" > /secrets/sarlanga RUN echo "sarasa" > /secrets/sarlanga
CMD ["/usr/bin/multirun", "-v", "faaso-daemon", "tinyproxy -d -c tinyproxy.conf"] CMD ["/usr/bin/multirun", "faaso-daemon", "tinyproxy -d -c tinyproxy.conf"]

View File

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

View File

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

View File

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

View File

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

View File

@ -1,6 +1,5 @@
User nobody
Group nogroup UserName nobody
LogLevel Info
Port 8888 Port 8888
Listen 0.0.0.0 Listen 0.0.0.0
Timeout 600 Timeout 600
@ -8,4 +7,4 @@
ReverseOnly Yes ReverseOnly Yes
ReverseMagic Yes ReverseMagic Yes
ReversePath "/admin/" "http://127.0.0.1:3000/" ReversePath "/admin/" "http://127.0.0.1:3000/"
ReversePath "/faaso/hello/" "http://hello:3000/" ReversePath "/faaso/hello/" "http://hello:3000/"