diff --git a/.forgejo/workflows/deploy.yaml b/.forgejo/workflows/deploy.yaml index 5503cc7..01a4f9c 100644 --- a/.forgejo/workflows/deploy.yaml +++ b/.forgejo/workflows/deploy.yaml @@ -3,4 +3,9 @@ jobs: deploy: runs-on: docker steps: - - run: echo All Good + - uses: actions/checkout@v4 + - run: | + echo "${{secrets.SERVER_SSHKEY}}" > ../server_key && + chmod 700 ../server_key && + echo "${{secrets.SERVER_SSHKEYSCAN}}" > ../known_hosts && + scp -i ../server_key -o UserKnownHostsFile=../known_hosts -r lapis runner@teabucket.eu:/etc/docker/container/cups-webring diff --git a/lapis/app.lua b/lapis/app.lua index 4b0ce7f..2de0c3c 100644 --- a/lapis/app.lua +++ b/lapis/app.lua @@ -5,7 +5,9 @@ local config = require("lapis.config").get() members = {{"fynn","https://fynngodau.de"}, {"anton","https://anton.ehrmanntraut.de"}, - {"max","https://aaahhh.de"}} + {"max","https://aaahhh.de"}, + {"theresa","https://treimer.dev"}, + {"never","https://nevereverever.de"}} members[#members+1] = members[1] math.randomseed(os.time()) @@ -19,7 +21,7 @@ app:get("/embed", function(self) if from == nil then return {"cups webring embed needs from defined (.../embed?from=me)"} end - return string.format('
', config.host, from, config.host, config.host, config.host, config.host, from, config.host), {layout = false, content_type="text/html"} + return string.format('', config.host, from, config.host, config.host, config.host, config.host, from, config.host), {layout = false, content_type="text/html"} end) app:get("/random", function(self) @@ -39,6 +41,10 @@ app:get("/next", function(self) found = true end end + if "cups" == self.params.from then + rand = math.random(1,#members-1) + return {redirect_to=members[rand][2]} + end return {redirect_to="/"} end) @@ -55,6 +61,10 @@ app:get("/prev", function(self) found = true end end + if "cups" == self.params.from then + rand = math.random(1,#members-1) + return {redirect_to=members[rand][2]} + end return {redirect_to="/"} end)