This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
LNETeam's profile picture

APT-GET Package Manager (Early)

Started by LNETeam, 27 August 2014 - 02:46 AM
LNETeam #1
Posted 27 August 2014 - 04:46 AM
Hello Computercraft Forums


It's been some time since I did anything in regard to CC, so I figured I'm past due. With work I've been dabbling more in the arts of Linux command line. We all know we need some way to get programs from the internets, to us; right? Well that's what package managers are for, in this case: apt-get. I taken the liberty of making a simple yet fluid and dynamic environment to submit applications to a repo which contains definitions to Github repos that users can download. For example, in order to use my git program, you'd need to download it, drag it in customize and then you can use it for your applications, yet you lack package management. Well I'd like to introduce CCAPT!


CCAPT? What?


CCAPT is a command line program for fetching files, installing them and registering them to a registry so you can update and remove them. I developed a front end developer port online (not quite ready for everyone. I have the login system and everything working, but the registration system is killing me. You can see the login portal at: http://lneteam.ddns.net. It's probably down since it's my dev server and it only stays on for 15 minutes at a time. Will be updated!)


YOU CAN NOW MAKE YOUR OWN ACCOUNT: http://lneteam.ddns.net/reg.php


Features
  • Project dependency resolving: The developer simply adds a INSTALL file to the root of their Github repo with a few lines of code. Within that code, a developer could point to other packages as prerequisites and will attempt to install those dependencies prior to installation.
  • Post and Pre Operations: A developer can add optional pre install actions, for example to prepare a certain file system, whatever. They can also issue post install actions to run at the conclusion of install. for example if you downloaded an install script, you could have that execute immediately after install. (Kinda like MySQL during install)
  • Dynamic Developer base: Everyone gets their own console to add, update, and remove their packages. We store passwords in an encrypted database hash to ensure YOUR security.
Information


Currently, it is very buggy. The Koding environment is being particular with it's anti-phishing protocols, so I'll be migrating over to a stand alone server soon. Which means that CCAPT can't quite connect to the repo just yet. Everything works, except the connection. It works!


Here is a set of login credentials to test the portal:

User: test.tester

Pass: ccrulex


It may be down unless I'm on, but it gives you a feel of the portal. It is completely mobile friendly! Just take a look from your tablet/smartphone! Regardless the repo should be working within a couple of days when I migrate everything over. I shall post the link to the apt-get program so you can see it.




Thank you for looking and hopefully see your project in the repo!



Current Web Server: http://lneteam.ddns.net



P.S If you have a Github, please submit any issue tickets so I can address them. Thanks! :D/>


Info: Your INSTALL file should be in the root of your repo and the link you provide, must be a RAW link to it. Most repos will allow you to view a file in a raw format, click that and paste the link for your location.


install =
{
	preAction = function()
		if (fs.exists("/sys")) then
			fs.delete("/sys")
		end
	end,
	Dependencies = {"ccgit"},
	InstallHierarchy =
	{
		{"/M-Tech/startup","/startup"},
		{"/M-Tech/sys/boot/main.int","/sys/boot/main.int"},
		{"/M-Tech/sys/boot/portal.int","/sys/boot/portal.int"},
		{"/M-Tech/sys/boot/version.info","/sys/boot/version.info"},
		{"/M-Tech/sys/boot/~iso-temp/BIOS","/sys/boot/~iso-temp/BIOS"},
		{"/M-Tech/sys/boot/~iso-temp/bootstrap","/sys/boot/~iso-temp/bootstrap"},
		{"/M-Tech/sys/config/bootPrefs.cfg","/sys/config/bootPrefs.cfg"},
		{"/M-Tech/sys/config/sys.cfg","/sys/config/sys.cfg"},
		{"/M-Tech/sys/frameworks/CAUTH.frmk","/sys/frameworks/CAUTH.frmk"},
		{"/M-Tech/sys/frameworks/CUIKit.frmk","/sys/frameworks/CUIKit.frmk"},
		{"/M-Tech/sys/frameworks/kernel.frmk","/sys/frameworks/kernel.frmk"},
		{"/M-Tech/sys/frameworks/mtech-boot.frmk","/sys/frameworks/mtech-boot.frmk"},
		{"/M-Tech/sys/frameworks/mtech-core.frmk","/sys/frameworks/mtech-core.frmk"},
		{"/M-Tech/sys/lib/errors/0x001C.libx","/sys/lib/errors/0x001C.libx"},
		{"/M-Tech/sys/lib/errors/0x001D.libx","/sys/lib/errors/0x001D.libx"},
		{"/M-Tech/sys/program_files/plc","/sys/program_files/plc"},
		{"/M-Tech/sys/programs/os/antiviral.af","/sys/programs/os/antiviral.af"},
		{"/M-Tech/sys/programs/os/dataman.af","/sys/programs/os/dataman.af"},
		{"/M-Tech/sys/programs/os/hpr","/sys/programs/os/hpr"},
		{"/M-Tech/sys/programs/security/portman.af","/sys/programs/security/portman.af"},
		{"/M-Tech/sys/programs/security/togglev2","/sys/programs/security/togglev2"},
		{"/M-Tech/sys/programs/c-chat.af","/sys/programs/c-chat.af"},
		{"/M-Tech/sys/programs/vman.af","/sys/programs/vman.af"},
	},
	postAction = function() os.reboot() end,
}
return install

This is what an INSTALL file should look like. postAction and preAction are optional

Here is the current list of enhancements/bugs: https://github.com/L...am/CCAPT/issues
If you want anything or have a problem, report them here.

Pleased to announce that it is now working! Some features are still not implemented but, it now can download single scripts from the repo. I used MKlegoman357's Redfile for a demo.






SpoilerChangelog: v1.0

Added registry adding/removing
Able to download from correct repo
Basic coloring for Advanced Computers
Edited on 27 December 2014 - 11:40 PM
Ferdi265 #2
Posted 27 August 2014 - 10:44 AM
Nice one. I've always thought that CC needs a package manager. :D/>
LNETeam #3
Posted 27 August 2014 - 12:28 PM
That's what I'm saying. I tried to make it as user friendly as possible
LNETeam #4
Posted 27 August 2014 - 01:26 PM
I also encourage visitors to submit packages to get a feel for it :D/>
Kizz #5
Posted 27 August 2014 - 01:33 PM
Is there a website for submitting packages or just here on the forums?
LNETeam #6
Posted 27 August 2014 - 01:34 PM
website http://lneteam.kd.io

You can log in with:
Username: test.tester
Password ccrulex

Everyone will eventually get their own, but the server ain't quite ready yet
Edited on 27 August 2014 - 11:35 AM
Kizz #7
Posted 27 August 2014 - 01:35 PM
Your link just asks me to log in.

Ahh got it. Adding my KESS file storage solution.
Edited on 27 August 2014 - 11:36 AM
LNETeam #8
Posted 27 August 2014 - 01:38 PM
yes, with those credentials

COOL!

FYI Like I said, the console side won't work just yet, but you can add your package.
If you need an INSTALL example: https://raw.githubusercontent.com/LNETeam/CCAPT/master/INSTALL
Edited on 27 August 2014 - 11:37 AM
Kizz #9
Posted 27 August 2014 - 01:55 PM
Well, it didn't seem to add my package. Not used to GitHub either, so I probably did something way wrong. I would really like to be able to just upload a file or files for my package and not have to link to a Git repository.

Ahh I see, I'm dumb. You're still working on it. Well if you need any help, I have a lot of PHP and webserver experience.
LNETeam #10
Posted 27 August 2014 - 01:58 PM
As of now, the website doesn't have storage internally. That's why I used github. You could use pastebin, but I haven't added that yet. Do you see a package called Example?

Did you fill out the form at the bottom? Because I don't see it in the repo

Just try filling some random stuff into the apt-get form at the bottom of the website and click submit
Edited on 27 August 2014 - 11:56 AM
Kizz #11
Posted 27 August 2014 - 02:07 PM
I did see example, and I did fill out the form, but once I did that, nothing was added.

It worked! It's in there :D/>.

However, I can't edit it once it's added. Need to add a description :P/>.
Edited on 27 August 2014 - 12:07 PM
LNETeam #12
Posted 27 August 2014 - 02:10 PM
You can edit by putting a "+u" at the end of your new version. Pretty much update your things and simple add "+u" to the end of your version. EX: "1.0+u". This will update your entries in the database
Ferdi265 #13
Posted 27 August 2014 - 02:25 PM
Cool :D/>

Going to add my EventLoop API.
Kizz #14
Posted 27 August 2014 - 02:25 PM
Updating worked. Nice work man.
LNETeam #15
Posted 27 August 2014 - 02:27 PM
No probs. Just added the info to the tiles. Do they work on your end?
Ferdi265 #16
Posted 27 August 2014 - 02:30 PM
Info works on my end, but updating info doesn't work for some reason.
LNETeam #17
Posted 27 August 2014 - 02:34 PM
did you add "+u" to the end of your new version? Also you cant change your package name at this point

Also in your Github INSTALL file, return the install table :D/>
Ferdi265 #18
Posted 27 August 2014 - 02:48 PM
I did add +u (the version was "1.3+u").

I tried it again, itstill doesn't work xD

Also, fixed INSTALL file.
LNETeam #19
Posted 27 August 2014 - 02:50 PM
I got it to work http://imgur.com/c0pcKvm
Edited on 27 August 2014 - 01:12 PM
Ferdi265 #20
Posted 27 August 2014 - 03:13 PM
Ahh, okay, the Info text was just too long, works now :D/>
LNETeam #21
Posted 27 August 2014 - 05:15 PM
Okay, you can now create your own accounts! http://lneteam.kd.io/reg.php
LNETeam #22
Posted 27 August 2014 - 05:48 PM
Have people been able to register?
Ferdi265 #23
Posted 27 August 2014 - 05:48 PM
Created account and moved my API to it.
LNETeam #24
Posted 27 August 2014 - 05:51 PM
If you go to http://lneteam.kd.io...?pack=EventLoop

You can see that it resolves who owns it an the install location. This is what CCAPT uses to get the files it needs
Edited on 27 August 2014 - 03:52 PM
MKlegoman357 #25
Posted 27 August 2014 - 07:00 PM
Looks good so far, but there is a big problem: it currently installs the apt-get itself instead of the package you want.
LNETeam #26
Posted 27 August 2014 - 07:07 PM
yeah, it's buggy. the resolving doesn't work just yet. The dev environment I use, Koding, has anti-phishing protocols, and makes i nigh impossible for CC to reach it. I'm moving everything over to a new server today. that should fix things

When you run it, the Resolving info should have "https://raw.githubusercontent.com/LNETeam/CCGit/master/INSTALL" in it now. I hard-coded that in to make sure that the install process works, it will be removed and replaced with the desired on when it's stable
MKlegoman357 #27
Posted 27 August 2014 - 07:08 PM
Ah, I see. Anyway, good luck with this program!
LNETeam #28
Posted 27 August 2014 - 10:11 PM
Okay, so I migrated the database and everything over to a new domain: http://lneteam.ddns.net. Go there from now on, that is where the utility will look.

Finally got it working. Can now download single files from the repo

Ferdi, your thing works! :D/>
Edited on 27 August 2014 - 11:09 PM
LNETeam #29
Posted 28 August 2014 - 02:40 AM
Download count added. See how many people have downloaded your project!
Ferdi265 #30
Posted 28 August 2014 - 10:56 AM
Ferdi your thing works! :D/>
edit: Wow, downlaoding and updating versions is surprisingy smooth. I like it :D/>

Now the only thing that's missing is downloading versions by GitHub release/tags, so you can still download v1.3 if v1.4 is added.

(GitHub adds release versions as a tag in the repo, so https://raw.githubusercontent.com/Ferdi265/ComputerCraft-EventLoop/v1.4.1/INSTALL always points to my v1.4.1 install file)
Edited on 28 August 2014 - 12:16 PM
Ferdi265 #31
Posted 28 August 2014 - 02:36 PM
Oh and another suggestion: add a list argument
apt-get list
should list all packages in the registry.
Also appreciated would be a list all packages GUI on the website.
Noiro #32
Posted 28 August 2014 - 02:47 PM
I want to add my API to it, but the register throws a cannot connect. I know it's still a WIP, but give me a shout when it's running.
Edited on 28 August 2014 - 12:48 PM
LNETeam #33
Posted 28 August 2014 - 02:49 PM
I did add list, but it's buggy. And I am adding a global list today

signify, you have to go to http://lneteam.ddns.net
Edited on 28 August 2014 - 12:49 PM
LNETeam #34
Posted 28 August 2014 - 03:25 PM
Added a global package viewer to the site
LNETeam #35
Posted 28 August 2014 - 04:14 PM
added pastebin support. When doing install hierarchy, just add the pastebin extension, not the whole url
Ferdi265 #36
Posted 28 August 2014 - 04:54 PM
nice package list :D/>

The way this looks, it'll become a great package manager.
LNETeam #37
Posted 28 August 2014 - 09:56 PM
To the gentleman who injected a query, once again, I've only just began the website, I haven't added authentication passed logging in