GithubHelp home page GithubHelp logo

lutris / website Goto Github PK

View Code? Open in Web Editor NEW
119.0 15.0 108.0 21.9 MB

Lutris.net website

Home Page: https://lutris.net

License: GNU Affero General Public License v3.0

JavaScript 30.93% Python 53.87% CSS 1.07% Shell 0.10% HTML 10.70% Makefile 0.20% Dockerfile 0.06% Vue 1.32% SCSS 1.73%
gaming

website's Introduction

Getting the site up and running for development

Install required packages:

apt install python3-venv

If you haven't done it already, install and configure virtualenvwrapper. If you are unfamiliar with virtualenvwrapper, see their documentation on their website: https://virtualenvwrapper.readthedocs.org/en/latest/

mkvirtualenv lutrisweb
cd lutrisweb
setvirtualenvproject

Once the virtualenv is created, you need to make sure that some environment variables are exported and are set to valid values, the simplest way to achieve that is to edit the postactivate script in $VIRTUAL_ENV/lutrisweb/bin/postactivate and add your exports here. The only required environment varible is the DJANGO_SETTINGS_MODULE one:

export DJANGO_SETTINGS_MODULE="lutrisweb.settings.local"

Alternatively, if you want to store additional secrets like API keys, you can place them in an environment file. You can then export values contained in this file by adding to the postactivate script:

export $(cat $HOME/Projects/website/.env.local | xargs)

Once your virtualenv is created, you can install the system and python dependencies:

# Ubuntu / Debian dependencies
sudo apt-get install build-essential git curl python3 python3-pip \
    python3-dev imagemagick libxml2-dev libxslt1-dev libssl-dev \
    libffi-dev libpq-dev libxml2-dev libjpeg-dev

# Red Hat / Fedora dependencies
sudo dnf install libpq-devel python3-devel libxml2-devel libxslt-devel

# Python dependencies
pip3 install -r config/requirements/devel.pip --exists-action=w

To build the frontend assets (javascript and css files), you'll need Node and NPM available. If your distribution offers a version of Node that is too old, you can use NVM (https://github.com/creationix/nvm) to install a more recent version.

You can then build the frontend assets:

npm install
npm run build

To watch for file changes and recompile assets on the fly, you can run in a separate terminal:

npm run watch

Once your PostgreSQL database is configured (explained in the paragraph below), run the database migrations to populate the database with tables:

./manage.py migrate

You can create a new admin user with the command:

./manage.py createsuperuser

Alternatively, if you want a database that is already populated with games, there are snapshots on the Github releases page: https://github.com/lutris/website/releases

The installer scripting documentation is not shipped with the website but with the client, if you want to build the docs, you'll need to get the client and compile the rst files into HTML. All this process is automated:

make client
make docs

Once everything is set up correctly, you should be able to run the test suite without any failures:

make test

Run the development server with:

make run

Redis configuration

The lutris websites uses Redis as a cache. Install with:

docker run -d \
    --name lutriscache \
    --restart unless-stopped \
    -p 6379:6379 \
    redis:latest

Postgresql configuration

You can get the same Postgres server used in the Docker setup by running the following command:

docker run -d \
    --name lutrisdb \
    --restart unless-stopped \
    --shm-size 4gb \
    -e POSTGRES_PASSWORD=admin \
    -e POSGRES_DB=lutris \
    -e POSTGRES_USER=lutris \
    -p 5432:5432 \
    -v lutrisdb_backups:/backups \
    postgres:12

Quickstart:

sudo -u postgres psql
create user lutris;
create database lutris with owner lutris;
alter user lutris createdb;
alter database lutris owner to lutris;
alter user lutris with password 'admin';

Create a user:

sudo -u postgres create user lutris

Note that the user will need to be able to create databases in order to run tests. If you have created an user without this permission, run:

sudo -u postgres psql
ALTER USER lutris CREATEDB;

Creating a database:

sudo -u postgres psql
create database lutris with owner lutris;

or (in shell):

createdb lutris -O lutris

Modify database's owner:

sudo -u postgres psql
alter database lutris owner to lutris;

Change user's password:

sudo -u postgres psql
alter user lutris with password 'admin';

Dropping all tables from the database:

drop schema public cascade;
create schema public;

Backing up the database:

pg_dump lutris > lutris.sql

Restoring a backup:

psql lutris < lutris.sql

To automate backups, make sure the Unix user has superuser privileges on PostgreSQL and run this script with cron:

cd /srv/backup/sql
backup_file="lutris-$(date +%Y-%m-%d-%H-%M).tar"
pg_dump --format=tar lutris > $backup_file
gzip $backup_file

Vue based code

Installer issues are using Vue based project stored in frontend/vue.

If you wish to develop for it, first install the dependencies and make a dev build:

cd frontend/vue
npm install
npm run build:issues-dev

The last command will run forever, watching for changes made to the source and rebuilding the project on each update. Press Ctrl+C to interrupt it.

Devcontainers

VSCode is recommended as a primary IDE for development. It provides an out of the box support for devcontainers - a modern full-featured development environment.

Prerequisite

