Jump to content

Solder API


DanteChaos

Recommended Posts

HOT EDIT

click here for Linux Instructions

----------------------------------------------------

So i wish to use the Solder API in order to check mods updates and such.

It came to my attention there is no documentation about it on this site what so ever.

Of course Google it which brought me to seam framework, looked trough it and determined that it was not what i think it's supposed to be.

Any information about this is appreciated.

Link to comment
Share on other sites

  • Replies 165
  • Created
  • Last Reply

Top Posters In This Topic

It's no easy thing to setup, and will be hard to explain here. I'll try to give a rough overview, but you will NEED to have some experience with this stuff. This isn't something that anyone will be able to do. If you've had a hard time figuring out how to make the new Platform work without Solder, I wouldn't recommend trying to get this setup. Seriously - if you haven't been able to get the platform working with a single zipped modpack, you cannot do this stuff. I'm not trying to be a jerk, just honest. :)

Anyway - I've managed to get it up and running on my host. It took some doing, but it works great. You're going to need some familiarity with Laravel (a PHP framework) though. Not much, just some knowledge of how to separate application files from presentation files (Laravel is an MVC framework and you don't want the core application in a public folder).

Once you get the TechnicSolder application itself working (the instructions are on that GitHub link), you'll then have to figure out how to get the mod library up and running. That part is configured by a few .yml files (YAML). You can see a rough example of this on GitHub as well: https://github.com/TechnicPack/Technic

Here's an idea of what the folder structure looks like:


AppFiles/

  application/

  bundles/

  laravel/

  storage/

  artisan

  paths.php

Public/

  bundles/

  css/

  img/

  js/

  laravel/

  modpacks/ [see below for this layout]

  .htaccess

  index.php



 

The modpacks directory is where all your yml files will be. Here's what it looks like:

modpacks/

  modName/

    resources/

      background.jpg

      icon.png

      logo_180.png

    modpack.yml

  mods/

    buildcraft/

      buildcraft-v3.4.3.zip [zip file layout is like so:]

        mods/

          buildcraft.jar

    someothermod/

    anothermod/

  modlibrary.yml

  modpacks.yml

Below you'll find more information about the YAML files listed above - but first a note: If you aren't familiar with YAML, you have to know that indentation is king. MAINTAIN INDENTATION. Don't use tabs - use spaces. If your editor converts tabs to spaces, awesome - if it doesn't, don't you dare touch that tab key. :)

modlibrary.yml

---------------------------------------------------------------

This file describes every mod in your mod library (that would be the mods folder). Here's a link to an example file for Technic. Go ahead and open that in a new window. You'll see "mods:" at the top, followed by a list of mods. Each mod defines a name, description, installtype, link, and versions.

The versions section is very important. The version is combined with the tagname for the mod. So if you look at that document, scroll down to "buildcraft" and you'll see that the first version listed is "v3.4.3" right? Right. Now, how does solder take that and now what file to look for? Simple, combine the tag and version separated by a hyphen with a zip extension: "buildcraft-v3.4.3.zip"

You can see that actual file in the mods folder here: https://github.com/TechnicPack/Technic/tree/master/mods

So, remember the tagname ("buildcraft:") and the version are VERY important. These map directly to folder and filenames.

modpacks.yml

---------------------------------------------------------------

This is a much simpler file to work with than modlibrary.yml. Here's a link to modpacks.yml for Technic.

You'll see that this is simply a listing of available modpacks. In my case, I only have one modpack available, so there's just one listed. For Technic you'll see 10 or so. Now, just like in modlibrary.yml, the tagname is important. See the tag name "tekkitlit:"? That correlates to a folder. I labeled that folder above as "modName"

So looking at the root of the TechnicPack you'll see a folder named "tekkitlite" - that folder name must match the tag name.

modName/modpack.yml

---------------------------------------------------------------

This is where you define the modpack versions and which mods are in the modpack. Here's a link to modpack.yml for tekkitlite.

At the top of this file you'll see launcher, current, recommended, latest, url, lib definitions, and builds.

I don't use the launcher tag, so I'm not sure what that's for.

The current, recommended, and latest tags allow you to define what version of your modpack the launcher will use. These versions correlate to version numbers further down the file.

The url is just a link to where you'd want your users to go for more info about the modpack.

I don't know what the lib definitions are for - I have them removed from my modpack and things work just fine. I'm pretty sure that this just allows you to define alternative libraries other than the defaults.

So on to the meat of this file, the builds tag. The first thing you see under the builds tag is a version number. You will have these version number sections for every single version you create moving forward. Under the version tag you'll see tags for minecraft, forge, and mods. The first two allow you to define which Minecraft and Forge versions to use. Note that the Forge version is the build number for Forge - not FML.

Under the mods section you'll see a list of mods and version numbers. The mod name must match the mod's tagname in modlibrary.yml as well as the version. Again, these are all related to the file system, so get these right or you'll get download errors.

modName/resources/

---------------------------------------------------------------

Here you'll find a few images that allow you to customize your launcher.

background.jpg - this will show up in the background of the launcher when your pack is selected.

icon.png - this will show up in your taskbar while running Minecraft.

logo_180.png - this will be the logo that appears on the left of the launcher.

Well - this post has rambled on and on now... I realize that this isn't documentation, and it isn't meant to be. It's really just more of a brain dump of what I managed to figure out on my own. I hope it helps, and I'll be happy to answer questions.

Link to comment
Share on other sites

  • Forum Administrators

It's highly recommended you avoid using the current implementation of Solder unless you already had a mod repository setup before the Platform.

The reason for this being is the current version of Solder is very user error prone. It can't do much to check if mods actually exist in its current state in the master branch.

If you are hell bent on trying Solder, play with the dev branch. It's way less error prone. In fact, I am making a video on it now.

Link to comment
Share on other sites

Haha yes, it is very prone to user error. :) I figured that out after many hours of reverse engineering. Luckily I'm a bit familiar with Laravel so I was able to get into some of the code and figure out what I needed to do.

