Coder Social home page Coder Social logo

solder's Introduction

TechnicPack Solder

Warning This project is abandoned and has been archived. For the current version of Solder, please see https://github.com/TechnicPack/TechnicSolder instead.

CircleCI Coverage Status StyleCI

Supercharge Your Modpack with Solder. Build, and maintain multiple versions of modpacks and manage all required downloads in one place.

Getting Started

These instructions will get you a locally running version of solder for development and testing purposes. Its important to note that this application is still in early development and updates may break functionality or require special upgrade steps. Do not use this in production.

Prerequisites

To run this project, you must have PHP 7.1.3 or newer, composer and npm installed. You will also probably want to have a web server running to serve the site (although this isn't strictly required for testing).

Setup

Begin by cloning this repository to your machine, and installing all dependencies.

$ git clone https://github.com/TechnicPack/solder.git
$ cd solder && composer install --no-dev && npm install --only=production
$ npm run production
$ php artisan solder:install

Next, boot up your webserver and visit your application. If using a tool like Laravel Valet, of course the URL will default to http://solder.test. If you aren't using a webserver you can start up a php webserver with the php artisan serve command.

The default username is [email protected] and the default password is secret

Upgrading

Begin by placing the application in maintenance mode, updating the repository and all dependencies.

$ php artisan down
$ git fetch && git pull
$ composer install --no-dev && npm install --only=production

Finally, rebuild any generated resources, migrate the database and put the application back online

$ npm run production
$ php artisan migrate --force
$ php artisan up

Running the tests

Its important that the project maintain very high test coverage to ensure that changes to the code don't break any expected behavior from the API. This API is called on nearly every time a user runs the TechnicPack Launcher, its an invisible part of what makes Technic work, and we want to keep it invisible to the day-to-day user.

PHPUnit Feature and Unit tests

A majority of the testing is done in feature tests which test the expected output of API endpoints under various conditions and with various inputs. You can run the full suite of unit and feature tests with PHPUnit.

$ vendor/bin/phpunit

Code style tests

Code style is also very important to us, a consistent code style makes the project easier to maintain and the pre- defined rules for how code should look lets everyone focus on function over form. Any push or PR will be checked by StyleCI before being merged. In order to reduce the number of commits, a local config and tool are included to allow you to run a fixer on your code before pushing it up to github.

$ vendor/bin/php-cs-fixer fix -v

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Authors

See also the list of contributors who participated in this project.

License

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

solder's People

Contributors

finlaydag33k avatar forcemagic avatar indemnity83 avatar noles avatar pyker 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

solder's Issues

Implement file uploads

Provisions have been made for file uploading in the API, but no documentation or implementation has been done.

Files are handled by the Assets model on the implementation side. Uploads should be done as PUT methods against well defined endpoints. The body of the PUT should ONLY be the file being uploaded (do not use form-multipart, or any other shortcuts).

For example, uploading a modpack logo would be:

PUT /modpack/{id}/logo
OR
PUT /modpack/{id}/assets/logo

See https://philsturgeon.uk/api/2016/01/04/http-rest-api-file-uploads/ for more information

Simplify modpack permissions to just published or not published

The current three tier permissions are overly complicated both for the end-user as well as for application logic.

A private modpack that has no authorized users is effectively hidden from all users. The only place it shows up outside of Solder is in the modpacks list on technicpack.net; but anybody who has access to that theoretically has an admin login to solder.

It would be significantly simpler to just have a concept of published and unpublished modpacks.

Web File Uploads

well wouldn't it be great to have a feature where the modpack creator doesn't have to make specific directory paths, file names etc.. when uploading a mod jar to the solder repository through ftp
instead a file browser through the web browser which the mod jar can be selected and it automatically uploads and creates directories and mod slugs?

i think that would be a great feature
thank you!!
great work

Missing URL config in install instructions or script

The APP_URL environment variable needs to be set in order for the application to work properly on most shared hosting providers but there are no install instructions or steps in the install script to have a user change it.

Add package management functions to UI

Blade template changes for package management

  • Add box with single input and button for updating the name
  • Add is-danger box with option to update package slug and button to delete modpack (see modpack management form)

Tests/UpdatePackageTest.php

  • A user can update a package
  • A guest is redirected to /login if they attempt to delete a package
  • Attempting to update a package with invalid slug returns a 404
  • Name cannot be blank
  • Slug cannot be blank
  • Slug must be unique
  • Slug must be alpha dash
  • All parameters are optional
  • Original slug can be resubmitted

Feature/DeletePackageTest.php

  • A user can delete a package
  • A guest is redirected to /login if they attempt to delete a package
  • Attempting to delete a package with invalid slug returns a 404

Unit/PackageTest.php

  • Deleting a package also deletes all releases

datafield size in database too small

i had to increase some datafields (website_url, donation_url and description) of the packages table
grafik
is it possible to increase that by default?

API responses return Content-Type: text/html by default

Do you want to request a feature or report a bug?

This is an unexpected behavior bug.

What is the current behavior?

An API request made with a default Accept: */* header will return Content-Type: text/html.

This can result in oddly unexpected behavior if for example an ajax request is made to an endpoint that requires authentication. Such a request results in a 302 Redirect to /login. If the user has an active session /login will 302 Redirect to /dashboard and the final status code ends up being 200 Ok, but the body is the dashboard page, not the endpoint requested.

Similarly a POST request results (after some redirects through /login) in a 415 Method Not Allowed even though POST is allowed to the endpoint originally requested.

If the current behavior is a bug, please provide the steps to reproduce

The initial 302 Redirect is technically the only bug and can easily be reproduced by sending a request to an endpoint which requires authentication with the Content-Type set to application/json

curl -X POST https://solder.indemnity83.com/api/modpack -H "Accept: */*"

What is the expected behavior?

In the example above the specifically expected response is a 405 Unauthorized error (and corresponding json error in the body)

What is the motivation / use case for changing the behavior?

Although it's not technically doing anything wrong, It is reasonable to expect that the default response type to an API request would be the application/vnd.api+json Content-Type.

Which versions of Solder, and which browser / http server / PHP versions are affected by this issue? Did this work in previous versions of Solder?

This applies to the untagged development of Solder.

Other information (e.g. stacktraces, related issues, suggestions how to fix)

I believe the fix requires setting up (or adjusting) a middleware on the API endpoints which will translate Accept: */* to Accept: application/vnd.api+json.

Endpoints for solderhelper

As requested, here is a list of the endpoints solder helpers currently scrappes to do it's thing, and what exactly it uses from them:

  • POST /Login
    • Take a wild guess.. (Currently there isn't really a reliable way to check if login has succeeded, so I check if I can find elements from the dashboard)
  • POST /modpack/create
    • For creating modpacks, does a normal form post
  • POST /mod/create
    • For creating the mods themselves (Creating new versions is seperate)
  • POST /mod/add-version
    • For actually adding new mod versions
  • POST /mod/rehash
    • Incase a mod version has changed, and solder needs to be told to calculate the new hash
  • GET /modpack/build/{buildId}
    • For checking wether a mod is already in a given build (In which case we need to change the active mod version)
    • For checking wether a mod version is active for a build (In which case we don't even need to pack and upload the new version locally)
    • Extending the above: For actually getting the mod version active in a build
  • POST /modpack/build/modify
    • For adding updating a build, incase the mod is already in a build, but another version is to be used
  • GET /mod/view/{modId}
    • For grabbing a mod version id, so it can be used to update the modpack builds
  • POST /modpack/add-build/{modpackId}
    • For creating new builds of a modpack
  • GET /modpack/view/{modpackId}
    • For getting build ids for updating
    • For figuring out if a new build should be created because it doesn't already exist
  • GET /modpack/list
    • For getting the modpack ids themselves
    • For knowing if a new modpack should be created
  • GET /mod/list
    • For grabing mod ids
    • For knowing if a mod should be created
  • POST /modpack/modify/add
    • For adding a mod version to a build

Everything can be found in details here in terms of parameters and such:https://github.com/zlepper/go-modpack-packer/blob/angular2/source/backend/solder/solderClient.go

How to access the panel?

So ehm... Finally got the thing installed, but now how do I run and access it?
I have ran php artisan up but I can't seem to find how to access it in the browser :
Not an issue with the code per-se, just something that could be updated in the docs :)

Add form validation and notification for Release upload form

This is a mental dump of the things that need to happen to get the library page (http://solder.indemnity83.com/library/{package}/) polished up.

Changes to blade template (.../packages/show.balde.php)

  • Change top notification class from is-primary to is-notification
  • Add is-dangerto input css for errors on the input
  • Add help text under inputs with errors
  • Add value="old($field)" to each input
  • Remove (for now) the hard-coded filename, it's confusing

Anticipated Tests

  • A user can create a release
  • A guest cannot create a release
  • Version is required
  • Version is unique
  • Version contains only numbers, letters, underscore, dash and dots
  • Version cannot start with a dot
  • Archive is a zip file

Users without permissions can create site admins

Hey, so i recently created an account for my friend on the solder install, and we were fooling around a little.
So he created another site admin without having the permissions to do so. ( he had permissions to add mods and builds ) Is the permissions system simply broken or is it just in my installation?

Add form validation and notification to Library

This is a mental dump of the things that need to happen to get the library page (http://solder.indemnity83.com/library) polished up.

Changes to blade template (.../packages/show.balde.php)

  • Change top notification class from is-primary to is-notification
  • Add is-dangerto input css for errors on the input
  • Add help text under inputs with errors
  • Add value="old($field)" to each input

Anticipated Tests

  • A user can create a modpack
  • A guest cannot create a modpack
  • Name is required
  • Slug is required
  • Slug is unique
  • Slug is alpha numeric

Migrate Theme

Need to get the application to look like previous versions of Solder

Frontend Colors

Front end is currently using the default Bulma colors; they aren't bad but they don't look very Technic or Solder like.

Would like to get some feedback on a color pallet, and possible a PR to adjust each of Bulma's primary colors into a pallet that better matches the application.

For more information about Bulma's colors: http://bulma.io/documentation/overview/variables/

Can't install Solder

running php artisan solder:install always gives me an error.

The "first" run (after removing the .env file and running php artisan config:clear) gives me: SQLSTATE [HY000] [2002] Connection refused.
Running it a second time (nothing else in between) gives me the error: Base table or view not found: 1146 Table 'solder.oauth_clients' doesn't exist (which is extremely obvious since the last attempt resulted in a failed connection).

I have checked my credentials a literal 20 times, and I'm 329523487532490% positive that they are correct.

EDIT: Might it be caused by the fact that the MySQL server is not hosted on the local machine (but rather on another machine in the network)

Browser testing fails on Travis-CI

There doesn't seem to be a clear solution to getting chrome working on Travis-CI build environments. There's either a lot of extra steps that need to be added to the test script (seems fragile) or users just simply changing to a different driver (like Firefox or PhantomJS).

I'd really like to get the tests working with Chrome since it works so seamlessly in local development so for now I'm disabling the automated tests and inviting the community to help me troubleshoot getting the automated tests running so I can concentrate on finishing the GUI instead of spinning my wheels debugging Travis.

Resource Versions should be tagged for their game version

In order to simplify the creation of modpacks; resources should be tagged for the versions of Minecraft they're compatible with. When creating a modpack build, the resource list (and resource versions) can be filtered to only show compatible resources.

clicking the x in /library links to /settings/general

the x on the top right of "Here is where you store all the mods, resource packs, configs or whatever else you might want to bundle into a modpack. You'll need to create a package to keep multiple versions of the same mod or resource pack together before you can start uploading files."

see title, nothing wild, just wanted to mention it ^^

Integrity constraint violation when creating model through api

For POST requests, the API accepts a client generated uuid, but does not validate the id is unique before attempting to use it.

When the request is made with a duplicate id, the request should be immediately rejected, and no records created.

However, currently a record is created with a different id than expected, and an SQL integrity constraint violation is returned to the consumer.

Document upgrade path

The upgrade path will not be a simple git pull process, the changes from Laravel 4.2 to 5.2 are to significant.

Attempting to add a package returns to package listing with no error or added package

I set a name of the package, and a slug then hit add a package. It will then take me back to the library page, but with nothing added, even checked the database and nothing has gone there either. I have made sure the permissions were set correctly for the public folder, along with config and app. Nothing just seems to be happening, am I missing something? Or is this an issue? (could not find anyone else having this issue)

Encryption keys already exist. Use the --force option to overwrite them.

When trying to install solder, I encounter some errors when configuring the MySQL.
When running php artisan solder:install I encounter the error Encryption keys already exist. Use the --force option to overwrite them. when I have a failed attempt.
The only way to get around it for me is to go back, delete the solder, re-clone it and basically start from scratch.
the --force option does not exist.

Build tags don't guarantee build has a 'minecraft' version attribute

In the interest of both simplifying the database, non-critical information about a build was moved into a 'tags' attribute.

Its unclear what attributes of the existing API are strictly required by the existing consumers (in particular the launcher) and which are optional. If the minecraft version is required by the launcher, it should be moved to its own attribute and required.

Create TechnicLauncher client token management in profile

  • Add new menu item to profile "Client Tokens" (maybe fa-window-maximize for the icon).

/Tests/AddClientTokenTest.php

  • A user can add a client ID to their profile
  • A guest is redirected to /login if they attempt to create a client id
  • Name is required
  • Token is required
  • Token must be unique

/Tests/DeleteClientTokenTest.php

  • A user can delete a client ID from their profile
  • A guest is redirected to /login if they attempt to delete a client id
  • A user cannot delete a token that is not linked to their profile

How to set solder Repo?

How can i set the location of the solder repo?
i only found in the .env file SOLDER_REPO= but that semms to be not working

data is uploaded to
/var/www/html/solderio/storage/app/public
it seems thats because oft the
'public' => [ 'driver' => 'local', 'root' => storage_path('app/public'), 'url' => env('APP_URL').'/storage', 'visibility' => 'public',
in the /var/www/html/solderio/config/filesystems.php

my repo is located at /var/www/html/repo
the vhost also directs the repo.domain.tld to there (standard solder configuration)

going to /modpacks crashes solder (500)

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
Accesing the modpacks page makes solder crash, with a 500

If the current behavior is a bug, please provide the steps to reproduce
Access the following url: https://solder.indemnity83.com/modpacks

What is the expected behavior?
I should see a list of modpacks

What is the motivation / use case for changing the behavior?
That people can actually use solder.

Which versions of Solder, and which browser / http server / PHP versions are affected by this issue? Did this work in previous versions of Solder?
Solder version: fd7c9d6

Other information (e.g. stacktraces, related issues, suggestions how to fix)
Error code provided: 6205a9b8-1dc4-4ad4-bc7a-26e9ecdac57f

Clone modpack builds

Currently, if you create a new build you have to re-add every single mod again.
This is rather annoying and it would be nice to implement a feature to clone builds while creating a new build.

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.