Latest version of VSCode with [devcontainers](https://code.visualstudio.com/docs/devcontainers/containers) extension and Docker installed on your system.

After cloning the project choose the Reopen in Container` option from the VSCode menu. The bootstrap process will run automatically during the initial execution, encompassing all the steps mentioned in this tutorial.

Reset devcontainers env

  • From the menu, opt for the Reopen Folder Locally choice.
  • Wait until all containers have been stopped, which may take up to 10 seconds.
  • Proceed to remove the SQL DB volume using the command:

    docker rm lutris-website_devcontainer_lutrisdb_1 docker volume rm lutris-website_devcontainer_postgres_data

  • Finally, select the Rebuild and Reopen in Container option from the VSCode menu.

website's People

Contributors

accountoneoff avatar alexanderravenheart avatar asciiwolf avatar brianrobt avatar burningfool avatar charlydelta avatar dependabot[bot] avatar dlitz avatar dreamurrrr avatar faalagorn avatar fgblomqvist avatar fmarier avatar freso avatar gascarcella avatar letiliel avatar michaelbutler avatar openglfreak avatar professorcode212 avatar puneetse avatar rayrapetyan avatar robloach avatar sartoshi-foot-dao avatar shuriken1812 avatar strycore avatar tannisroot avatar thecalcaholic avatar towerism avatar turupawn avatar txtsd avatar vinzv 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

website's Issues

Footer

On the bottom of the Page, category Gaming News, there is a link to "LinuxGames" which is not longer active or has moved to an other address. (http://www.linuxgames.com/)

Also may we could add there "Linux Game News" -> http://linuxgamenews.com/
It is daily active and very useful!

Unhandled Steam account reassignment

How to reproduce:

  • log in with 1st user account
  • associate with steam user account
  • log in with 2nd user account
  • try associating with same steam account

Expected results:
Catch error, and display error message

Actual results:
Error 500

Send weekly reminder of unreviewed game submissions

The lutris website should send an email to all mods containing a list of unreviewed games. The email should link to a page on the website containing a list of all unreviewed games but with a better presentation than the Django admin.

If all user submissions have been reviewed, pick a few unpublished games at random and include them in the mail.

Missing words

On the "My account" page, at leat two words are missing due to line breaks in the code. "connect" and "them".

Link platforms to installers

I think it would make sense to have the platform information linked to the installer instead of the game. That is, when adding an installer, specify the platform it's for. It would :

  • 'Automate' the list of platforms for a game.
  • Limit this list to the platforms that have an installer for. I think that's for the best in most cases.
  • Make possible to display the correct platform a game has been installed for in the client.

Create aliases model for games

Add a model to store alternate names or common misspellings for game names so they can be redirected to the right page.

Return all found installers when requested by slug

When a game has several installers and a client requests the installers by the game's slug, return a list of all installers.

This may require to serve the installers on a different url for backward compatibility.

Let everyone see and use unpublished installers

Right now, only the author of a script and moderators can see unpublished installers. This does not encourage contributions and testing. I propose the following behavior is what I suggest:

  • Display published installers the same way for everyone
  • Add a "Show unpublished installers" link at the bottom of the installers list
  • Clicking on that link would show all the unpublished installers

Script format inconsistency between the site and client

For now, when downloading a game script from the site, it is in JSON format.
So as a lutris script writer wannabee i copied the script from Warcraft III to learn and adapt it for another game.
The problem is the submit installer game screen only allows YAML format. On top of that there is no clear error message saying what is wrong.

I really have no preference about one or the other, but i think the two should be the same.
Since the script documentation is a bit scarce, and other scripts are always a good point of reference, i consider this important.

Expire logins

It would be great if lutris.net would have a way to "expire" active login sessions. E.g., if your laptop is stolen and you really don't want people to get access to your highly sensitive Lutris account. Or just to avoid having a bunch of Lutris logins being valid even if they're from systems that no longer exist/are being used.

Add a downloads counter to installers

It would be rewarding for installer writers to see the number of people who've used their installer. And interesting to others.
Ideally it would only count one use if the same account / IP uses the same installer multiple times.

Add external links to games

Outside of the official website and store pages (Steam, GOG, HB) we should add links to external website.

So far I've selected these sites:

  • Wikipedia
  • PCGamingWiki
  • MobyGames
  • WineHQ AppDB
  • LemonAmiga

Add fork installer feature

This action should be present in the installer menu (where the "Edit installler" is) and should display a dialog prompting the game to fork it to, defaulting to the current game.
The game input should have autocomplete based on all games (including unpublished ones) and once the fork is done, the user should be redirected to the edit installer page for the fork.
The version field should be automatically changed to something like "copy" or "change-me"

Add a view installer feature

Installers can't be edited by anyone else other than the author and mods, it is currently very complicated to view the contents of an installer.

There should be a "View installer" action in the installer menu that would display the contents either in yaml or in json.

Selecting an installer on the website won't preselect it in the client

You've made so that all installers show up in the install game dialog after you've clicked some Install button on the website but the client doesn't preselect this installer, it just preselects the first in the list.

Edit: Er... I should probably have put this in client issues.

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.