The following documentation is a copy of the documentation created by the BarracudaDrive installation application.


Make BarracudaDrive visible on the Internet

You now have BarracudaDrive up and running, but the web-server is not accessible from the outside world before you make a number of changes to your home network. This tutorial is designed to help you configure your home network and make the web-server available on the internet. We assume you have a small home network with a router such as a D-Link, Linksys, etc.

Port forwarding

If you are using a home router, you must set up port forwarding since a home router uses Network address translation. This may sound very difficult, but any person with home network skills should be able to do it.

Portforward.com contains step by step guidelines for how to set up port forwarding for BarracudaDrive. Portforward.com tells you to set up a static IP address for your computer, but in most cases this is generally not needed as new routers should remember your PC's MAC address. Just make sure that you do not turn off your router. Please follow the tutorial at Portforward.com by clicking the above link. Also, some routers allow you to lock in the IP address by using your PC's MAC address -- this is referred to as static DHCP. If the terminology is unclear, you can read about this in Portforward.com.

Ask a friend to test your web-server when you have set up the router. Tell him to enter the IP address of your WAN IP address in the browser as http://69.123.225.54, where 69.123.225.54 is an example of a WAN address. You can get your WAN IP address here.

Your friend should see your start page if you managed to correctly configure your router.

Domain name

We explained how to make your web-server available on the internet above. You can now access your computer remotely by using your WAN IP address.

Using the WAN IP address is cumbersome for two reasons:

We need to find a method for using names such as http://mycomputer.com instead of http://69.123.225.54. This translation is normally handled by a DNS server and can be configured if you register a domain name and if you have a static WAN IP address. As an example, you can access the Google search engine by typing in http://www.google.com in a browser. The domain name google.com is registered to Google and made available on the internet. The browser asks a DNS server, and the DNS server translates the domain name to an IP address behind the scene.

Dynamic DNS

Most home/broadband users have a dynamic IP address with a lease that typically expires after 24 hours. You may have to pay extra to get a static IP address at home. It is also difficult to configure DNS. A much easier solution is to use one of the Dynamic DNS (DDNS) service providers. This service is also easy to use if you have a static IP address.

DDNS providers typically provide two types of DDNS services: a free service and a commercial service.

The free service typically lets you select from a list of pre-registered domain names, and your domain name will have the form: myname.preregistered-domain.com. Example: erik.homeftp.org, where homeftp.org is a pre-registered domain from a DDNS provider.

The commercial service allows you to register and select your own domain name. As an example, realtimelogic.com could have been handled by a DDNS service provider.

Registering a free DDNS service

One of the free DDNS service providers is DynDNS. In the following section, we will show you how to register and get a DynDNS account up and running. You are not limited to using DynDNS -- any of the other DDNS providers available can be used. You do not need to understand how this works, but if you are curious, you can read about how Dynamic DNS works at Wikipedia.

Click the following link to create a free DynDNS account: register.

You can create a computer name as soon as you have received the confirmation email from DynDNS. Click the following link to login and create a computer name: add computer.

  1. Type in a host name such as your first name or family name.
  2. Select one of the pre-registered domain names.
  3. Enable wildcard.
  4. Press the Add Host button.
  5. Please write down your host name and domain name. You will need them later.

You have now registered a host name and domain name in the DynDNS database. The database must be periodically updated, and, therefore, you must install a DynDNS updater on your computer. Your internet computer name will not work unless the DynDNS updater periodically updates the database.

Notice that some routers, such a D-Link, allow you to setup a DDNS updater directly in the router. This means that you may skip the next section if your router supports this option.

Windows DynDNS updater:

  1. Download and install DynDNS updater.
  2. Select launch.
  3. Follow the installation.
  4. Select any name for the group name.
  5. Enter the username you used when registering your DynDNS account. The program will automatically download your host name.
  6. Enable automatic update for your hostname.
  7. After installing, right click the DynDNS updater icon in the system tray and select Start with Windows.

Macintosh/OS X DynDNS updater.

Linux DynDNS updater.

Introduction to the administrator panel

The administrator panel is an application built into the BarracudaDrive web-server. This application lets you control and manage the BarracudaDrive web-server.

The administrator panel is designed using cutting edge web technology. Thus, the application must be run in Internet Explorer 6.0 or better, or Firefox 1.5 or better.

