Commit 98427af2 authored by Lukas Böhm's avatar Lukas Böhm 🎱
Browse files

think it works now maybe lul

parent 7f199ebf
......@@ -13,13 +13,12 @@ app.config['MEDIA_LOCATION'] = os.getenv('MEDIA_LOCATION') or os.path.join(datad
app.config['SQLALCHEMY_DATABASE_URI'] = os.getenv('DATABASE_URI') or 'sqlite:///' + os.path.join(datadir, 'home.db')
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
app.config['MAX_CONTENT_LENGTH'] = 5 * 1024 * 1024 # 5 MB
app.config['REDIS_URI'] = os.getenv('REDIS_URL') or 'redis://'
app.config['REDIS_URI'] = os.getenv('REDIS_URI') or 'redis://'
db = SQLAlchemy(app)
# task_queue = Queue(connection=Redis.from_url(app.config['REDIS_URI']))
# task_queue = Queue(connection=Redis(host='redis'))
task_queue = Queue(connection=Redis(host='localhost'))
task_queue = Queue(connection=Redis(host='chiefsend-redis'))
from app.models import *
......
import os
from datetime import timedelta
from werkzeug.exceptions import HTTPException
from app import app, db
from flask import redirect, url_for, render_template, send_from_directory, current_app, abort, request
from flask import redirect, url_for, render_template, send_from_directory, current_app, abort, request, jsonify
from app.models import Share, Attachment
from app.forms import UploadForm
from app import task_queue as que
from shutil import make_archive, rmtree
@app.route('/config')
def see_config():
return jsonify(dict(redis=app.config['REDIS_URI']))
def get_and_check_share(share_id):
share = Share.query.get(share_id)
if share is None:
......
......@@ -2,27 +2,29 @@ version: "3.8"
services:
redis:
container_name: "redis"
hostname: "redis"
container_name: "chiefsend-redis"
hostname: "chiefsend-redis"
image: "redis:latest"
# ports:
# - "5000:6379"
#command: [ "redis-server", "--appendonly", "yes" ]
rq:
container_name: "chiefsend-rq"
image: "geekinutah/python-rq-worker"
container_name: "chiefsend-tasks"
image: "chiefsend:latest"
entrypoint: rq worker --with-scheduler --url redis://chiefsend-redis
environment:
- REDIS_HOST=redis
links:
- redis:redis
- redis
- REDIS_URI=redis:///chiefsend-redis
depends_on:
- redis
volumes:
- type: bind
source: ./data
target: /home/chiefsend/data
web:
container_name: "chiefsend-web"
build: .
image: "chiefsend:latest"
environment:
- REDIS_URI=redis:///chiefsend-redis
deploy:
resources:
limits:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment