summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/deployment/gecloudpad
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2020-04-17 19:21:16 +0200
committertv <tv@krebsco.de>2020-04-17 19:21:16 +0200
commite1bfdd8d839929538d36e421908a96407b3aa0ab (patch)
tree557bf9a711f06997e846a5ef14a4105248f1da8c /makefu/2configs/deployment/gecloudpad
parent6ace0f7b6941c1c9476d84944cdba8bedf98d95d (diff)
parent07f18d851a974ee594c92e3332f167ef3b1d259f (diff)
Merge remote-tracking branch 'prism/master'
Diffstat (limited to 'makefu/2configs/deployment/gecloudpad')
-rw-r--r--makefu/2configs/deployment/gecloudpad/default.nix43
-rw-r--r--makefu/2configs/deployment/gecloudpad/gecloudpad.nix24
2 files changed, 67 insertions, 0 deletions
diff --git a/makefu/2configs/deployment/gecloudpad/default.nix b/makefu/2configs/deployment/gecloudpad/default.nix
new file mode 100644
index 000000000..e13ec6ae6
--- /dev/null
+++ b/makefu/2configs/deployment/gecloudpad/default.nix
@@ -0,0 +1,43 @@
+{ config, lib, pkgs, ... }:
+# more than just nginx config but not enough to become a module
+let
+ wsgi-sock = "${workdir}/uwsgi-gecloudpad.sock";
+ workdir = config.services.uwsgi.runDir;
+ gecloudpad = pkgs.python3Packages.callPackage ./gecloudpad.nix {};
+in {
+
+ services.uwsgi = {
+ enable = true;
+ user = "nginx";
+ # runDir = "/var/lib/photostore";
+ plugins = [ "python3" ];
+ instance = {
+ type = "emperor";
+ vassals = {
+ gecloudpad = {
+ type = "normal";
+ pythonPackages = self: with self; [ gecloudpad ];
+ socket = wsgi-sock;
+ };
+ };
+ };
+ };
+
+ services.nginx = {
+ enable = lib.mkDefault true;
+ virtualHosts."pad.binaergewitter.de" = {
+ enableACME = true;
+ forceSSL = true;
+ locations = {
+ "/".extraConfig = ''
+ expires -1;
+ uwsgi_pass unix://${wsgi-sock};
+ uwsgi_param UWSGI_CHDIR ${gecloudpad}/${pkgs.python.sitePackages};
+ uwsgi_param UWSGI_MODULE gecloudpad.main;
+ uwsgi_param UWSGI_CALLABLE app;
+ include ${pkgs.nginx}/conf/uwsgi_params;
+ '';
+ };
+ };
+ };
+}
diff --git a/makefu/2configs/deployment/gecloudpad/gecloudpad.nix b/makefu/2configs/deployment/gecloudpad/gecloudpad.nix
new file mode 100644
index 000000000..7d51dfa0d
--- /dev/null
+++ b/makefu/2configs/deployment/gecloudpad/gecloudpad.nix
@@ -0,0 +1,24 @@
+{ lib, pkgs, fetchFromGitHub, ... }:
+
+with pkgs.python3Packages;buildPythonPackage rec {
+ name = "gecloudpad-${version}";
+ version = "0.2.3";
+
+ propagatedBuildInputs = [
+ flask requests
+ ];
+
+ src = fetchFromGitHub {
+ owner = "binaergewitter";
+ repo = "gecloudpad";
+ rev = "master";
+ sha256 = "0p9lcphp3r7hyypxadzw4x9ix6d0anmspxnjnj0v2jjll8gxqlhf";
+ };
+
+ meta = {
+ homepage = https://github.com/binaergeiwtter/gecloudpad;
+ description = "server side for gecloudpad";
+ license = lib.licenses.wtfpl;
+ };
+}
+