You can operate the administrator panel from a remote computer, but you should always use a secure connection (HTTPS). Also, we do not recommend remotely operating the administrator panel from a public computer as the public computer may have spyware such as keystroke logging software installed.

Starting the administrator panel

  1. Click the Settings link above.
  2. You will see the login page if not authenticated.
  3. Make sure you use a secure connection if you are remotely operating the BarracudaDrive server -- i.e., make sure you use HTTPS.
  4. Click the administrator panel link.

Only users in the "admin" role will see the administrator panel link on the settings page. Users and roles are introduced in administrating users.

Applications in the administrator panel

You will see the following links in the left pane of the administrator panel.

Please click on one of the above links for a detailed explanation of how to use the administrator panel applications. Please see administrating users for an introduction to managing users and setting user permissions.

Administrating users and their access rights

This tutorial is based the fictitious users we created in the "How it works" section on the "Create users" page. We have also a fictitious administrator called gordon.

The following tutorial shows you how to manage BarracudaDrive users and give the users access to the built in web-file-manager and the WebDAV server.

This tutorial is based on the two users, thomas and james, that we used as an example in the "how it works link" on the create users page. Assume also that we have a user called gordon that was created by clicking the Set admin link.

The following two images shows a fragment of the Users Editor and the Drive Constraints Editor after we have created the admin user gordon, and the two users, thomas and james.

Users Editor Drive Constraints Editor

From the above left image, the Users Editor, you see that we have the following:

From the above right image, the Drive Constraints Editor, you see that we have the following constraints:

A constraint is just an anchor point for joining path elements and roles. The name of the constraint is irrelevant. We are naming the constraints the same as the roles in the above example since the constraints we created only contain one role. A constraint typically consists of one or more roles. A constraint with zero roles implies that it includes all roles -- i.e., a wildcard constraint.

Users and roles

A role is a collection of one or more users. A role is also sometimes called a group. Roles are used by the constraints Editor when setting permissions. The constraints editor makes it possible to give access or deny access to roles, but not to users -- i.e., you do not directly set permission rules for users, but for the roles.

It is common to group users into roles as you may want to set certain permissions for a group of users. It is also common to give users unique access rights such as giving a specific user access to his/her home directory.

The roles thomas and james above are used for giving the user thomas and james unique access rights to their home directories. The role common is used for giving all users full access rights to the common directory. The role users_r is used for giving users read access to the users base directory. We will discuss the role users_rw later.

Users can be in more than one role. User thomas is in the thomas and users roles. User james is in the james and users roles. User gordon is in all roles since his roles list is empty. An empty roles list means that a user is in all roles. Be very careful about not including users in any roles as they in effect become administrators. When you create a new user, the user is automatically added to the role "guest" to make sure the roles list is not accidentally left empty.

Drive constraints

We briefly discussed above that we set permissions for roles and not directly for users. This gives us greater flexibility in managing the permissions for the users. The Drive Constraints Editor uses the roles when setting up constraints for the BarracudaDrive users.

You might be used to setting file permissions on files on your hard drive. One can typically set permissions such as read only access, or read and write access on a particular file or directory. BarracudaDrive uses a very different scheme for setting access permissions on files and directories. You do not set permissions on the physical file or directory. BarracudaDrive's permission rule set is based on the path element of a URL. It is possible to set permissions on a file or directory that does not yet exist.

Let us start by analyzing the permissions we set in the how it works link on the create users page. We have the following:

Path

Access thomas

Access james

Access Gordon

c:\bdusers

Read

Read

Read and write

c:\bdusers\common

Read and write

Read and write

Read and write

c:\bdusers\thomas

Read and write

No access

Read and write

c:\bdusers\james

No access

Read and write

Read and write

Any other directory

No access

No access

Read and write

The above table can be translated to the following URL path elements and the following roles:

Path

Roles

Access type

