Selaa lähdekoodia

[photoview] Use immortal instead of supervisor

Colin Powell 3 vuotta sitten
vanhempi
commit
a3718f3002

+ 5 - 5
ansible/roles/photoview/tasks/main.yml

@@ -90,10 +90,10 @@
 # TODO We have to comment out:
 #    vi ~/go/pkg/mod/github.com/strukturag/libheif@v1.12.0/go/heif/heif.go
 #    line 269
-- name: Photoview supervisor file installed
+- name: Photoview immortal file installed
   template:
-    src: supervisor.conf.j2
-    dest: /usr/local/etc/supervisor/conf.d/photoview.conf
+    src: immortal.conf.j2
+    dest: /usr/local/etc/immortal/photoview.yml
     owner: root
-    mode: 0644
-  notify: Supervisor restarted
+    mode: 0664
+  notify: Immortal restarted

+ 17 - 0
ansible/roles/photoview/templates/immortal.yml.j2

@@ -0,0 +1,17 @@
+cmd: /usr/local/src/photoview/api/api
+cwd: /usr/local/src/photoview/api
+env:
+    PHOTOVIEW_DATABASE_DRIVER: postgres
+    PHOTOVIEW_POSTGRES_URL: "postgres://photoview:{{photoview_db_pass}}@db.service:5432/photoview"
+    PHOTOVIEW_LISTEN_IP: 0.0.0.0
+    PHOTOVIEW_LISTEN_PORT: 4001
+    PHOTOVIEW_API_ENDPOINT: "https://photos.unbl.ink/api/"
+    PHOTOVIEW_UI_ENDPOINT: "https://photos.unbl.ink/"
+    MAPBOX_TOKEN: "{{mabox_api_key}}""
+    PHOTOVIEW_DEVELOPMENT_MODE: 0
+log:
+    file: /var/log/photoview.log
+    age: 86400 # log 1 day
+    num: 7     # keep 7 files
+    size: 1    # size of file 1MB
+wait: 1