Giter Site home page Giter Site logo

openacs's Introduction

Table of Contents

About

This is OpenACS on Ubuntu base docker image (version 22.04) . To install OpenACS I used code from Gustaf Neumann script install-oacs.sh. The base image is oupfiz5/openacs

OpenACS is self-hosting at https://chiselapp.com/user/oupfiz5/repository/openacs.

If you are reading this on GitHub, then you are looking at a Git mirror of the self-hosting OpenACS repository. The purpose of that mirror is to test and exercise Fossil's ability to export a Git mirror and using GitHub CI/CD (GitHub Actions). Nobody much uses the GitHub mirror, except to verify that the mirror logic works. If you want to know more about OpenACS, visit the official self-hosting site linked above.

Prerequisite

Tools

  1. *nix operation system
  2. Install Docker
  3. Install git (optional)
  4. Install fossil (optional)

Third party tools

They are using for testing and scanning:

  1. Bats
  2. Shellcheck
  3. Hadolynt
  4. Dockle
  5. Snyk - not necessarily
  6. Trivy - not necessarily

Installation

Build from chiselapp (fossil)

fossil clone https://chiselapp.com/user/oupfiz5/repository/openacs openacs.fossil
mkdir openacs
cd openacs
fossil open ../openacs.fossil
docker build -t oupfiz5/openacs -f ./Dockerfile .

Download from DockerHub

You can download docker images from dockerhub:

docker pull oupfiz5/openacs:oacs-5-10

Build from GitHub

git clone https://github.com/oupfiz5/openacs.git
cd openacs
docker build -t oupfiz5/openacs -f ./Dockerfile .

Contfiguration

Build arguments

Arguments Default Description
BUILD_DATE none Set build date for label
OACS_TAG oacs-5-10 Set OpenACS version
NS_IMAGE_TAG 4.99.24 Set NaviServer version
NS_IMAGE_REPOSITORY oupfiz5 Set NaviServer repository
NS_IMAGE_NAME naviserver Set NaviServer image name
IMAGE_NAME openacs Set OpenaACS image name
IMAGE_REPOSITORY oupfiz5 Set OpenACS repository
IMAGE_TAG oacs-5-10 Set OpenACS image tag

Example of build

set -a; source ../VERSIONS ; set +a;
IMAGE="${IMAGE:-${IMAGE_REPOSITORY}/${IMAGE_NAME}:${IMAGE_TAG}}"
docker build --no-cache \
    --build-arg BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \
    --build-arg OACS_TAG="oacs-5-10" \
    -t "${IMAGE}" \
    -f ./Dockerfile \
    .

Quickstart

Manage OpenACS using docker-compose

Prerequisite

Clone repository from:

  • fossil:

    fossil clone https://chiselapp.com/user/oupfiz5/repository/openacs openacs.fossil
    mkdir openacs
    cd openacs
    fossil open ../openacs.fossil
    
  • GitHub:

    git clone https://github.com/oupfiz5/openacs.git
    cd openacs
    

Start/stop interactive

start:

docker-compose up

The site will be accessible by url http://localhost:8080.

stop:

<Ctrl>+C

Start/stop/remove as daemon

start :

docker-compose up -d

The site will be accessible by url http://localhost:8080.

stop:

docker-compose down

remove:

docker-compose rm

View logs

Logs follow:

docker-compose logs -f

Logs tail:

docker-compose logs --tail=10

View list containers

docker-compose ps

Prune all

docker system prune --volumes --force

Configuration options

General options

