-
Notifications
You must be signed in to change notification settings - Fork 1
Basic server hosting
Servers can be hosted on both Normal and Advanced Computers only. You can download the server software either through accessing rdnt://server on a Firewolf client, or by downloading the server with the pastebin link http://pastebin.com/hi4xFVxn
The server can be started by running the program along with 1 argument, being the domain you would like the server to run on. Note: that after the first time you run the server software, you can run it without arguments and it will automatically launch it with the last domain used.
Example:
fwserver mysite.com
Once you run the server, you will be greeted by the console where information is displayed, and you can type commands for the server to perform.
Essential Commands:
-
exit- Exits Firewolf -
edit- Launches shell in the domain directory for editing -
lock- Locks the server -
password <password>- Sets the password for the server -
startup- Runs the server on startup
The server console displays log information, including requests for a page, a response to command, or an error. It is also hidden when locked
You can edit the server files by typing in edit in the server console. You can create files and folders for pages on your server.
There are three special files, the first one is index, the index file for your server and is what people see when they load your website's home page.
The second file is not-found, the custom page not found file you can use.
The third special file is server_api which isn't automatically generated and you'll need to create it yourself, if you would like to use the Server API. Note that people cannot access the server_api file by going to rdnt://mysite.com/server_api.
Files by default on the server are just simply Lua scripts like any other program. Just write a program like what you normally would, with prints, term functions, etc.
Some useful functions have also been added in! See the Client API documentation. However, some functions have also been disabled for security purposes, including os.queueEvent, fs operations, and some os and shell functions.
Pages on the server can also be Firewolf Markup files, if you append a .fwml extension at the end of it. You can access the page in the browser as if it doesn't have a .fwml extension at the end of it. Firewolf Markup files use Firewolf Markup Language instead of Lua to serve pages. See the [Firewolf Markup Language documentation](Firewolf-Markup Language) for more information.
My page at fw_servers/mysite.com/index can be accessed by the browser through rdnt://mysite.com
My page at fw_servers/mysite.com/index.fwml can also be accessed using rdnt://mysite.com (Note that Lua files have priority over FWML)
My page at fw_servers/mysite.com/not-found or at fw_servers/mysite.com/not-found.fwml is my custom "page not found" pages, what users will be directed to if the page they requested could not be found.
My page at fw_servers/mysite.com/about or at fw_servers/mysite.com/about.fwml like above, can both be accessed using rdnt://mysite.com/about.
My page at fw_servers/mysite.com/pages/info(.fwml) like above, can both be accessed using rdnt://mysite.com/pages/info.
That should give you the gist of how it works.
Adding a lock to your server can protect it from people modifying the files on the server, first you'll need to set a password, by typing password <password> in the console. You can then type lock to lock the server. Note that once you add a password, the server will then automatically lock whenever you run it, there is no way to remove the password, you can only change it with password <new-password>.
You can run your server on startup with the command startup which will write into the startup file. It is recommended to add a password when you run your server on startup (See above)