Giter VIP home page Giter VIP logo

uhlelox's Introduction

uhleloX

uhleloX is a modern PHP Content Management System.

Built on PHP 8, jQuery 3 and Bootstrap, it provides a lightweight and powerful CMS experience to powerusers. A number of core plugins available, add features such as Media Editor, Text Editor (both CKEditor and CodeMirror) and Media Upload.

A number of big CMS have "ruled" the web for the past years, and they are excellent. However, many of them are built on very outdated code, and have a number of security issues and user shortcomings that uhleloX tries to fix.

One of the biggest differences to any common CMS (inclusive WordPress) is that uhleloX can not be taken over during install, because it uses a very simple but effective verification of the owner during install, user creation, and database install.

Other differences are:

  • uhleloX is very modular. In its most basic version, all you get is a Content Management System. Using Core Extensions, developed directly by uhleloX, and shipped in the install (but not activated) you can extend uheloX with very modern and powerful text editors, image editors and media management features.
  • uhleloX uses a normalized, compressed database structure. No JSON or seralised arrays are stored. It has a native relational Database that can be infinitely extended, inclusive translations. This grants major performance advantages compared to traditional PHP CMSs.
  • Strict SSL and CSPs are applied natively in uhleloX, making it literally impossible to run an unsafe HTTP website or loading any scripts from external sources. Everything has to be loaded with SSL and from your own server.
  • uhleloX is not owned by anyone. While the GitHub and Website Servers are sponsored by TukuToi Co Ltd, and currently development is as well made by TukuToi developers, the project as such is intended to be open to anyone contributing. Leadesrhip is is in the hands of those who do the work. Full stop.

uhleloX also uses several features of other CMSs that make them so powerful:

  • Just like WordPress, uhleloX also offers a set of PHP Hooks that can be used to extend core functionality.
  • In future Releases, uhleloX will support the (so much neglected) well known ShortCodes system that WordPress used.

Install

  • Prepare an Apache or nginX server with PHP 8 and a MySQL Database. Note, in nginX you have to ensure pretty url rewrites on your own. Try something like below in your server block. On Apache, uhleloX already includes an .htaccess rewrite rule.
location / {
	try_files $uri $uri/ /index.php?$args; 
}
  • Download and unzip the latest Release.
  • Unzip the downloaded package, open the folder and find the hash.txt file in it.
  • Create an SHA256 hash of a passphrase of your choice that you will be using to: -- Setup the install -- Create new users -- maybe in future log in to the system ==> A possible online service to create an SHA256 hash is https://emn178.github.io/online-tools/sha256.html
  • Paste the SHA 256 hash of your passphrase in the hash.txt file and save it
  • Upload the entire folder's contents to your webserver's web root (for example, into the var/www/html folder)
  • Visit your website (i.g. https://domain.tld)
  • Complete the setup steps. You will need to enter your Database host, name, port, charset, user/password and passphrase created above, thus have them ready.
  • Create a User in the next prompt.
  • Login to the CMS in the last prompt.

Setup

Settings All necessary settings for the default to work are added during setup Add new settings are in /admin.php?x_action=add&x_type=settings You should upload at least a Website Logo and complete the x_logo_id setting after.

Extensions All currently existing core extensions are inactive by default, and not installed. You will need to download each from the respective repositories, and then activate them in the uhleloX Dashboard > Extensions control panel /admin.php?x_action=add&x_type=extensions.

Please note that CodeMirror and CKEditor can not be used toegether.

Relationships

Add new relationships in /admin.php?x_action=add&x_type=relationships

  • UUID: {entity-a}_{entity-b} (SHOULD be singular database table names separated by underscores)
  • Type: m2m (none else supported yet)
  • Entity_a: database table name (the "left" partner in a relationship, MUST be database table name)
  • Entity_b: database table name (the "right" partner in a relationship, MUST be database table name) You can now connect any item of "left" database table to any item of "right" database table name. NOTE: currently only whitelisted tables are accepted for new relationships. See in the extension x-custom-types how to whitelist your own tables.

Todo and Future Plans

A lot, and many

  • finalise front end display, routing, templating, paginating...
  • finalise user management and role/capabilities...
  • finalise API (event(), currently add_action and add_filter)...
  • ... + ... Also see open issues in this GitHub project

Updating

To update an existing install, you can do so directly from within the uhleloX Dashboard. uhleloX has a remote API that will ship you the latest updates directly onto your server. You will (currenlty) need to manually run the "Check for updates" action (screen /admin.php?x_action=update).

uhlelox's People

Contributors

smilebeda avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

uhlelox's Issues

Add Template Management and API

Currently, a default Template is loaded which does not allow for much (backend, user friendly) customisation.

For starters we should add a more robust API and a way to easily create custom templates.
Going forward (but not in this release milestone) a Page Builder Extension should be created similar to TukuToi Template Builder we've made for CP.

For this milestone:

  • robust but simple API provided for Template developers to create their own templates easily.
  • robust but simple fallback template provided (as is currently available)
  • robust but simple routing templates (single, archive, search, 404 and home)

Role management

While the database structure for it is present as well as the UI to create users and roles, and we can even add roles to a user, uhleloX at this moment neither controls User Roles (it plain simple assumes every user to be an admin), nor does it allow to lock front end user creation or make those by default a very low role.

This needs to:

  • have a default check for the user role and make only the first ever created user a super admin, all other users created after, should be of low role and then be managed by admins
  • add checks internally and externally for user roles when accessing code and data

Check security for admin files

currently uhleloX doesn't check for security when accessing files directly.

This means, while you can't access a Dashboard or publish a post since every file is somehow interconnected and directly accessing generally fails in a fatal for missing code, the malicious user still can access those files. That should be impossible.

It's easy enough to avoid that by defining a constant somewhere after session is open and valid, then each file should check if that constant is defined or not.

I thus introduce X_ADMIN for this. If set, the admin is loaded and it is loaded by a valid user. If not set, the admin is not loaded and accessing the file should be impossible.

cURL should verify host certificate when connecting to the API

SonarCloud detected that the cURL connecting to api.uhlelox.com does not check the certificate, thus making it potentially vulnerable to Man in the Middle attacks.

While that's not a big deal, since we verify the signature on download, we still should verify it.

Add ShortCodes System

We can take inspiration from WordPress for this.

The idea is to allow users to insert a shortcode (something like [shortcode_identifier shortcode_attribute="shortcode_value"]) in their Text editors (or per function in the Templates/Extensions) which then will display data as determined by the shortcodes PHP code.

For example, a ShortCode could be used to display the current users's description, and all the users would have to do is insert the ShortCode in the editor, instead of crafting PHP or hardcoding the information.

Rewrite the hooks API

The hooks API is basically the only part that is not native to uhleloX (it is inspired (and mostly copied) from WordPress).

What needs to happen here is that all add_ and did_ and apply_ and do_ hooks should be changed into add_event and do_event or something like hook() and add_hook().
This involves A) a complete review of current code and B) a rewrite of the current classes for hooks.

