Skip to content

Latest commit

 

History

History
163 lines (136 loc) · 4.57 KB

INSTALL.md

File metadata and controls

163 lines (136 loc) · 4.57 KB

Installation Guide

Submodule

To initial third-party, you need to update submodule.

git submodule update --init

Download

You can clone the project with git

git clone https://github.com/AdminTL/gestion_personnage_TL.git

Or download it from here : https://github.com/AdminTL/gestion_personnage_TL/archive/master.zip

Dependencies

You need python3.5

Arch Linux

sudo pacman -S python python-pip
sudo pip install -r requirements.txt

Mac OSX

brew install python3
sudo pip3 install -r requirements.txt

Ubuntu / Debian

sudo apt-get install python3 python3-pip
sudo pip3 install -r requirements.txt

If you have problem with oauth2client, maybe you need to update pyasn.

sudo apt-get --reinstall install python-pyasn1 python-pyasn1-modules

or

sudo pip3 install --upgrade google-auth-oauthlib

or install all Google tools

sudo pip3 install -U pypinfo

Windows

Install python 3 from https://www.python.org/downloads/ using the installer Install nodejs if not done already https://nodejs.org/en/download/ Start a cmd prompt with admin privileges by right-clicking->run as administrator (git-bash works well)

pip3 install -r requirements.txt

Bower

We use bower to update and install javascript code. Only need in develop or server without Internet.

You don't need bower if you execute the server with the --use_internet_static argument Because this option will get dependencies on Internet directly.

You need to install bower and execute the install command :

cd src/web
bower install

Choose the first option if bower asks to resolve conflict.

Authentication

To disable authentication, use argument --disable_login To disable oauth authentication, use argument --disable_login_oauth

Running

Run ./script/web_server.sh to launch the server.

Configure server

On production server, you need to specify your host and port. Run instance with argument :

-l HOST:PORT

When using http, use port 80.

When using https, use port 443.

When using http with https "--redirect_http_to_https", use port 80.

SSL

To enable https, you can generate a certificate ssl.

  1. Edit your domain in file ssl_cert/domains.txt
  2. Adapt the configuration file ssl_cert/config
  3. On config, set your email address
  4. On config, enable CA=... with staging address to test the script.
  5. And execute :
./script/justletsencrypt.sh

Systemctl

You can setup the daemon with Systemctl.

sudo cp ./script/gestion_personnage.service /etc/systemd/system/gestion_personnage.service

Edit the file on destination with argument you need. Update the variable WorkingDirectory and ExecStart.

Run the daemon:

sudo systemctl enable gestion_personnage.service
sudo systemctl start gestion_personnage.service

Database

Create user database.

touch database/client_secret.json

Create you a user.

TODO missing admin permission, ask help TODO missing Google Spreadsheet documentation

Options

--debug : Enable debug (default=False)
--open_browser : Open web browser on tabulation on server start (default=False)
--static_dir : Web: Static files directory (default=WEB_DEFAULT_STATIC_DIR)
--template_dir : Web: Template files directory (default=WEB_DEFAULT_TEMPLATE_DIR)
--db_path : Specify a path for database file. (default=DB_DEFAULT_PATH)
--db_demo : Use demo database. This option keeps all information in memory and does not save to the real database. (default=False)
--web-listen-address : Web: Web server listen address (default=Listen())
--ssl : Activate https and create ssl files if they don't exist. Doesn't work in Windows. (default=False)
--redirect_http_to_https : when you need to support external link with http, this will redirect request to https.
--use_internet_static : Not implemented. Force using static files like css and js from another internet website. Use web browser cache. (default=False)
--disable_login : Disable authentication
--disable_login_oauth : Disable authentication oauth
--disable_character : Disable access to character
--disable_user_character : Disable access to user of our character
--disable_message_character : Disable message to user in your character sheet from administration