Giter Site home page Giter Site logo

afdaniele / compose Goto Github PK

View Code? Open in Web Editor NEW
6.0 1.0 3.0 18.96 MB

A lightweight web-based CMS.

Home Page: http://compose.afdaniele.com

CSS 4.47% JavaScript 4.89% PHP 87.33% HTML 0.79% Shell 0.58% Dockerfile 0.18% Hack 0.41% Python 1.18% Makefile 0.17%

compose's Introduction

\compose\ - A lightweight web-based CMS

\compose\ is a CMS (Content Management System) platform written in PHP that provides functionalities for fast-developing web applications on Linux servers.

Born to be modular, \compose\ is built around the concept of installable packages. The built-in Core package is responsible for managing the third-party packages and allows us to install, remove, update, enable/disable packages and single components such as API End-points or Pages directly from the browser.

Features:

  • Built-in support for different types of users;
  • 4 types of users supported by default: guest, user, supervisor, administrator;
  • Web-based package manager;
  • Web-based pages manager;
  • Web-based RESTful API end-points manager;
  • Built-in support for Google Sign-In OAuth 2.0 authentication;
  • Built-in HTTP RESTful API service;
  • Error handler;
  • Graphics based on Bootstrap (v3.3.1);
  • and many many more...

Architecture

You can use \compose\ out-of-the-box, though there is not much to see or do until you create or install packages. \compose\ is designed to be modular with a built-in core package that provides all the functionalities needed for managing additional packages and their components. A Configuration class provides functionalities for managing settings for both the core package and other additional packages.

The RESTful API module in \compose\ offers an easy way for packages to export API end-points accessible via HTTP.

Documentation

Check the Full Documentation if you want to learn more about \compose\

\compose\ in Docker

\compose\ is also available as a Docker image.

Build your own image using Dockerfile

You can download our Docker files from (here)[https://github.com/afdaniele/compose/tree/master/docker]. To build a Docker image from one of our Docker files run:

docker build -t <image_name>:<image_tag> .

Pre-built Docker images

You can find the list of pre-built images on (Docker Hub)[https://cloud.docker.com/repository/docker/afdaniele/compose/tags].

Run image with \compose\ outside the container (suggested)

Run

docker run -itd -p <PORT>:80 -v <COMPOSE_ROOT_HOST_DIR>:/var/www/html afdaniele/compose:<IMAGE_TAG>

NOTE: <COMPOSE_ROOT_HOST_DIR> is the path to the directory on the host that contains the root of the \compose\ repository. This path should contain a public_html dir.

Run image with \compose\ inside the container

NOTE: All the changes made in \compose\ will be saved inside the container. If you delete the container without committing, all the changes will be lost.

Run

docker run -d -p <PORT>:80 afdaniele/compose:<IMAGE_TAG>

compose's People

Contributors

afdaniele avatar jasonhu5 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

compose's Issues

no check for access_level

In web-api/index.php, it seems that nobody is checking $action['access_level'] against Core::getUserRole(). Investigate this.

TODO: try to run an administrator-only action while logged as a simple user and see what happens and in case who/what complains.

child_pages

Website compose.afdaniele.com, the page build_markdown from the package doxygen does not have a menu entry but qualifies as child_page of the page docs. The menu entry of the page docs does not highlight when build_markdown is visited.

API via HTTP when SSL Redirect is enabled

It looks like API calls with App ID/Secret do not work on HTTP when HTTPS is enabled.
The server returns app_id is mandatory. Maybe the arguments are not forwarded to HTTPS.

configuration files saved without formatting values

The configuration file for the core package (and I guess the others packages too) are dumped with the values not formatted according to the metadata of the configuration.

For instance, the file metadata.json of the configuration for the core package reads:

{
    "configuration_content" : {
        "maintenance_mode" : {
            "title" : "Mainteinance mode (NOT YET IMPLEMENTED)",
            "type" : "boolean",
            "default" : false,
            "details" : "Whether the platform is in maintenance mode"
        },
        . . .
    }
}

whereas after pushing a new configuration from the browser, this is what the file configuration.json looks like:

{
	"maintenance_mode": "1",
	"navbar_title": "Welcome",
	"logo_white": "http:\/\/compose.afdaniele.com\/images\/compose-white-logo.svg",
	"logo_black": "http:\/\/compose.afdaniele.com\/images\/compose-black-logo.svg",
	"admin_contact_email_address": "[email protected]",
	"cache_enabled": "0",
	"guest_default_page": "login",
	"user_default_page": "profile",
	"supervisor_default_page": "profile",
	"administrator_default_page": "profile"
}

It is clear that maintenance_mode should be formatted to be true rather than 1.

Auto-Error: #1542006137

Error reported at 2018-11-12 07:02:17 GMT.

Error message:
An error occurred while talking to the challenges API. The server returned the code <strong>500</strong>.

Infinitely expanding cache pie charts

In the Settings page, opening and closing the Cache section multiple times will have the effect of expanding the canvas size of the two pie charts.

Error loop

When an error is thrown (i.e., Core::throwError()) but there is no message, the error page will refuse to render and redirect to the default page. When the default page generates the error (with no explanation) a weird loop situation arises.

A possible solution would be to change the error page so that a default error message is shown when there is no message.

Permission issue does not allow to create config file

If we install compose in a directory that does not belong to www-data (very common when the code is mounted from outside a Docker container), compose cannot create the configuration file for the core package at boot. This prevents the default value of maintenance_mode from metadata.json to be written, and the user is redirected to maintenance since the default value passed to Core::getSetting('maintenance_mode', 'core') is true.

We either show an error in this case or make it easier for the user to figure out what the issue is. Perhaps, we could use the entrypoint script to check and notify the user somehow (on-the-fly written page?).

Add loading image to setup page

Every time we confirm a step in setup/, the page reloads up to the tab we confirmed, then stops for a while and reloads to the next step. Add a loading gif to the body of the tab for this intermediate load. This will show that something is happening.

PHP Session lock

Use session_write_close(); to suspend the session, save the file and release the lock for those API calls that do not change the $_SESSION variable. Add a boolean parameter 'read-only' to web-api-specification.json for each action.

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.