Use UUID instead of slug in Database Columns

From the WordPress influence I got, I used slug in the database for what in reality is a UNIVERSALLY UNIQUE IDENTIFIER (UUID).

"slug" really is an animal. It doesn't describe what it really is, namely a unique value that identifies our item apart of the classic id.
Thus, rename this to UUID and refactor all code to listen to the UUID instead.

Properly hide, and encode User Passwords

Currently User Passwords are properly encrypted when we create an user from the Front end.
However when editing a user in the backend the encrypted value of the password is shown in the editor and no way to "reset" (add/chnage) the password in actual plain text is available.

This needs to:

  • have an input that is populated by default with the users's password (hidden)
  • allow users to add new users with new password
  • allow users to change their own or others passwords

Prevent Hostile takeovers

WordPress for example has had a long standing issue of Hostile Install/Config Takeovers.

When a user installs WP on their servers and abandons the install without completing it, a third party can call up setup-config.php and complete the install.

uhleloX should avoid this natively, both when installing it, but also when setting up users.
Possibly, the same technology should/could be used to verify users when logging in.

Proposed solution:

  • create a simple .txt file in the install that holds (currently one) SHA256 hash of a passphrase the user defines prior to upload the package to the server.
  • the user has to save that SHA256 hash in the text file
  • the user is then prompted to insert his/her passphrase during install and user creation
  • that passphrase is then encoded with the same algorithm and compared to the stored hash. If the hash does not match, the process is aborted.

The user currently can create his/her hash with tools like https://emn178.github.io/online-tools/sha512.html, we could also offer that as a "download safe package here" option, yet, that would theoretically allow the server owner to store both passphrase and generated hash, and then scan the web for the hash value in the text file and thus match domains against generated hashes. Fort this reason, it is probably best to leave the hash generation to the end user, so they can choose to use any tool, inclusive terminal, to generate their hashes.

Provide an update mechanism

Most important of all things software is updating it.

uhleloX as of now has no update mechanism, at all, other than manual overwrites.

Provide a update mechanism that allows the following:

  • check for updates
  • pull updates by the click of a button

This should be done for core

As probably the extensions at some point should become independent entities (even if bundled in the initial core package), I'd assume those shouldn't be included in this logic, but as we are at it, we should consider allowing the update of single core extensions, or, just pull them (core extensions) together with main.

Set Up Defaults on install

Currently user has to manually set several necessary settings, extensions, templates, and so on after installing uhleloX

This should be automatic.

Settings
Slug: x_site_url, Value: https://domain.tld (your site URL)
Slug: x_upload_max_size, Value: 999999999 (value in bites defining max upload file size)
Slug: x_active_template, Value: uhlelox-template (unless you have a custom template, use that temlate's slug)
Slug: x_field_type_mugshot, Value: img (this is a dynamic setting defining the input type of a field in edit screen. Setting slug can be x_field_type_{field_slug}, value can be img [image input], owner [select2 with users])
Slug: x_field_type_ownert, Value: owner (this is a dynamic setting defining the input type of a field in edit screen. Setting slug can be x_field_type_{field_slug}, value can be img [image input], owner [select2 with users])

Extensions
Slug: x-ck-editor, Status: active (activates the CK Editor on edit screens)
Slug: x-media-browser, Status: active (activates a media browser in the Editors)
Slug: x-file-robot, Status: active (activates media editor)

Templates
Slug: uhlelox-template Status: active (activates the CK Editor on edit screens)

Relationships
Slug: user_role, Entity_a: users, Entity_b: roles
user_page: 1 entry connecting user ID 1 to role ID 1
roles: 1 entry with a new user role owner

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.