/*

admin

Read and write

/c/bdusers/*

users_r

Read

/c/bdusers/*

users_rw

Read and write

/c/bdusers/common/*

common

Read and write

/c/bdusers/thomas/*

thomas

Read and write

/c/bdusers/james/*

james

Read and write

A path ending with /* indicates that the permission is for this directory and all sub-directories -- i.e., a wildcard match.

We explained above that user gordon is in all roles since his roles field is empty. We want gordon to have access to all directories so let us analyze how this works.

Gordon is in all groups and also in group admin. You can see from the above table that the admin group has access to /* -- i.e., access to everything. You might think that gordon will have access to all directories since he is part of the admin group, but this is not the case. In BarracudaDrive, a longer path takes precedence over a shorter path. This means that, for example, the path /c/bdusers/common/* takes precedence over /* and the group admin no longer applies in this directory. Luckily, gordon is in all roles and, therefore, also in role "common", which has read and write access to /c/bdusers/common/*.

Role "user_r" with path /c/bdusers/* takes precedence over the admin group. This role has read access to the /c/bdusers/ directory, and consequently, gordon has read access to /c/bdusers/. We want gordon to have read and write access to this directory so we must create a new group that also has write access. The group "users_rw" fixes this problem and gives gordon full access to /c/bdusers/ -- i.e., the only reason for this group is to give gordon full access to directory /c/bdusers/.

User thomas is in role thomas and users. He, therefore, has read and write access to /c/bdusers/thomas/* and /c/bdusers/common/*. He also has read access to /c/bdusers/.

User james is in role james and users. He has read and write access to /c/bdusers/james/* and /c/bdusers/common/*. He also has read access to /c/bdusers/.

How to deny access to certain directories

We explained above that a constraint with a longer path takes precedence over a constraint with a shorter path. We also explained that a constraint with zero roles implies that it includes all roles. We can use this information to make constraints that limit access for all roles to certain directories.

Making limitations to certain directories is very useful on a Windows computer. We explained in the web-file-manager tutorial that BarracudaDrive sees the disks on your computer as root directories. The following image shows a Web Folder window (WebDAV client) viewing the root of BarracudaDrive. We are logged into the server by using the user gordon as only this user has access to the root.

The above image shows how the disks A, C, D, F, and Z show up in Web Folders. Many WebDAV clients automatically descend into directories and start reading information from these directories. Reading from volatile/removable disks such as the floppy drive A and the two CD-ROM drives D and F is not good as it slows down the BarracudaDrive server when there are no disks in these drives. What we should do is to make the disks A, D, and F invisible for clients. This is easily accomplished by creating a constraint that limits access to all roles.

Open the Drive Constraints Editor and do the following:

  1. Create a new constraint. The constraint name is irrelevant. As an example, you may call it removeddrives
  2. Click on the constraint you created so it is activated.
  3. In the Input field, enter /A/* and press the "Add" button.
  4. Repeat the step above for all your volatile drives.
  5. Make sure that neither "read access" or "write access" is selected.
  6. Delete the role "guest" that was automatically added. The "Roles list" should now be empty, which implies that this constraint includes all roles.
  7. Press the save button.

You can now open either the web-file-manager by using a browser or connect to the server using a WebDAV client such as Web Folders. The volatile disks will no longer be visible in the client.

The Users Editor

The Users Editor makes it possible to locally or remotely manage the BarracudaDrive users. The image below shows the "Users Editor" with the users we created in the introduction.

  1. The administrator panel contains a number of applications. We have selected the "Users Editor"which is shown in the right pane.
  2. The "All Roles" list shows all roles we have added. This list acts as a filter for the "Users List" (3). Clicking on a role in (2) will show all users in that role in (3). The "All" link is not a role; clicking "All" will show all users in (3).
  3. The "Users List" shows the users we selected with (2). The above image shows all users in our system since we have not selected any of the roles in (2). The above image shows information for the selected user "gordon", such as Username, Password, etc..
  4. Inactive is the number of seconds the user, gordon, is allowed to be inactive before being automatically logged out.
  5. Max users is the maximum number of allowed concurrent logins for this user. It is common to login using more than one client. For example, a client may be logged in using a browser and the HTTPS tunnel client at the same time. You can disable a user by setting "Max users" to zero.
  6. Recycle makes it possible to automatically logout one of the user's clients if (5) reaches max. We have set this to three in the above image, which means that one of gordon's clients will be automatically logged out if he logs in using more than three clients.
  7. The Roles List shows the roles the user is in. Gordon's roles list is empty and we have previously explained that an empty "Roles list" implies that the user is a member of all roles. This means that gordon is an administrator.
  8. You add roles to the user's "Roles list" by clicking on a role in the system's "Roles list"(2) and dragging it to the users "Roles list"(7).
  9. The "Add user" button is for adding new users to the system.
  10. The "Add role" button is for adding new roles to the system.
  11. The search field makes it possible to filter out and show only a subset of the users. This is typically used in a system with many users.
  12. The "Save button" sends the user database to the BarracudaDrive server, where it is saved. No data is persistently saved until you press this button.

The admin role

The "admin" role is a role used by a number of services in the server. It is a hardwired role built into the system. For example, this tutorial you are reading now is only accessible to users in the "admin" group.

The admin panel and the admin panel's communication with the BarracudaDrive server is protected and only users in the "admin" role are allowed to access the admin panel. Our user gordon is in all roles since his "Roles list" is empty. He is, therefore, allowed to access the admin panel. We suggest that you keep your admin account's "Roles list" empty as you can otherwise accidentally deny yourself access to the admin panel.

The Drive Constraints Editor

The Drive Constraints Editor makes it possible to locally or remotely manage the web-file-manager and the WebDAV access rights. The image below shows the Drive Constraints with the users we created in the introduction.

  1. The administrator panel contains a number of applications. We have selected the "Drive Constraints Editor", which is shown in the right pane.
  2. The "All Roles" list shows all roles we have added to the system.
  3. The "All Constraints" list shows the list of all the constraints we have added to the system. The above image shows a selected removeddrives constraint, which we created in the introduction, and the settings for the removeddrives constraint.
  4. Access is where you set read and/or write access for this constraint. Notice that the selected removeddrives constraints in the above image has neither read nor write access selected. This means that the path elements in (9) will be invisible for the roles in (5). The advanced options button is intended for advanced users with knowledge of the extended HTTP methods used by WebDAV.
  5. The list of roles this constraint applies to. The list is empty in the above image, which means that it applies to all roles.
  6. Roles are added to the constraints by clicking on a role in the "All roles" list(2) and dragging the role to the constraint's "Roles list"(5).
  7. You use either the input field or the Add path button for adding URL path elements to the constraint. We will further explain how this works below.
  8. You press the add button when you have added a new path by manually entering the path in the input field.
  9. The list of path elements added by (8) or by using the "Add path" button. The constraint covers all the path elements added here. We have used the example from the introduction, where we removed the disks A, D, and F.
  10. Click the Add constraints button if you would like to create a new constraint.
  11. You can add a new role in the Drive Constraints Editor or in the Users Editor. The two buttons are identical and add a new role to the system.

Adding a path element to a constraint

We briefly explained how one adds a path element to a constraint in (7) above. Assume that we want to give user thomas read and write access to james' home directory. One can either type in the path to james' home directory in the input field or press the browse button. The image below shows the Drive Constraints Editor when we have selected constraint thomas and pressed the "Add path" button.

The "Add path" button opens a directory browser that lets you remotely navigate your BarracudaDrive server. The client web-application uses Web Services and communicates with the BarracudaDrive web-file-manager server in the background. You simply navigate to the desired directory, click the directory, and drag the directory to the URL path elements list. In the above image, we drag /c/bdusers/james to the thomas constraints, thus giving the user thomas read and write access to james' home directory.

The directory browser initially appears in the top left corner. One can move this pop-up window around by clicking on it with the mouse and dragging it to a different location. We have moved the directory browser to the bottom right corner in the above image to make it easier to view.

You remove the directory browser by pressing the hide button located in the lower left corner.

Tunnel Constraints Editor

The Tunnel Constraints Editor makes it possible to locally or remotely manage permissions for the built in BarracudaDrive HTTPS tunnel server. See the HTTPS tunnel client for more information on how to use the BarracudaDrive HTTPS tunnel.

The Tunnel Constraints Database is by default empty; hence no user is allowed to use the tunnel. The Tunnel Constraints Editor is similar to the Drive Constraints Editor and makes it possible to give roles access to use the tunnel service.

The tunnel constraints use URL path elements similar to the drive constraints. The path element works as follows:

/computername/port

One can use wildcard path elements so the following is allowed:

/computername/*
/*

Examples:

Description

Constraint path element

Give role(s) access to localhost port 23

/localhost/23

Give role(s) access to google.com port 80

/google.com/80

Give role(s) access to any port on the computer with IP address 192.168.1.100

/192.168.1.100/*

Give role(s) access to any computer and any port.

/*

The following image shows a constraint called "thomas". The constraint gives the role thomas, which is unique to the user thomas, access to use the telnet server running on the same computer as BarracudaDrive. The constraint also allows thomas to use any port on myserver.net. The user thomas is not allowed to use any other service.

  1. The "All Roles" list shows all roles we have added to the system.
  2. The "All Constraints" list shows the list of all the tunnel constraints we have added to the system. The above image shows our selected "thomas" constraint. In the above example, we have only one constraint for the tunnel.
  3. You add a new path element by entering in the hostname in the host field and the port number in the port field. The add button adds the new path element to (4).
  4. The path elements this constraint applies to.
  5. The list of roles this constraint applies to. An empty list means that the constraint applies to all roles.
  6. Roles are added to the constraints by clicking on a role in the "All roles" list and dragging the role to the constraint's "Roles list".
  7. You may want to temporarily disable a constraint without having to delete the constraint.

In (3) above, you enter the hostname and either type in the port number or use the drop down list to select one of the standard ports, such as telnet. Leave the port field empty if you would like to add a path such as /computername/*. Leave the host field empty if you would like to add a path such as /*. You can modify a path element as follows: Click on the path in (4), modify the path, and press the "Modify" button.

Application Manager

BarracudaDrive is a web-operating-system that allows you to dynamically start and stop web-applications. The installation guide you are currently reading is designed using our LSP scripting language and is such an application. You can use the Application Manager to stop and then optionally remove this installation guide once you no longer need it.

The following applications are integrated into the web-server and cannot be removed: Web-File-Manager, WebDAV server, HTTPS tunnel server, administration panel and auxiliary HTML files.

An application can be one of the following:

Each application should have a file called ".appinfo" in the root of the application folder. Do not delete this file as it contains configuration data for the application, such as the application type and application mode.

Standard applications and root applications

An application can be in two modes: standard application or root application. The mode is set in the .appinfo configuration file. The .appinfo configuration file is automatically created when you create a new BarracudaDrive application.

Standard applications:

A standard application has a name and the name is used as the base path for the application. For example, the base path to this setup guide is /setup/. You can see this in your browser's URL field.

A link to a running (active) standard application is automatically generated by the web-server if you visit one of the standard BarracudaDrive pages such as /rtl/settings/, /rtl/about.lsp, etc.. The link appears on the left side of the page.

Root applications:

A root application is installed into the web-server's root directory and the application does not have a base path. For example, a root application with an index.html will be the web-server's main index.html page -- i.e., the page visitors will first see when visiting your BarracudaDrive web-server. The set WWW" link to the left installs a root application.

One typically has one root application in addition to the hard wired BarracudaDrive root application. The BarracudaDrive root application directs visitors entering the servers root path /rtl/, which is our welcome page.

You can set a priority on your root application if you have purchased BarracudaDrive professional. The "Set WWW" link to the left creates an application with a higher priority than the hard wired BarracudaDrive root application. This means that once you have installed your WWW root application, visitors will no longer be directed to /rtl/ when they visit BarracudaDrive, but will instead see your own main index page.

Using the application manager

You will see the following tabs at the top of the Application Manager:

Manager

The manager gives you a list of the applications the Application Manager is aware of. The applications may or may not be running. You can click on the application and the application manager will give you detailed information regarding this application. The page with the detailed information also lets you start, stop, and remove applications.

Load

The Load button on the Load page makes it very easy to load new BarracudaDrive applications. The "applications" sub-folder, which is a subordinate directory of your BarracudaDrive installation, is where you keep deployed BarracudaDrive applications -- i.e., BarracudaDrive ZIP files. When you press the load button, the server analyzes the content of the "applications" sub-folder and loads new application(s) found in this directory.

A link to each running application is automatically generated by the web-server if you visit one of the standard BarracudaDrive pages such as /rtl/settings/, /rtl/about.lsp, etc.. The link(s) appear on the left side of the page.

The BarracudaDrive server is delivered with a few applications, such as this setup guide. Additional applications can be downloaded from barracudaserver.com.

New

The "New" page allows you to create new BarracudaDrive applications. This page is mainly intended for BarracudaDrive LSP application developers. The "Set WWW" link to the left is a simplified version of this page that allows you to create a BarracudaDrive root application by simply pressing one button.

A BarracudaDrive application is a plugin that extends the functionality in the server. You typically create a BarracudaDrive application, develop, test, and deploy the application by zipping the application together. A deployed application is typically copied to the "applications" sub-folder. The load button then allows you to load the deployed application. Note, data from a deployed application is typically sent compressed to the client which means faster response and bandwidth saved.

Creating a new application:

  1. Create a subordinate directory in the BarracudaDrive installation folder.
  2. Open the "New page" in the application manager.
  3. Enter an application name. The name is used as the base path for standard applications.
  4. Enter the path to a subordinate directory you created or press the browse button and navigate to the directory.
  5. Press submit.
  6. Fill in the form. The form data is used by the server when creating the .appinfo configuration file.
  7. Press submit. The server adds the application to the application list and creates a link to this application if you created a standard application.
  8. You can now add your HTML files and or LSP pages to the new directory. The pages you create will be directly accessible from a client such as a browser.

Introduction to Lua Server Pages

The following information is for web-developers with server side scripting experience.

Bindows

BarracudaDrive includes Bindows, which is covered by a run-time license. Commercial development using Bindows requires purchasing the Bindows Framework Developer's Kit.

The root URL to the Bindows toolkit is: http://domainname/rtl/bindows/. This directory includes only the Bindows html directory - i.e. no examples or documentation.

The Lua scripting language is extensible and powerful. Lua is very fast compared to other scripting languages. The standard Barracuda Embedded Web Server API is only available to C/C++ programmers. The LSP plugin exports methods in the Barracuda Embedded Web Server to Lua. The list of currently exported methods can be found in our online LSP documentation. The Barracuda LSP plugin makes it possible to handle multiple concurrent requests. Multiple requests are typically not possible in standard scripting servers as most scripting languages are not concurrent. The LSP plugin uses a combination of Lua Coroutines and Barracuda threads, making it possible to have a database driven server application with multiple concurrent requests.

The current LSP plugin makes a subset of the Barracuda Embedded Web Server available to script developers. The server currently allows you to develop standard WEB 1 applications. We are developing a WEB 2 server API that will enable Bindows applications, using standard RPC and our unique EventHandler, to communicate with the server in real-time.

We have prepared a few tutorials you can download and copy to the applications directory. The tutorials are available at http://localhost/tutorials/ after you have downloaded and started the tutorial using the BarracudaDrive application manager. See "loading applications" for more information.

Download LSP tutorials

The ZIP file contains:

Developing a web application:

You may write your first LSP application as soon as you have used the application manager to create a new LSP application. Any of the sample scripts in the tutorial can be unpacked and copied to your new LSP application directory. Go to the plugins sub-directory in the BarracudaDrive installation directory, unzip and copy tutorials.zip to the location of your LSP application. The sample scripts will be available at http://localhost/name/, where name is the name of your LSP application, as soon as you have unpacked the zip file in your home directory.

We suggest that you try to modify some of the LSP scripts. Pressing refresh in the browser will automatically recompile and run your LSP script.

Deploying a web application:

The web-application can be deployed as soon as you have completed the development. A BarracudaDrive LSP application is deployed by zipping the application together and then copying the zip file to the plugins sub-directory in the BarracudaDrive installation directory. The root name of the application is the name of the zip file. For example, our LSP demo is named tutorials.zip and the root path is therefore http://localhost/tutorials/.
The LSP demo contains a index.lsp file, which is automatically loaded when we specify the URL: http://localhost/tutorials/.

How the LSP plugin works:

The LSP plugin works in cooperation with the Barracuda Embedded Web Server. The Barracuda Embedded Web Server delegates the request to the LSP engine if a file has the extension ".lsp". All other files are handled directly by the Barracuda Embedded Web Server. You can make the server more efficient by keeping HTML data to a minimum in a LSP page. You can take advantage of response:include for including HTML fragments and response:forward for response delegation -- i.e., a LSP script can, for example, contain logic to handle data received from an HTML form and then delegate the response to a HTML file for rendering the response.

A zipped (compressed) deployed application can directly serve standard HTML files compressed to the client. A LSP page is uncompressed and run by the server. A LSP page can send compressed data to the client by delegating the response, using response:forward, to a HTML page.