[defaults]
inventory=inventory
+interpreter_python=/usr/bin/python3
[ssh_connection]
pipelining = True
creates: '/etc/letsencrypt/live/{{domain}}/privkey.pem'
- name: create lemmy folder
- file: path={{item.path}} state=directory
+ file: path={{item.path}} {{item.owner}} state=directory
with_items:
- - { path: '/lemmy/' }
- - { path: '/lemmy/volumes/' }
+ - { path: '/lemmy/', owner: 'root' }
+ - { path: '/lemmy/volumes/', owner: 'root' }
+ - { path: '/lemmy/volumes/pictrs/', owner: '991' }
- block:
- name: add template files
- { src: '../docker/iframely.config.local.js', dest: '/lemmy/iframely.config.local.js', mode: '0600' }
vars:
lemmy_docker_image: "dessalines/lemmy:{{ lookup('file', 'VERSION') }}"
- lemmy_port: "8536"
- pictshare_port: "8537"
- iframely_port: "8538"
- name: add config file (only during initial setup)
template: src='templates/config.hjson' dest='/lemmy/lemmy.hjson' mode='0600' force='no' owner='1000' group='1000'
creates: '/etc/letsencrypt/live/{{domain}}/privkey.pem'
- name: create lemmy folder
- file: path={{item.path}} state=directory
+ file: path={{item.path}} owner={{item.owner}} state=directory
with_items:
- - { path: '/lemmy/' }
- - { path: '/lemmy/volumes/' }
+ - { path: '/lemmy/', owner: 'root' }
+ - { path: '/lemmy/volumes/', owner: 'root' }
+ - { path: '/lemmy/volumes/pictrs/', owner: '991' }
- block:
- name: add template files
- ./lemmy.hjson:/config/config.hjson:ro
depends_on:
- postgres
- - pictshare
+ - pictrs
- iframely
postgres:
- ./volumes/postgres:/var/lib/postgresql/data
restart: always
- pictshare:
- image: hascheksolutions/pictshare:latest
+ pictrs:
+ image: asonix/pictrs:amd64-v0.1.0-r9
+ user: 991:991
ports:
- - "127.0.0.1:8537:80"
+ - "127.0.0.1:8537:8080"
volumes:
- - ./volumes/pictshare:/usr/share/nginx/html/data
+ - ./volumes/pictrs:/mnt
restart: always
iframely:
image: dogbin/iframely:latest
ports:
- - "127.0.0.1:8061:80"
+ - "127.0.0.1:8538:80"
volumes:
- ./iframely.config.local.js:/iframely/config.local.js:ro
restart: always
proxy_cache_min_uses 5;
}
- location /pictshare/ {
+ location /pictrs/ {
proxy_pass http://0.0.0.0:8537/;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
-
- if ($request_uri ~ \.(?:ico|gif|jpe?g|png|webp|bmp|mp4)$) {
- add_header Cache-Control "public, max-age=31536000, immutable";
- }
}
location /iframely/ {
- proxy_pass http://0.0.0.0:8061/;
+ proxy_pass http://0.0.0.0:8538/;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
version: '3.3'
services:
- postgres:
- image: postgres:12-alpine
- environment:
- - POSTGRES_USER=lemmy
- - POSTGRES_PASSWORD=password
- - POSTGRES_DB=lemmy
+ nginx:
+ image: nginx:1.19-alpine
+ ports:
+ - "8536:8536"
volumes:
- - ./volumes/postgres:/var/lib/postgresql/data
- restart: always
+ - ./nginx.conf:/etc/nginx/nginx.conf
+ depends_on:
+ - lemmy
+ - pictrs
+ - iframely
+ restart: "always"
lemmy:
build:
context: ../../
dockerfile: docker/dev/Dockerfile
- ports:
- - "127.0.0.1:8536:8536"
restart: always
environment:
- RUST_LOG=debug
- ../lemmy.hjson:/config/config.hjson
depends_on:
- postgres
- - pictshare
- iframely
- pictshare:
- image: hascheksolutions/pictshare:latest
- ports:
- - "127.0.0.1:8537:80"
+ postgres:
+ image: postgres:12-alpine
+ environment:
+ - POSTGRES_USER=lemmy
+ - POSTGRES_PASSWORD=password
+ - POSTGRES_DB=lemmy
volumes:
- - ./volumes/pictshare:/usr/share/nginx/html/data
+ - ./volumes/postgres:/var/lib/postgresql/data
+ restart: always
+
+ pictrs:
+ image: asonix/pictrs:amd64-v0.1.0-r9
+ user: 991:991
+ volumes:
+ - ./volumes/pictrs:/mnt
restart: always
iframely:
image: dogbin/iframely:latest
- ports:
- - "127.0.0.1:8061:80"
volumes:
- ../iframely.config.local.js:/iframely/config.local.js:ro
restart: always
--- /dev/null
+events {
+ worker_connections 1024;
+}
+
+http {
+ server {
+ listen 8536;
+ server_name 127.0.0.1;
+ #access_log off;
+
+ # Upload limit for pictshare
+ client_max_body_size 50M;
+
+ location / {
+ proxy_pass http://lemmy:8536;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header Host $host;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+
+ # WebSocket support
+ proxy_http_version 1.1;
+ proxy_set_header Upgrade $http_upgrade;
+ proxy_set_header Connection "upgrade";
+ }
+
+ location /pictrs/ {
+ proxy_pass http://pictrs:8080/;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header Host $host;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ }
+
+ location /iframely/ {
+ proxy_pass http://iframely:80/;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header Host $host;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ }
+ }
+}
file = event;
}
- const imageUploadUrl = `/pictshare/api/upload.php`;
+ const imageUploadUrl = `/pictrs/image`;
const formData = new FormData();
formData.append('file', file);
})
.then(res => res.json())
.then(res => {
- let url = `${window.location.origin}/pictshare/${res.url}`;
+ let url = `${window.location.origin}/pictrs/${res.url}`;
let imageMarkdown =
res.filetype == 'mp4' ? `[vid](${url}/raw)` : `![](${url})`;
let content = i.state.commentForm.content;
file = event;
}
- const imageUploadUrl = `/pictshare/api/upload.php`;
+ const imageUploadUrl = `/pictrs/image`;
const formData = new FormData();
- formData.append('file', file);
+ formData.append('images', file);
i.state.imageLoading = true;
i.setState(i.state);
})
.then(res => res.json())
.then(res => {
- let url = `${window.location.origin}/pictshare/${encodeURI(res.url)}`;
+ let url = `${window.location.origin}/pictrs/${encodeURI(res.url)}`;
if (res.filetype == 'mp4') {
url += '/raw';
}
handleImageUpload(i: User, event: any) {
event.preventDefault();
let file = event.target.files[0];
- const imageUploadUrl = `/pictshare/api/upload.php`;
+ const imageUploadUrl = `/pictrs/image`;
const formData = new FormData();
formData.append('file', file);
})
.then(res => res.json())
.then(res => {
- let url = `${window.location.origin}/pictshare/${res.url}`;
+ let url = `${window.location.origin}/pictrs/${res.url}`;
if (res.filetype == 'mp4') {
url += '/raw';
}