Option Default Description
NS_CONF openacs-config.tcl Full path to configuration file
oacs_db_host* ${PGHOST} Set database host for OpenACS
oacs_db_name* ${PGDATABASE} Set database name for OpenACS
oacs_db_passwod* ${PGPASSWORD} Set db user password for OpenACS
oacs_db_port* ${PGPORT} Set database port for OpenACS
oacs_db_user* ${PGUSER} Set database user for OpenACS
oacs_httpport* 8000 Set listen port for OpenACS
OACS_IMAGE_NAME openacs Set OpenACS image name
OACS_IMAGE_TAG oacs-5-10 Set OpenACS image tag
oacs_ipaddress* 0.0.0.0 Set listen address for OpenACS
OACS_LISTEN_PORT 8080 Set http listen port, example 8080
OACS_REPOSITORY oupfiz5 Set OpenACS repository name
PGDATABASE openacs Database name
PGHOST postgres Database host name
PGPASWORD testing Database user password
PGPORT 5432 Database port
PGUSER openacs Database user name
POSTGRES_DB ${PGDATABASE} Set postgres db name for docker image
POSTGRES_PASSWORD ${PGPASSWORD} Set postgres db password for docker image
POSTGRES_USER ${PGUSER} Set postgres db user for docker image
POSTGRES_REPOSITORY postgres Set default postgres repository
POSTGRES_TAG 14.1-alpine Set default postgres tag
TZ UTC Set timezone, example Europe/Moscow
  • setting these variables as environment variables with the "oacs_" prefix (suitable for e.g. docker setups for defaultConfig in NS_CONF (see naviserver commit).

All options have predifined values and store in file .env .

oacs_* variables

Setting these variables as environment variables with the "oacs_" prefix (suitable for e.g. docker setups for defaultConfig in NS_CONF (see naviserver commit). Code example from NaviServer configuration file is:

...
# All default variables in defaultConfig can be overloaded by
# 1) setting these variables in this file (highest precedence)
# 2) setting these variables as environment variables with
#    the "oacs_" prefix (suitable for e.g. docker setups)
# 3) set the variables from the default values.
#
set defaultConfig {
    hostname	localhost
    ipaddress	127.0.0.1
    httpport	8000
    httpsport	""

    server     "openacs"
    serverroot	/var/www/$server
    logroot	$serverroot/log/
    homedir	/usr/local/ns
    bindir	$homedir/bin
    db_name	$server
    db_user	$server
    db_host	localhost
    db_port	""
    db_password	"testing"
}
...

Environment variables from .env file are:

...
oacs_httpport='8000'
oacs_db_user="${PGUSER}"
oacs_db_passwod="${PGPASSWORD}"
oacs_db_name="${PGDATABASE}"
oacs_db_host="${PGHOST}"
oacs_db_port="${PGPORT}"
oacs_ipaddress='0.0.0.0'
...

OpenACS listen port

OACS_LISTEN_PORT set the http listen port for the openacs. In this case the OpenACS is accessible by URL http://localhost:8070.

OACS_LISTEN_PORT=8070 docker-compose up

OpenACS docker image

Docker-compose uses the following variables for pulling OpenACS image from docker hub:

  • OACS_REPOSITORY
  • OACS_IMAGE_NAME
  • OACS_IMAGE_TAG

NaviServer configuration file

NS_CONF - configuration file. Default value is /usr/local/ns/conf/openacs-config.tcl

  1. Put the configuration file to rootfs/usr/local/ns/conf

  2. Run docker compose

    NS_CONF="/usr/local/ns/conf/my-config.tcl" docker-compose up

PostgreSQL docker image

Docker-compose uses the following variables for pulling postgres image from docker hub:

  • POSTGRES_REPOSITORY
  • POSTGRES_TAG

Database hostname

PGHOST set the database hostname for the openacs. By default it has name of docker-compose database service - postgres.

PGHOST=foo docker-compose up

Database name

PGDATABASE set the database name for the openacs. By default it has name of docker-compose database service - openacs.

PGDATABASE=foo docker-compose up

Database username

PGUSER set the database username for the openacs and postgres.

PGUSER=foouser docker-compose up

Database password

PGPASSWORD set the database user password for the openacs and postgres.

PGPASSWORD=foopass docker-compose up

Postgres tag

POSTGRES_TAG set the docker image tag for official postgres. Pay attention - some openacs version can use only correspond version of postgres.

POSTGRES_TAG="14.1-alpine" docker-compose up

Timezone

Set the timezone for the containers, defaults to UTC. To set the timezone set the desired timezone with the variable TZ. Useful for setup correct time in logging.

TZ="Europe/Moscow" docker-compose up

CI/CD

For build and push docker images we use GitHub Actions workflow.

Maintenance

Shell access

For debugging and maintenance purposes you may want access the containers shell. If you are using Docker version 1.3.0 or higher you can access a running containers shell by starting bash using docker exec:

docker exec -it openacs_openacs_1 /bin/bash

docker exec -it openacs_postgres_1 /bin/bash

openacs's People

Stargazers

Morpheus New avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.