Code Monkey home page Code Monkey logo

jawanndenn's Introduction

pre-commit

image

What is jawanndenn?

jawanndenn is a simple web application to schedule meetings and run polls, a libre alternative to Doodle. It is using the following technology:

jawanndenn is libre software developed by Sebastian Pipping. The server code is licensed under the GNU Affero GPL license version 3 or later whereas the client code is licensed under the GNU GPL license version 3 or later.

Please report bugs and let me know if you like it.

Poll Setup Format

The textarea titled "Setup (JSON)" uses a simple JSON-based format that knows the following keys:

  • equal_width — a bool to control whether all options are pumped up to the same width (true or false) to counter potential voter bias
  • lifetime — duration after which this poll will be deleted; can be "week" or "month"; an enum-like string
  • options — a list of strings, one for each option; supports Markdown-like syntax for: bold, italic, inline code
  • title — the title or headline of the poll to run; supports Markdown-like syntax for: bold, italic, inline code

Installation

To install the latest release without cloning the Git repository:

# pip3 install jawanndenn --user

To install from a Git clone:

# ./setup.py install --user

Deployment with docker-compose

Create a simple file .env like this one:

JAWANNDENN_POSTGRES_NAME=jawanndenn
JAWANNDENN_POSTGRES_USER=jawanndenn
JAWANNDENN_POSTGRES_PASSWORD=dEb2PIcinemA8poH
JAWANNDENN_SECRET_KEY=606ea88f183a27919d5c27ec7f948906d23fdd7821684eb59e8bcf7377e3853b

Make sure to adjust these values after copy and paste!

You can then build and run a docker image using docker-compose up --build.

The app is served on localhost:54080. PostgreSQL data is saved to ~/.jawanndenn-docker-pgdata/ on the host system. There is also an instance of Redis used for cross-process rate limiting, and a "cron" housekeeping container that will go delete polls that have exceeded their configured lifetime, every 60 minutes.

(If you need a low-maintenance SSL reverse proxy in front of jawanndenn, docker-ssl-reverse-proxy could be of interest.)

There is a few more environment variables that you could want to adjust in your environment. Altogether, there are these variables:

Environment variables

DJANGO_SETTINGS_MODULE

Django settings module to use, leave as is, defaults to jawanndenn.settings (see docker-compose.yml)

JAWANNDENN_ALLOWED_HOSTS

Hostnames to serve jawanndenn at, list separated by comma, is set to jawanndenn.de,www.jawanndenn.de on the main production server, defaults to 127.0.0.1,0.0.0.0,localhost (see jawanndenn/settings.py)

JAWANNDENN_DEBUG

Debug mode, disabled for all values but True, disabled by default, should never be enabled in production for security (see jawanndenn/settings.py)

JAWANNDENN_MAX_POLLS

Maximum total number of polls to store, denial of service protection, defaults to 1000 (see jawanndenn/settings.py and docker-compose.yml)

JAWANNDENN_MAX_VOTES_PER_POLL

Maximum total number of polls to store, denial of service protection, defaults to 40 (see jawanndenn/settings.py)

JAWANNDENN_POSTGRES_HOST

Hostname of the PostgreSQL database to connect to; defaults to postgres (see docker-compose.yml)

JAWANNDENN_POSTGRES_NAME

Database name of the PostgreSQL database to connect to; no default, always required

JAWANNDENN_POSTGRES_PASSWORD

Password for log-in with the PostgreSQL database; no default, always required

JAWANNDENN_POSTGRES_PORT

Port of the PostgreSQL database to connect to; defaults to 5432 (see docker-compose.yml)

JAWANNDENN_POSTGRES_USER

Username for log-in with the PostgreSQL database; no default, always required

JAWANNDENN_REDIS_HOST

Hostname of the Redis database to connect to; defaults to redis (see docker-compose.yml)

JAWANNDENN_REDIS_PORT

Port of the Redis database to connect to; defaults to 6379 (see docker-compose.yml)

JAWANNDENN_SECRET_KEY

Django secret key; should be long, generated, not used elsewhere; no default, always required

JAWANNDENN_SENTRY_DSN

Data source name (DSN) for use with Sentry, disabled/empty by default (see jawanndenn/settings.py)

JAWANNDENN_URL_PREFIX

Prefix string to insert into URLs rather after the domain name to help with hosting multiple apps under the same domain side by side; e.g. prefix prefix123 will result in URLs like https://<domain>/prefix123/poll/<id>; empty by default (see jawanndenn/settings.py)

Command line usage

When installed, invocation is as simple as

# jawanndenn

During development, you may want to run jawanndenn from the Git clone using

