Skip to content

A website for uploading, viewing, and downloading Fantom pods. Host your very own Pod Repository!

Notifications You must be signed in to change notification settings

Fantom-Factory/afEggbox

Repository files navigation

Eggbox v0.2.2


Written in: Fantom pod: v0.2.2 Licence: ISC

Overview

Eggbox is a website for uploading, viewing and downloading Fantom pods. Eggbox is fanr compatible and backed by MongoDB.

To see Eggbox in action, visit https://eggbox.fantomfactory.org/.

Use Eggbox to host your very own pod repository, be it at home or at work! Eggbox is easy to setup and simple to configure.

Eggbox features:

  • Editable Pod properties

  • Enhanced Fandoc documentation + syntax highlighting

    • table support
    • link to images in pods
    • broken link reporting
  • Atom (RSS) feeds for individual pods

  • Open Graph markup on pod summary pages

  • Sitemap XML generation

  • Basic Gravatar integration

Install

Install Eggbox with the Fantom Pod Manager ( FPM ):

C:\> fpm install afEggbox

Or install Eggbox with fanr:

C:\> fanr install -r http://eggbox.fantomfactory.org/fanr/ afEggbox

To use in a Fantom project, add a dependency to build.fan:

depends = ["sys 1.0", ..., "afEggbox 0.2"]

Documentation

Full API & fandocs are available on the Eggbox - the Fantom Pod Repository.

Quick Start

  1. Start an instance of MongoDB: C:> mongod

    MongoDB starting db version v3.0.5 waiting for connections on port 27017

  2. If Eggbox was installed as a pod, start the website with: C:>fan afEggbox 8069 ___ __ _____ _ / _ | / /_____ _____ / / / /_____ __ __ / _ | / // / -|/ _ /===/ __// _ / / __/ _ / __|/ // / // ||////_|//// // _,/__/_/// _, / Alien-Factory BedSheet v1.4.12, IoC v2.0.10 //

    IoC Registry built in 303ms and started up in 892ms

    Bed App 'Eggbox' listening on http://localhost:8069/

    Or if using the Eggbox standalone application, just run the script. (Edit the script to change the port.)

  3. Point your browser to http://localhost:8069/ and Job Done! Quickstart Screenshot

Standalone Installation

Eggbox may be run as a (portable) standalone application without the need to have Fantom installed. Just download the .zip file from Eggbox Downloads Page, extract, and run the bundled script.

Note that the standalone application does require java to be installed and available on the command line.

Configuration

The website is configured with various properties which may be set as environment variables, or overridden by a config.properties file. The config.properties should be in the current / same directory that the website is started in.

MongoDB URL

This defines the MongoDB instance Eggbox should connect to. It takes the form of the standard MongoDB connection URL:

afEggbox.mongoDbUrl = mongodb://db1.example.net:2500/?connectTimeoutMS=30000

Defaults to mongodb://localhost:27017/eggbox

Public URL

The public URL is used in Sitemap generation, Atom (RSS) feeds, og:image meta tags, and other components that require an absolute URL. It is used to set the BedSheet host config property.

afEggbox.publicUrl = http://eggbox.fantomfactory.org

Defaults to http://localhost:<port>

Contact Details

The contact details, as shown as a link in the bottom left hand corner of all Eggbox pages, are set via the following properties:

afEggbox.contactName  = Micky Mouse
afEggbox.contactEmail = micky.mouse@disney.com

Contact details are disabled by default.

Google Analytics

If the following properties are set then, Google's Universal Analytics script is included on all public pages.

afEggbox.googleAccNo     = XX-99999999-9
afEggbox.googleAccDomain = //eggbox.fantomfactory.org/

See Google Analytics's Pod for more details.

Google analytics is disabled by default.

Error Reporting

Eggbox can email a detailed error report whenever an unhandled error occurs on the server. To enable, set the following properties:

afEggbox.errorEmails.smtpHost     = mail.example.com
afEggbox.errorEmails.smtpPort     = 25
afEggbox.errorEmails.smtpUsername = micky.mouse
afEggbox.errorEmails.smtpPassword = password
afEggbox.errorEmails.smtpSsl      = false
afEggbox.errorEmails.sendTo       = micky.mouse@disney.com

Email sending is disabled by default.

Event Logging

Eggbox can log events to MongoDB. To enable, set the following properties to true:

afEggbox.logDownloads = true
afEggbox.logActivity  = true

The event info is not currently used, but may be used to present statistics in future repository releases.

Event logging is disabled by default.

Admin User

The admin user has access to, and may edit, all pods. The admin user is any user with the same email address as this property.

afEggbox.adminEmail = micky.mouse@disney.com

The admin user is disable by default.

Auto Login

If this property is set, then should anyone visit a private URL, they will be automatically logged in as this user.

afEggbox.autoLoginEmail = micky.mouse@disney.com

Note that the user must already exist on the system.

Auto login is disabled by default.

TIP: By setting afEggbox.adminEmail and afEggbox.autoLoginEmail to the same email address (and having people bookmark a private URL such as /my/pods) you create an open pod repository accessible to all.

About Page

Eggbox may have an optional About page. To enable, create an about.fandoc file in the current / same directory that the website is started in, next to config.properties. Existence of this file enables the About link in the top nav bar. The file is rendered as the About page.

The About page is disabled by default.

Environment Overrides

Sometimes it is convenient to have different configurations for different environments, such as dev or test. All the Eggbox properties may have environment specific properties that override the normal properties. Just prefix them with the environment:

afEggbox.mongoDbUrl      = mongodb://localhost:27017/eggbox
dev.afEggbox.mongoDbUrl  = mongodb://localhost:27017/eggbox-dev
test.afEggbox.mongoDbUrl = mongodb://localhost:27017/eggbox-test

Using the properties above will make Eggbox connect to the eggbox database by default, but it will connect to eggbox-dev in a dev environment and to eggbox-test in test.

The environment is set via the command line env argument:

C:\>fan afEggbox -env test 8069

Note that all Eggbox properties may be overridden in the same manner.

Sample config.properties

Here is a sample config.props for you to cut'n'paste. Uncomment / remove the leading # symbol, from any line you wish to use.

# config.properties for Eggbox
# ****************************
#
# See http://eggbox.fantomfactory.org/pods/afEggbox
#

#afEggbox.mongoDbUrl               = mongodb://localhost:27017/eggbox

#afEggbox.publicUrl                = http://example.com

#afEggbox.contactName              = Micky Mouse
#afEggbox.contactEmail             = micky.mouse@disney.com

#afEggbox.googleAccNo              = XX-99999999-9
#afEggbox.googleAccDomain          = //example.com/

#afEggbox.errorEmails.smtpHost     = mail.example.com
#afEggbox.errorEmails.smtpPort     = 25
#afEggbox.errorEmails.smtpUsername = micky.mouse
#afEggbox.errorEmails.smtpPassword = password
#afEggbox.errorEmails.smtpSsl      = false
#afEggbox.errorEmails.sendTo       = micky.mouse@disney.com

#afEggbox.logDownloads             = true
#afEggbox.logActivity              = true

#afEggbox.adminEmail               = micky.mouse@disney.com
#afEggbox.autoLoginEmail           = micky.mouse@disney.com

Acknowledgements

The following, non-Fantom, libraries and services are used by Eggbox:

Cheers!