Looking forward to seeing what's new - I'll definitely check out the dev branch. Not sure why I didn't think of that before. :)

Link to comment
Share on other sites

It would certainly be easier with SSH access. You have to run the artisan command to initialize and setup your database. The instructions call for running that from the command line ("php artisan migrate:install"), but I'm pretty certain you could find a way to run that through a browser instead. You'd be best researching that in the Laravel support areas though.

Aside from that command, there's no other need for SSH access other than ease of use.

Link to comment
Share on other sites

SeanWcom you sir just won the internet!

Thanks for the very detailed explanation about this.

I'm a programmer myself so i wont have trouble with yaml and the other subjects.

@SCT: Thanks i shall fiddle with the dev branch a bit and see if i can manage with that.

I'm rather surprised that no one else asked on the forum about this. My Google search was ineffective but i probably used the wrong keywords then.

Ha in fact this topic is on top if searching for: Technic Solder API now :D

Link to comment
Share on other sites

Awesome, let me know how it turns out for you! Oh, and let me know how the dev branch works out for you. I haven't had a chance to check it out yet myself.

Also, SCT - if you would prefer any of this info to not be public, feel free to edit this (or let me know and I'll edit). I know the API is still in development and it can be frustrating to have people try and document something they aren't as familiar with as you guys are.

Anyway, one thing I forgot to mention is that anyone using the Solder API has a way you can view their JSON data that the API returns. If you follow the cookie trail, you can find examples of how this is all set up.

Let's use the Aegis Anarchy pack as an example. I'd use my own pack, but it's a private pack. Mine. You can't have it! :) So start here instead: http://www.technicpack.net/modpack/details/aegis-anarchy

You can see the Platform API link on the page is this: http://www.technicpack.net/api/modpack/aegis-anarchy

Open that URL up and look at the mirror_url. It is: http://technicapi.aegisgaming.org/api/

Open that up - it doesn't show you a lot, but if you are familiar with Laravel and/or how MVC systems work, it doesn't take much to track down what should come next. I'll skip that and tell you that the next URL you want to look at is this: http://technicapi.aegisgaming.org/api/modpack/

Ok, now we're getting somewhere! Note that they have two modpacks listed. The first one is "Aegis Anarchy" but the tag name is "aegis-anarchy" right? Cool, so append that tag name to your URL:

http://technicapi.aegisgaming.org/api/modpack/aegis-anarchy/

Now you can see a list of builds. Again, append the build to the url: http://technicapi.aegisgaming.org/api/modpack/aegis-anarchy/1.3.1

Now you can see a list of mods that build includes. And let me tell you, that page in my own implementation has been priceless for verifying that my YAML files are correctly setup. You can also test your URL's here to make sure that they link correctly - the launcher uses this information, so it doesn't hurt to run through them all and make sure they work.

Link to comment
Share on other sites

It would certainly be easier with SSH access. You have to run the artisan command to initialize and setup your database. The instructions call for running that from the command line ("php artisan migrate:install"), but I'm pretty certain you could find a way to run that through a browser instead. You'd be best researching that in the Laravel support areas though.

Aside from that command, there's no other need for SSH access other than ease of use.

Could a chron job be used? My host allows me to run chron jobs, maybe I could run that once as a chron job.

Link to comment
Share on other sites

Could a chron job be used? My host allows me to run chron jobs, maybe I could run that once as a chron job.

