Giter Site home page Giter Site logo

martinskalicky / skepy-pf Goto Github PK

View Code? Open in Web Editor NEW

This project forked from goryn-clade/pathfinder-containers

0.0 0.0 0.0 152 KB

A Docker-compose solution for Pathfinder mapping tool using Traefik

License: Other

Shell 58.47% Dockerfile 41.53%

skepy-pf's Introduction

Pathfinder Containers

Docker Image Master Branch

A fork of techfreak's Pathfinder-container docker-compose solution for Pathfinder that is designed to work with Goryn Clade's Pathfinder fork, using Traefik as a reverse proxy to expose the docker container.

Modified to work for SKEPY UNIVERSE corporation. You can use this to install from scratch. Following guide is modified for Debian server (12+)

  1. Installation
  2. Using Traefik
  3. Development

Installation

Prerequisites:

Note: The Docker-compose file uses Compose v3.8, so requires Docker Engine 19.03.0+


  1. Create an API-Key

    • Go the Eve Online Developer portal
    • After signing in go to "MANAGE APPLICATIONS" โ†’ "CREATE NEW APPLICATION"
    • Choose a name for your application (e.g. "Pathfinder Production")
    • Enter a Description for this installation
    • Change "CONNECTION TYPE" to "Authentication & API Access"
    • Add the following "PERMISSIONS":
      • esi-location.read_online.v1
      • esi-location.read_location.v1
      • esi-location.read_ship_type.v1
      • esi-ui.write_waypoint.v1
      • esi-ui.open_window.v1
      • esi-universe.read_structures.v1
      • esi-corporations.read_corporation_membership.v1
      • esi-clones.read_clones.v1
      • esi-characters.read_corporation_roles.v1
      • esi-search.search_structures.v1
    • Set your "CALLBACK URL" to https://[YOUR_DOMAIN]/sso/callbackAuthorization

  2. Clone the repo

    git clone --recurse-submodules  https://github.com/martinskalicky/skepy-pf.git
  3. Create a .env file (copy .env.example) and make sure every config option has an entry.

    DOMAIN=""                                    # Change to your domain (or sub-domain) you wanna use
    LE_EMAIL=""                                  # Emails from Lets Encrypt about your certificate will go here
    APP_PASSWORD=""                              # Password for SETUP
    MYSQL_HOST="mariadb"                         # MYSQL Host
    MYSQL_PORT="3306"                            # Default MYSQL port
    MYSQL_USER="root"                            # MYSQL User
    MYSQL_PASSWORD=""                            # MYSQL Password
    MYSQL_PF_DB_NAME="pathfinder"                # PF Database name
    MYSQL_UNIVERSE_DB_NAME="eve_universe"        # EVE Universe Database name
    MYSQL_CCP_DB_NAME="eve_lifeblood_min"        # EVE CCP Database name
    REDIS_HOST="redis"                           # REDIS Host
    REDIS_PORT="6379"                            # REDIS Port
    CCP_SSO_CLIENT_ID=""                         # Use SSo tokens created in step 1
    CCP_SSO_SECRET_KEY=""                        # Use SSo tokens created in step 1
    CCP_ESI_SCOPES="esi-location.read_online.v1,esi-location.read_location.v1,esi-location.read_ship_type.v1,esi-ui.write_waypoint.v1,esi-ui.open_window.v1,esi-universe.rea>
    PATHFINDER_SOCKET_HOST="pathfinder-socket"   # domain of the websocket container, relative to the main pf container 
    PATHFINDER_SOCKET_PORT="5555"                # default tcp socket port
    SMTP_HOST=""
    SMTP_PORT=""
    SMTP_SCHEME=""
    SMTP_USER=""
    SMTP_PASS=""
    SMTP_FROM=""
    SMTP_ERROR=""
    1. Edit the config/pathfinder/pathfinder.ini to your liking

      Recommended options to change:

      • [PATHFINDER]
        • NAME- the tab title when viewing your Pathfinder
      • [PATHFINDER.LOGIN]
        • COOKIE_EXPIRE - expire age (in days) for login cookies. read more
        • SESSION_SHARING - Share maps between logged in characters in the same browser session. read more
        • CHARACTER - Character allow-list. Comma separated string of character ids. (empty = "no restriction")
        • CORPORATION - Corporation allow-list. Comma separated string of corporation ids. (empty = "no restriction")
        • ALLIANCE - Alliance allow-list. Comma separated string of alliance ids. (empty = "no restriction")
      • [PATHFINDER.MAP.PRIVATE], [PATHFINDER.MAP.PRIVATE], [PATHFINDER.MAP.ALLIANCE]
        • LIFETIME - expire time (in days) until a map type will be deleted (by cronjob)

    2. Build & Run it

      docker network create web && docker-compose up -d --build

    3.Open the http://< your-domain >/setup page.

    • Your username is pf and password is the password you set in APP_PASSWORD in the .env file.
    • Find the database section of the setup page, for both "pf" and "eve_universe" databases click the "create database" button.
    • Once the page has reloaded, click the "setup tables", and then "fix columns/keys".

    1. Go back to your console and insert the eve universe dump with this command:

      docker-compose exec pfdb /bin/sh -c "unzip -p eve_universe.sql.zip | mysql -u root -p\$MYSQL_ROOT_PASSWORD eve_universe";
      
    2. When everthing works, configure Traefik correctly for production

      • Remove the staging CA server line (#89) from docker-compose.yml.
      • Delete the ./letsencrypt/acme.json configuration file so Let's Encrypt will get a new certificate.

      • If you are not the root user on your host you may need to edit file permissions. Docker-engine creates the letsencrypt director as root user, which means that you would need to prefix sudo on any future docker commands (sudo docker-compose up etc). To avoid doing this you can take ownership of the letsencrypt directory by running sudo chown -R $USER ./letsencrypt.

Hint: If you need to make changes, perform your edits first, then do docker-compose down to bring down the project, and then docker-compose up --build -d to rebuild the containers and run them again.

Troubleshooting

  • Make sure you do not have nginx/apache installed. You will get error that port is used when trying to build it
  • make sure you do not have mariadb/mysql installed. You will get error that port is used when trying to connect to it from website



Using Traefik

To keep things simple, the structure of this project assumes that you will use Traefik to provide access to your Pathfinder docker container and nothing else. As such, Traefik containers start and stop with the Pathfinder containers.

If you want to run other services in docker on the same host that also need to be exposed to the web, you should strongly consider splitting Traefik into a separate project with its own docker-compose file. This will allow you to take pathfinder project offline for maintenance without affecting other containers that rely on Traefik.




Development

Some Development configurations that have worked well for me have been saved in the development/ directory, including step debugging for VsCode using xdebug

Development configs and docker files can be quickly restored using:

chmod +x ./development/development.sh && ./development/development.sh

This creates a partial .env file, but you will need to add your CCP SSO client and keys manually, if you want to copy development files without overwriting your .env file add the flag --noenv when running the script.

It's best to create a new SSO application for development work, so that you can set the callback url to https://localhost/sso/callbackAuthorization.




Acknowledgments

Authors

  • techfreak
  • johnschultz
  • samoneilll

License

This project is licensed under the MIT License - see the LICENSE.md file for details

skepy-pf's People

Contributors

samoneilll avatar greg2010 avatar ajaxify avatar martinskalicky avatar lynkfox avatar turbofeedorglory avatar dependabot[bot] avatar

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.