Giter VIP home page Giter VIP logo

openrct2_plugin_repository's Introduction

OpenRCT2 Plugin Repository

A place where users can share OpenRCT2 plugins

image

For now, users can submit plugis hosted on GitHub repos. There is a button in the top right to submit links, without needing to log in.

There is server side validation to make sure it's a https://github.com link. I'm alsothinking about adding validation to check if the repo has rct2 or OpenRCT2 in the tags, but not everyone uses tags.

There is basic listing (sorting new and rating, which is based on when users submitted the plug-in, and how many stars it has on GitHub), also a basic search functionality.

Users can also check details about the plug-in (which is basicallt the README.md form the GitHub repo), and also list plugins by user (by clicking on their profiles)

Setup:

Development:

  • Create a GitHub Access Token with the public_repo option.
  • Copy template.env to .env and edit it with your GitHub Token, and change the HTTP port if you'd like
  • make run

You should now be able to access the page at http://localhost, or http://localhost:PORT if you edited the port in the .env file

Prod:

Reverse proxy example for NGINX is in docker/nginx/prod/reverse-proxy.conf

  • Copy template.env to .env and edit it with your GitHub Token, and also change the MySQL password
  • Run make build-sass to build the scss into a css file
  • make run-prod

Links and other third party libraries used:

openrct2_plugin_repository's People

Contributors

harry-hopkinson avatar saadbruno avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

openrct2_plugin_repository's Issues

remove jQuery

jQuery is used for handling Ajax stuff in code/public/js/orct2p.js
We can replace it with native JS

Tables from markdown doesn't have the correct CSS

Bootstrap has its own classes to properly handle style of tables:
https://getbootstrap.com/docs/4.5/content/tables/

The problem is that the Parsedown library doesn't output the classes required by bootstrap to properly style them, leaving us with this monstrosity:
image

There's easy 2 ways of fixing this:

  1. Apply the bootstrap styling to html tags (<table>, <thead> and so on) instead of specific classes. This will affect every table in the website, but i don't think that's an issue

  2. Modify the Parsedown library to output the correct classes along with the html tags.

I prefer the 1st option as it doesn't rely on modifying the library and won't have a problem if it's updated and whatnot.

New GitHub authentication token format

I received an email from GitHub recently stating:

We noticed your personal access token, openrct2plugins_prod, has an outdated format and was used to access the GitHub API on May 20th, 2021 at 04:00 (UTC) with a user-agent header of Dunglas's minimal GraphQL client.

We recently updated the format of our API authentication tokens, providing additional security benefits to all our customers.

In order to benefit from this new format, please regenerate your personal access token, openrct2plugins_prod, using the button below.

(Regenerate your personal access token Button)

To understand more about this change and why it's important, visit https://github.blog/2021-04-05-behind-githubs-new-authentication-token-formats.

We encourage you to reset your other authentication tokens as well, or revoke any that are no longer needed. This applies to integrations (such as OAuth Apps and GitHub Apps) as well as personal access tokens. For more information on reviewing your authorized integrations, refer to https://docs.github.com/github/authenticating-to-github/reviewing-your-authorized-integrations.

Thanks,
The GitHub Team

Need to dig deeper into this, and see if there are any changes needed in the code, or if I can just regenerate the tokens

Plugin info api

So I have made a package manager for openrct plugins
https://github.com/marvin1099/OpenRCT-Plugin-PM
It works by webscaping the webside
openrct2plugins.org
and at first I didn't think an API would be that important, but it would make the package manager more elegant and the plugin website more versatile.
I already talked about it in Discord and Saadbruno asked me if he should implement it.
At this point it may or may not be worked on, I created this topic mainly so that the status of the implementation can be easily verified.
If there is no interest in this feature, you can of course say so or close the issue.
Btw. "lastupdate" wold be a unix timestamp in this example.
Here is my idea of how the api could look like:
Reqest --------

https://api.openrct2plugins.org/?getjson=true?query=grass?maxresults=10

Or i could be reqested like this -------

https://openrct2plugins.org/?api=true?getjson=true?query=grass?maxresults=10

Result -----
{
    "resultsnr":"3"
    "results":[
        {
            "pluginname":"openrct2-auto-mow",
            "plugindataurl":"https://openrct2plugins.org/plugin/R_kgDOHLFjjQ/openrct2-auto-mow",
            "plugingeturl":"https://github.com/PhasecoreX/openrct2-auto-mow/releases/latest",
            "lastupdate":1694292469
        },
        {
            ...
        },
        {
            ...
        }
    ]
}

Custom overrides for plugin information

As discussed in Discord, would be cool if developers could submit custom information to the plugins site along with their repo, to allow manual overrides of plugin title, image and set a direct link to the plugin JS file.

There's a few ways we could do it. We could have a login system with user accounts, so they could register and edit their own plugins. I'm not really a fan of this idea.

Another way we can do it (thanks to Oli414 for the suggestion) is to allow plugin owners to have a file in their repo with information we can use. I think we go with this one.

So we need to:

  • Choose a markup language
  • Choose a file name
  • Implement all the code and DB changes to make it happen

update_plugins.php fails if plugin is missing

code/bin/update_plugins.php is the script we run when updating plugins via cron.

When an existing plugin listed in our database gets deleted from GitHub, this script stops excecution:

updating plugin for Topodic/openrct2-scenery-scatterer-plugin
{"status":"error","message":"Error when adding plugin "}make: Leaving directory '/home/saad/dev/openrct2_plugin_repository/docker'

Wether we should delete the plugin from our database when it's missing from github or not is another question. But this script should keep updating the rest of the plugins regardless.

Show license information for plugins

The website should show which license the plugin you're viewing uses, preferably even on the list overview but the plugin detail page would be good enough.

I for one don't want to use any proprietary plugins (if they will ever exist) so I'll have to filter by FOSS only.

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.