Skip to content

PAL Quickstart Guide

Katyatu edited this page Apr 19, 2024 · 4 revisions

Note

Updated as of PAL v1.1

Important

This guide will assume that:

Step 1: Launching the PAL-manager

After installing PAL, the command PAL-manager was added. Go ahead and type in PAL-manager and hit enter.

Launching PAL-manager

Step 2: Create an instance

Using PAL-manager brings you to the central control hub for PAL. The first thing you will want to do is create a new instance for PAL to manage. Type in 1 and hit enter to start the process.

PAL-manager

Step 2a: Name your new instance

Here you can name the instance to whatever you wish, the only rule is that it must be alphanumeric. Symbols and spaces in filenames tend to cause headaches behind the scenes.

Instance naming

Step 2b: Assign a MEGA folder to your instance

PAL will show you a tree of your current MEGA cloud drive. Pick the folder containing the files you want your customers to be able to access.

Tip

If you have multiple tiers containing less/more files, you will need to create an instance for each tier's folder.
(ie. Instance "Tier1" assigned folder "/Patreon/Tier1", Instance "Tier2" assigned folder "/Patreon/Tier2", etc.)

Assigning a MEGA folder

Step 2c: Specify the link refresh interval

PAL's whole purpose is to automatically expire old MEGA folder share links and generate new ones, so that anyone who wants to access your MEGA files will have to be an active member of your Discord. Here you can specify how often you want PAL to expire-generate the share link of the folder you specified in the previous step.

Choosing the refresh inteval

Step 2d: Assign the Discord Webhook Bot dedicated to a specific channel in your server

This is how PAL publicly manages the MEGA folder share link that your customers will be using to access your files. Go inside your Discord server and grab the webhook bot URL corresponding to your intended tier level, right-click + paste it in the terminal, then hit enter. PAL will use the given bot URL to make a post in the bot's assigned channel containing a random confirmation number. Simply type that number into PAL and hit enter to confirm ownership.

Tip

I recommend setting up read-only channels that only the webhook bots can post to. 1 channel w/ 1 bot for every tier level. Make sure to position the channels high up on your server's channel list so it's easy to see and access.
(ie. Instance "Tier1", assigned folder "/Patreon/Tier1", will be assigned the webhook bot that runs in the channel "Tier 1" of your Discord server)

Caution

If you are inexperienced with command line terminals, common keyboard shortcuts like ctrl+c ctrl+v to copy/paste DO NOT WORK, they do completely different operations. To copy, left-click and drag over the text you want to copy, then right-click and hit copy. To paste, right-click and hit paste.

Assign a webhook bot

That's it! Instance created!

A summary of the information you provided is shown, and the instance is saved for PAL to use. If you have more tiers to cover, you can repeat the whole process by entering in y and hitting enter. Otherwise, n returns you to the PAL-manager.

Instance created

Step 3: Re-initialize PAL

When you're back at the PAL-manager menu, type in 4, hit enter, and wait until it says its finished.

Important

As noted in PAL-manager, if you make any new instances, delete any instances, change any settings, etc., you HAVE TO re-initialize PAL in order for the changes to take place. PAL reads settings/instances only once when it starts up, so you have to reboot it for it acknowledge your changes.

PAL restarted

Done!

After PAL lets you return to the manager, you can then q, enter, to exit the manager (and exit, enter, to close the SSH connection).

Now, go on over to your Discord server and check the channel you assigned to your instance, you should already see a new post by your webhook bot containing the link to the MEGA folder you assigned. This single message will be edited by your webhook bot, as instructed by PAL, replacing the old share link with the newly generated share link, every x hours as you specified. Since the message is being edited instead of deleted/created, you won't have to worry about your Discord server spamming your members with notifications with every new link that is generated. Plus, keeping things discrete helps out in the long run.

Take note of the current link and check back later after the PAL instance iterates, you'll notice the link is different but still leads to the same MEGA folder! If everything is functioning as it should, you're good to go!

PAL-manager will always be available if you need to manage instances, employ stronger countermeasures, or manage PAL itself, use it well to protect your work!

Note

This is the bare minimum you have to do in order to use PAL. Just make sure you enabled plug-n-play so that if you ever reboot the device running PAL, it will start back up automatically without you needing to SSH log into the device to get PAL to start up.