# PYTHONPATH=. python3 -m jawanndenn --debug

Currently supported arguments are:

# jawanndenn --help
usage: jawanndenn [-h] [--debug] [--host HOST] [--port PORT]
                  [--url-prefix PATH] [--database-sqlite3 FILE]
                  [--django-secret-key-file FILE] [--max-polls COUNT]
                  [--max-votes-per-poll COUNT] [--dumpdata]
                  [--loaddata FILE.json]

optional arguments:
  -h, --help            show this help message and exit
  --debug               Enable debug mode (default: disabled)
  --host HOST           Hostname or IP address to listen at (default:
                        127.0.0.1)
  --port PORT           Port to listen at (default: 8080)
  --url-prefix PATH     Path to prepend to URLs (default: "")
  --database-sqlite3 FILE
                        File to write the database to (default:
                        ~/jawanndenn.sqlite3)
  --django-secret-key-file FILE
                        File to use for Django secret key data (default:
                        ~/jawanndenn.secret_key)

limit configuration:
  --max-polls COUNT     Maximum number of polls total (default: 1000)
  --max-votes-per-poll COUNT
                        Maximum number of votes per poll (default: 40)

data import/export arguments:
  --dumpdata            Dump a JSON export of the database to standard output,
                        then quit.
  --loaddata FILE.json  Load a JSON export of the database from FILE.json,
                        then quit.

Migrating data from jawanndenn 1.x to 2.x

Migration takes four steps:

  1. Update to the latest version of jawanndenn 1.x, e.g. by running: pip2 install --upgrade 'jawanndenn<2'; the JSON data export was first introduced with release 1.6.3.
  2. Export existing polls:
    1. If you're using the commend line app: python2 -m jawanndenn --dumpdata > dump.json
    2. If you're using docker-compose: docker-compose run -T jawanndenn --database-pickle /data/polls.pickle --dumpdata > dump.json
  3. Deploy latest jawanndenn 2.x somewhere (as described above) or just pip3 install 'jawanndenn>=2' it somewhere
  4. Import the JSON dump created in step (2):
    1. If you're using the commend line app: python3 -m jawanndenn --loaddata dump.json
    2. If you're using docker-compose: docker-compose run -T jawanndenn sh -c 'cat > /tmp/dump.json && DJANGO_SETTINGS_MODULE=jawanndenn.settings python3 -m django loaddata /tmp/dump.json' < dump.json

Goals

Please check out the list of upcoming features.

Non-goals

  • Use of heavy frontend frameworks: building blocks only
  • Read availability from calendars

Thanks

Special thanks to Arne Maier (@KordonDev) for reporting an XSS vulnerability, responsibly.

jawanndenn's People

Contributors

dependabot[bot] avatar hannob avatar hartwork avatar kiyutink avatar mrape avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

jawanndenn's Issues

Add readme

  • Goals and non-goals
  • Used technology
  • Installation

Enable vertical scroll

When I want to create a large poll almost all options are off screen, which means I can't select them.

Detailed Installation Instructions

Hi,

there are a few environment variables in the docker-compose file which need to be filled.
I can not find an explanation in the documentation, for example:

JAWANNDENN_SENTRY_DSN
JAWANNDENN_ALLOWED_HOSTS
JAWANNDENN_URL_PREFIX
JAWANNDENN_DEBUG

Furthermore the cron container is not mentioned anywhere in the documentation.

Thanks!

docker-compose installation results in 'ImportError: No module named main'

After trying for an hour I would like to ask for your help here:
I was trying to install jawanndenn via docker-compose.
Because of a proxy I had to change my docker-compose.yml like following:

version: '2'

services:
  jawanndenn:
    restart: always
    networks:
      - proxy
    build: .
    volumes:
      - '/data/docker/jawanndenn:/data'
    environment:
      - 'VIRTUAL_HOST=jawanndenn.mydomain.com'
      - 'LETSENCRYPT_HOST=jawanndenn.mydomain.com'
      - '[email protected]'
      - 'LETSENCRYPT_TEST=true'

networks:
  proxy:
    external:
      name: proxy_proxy

Running dc up -d && dc logs -f --tail=100 always gives me following log messages:

Creating jawanndenn_jawanndenn_1
Attaching to jawanndenn_jawanndenn_1
jawanndenn_1  | Traceback (most recent call last):
jawanndenn_1  |   File "/root/.local/bin/jawanndenn", line 11, in <module>
jawanndenn_1  |     load_entry_point('jawanndenn==1.5', 'console_scripts', 'jawanndenn')()
jawanndenn_1  |   File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 480, in load_entry_point
jawanndenn_1  |     return get_distribution(dist).load_entry_point(group, name)
jawanndenn_1  |   File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2691, in load_entry_point
jawanndenn_1  |     return ep.load()
jawanndenn_1  |   File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2322, in load
jawanndenn_1  |     return self.resolve()
jawanndenn_1  |   File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2328, in resolve
jawanndenn_1  |     module = __import__(self.module_name, fromlist=['__name__'], level=0)
jawanndenn_1  | ImportError: No module named main
jawanndenn_1  | Traceback (most recent call last):
jawanndenn_1  |   File "/root/.local/bin/jawanndenn", line 11, in <module>
jawanndenn_1  |     load_entry_point('jawanndenn==1.5', 'console_scripts', 'jawanndenn')()
jawanndenn_1  |   File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 480, in load_entry_point
jawanndenn_1  |     return get_distribution(dist).load_entry_point(group, name)
jawanndenn_1  |   File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2691, in load_entry_point
jawanndenn_1  |     return ep.load()
jawanndenn_1  |   File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2322, in load
jawanndenn_1  |     return self.resolve()
jawanndenn_1  |   File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2328, in resolve
jawanndenn_1  |     module = __import__(self.module_name, fromlist=['__name__'], level=0)
jawanndenn_1  | ImportError: No module named main
jawanndenn_jawanndenn_1 exited with code 1

Am I doing something wrong?

Footer should include a possibility to insert an impressum

Great small piece of software. Works like a charm. I miss a possibility to insert a Impressum which is obligatory for public web services in Germany in my opinion all over the in the EU

How can I insert such a Impressum or a link to a Impressum?

API ?

Hello, does this app have an API ?

I would like to be able to create poll automatically and retrieve the link.

Regards

handling timezones

Proposal general idea

It would be great if jawanndenn can provide a way for the user to define their timezone, and then it automatically adjust the options based on the user's timezone.

Implementation suggestion

For instance it can detect if the options are dates, it enables a drop-down field in which people can use their timezone. If no date/time was detected, the the dropdown menu be visible but disabled. This can also be used as a reference to tell user that the options are not detected as valid dates.

Domain Subfolder

Hi,

I have installed jawanndenn under docker. As each web application, I access it throw an nginx web proxy (running on another docker container). There is SSL till the nginx proxy, then there is no SSL anymore.

All web application have their specific unique subfolder. So, I want to access the jawanndenn application via the following URL: https://mydomain.com/jawanndenn.
For other applications, I used to change the server (nginx, apache, tomcat, etc) root folder into the application container. Since jawanndenn is using bottle python which I am not familiar with, I have difficulties to configure the root folder. The application is not working as excepted since it cannot load other resources such as css and js files: see screenshot with a black square to hide my domain.

image

According the bottle documentation, it is possible to define a route somewhere inside the application. Is it really possible? If yes, where do I need to add the statement? I can edit the code when creating the docker image, it is fine for me...

Thank you

Enable "matchmaking" capabilities.

Disclaimer
I'm relatively new to the Open Source community and don't really know how to approach feature requests.

Use Case
In short, the Assignment Problem can be understood as the process to assign e.g. tasks to e.g. users. I think it would be possible to extend jawanndenn to solve this problem.

Let me explain:
Say instead of organizing a BBQ (for which I could use jawanndenn to find a date), I want to make sure that there are different kinds of foods and things needed for a BBQ. As the BBQ organizer, I want to make sure, that there's: drinks, food, music, blanket
There are four participants A,B,C,D. Each is able to provide different things for the BBQ:

 | Drinks   | Food    | Music   | Blanket   |
A|   yes    |   yes   |    no   |     no    |
B|    no    |  yes    |    yes  |   yes     |
C|   no     |   no    |    no   |    yes    |
D|   yes    |   no    |    no   |    no     | 

The Assignment Problem could be solved in this case by: A->Food, B->Music, C->Blanket, D->Drinks.

Things to consider
There might be no solution to the Assignment Problem, or the solution might not be unique. For non-unique cases, one (arbitrary) assignment could be returned. For unsolvable problems, some sort of "as-good-as-it-gets-solution" could be returned.

Implementation
The JSON setup file could contain an additional flag: assignmentproblem: false / true to switch between the classical use case and the Assignment Problem use case.

Algorithms for the AP are plenty. E.g. the Hungarian algorithm solves the problem in polynomial time.

Personal
My motivation for this use case stems from the fact that our working group currently uses Doodle to schedule speaker-slots for our internal meeting: We have many (say 10) slots for many (also 10) people and everyone has different dates on which they are able to present. This is being done by hand and is starting to get cumbersome.

