diff --git a/ansible/files/home/signer/webhook/.keep b/ansible/files/home/signer/webhook/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/ansible/files/home/signer/webhook/Gemfile b/ansible/files/home/signer/webhook/Gemfile new file mode 100644 index 0000000..e965cf0 --- /dev/null +++ b/ansible/files/home/signer/webhook/Gemfile @@ -0,0 +1,3 @@ +source "https://rubygems.org" + +gem "rack" diff --git a/ansible/files/home/signer/webhook/config.ru b/ansible/files/home/signer/webhook/config.ru new file mode 100644 index 0000000..bdf9984 --- /dev/null +++ b/ansible/files/home/signer/webhook/config.ru @@ -0,0 +1,24 @@ +# Copyright (C) 2024 Kodama Takuya +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +require "pathname" + +base_dir = Pathname(__FILE__).dirname +lib_dir = base_dir + "lib" + +$LOAD_PATH.unshift(lib_dir.to_s) + +run WebhookSigner::App.new diff --git a/ansible/files/home/signer/webhook/lib/webhook-signer/app.rb b/ansible/files/home/signer/webhook/lib/webhook-signer/app.rb new file mode 100644 index 0000000..c1a1739 --- /dev/null +++ b/ansible/files/home/signer/webhook/lib/webhook-signer/app.rb @@ -0,0 +1,23 @@ +# Copyright (C) 2024 Kodama Takuya +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +module WebhookSigner + class App + def call(env) + [200, {}, ["Hello Webhook Signer"]] + end + end +end