Lovely Scala Blogging Engine provides a basic blog CMS, all written with love, Scala and coffein! My own deployed version can be found here.
- SBT (Scala Build Tool): download here.
- MongoDB: installation instructions here.
- Sass (Syntactically Awesome Style Sheets): installation instructions here.
- UglifyJs: installation instructions here.
The server is configured with environment variables:
APP_CONTEXT
: context of the application (PROD
orDEV
, default isDEV
)SERVER_HOST
: the host on which to bind. Default used islocalhost
which makes it unreachable from the outsidePUBLIC_PORT
: the port for the public api (default8080
)ADMIN_PORT
: the port for the admin api (default9090
)REPOSITORY_LINK
: link given in theserver/info
route (defaulthttps://github.com/jrabasco/LSBEngine
)MONGO_HOST
: host for the mongo database (defaultlocalhost
)MONGO_CUST_PORT
: port of the mongo database (default27017
)MONGO_NAME
: name of the database (defaultlsbengine
)HASH_ITERATIONS
: number of iterations when hashing the password (default300000
, should be high enough so that it takes around 1 second to perform a hash)BLOG_OWNER_FIRST_NAME
: first name of the owner of the blog (defaultJeremy
)BLOG_OWNER_LAST_NAME
: last name of the owner of the blog (defaultRabasco
)BLOG_OWNER_PSEUDO
: owner's usual pseudonym (default empty)BLOG_OWNER_GENDER
: owner's gender (defaultmale
, remember that it was built for me initially and I am a male, no discrimination here)BLOG_SHORT_DESCRIPTION
: short description of the blog, for the RSS flux (defaultMy Personal Blog
)BLOG_META_DESCRIPTION
: short description for the blog (defaultMy name is Jeremy Rabasco. I am a Computer Science major and I currently work at <JOB_HERE>.
)CONTACT_ADDRESS
: email for the footer (default[email protected]
)GTAG_KEY
: Google analytics tracking key, leave empty if you do not wish to use Google analytics.HEADER_TITLE
: title in the header (defaultLSBEngine
)IMAGES_LOCATION
: location where the uploaded images are saved (default/home/jrabasco/images
)SITE_URL
: the URL of the website (defaultlocal.lsbengine.me
)RESUME_REPO
: link to your resume repository, see the Resume sectionDISCLAIMER
: A disclaimer that will appear in the footer (defaultMy opinions do not necessarily represent those of my employer.
)COPYRIGHT
: copyright mention for the footer (defaults to nothing)DEFAULT_POSTS_PER_PAGE
: number of posts per page when no parameter is supplied (default10
)
To add a user run:
$ sbt
> run-main me.lsbengine.bin.UserManager add <username> <password>
To remove a user run:
$ sbt
> run-main me.lsbengine.bin.UserManager remove <username>
The usernames are case insensitive. Remember that all the users are considered admin users.
To make your resume available, you must provide a link to your resume repository. This repository must contain a Makefile so that when running make
in the repository, it generates a file named resume.pdf
. It will be then downloadable from the following route: /assets/$firstname_$lastname_resume.pdf
. $firstname
and $lastname
are the provided names in lower case.
If no repository is provided, this just does not happen at all.
Clone the repository and run
$ make run
If you plan to run this on the production machine, make sure you set the PUBLIC_DOMAINS
environment variable to be your actual list of valid public domains/subdomains, ADMIN_DOMAINS
to be the location for your admin interface and DOMAIN
to be just your domain name then run:
$ make build-docker
$ docker-compose up -d
Example of a valid domains setup script:
export PUBLIC_DOMAINS="public.lsbengine.me lsbengine.me blog.lsbengine.me www.lsbengine.me"
export ADMIN_DOMAINS="admin.lsbengine.me"
export DOMAIN="lsbengine.me"