"docker-compose up --build" fails with docker-compose 2.x.x (but not 1.x.x)

[root@starbase-01 jawanndenn]# docker-compose up --build
WARN[0000] The "JAWANNDENN_DEBUG" variable is not set. Defaulting to a blank string.
WARN[0000] The "JAWANNDENN_URL_PREFIX" variable is not set. Defaulting to a blank string.
WARN[0000] The "JAWANNDENN_SENTRY_DSN" variable is not set. Defaulting to a blank string.
WARN[0000] The "JAWANNDENN_ALLOWED_HOSTS" variable is not set. Defaulting to a blank string.
WARN[0000] The "JAWANNDENN_SENTRY_DSN" variable is not set. Defaulting to a blank string.
WARN[0000] The "JAWANNDENN_URL_PREFIX" variable is not set. Defaulting to a blank string.
WARN[0000] The "JAWANNDENN_ALLOWED_HOSTS" variable is not set. Defaulting to a blank string.
WARN[0000] The "JAWANNDENN_DEBUG" variable is not set. Defaulting to a blank string.
WARN[0000] The "JAWANNDENN_SENTRY_DSN" variable is not set. Defaulting to a blank string.
[+] Running 0/3
 ⠿ postgres Error                                                                                                                                        1.4s
 ⠿ redis Error                                                                                                                                           1.4s
 ⠿ cron Error                                                                                                                                            1.4s
Error response from daemon: pull access denied for jawanndenn_jawanndenn, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
[root@starbase-01 jawanndenn]#

Add ternary choice "maybe/dunno"

Really cool project, I feeled desperate to find a nice meetings scheduler!

Would be nice to have a three possible vote values: yes, no but also dunno/possible if really needed.

Doodle provides that (as well as framadate), I think that's somehow the only choice you can answer sometimes.

Docker image issue

Hello,

First of all thank you for the project.
Second of all, I tried to build the docker image.

[root@localhost ~]# docker run -v $(pwd)/data:/data -p 8080:8080 jawanndenn
INFO:jawanndenn.main:Hash randomization found to be disabled.
INFO:jawanndenn.main:Re-executing with hash randomization enabled...
Traceback (most recent call last):
File "/root/.local/bin/jawanndenn", line 11, in
load_entry_point('jawanndenn==1.5', 'console_scripts', 'jawanndenn')()
File "/root/.local/lib/python2.7/site-packages/jawanndenn-1.5-py2.7.egg/jawanndenn/main.py", line 104, in main
db.save(filename) # catch saving trouble early
File "/root/.local/lib/python2.7/site-packages/jawanndenn-1.5-py2.7.egg/jawanndenn/poll.py", line 168, in save
suffix='.pickle',
File "/usr/local/lib/python2.7/tempfile.py", line 314, in mkstemp
return _mkstemp_inner(dir, prefix, suffix, flags)
File "/usr/local/lib/python2.7/tempfile.py", line 244, in _mkstemp_inner
fd = _os.open(file, flags, 0600)
OSError: [Errno 13] Permission denied: '/data/polls-tmpNDH70D.pickle'

Have you got this issue?

Thank you
Olivier

Integration with existing Django Sites

Is it possible to integrate this an existing Django site. This is exactly what I am looking for but our intranet is already Django and would love to make this another app in that site.

Where can ALLOWED_HOSTS be changed for testing?

I am trying out jawanndenn on own server, but I cannot quite get it to work.

I set up jawanndenn inside a virtualenv, where it was installed with pip3 install jawanndenn; then, I try to test it with:

$ JAWANNDENN_ALLOWED_HOSTS="mysite.com" jawanndenn --host 0.0.0.0 --port 6789

Then, when I fire up the browser at mysite.com:6789, I get Bad Request (400) in the browser, and the server terminal reports:

Invalid HTTP_HOST header: 'mysite.com:6789'. You may need to add 'mysite.com' to ALLOWED_HOSTS (['0.0.0.0', '127.0.0.1', '0.0.0.0', 'localhost']).
XX.YY.ZZ.WW- - [30/Nov/2021:11:37:59 +0000] "GET / HTTP/1.1" 400 143 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:94.0) Gecko/20100101 Firefox/94.0"

Eh, however, I added it here in ALLOWED_HOSTS already:

jawanndenn/lib/python3.8/site-packages/jawanndenn/settings.py:    'mysite.com',
jawanndenn/lib/python3.8/site-packages/django/conf/global_settings.py:ALLOWED_HOSTS = [ "mysite.com" ]

... and I still get the above message.

Any suggestions how can I get this running for testing?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.