8 месяцев назад История
README.md

About

OpenSource self-hosted personal time management system. Server source code was created for this Android application from GooglePlay

Official working instance: https://wtf-dev.ru/sync/

Donate: >> PayPal <<

You can install this sources in any other place and change settings inside Application to use your installation.

Installation

Why Python? Just for fun, I wanted to get acquainted with this language. I think it’s good when learning from the beginning can benefit many people. But PHP would actually be better here.

1) Setup server environment (look “Server requirements”) 2) Create database structure from file zzz_database.sql 3) Save the settings file (from 4) and remove old source files if they exists. 4) Open file /_common/api/_settings.py and change settings. 5) Run script /zzz_run_once.sh as files owner 6) Remove all files with name prefix zzz_ and with any extensions

For update process please start from step 2

Server requirements

  • Linux
  • MacOS
  • Windows? Really?? Replace #!/usr/local/bin/python3 in all *.py scripts at the top of file.

Can be any old personal computer. Or any modern dedicated server. You can try to install it even directly to your mobile device or router, if you know how to do this and want to have fun.

Python >= 3.5

Or higher. While development process version was v3.7

sudo apt-get install python3

Create a link to python3 interpreter from this installation inside /usr/local/bin/ folder. May be to pip3 command also.

Database

Install MySQL >= 5.5 or MariaDB >= 5.5

sudo apt-get install mariadb-server

And install recommended mysql client for Python

/usr/local/bin/python3 -m pip install PyMySQL

Apache2

Must be with CGI folder (mod_cgi must be enabled)

AddDefaultCharset UTF-8
SetEnv PYTHONIOENCODING utf8

<VirtualHost *:80>
    <Directory /var/www/html>
        Options +ExecCGI
        DirectoryIndex index.py, index.html
    </Directory>
    AddHandler cgi-script .py
    ...
    ...
</VirtualHost>

May be next code will solve some problems after update. This is not necessary and not recommended. Only if you see some cached content and can not clear internal browser cache.

<FilesMatch "\.(html|htm|js|css)$">
    <IfModule mod_headers.c>
        Header set Cache-Control "private, max-age=300, no-store, must-revalidate"
        Header set Pragma "no-cache"
        Header set Expires "Wed, 11 May 1983 17:30:00 GMT"
    </IfModule>
</FilesMatch>

FAQ

  • If you want to install this project somewhere and don’t know how to do this: there are a lot of examples in Google by request: Apache(CGI mode) + MySQL + Python
  • If you want to change/add/extend something: “do it, just do it” and create pull request.

For developers

Please set auto-format tool to ignore “E24, E402” - look pycodestyle.ini for examples. And follow current code structure.

Links

Конвейеры
0 успешных
0 с ошибкой