That should work just fine. You'll want to test out something simple first to make sure your paths work. Maybe some code to write to a file or something. My host didn't have PHP 5.3 in the path, so I had to find the correct path and run it with the full path to the later version. But yeah, cron should work just fine.

Link to comment
Share on other sites

@SeanWcom What you said combined with the info on the Technic github really helped, thanks a lot!

I have a small question though. I have created all of the necessary files and folders for my modpack solder (i.e the .ymls and the mods folder with the mod versions), but where can I host the files so that they can be reached by the launcher, would a github repo suffice? If so, could you run through configuring the application/config-sample/solder.php file? According to the Technic Github guide, I need to enter in some urls, but I'm not sure which ones to enter if I'm using GitHub.

Thanks so much for the help!

Link to comment
Share on other sites

I don't think GitHub would work - you need to be able to host the PHP files, not just store them. Also, you need to be able to setup a database for the PHP files to access. I'm sure there are plenty of places that allow free web hosting though. You just need to be able to setup a database (MySQL most likely), and you need to be able to run the artisan command either from a command line, or as a cron job.

Link to comment
Share on other sites

Hello everyone! Need ur advice, i've been able to set up solder on webhost, but cant access its admin area. host/solder/public/index.php/ moves me to host/solder/public/index.php/dashboard and gives standart "welcome to nginx" webpage. Nginx is configured to work with php-fpm and mysql. other web apps seem to work fine. Mysql migrate is done already, i can see thoose tables.

Thanx in advance

P.S.maybe i am looking for login page in wrong place?or need some server php modules to run laravel?

Link to comment
Share on other sites

API link would be formed like this, but depends entirely on the folder structure you have setup:

http://www.yourdomainhere.com/solder/api/

In that case, the solder files are in the solder subdirectory. Adding /api/ to the url triggers a controller action in Laravel, and renders json data. This is the root of your solder API, and the URL you would plugin to create a pack on TechnicPack.net

Link to comment
Share on other sites

Mod adding is discussed further up this thread with editing the yml files - but I haven't yet updated my solder installation to the latest, so I'm not sure what's changed.

SCT responded in another thread (here) about how to change your custom modpack to point at your solder installation. I think that's what you're asking about?

Link to comment
Share on other sites

Hello again.

I have done everything to set up Solder for my modpack, except two things:

1. It doesn't seem like I'm able to execute the migration (php artisan migrate:install) commands via a cron job or SSH. This is the full cron job command that is being executed: php -f /home/u547714130/public_html/artisan migrate:install

This is the error I get (please note that the section of the command above in bold is default which I can't change): "Path can not start with "/" and contain alphabet symbols or numbers"

However, this works: php -f /home/u547714130/public_html/artisan

The same command won't work with SSH either.

2. I used the URL location to my root Solder folder, which I got from my FTP client (ftp:[email protected]/public_html), would I use that as the mirror_url, repo_location and Solder URL in the Technic Dashboard?

These are the people who I'm using for the hosting: http://www.2freehosting.com

As you guys have helped me a lot, I'll give you a shoutout on my modpack page :)

I'm asking all of this because the current documentation for Solder is quite vague, which I understand at this point in the early development :)

Link to comment
Share on other sites

These are tough questions to answer from the outside looking in. I'll start with the cron job:

You may be best starting off by creating a simple PHP file that writes to a text file or sends an email when it's run. Then setup a cron job to run that php file. This gives you a very simple file that you can run and know exactly what the outcome should be. Once you get that working (if it's possible with that host), then you'll know exactly how to proceed with artisan. My hosting is with dreamhost.com and I was able to get things working through SSH. You mentioned that it didn't work through SSH, so you do have SSH access? If so, then I'd concentrate on getting that to work rather than a cron job.

As for the URL's, I don't recall needing to set a location in the Technic dashboard - looking at my mod the "Modpack Location" field is blank. I think the rest got imported automatically from my Solder repo. When you create a modpack, you should have already created the link in your profile to the Solder API. This link tells the Technic Platform where to find your modpacks. But if you haven't been able to run the artisan migrations yet, then I'm guessing you haven't gotten this far yet.

I'm not sure that info will help you a whole lot, but without having hands on, I can't offer much more than that. :)

Link to comment
Share on other sites

I can't help with the chron job, but as for your other question... If I understand correctly, repo_location is the internal location relative to the script, so that should just be either "../" or "/home/u547714130/public_html/". mirror_url is the external location that the client downloads the files from, so that should be your domain name or IP address and nothing else, since public_html is the root of the public site. Solder URL should end in /api and will be yhe path to your solder install from outside (So, like "domain.com/solder/api" or maybe just "domain.com/api".)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Announcements

  • Anything claiming to be official Technic servers are not allowed here, for obvious reasons



×
×
  • Create New...