Code Monkey home page Code Monkey logo

ada-awa's Introduction

Ada Web Application

Alire Alire Build Status Test Status Coverage Documentation Status Download License Commits

Ada Web Application is a framework to build a Web Application in Ada 2012. The framework provides several ready to use and extendable modules that are common to many web application. This includes the login, authentication, users, permissions, managing comments, tags, votes, documents, images. It provides a complete blog, question and answers and a wiki module.

AWA simplifies the Web Application development by taking care of user management with Google+, Facebook authentication and by providing the foundations on top of which you can construct your own application. AWA provides a powerful permission management that gives flexibility to applications to grant access and protect your user's resources.

AWA Features

AWA integrates the following projects:

These projects are distributed under the Apache License 2.0 or MIT license for Ada LZMA.

AWA relies on the following external projects:

These projects are provided as tarball in 'external' directory. They are distributed under different licenses (GNU GPL).

The AWA framework integrates a set unit tests and provides a framework to build unit tests for AWA applications. The unit tests are based on Ada Util test framework which itself is built on top of the excellent Ahven test framework (Ahven sources is integrated in Ada Util). You may get Ahven or Aunit at:

Version 2.5.0 - Sep 2023

  • Feature #22: Add command line support to register a new user
  • Feature #23: Add command line for database schema migration
  • Feature #25: Update database schema for ADO 2.4
  • Feature #26: Support to enable/disable user account
  • Feature #27: New option for the list command to print the last audit fields
  • Feature #31: Use <header>, <footer>, <main> for HTML layouts
  • Feature #32: Support several authentication methods for a user
  • Feature #35: Blog post creation improvement
  • Fix #30: Configuration to authenticate with GitHub is incomplete
  • Fix #33: Application name not recognized by some AWA commands
  • Fix #34: Configuration to authenticate with Gitlab is incomplete
  • Fix #37: Cannot use entity-permission for the url-policy
  • Fix #38: Image module does not handle SVG correctly
  • Fix #45: AWA start command option --max-upload-size and --max-form-size don't accept a value
  • Update Trumbowyg editor to version 2.26.0
  • Use Markdown for the AWA comments and questions modules

List all versions

Using git

The AWA framework uses git submodules to integrate several other projects. To get all the sources, use the following commands:

   git clone --recursive https://github.com/stcarrez/ada-awa.git
   cd ada-awa

Development Host Installation

The PostgreSQL, MySQL and SQLite development headers and runtime are necessary for building the Ada Database Objects driver. The configure script will use them to enable the ADO drivers. The configure script will fail if it does not find any database driver.

Ubuntu

First to get the LZMA and CURL support, it is necessary to install the following packages before configuring AWA:

sudo apt-get install unzip liblzma-dev libcurl4-openssl-dev

MySQL Development installation:

sudo apt-get install libmysqlclient-dev

MariaDB Development installation:

sudo apt-get install mariadb-client libmariadb-client-lgpl-dev

SQLite Development installation:

sudo apt-get install sqlite3 libsqlite3-dev

PostgreSQL Development installation:

sudo apt-get install postgresql-client libpq-dev

FreeBSD 13

First to get the LZMA, XML/Ada and CURL support, it is necessary to install the following packages before configuring AWA:

pkg install gnat12 gprbuild lzma curl-7.87.0 xmlada

MariaDB Development installation:

pkg install mariadb106-client mariadb106-client-10.4.7 mariadb106-server-10.6.11

SQLite Development installation:

pkg install sqlite3

PostgreSQL Development installation:

pkg install postgresql15-client-15.1 postgresql15-server-15.1_1

Windows

It is recommended to use msys2 available at https://www.msys2.org/ and use the pacman command to install the required packages.

pacman -S git
pacman -S make
pacman -S unzip
pacman -S base-devel --needed
pacman -S mingw-w64-x86_64-sqlite3

For Windows, the installation is a little bit more complex and manual. You may either download the files from MySQL and SQLite download sites or you may use the files provided by Ada Database Objects and Ada LZMA in the win32 directory.

For Windows 32-bit, extract the files:

cd ada-ado/win32 && unzip sqlite-dll-win32-x86-3290000.zip
cd ada-lzma/win32 && unzip liblzma-win32-x86-5.2.4.zip

For Windows 64-bit, extract the files:

cd ada-ado/win32 && unzip sqlite-dll-win64-x64-3290000.zip
cd ada-lzma/win32 && unzip liblzma-win64-x64-5.2.4.zip

If your GNAT 2019 compiler is installed in C:/GNAT/2019, you may install the liblzma, MySQL and SQLite libraries by using msys cp with:

cp ada-lzma/win32/*.dll C:/GNAT/2021/bin
cp ada-lzma/win32/*.dll C:/GNAT/2021/lib
cp ada-lzma/win32/*.a C:/GNAT/2021/lib
cp ada-ado/win32/*.dll C:/GNAT/2021/bin
cp ada-ado/win32/*.dll C:/GNAT/2021/lib
cp ada-ado/win32/*.lib C:/GNAT/2021/lib
cp ada-ado/win32/*.a C:/GNAT/2021/lib

Ada Web Server

The Ada Web Server should be compiled with the SSL support if you want to use the OAuth 2.0 protocol and integrate with Google, GitHub and GitLab authentication systems. The AWS version shipped with GNAT 2021 will not work because it does not support SSL.

You may build AWS by using:

   git clone --recursive -b 20.2 https://github.com/AdaCore/aws
   cd aws
   make SOCKET=openssl setup build install

Building AWA

The framework uses the configure script to detect the build environment. In most cases you will configure, build and install with the following commands:

   ./configure --prefix=/usr/local
   make
   make install

Next steps

Once you have built and installed the Ada Web Application framework, you can use the dynamo command to create your first project by using the create-project command:

dynamo create-project -l apache atlas [email protected]

Have a look at the Dynamo(1) documentation for the detail of the dynamo command options.

Then, configure and build the project by using:

cd atlas
./configure
make generate build

At this step, you will get the binary server in bin/atlas-server and you can launch it with:

./bin/atlas-server setup

The generated binary server provides several commands that you can use. The list of commands and their options is described in: command (1).

Follow the Tutorial section and the Ada Web Application programmer's guide to proceed to the next development steps.

Docker

A docker container is available for those who want to try AWA without installing and building all required packages (See Ada Web Application on Docker. To use the AWA docker container you can run the following commands:

   sudo docker pull ciceron/ada-awa

Documentation

The Ada Web Application programmer's guide describes how to setup the framework, how you can setup and design your first web application with it, and it provides detailed description of AWA components:

Tutorial

You may read the following tutorials to lean more about the technical details about setting up and building an Ada Web Application:

Presentations

Articles

Sites Using AWA

ada-awa's People

Contributors

dependabot[bot] avatar jquorning avatar persan avatar stcarrez avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ada-awa's Issues

docker image

Hi, the correct docker command is:
docker pull ciceron/ada-awa instead of
docker pull ciceron/awa
in documentation.
Thanks

AWA blog plugin fails to serve an image when it is stored in the storage directory

When an image is big it can be stored in the storage directory instead of the database (this is configurable).

Then, when the image is referenced from a blog article, the blog image servlet does not load the image content.
The image is therefore not served and we get a 404 error.

There is no issue if the image was stored in the database.

Support several authentication methods for a user

The AWA 2.4 implementation supports only a single authentication method for a user registered with an email address.
It is useful to allow a Google OAuth access at the same time of a GitHub, GitLab or even password based access as long as we are sure this is the same user.

  • the authenticate information must be moved outside of the awa_user table,
  • the same user can authenticate as soon as the email address matches (assuming we trust GitHub or GitLab)

imported project file "aws" not found

For some reason the configure script isn't finding the aws installation even though its in the "external" directory. Ideas or should I just install it from the AUR?

Unable to build

I have used two ways to clone this repository but problem persists, in both cases ada-lzma is empty. I have used submodule init and submodule update method but result is the same. Here are commands output:-

$ git clone --recurse-submodules https://github.com/stcarrez/ada-awa.git
Cloning into 'ada-awa'...
remote: Enumerating objects: 1531, done.
remote: Counting objects: 100% (1531/1531), done.
remote: Compressing objects: 100% (743/743), done.
remote: Total 34595 (delta 935), reused 1240 (delta 753), pack-reused 33064
Receiving objects: 100% (34595/34595), 108.62 MiB | 1.03 MiB/s, done.
Resolving deltas: 100% (25990/25990), done.
Submodule 'ada-ado' (git://github.com/stcarrez/ada-ado.git) registered for path 'ada-ado'
Submodule 'ada-asf' (git://github.com/stcarrez/ada-asf.git) registered for path 'ada-asf'
Submodule 'ada-el' (git://github.com/stcarrez/ada-el.git) registered for path 'ada-el'
Submodule 'ada-lzma' (git://github.com/stcarrez/ada-lzma.git) registered for path 'ada-lzma'
Submodule 'ada-security' (git://github.com/stcarrez/ada-security.git) registered for path 'ada-security'
Submodule 'ada-servlet' (git://github.com/stcarrez/ada-servlet.git) registered for path 'ada-servlet'
Submodule 'ada-util' (git://github.com/stcarrez/ada-util.git) registered for path 'ada-util'
Submodule 'ada-wiki' (git://github.com/stcarrez/ada-wiki.git) registered for path 'ada-wiki'
Submodule 'dynamo' (git://github.com/stcarrez/dynamo.git) registered for path 'dynamo'
Submodule 'swagger-ada' (git://github.com/stcarrez/swagger-ada.git) registered for path 'swagger-ada'
Cloning into '/home/amit/0myspace/ada/gitrepo/ada-awa/ada-ado'...
remote: Enumerating objects: 515, done.
remote: Counting objects: 100% (515/515), done.
remote: Compressing objects: 100% (246/246), done.
remote: Total 6401 (delta 322), reused 419 (delta 269), pack-reused 5886
Receiving objects: 100% (6401/6401), 3.28 MiB | 598.00 KiB/s, done.
Resolving deltas: 100% (4581/4581), done.
Cloning into '/home/amit/0myspace/ada/gitrepo/ada-awa/ada-asf'...
remote: Enumerating objects: 11297, done.
remote: Total 11297 (delta 0), reused 0 (delta 0), pack-reused 11297
Receiving objects: 100% (11297/11297), 9.33 MiB | 98.00 KiB/s, done.
Resolving deltas: 100% (7920/7920), done.
Cloning into '/home/amit/0myspace/ada/gitrepo/ada-awa/ada-el'...
remote: Enumerating objects: 14, done.
remote: Counting objects: 100% (14/14), done.
remote: Compressing objects: 100% (12/12), done.
remote: Total 1752 (delta 4), reused 7 (delta 2), pack-reused 1738
Receiving objects: 100% (1752/1752), 802.54 KiB | 220.00 KiB/s, done.
Resolving deltas: 100% (1246/1246), done.
Cloning into '/home/amit/0myspace/ada/gitrepo/ada-awa/ada-lzma'...
remote: Enumerating objects: 6, done.
remote: Counting objects: 100% (6/6), done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 230 (delta 1), reused 3 (delta 1), pack-reused 224
Receiving objects: 100% (230/230), 152.31 KiB | 313.00 KiB/s, done.
Resolving deltas: 100% (121/121), done.
Cloning into '/home/amit/0myspace/ada/gitrepo/ada-awa/ada-security'...
remote: Enumerating objects: 50, done.
remote: Counting objects: 100% (50/50), done.
remote: Compressing objects: 100% (30/30), done.
remote: Total 2716 (delta 24), reused 40 (delta 20), pack-reused 2666
Receiving objects: 100% (2716/2716), 761.88 KiB | 525.00 KiB/s, done.
Resolving deltas: 100% (1854/1854), done.
Cloning into '/home/amit/0myspace/ada/gitrepo/ada-awa/ada-servlet'...
remote: Enumerating objects: 95, done.
remote: Counting objects: 100% (95/95), done.
remote: Compressing objects: 100% (50/50), done.
remote: Total 12036 (delta 49), reused 83 (delta 45), pack-reused 11941
Receiving objects: 100% (12036/12036), 9.12 MiB | 736.00 KiB/s, done.
Resolving deltas: 100% (8426/8426), done.
Cloning into '/home/amit/0myspace/ada/gitrepo/ada-awa/ada-util'...
remote: Enumerating objects: 9898, done.
remote: Total 9898 (delta 0), reused 0 (delta 0), pack-reused 9898
Receiving objects: 100% (9898/9898), 2.70 MiB | 99.00 KiB/s, done.
Resolving deltas: 100% (7228/7228), done.
Cloning into '/home/amit/0myspace/ada/gitrepo/ada-awa/ada-wiki'...
remote: Enumerating objects: 102, done.
remote: Counting objects: 100% (102/102), done.
remote: Compressing objects: 100% (66/66), done.
remote: Total 4231 (delta 40), reused 75 (delta 35), pack-reused 4129
Receiving objects: 100% (4231/4231), 836.94 KiB | 610.00 KiB/s, done.
Resolving deltas: 100% (2838/2838), done.
Cloning into '/home/amit/0myspace/ada/gitrepo/ada-awa/dynamo'...
remote: Enumerating objects: 27, done.
remote: Counting objects: 100% (27/27), done.
remote: Compressing objects: 100% (20/20), done.
remote: Total 9974 (delta 14), reused 14 (delta 7), pack-reused 9947
Receiving objects: 100% (9974/9974), 3.90 MiB | 924.00 KiB/s, done.
Resolving deltas: 100% (7189/7189), done.
Cloning into '/home/amit/0myspace/ada/gitrepo/ada-awa/swagger-ada'...
remote: Enumerating objects: 58, done.
remote: Counting objects: 100% (58/58), done.
remote: Compressing objects: 100% (37/37), done.
remote: Total 1249 (delta 29), reused 46 (delta 21), pack-reused 1191
Receiving objects: 100% (1249/1249), 21.17 MiB | 1001.00 KiB/s, done.
Resolving deltas: 100% (825/825), done.
Submodule path 'ada-ado': checked out '2c4b89d1ba8b7eabff63b090e4130f9cf759ae6c'
error: Server does not allow request for unadvertised object 138efbdc94982ed1f84c5e74ee03d71774d156d4
Fetched in submodule path 'ada-asf', but it did not contain 138efbdc94982ed1f84c5e74ee03d71774d156d4. Direct fetching of that commit failed.

$ cd ada-awa

$ ./configure --prefix=/usr
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking shared library support... no
checking distribution build... yes
checking coverage support... no
checking for gprbuild... gprbuild
checking for gprclean... gprclean
checking whether make sets $(MAKE)... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking for unzip... yes
checking for mysql... mysql
checking for sqlite3... sqlite3
checking for psql... psql
checking for msysinfo... no
checking number of processors... 4
checking XML/Ada... trying xmlada
checking whether xmlada project exists in gnatmake's search path... yes
checking Ada Web Server... trying aws
checking whether aws project exists in gnatmake's search path... yes
configure: creating ./config.status
config.status: creating Makefile

$ make
touch stamp-xmlada
touch stamp-aws
Configuring ==== ada-lzma ====

(cd /home/amit/0myspace/ada/gitrepo/ada-awa/ada-lzma && ./configure --prefix=/usr )
/bin/sh: ./configure: No such file or directory
Makefile:143: recipe for target 'stamp-configure' failed
make: *** [stamp-configure] Error 127

Think I have provided you enough information. If anything else required, please ask.

Database schema is broken for unit tests

The AWA framework has a testsuite which uses the database and exercises every AWA module.
The database schema is not generated correctly and the awa_audit_field table is not created at the proper place.
This impacts only unit tests.

ada.awa profile in the argo editor

I have added the awa profile into the argo editor and then restarted argo. When I went to create the models directory as per your video there was no datamodel stereo type. I've checked what I did is exactly the same as in your video and cannot figure out what went wrong.

./configure needs ada-wiki

./configure wants ada-wiki-1.0.0.tar.gz, which is not found in distrib dir. Should it be there, or should README be modified to let the user know ada-wiki must be compiled separately?

Blog post creation improvement

The blog post creation is not clear and could be improved by allowing to choose the article format (Markdown, Html, Dotclear) before creating the page and having the online editor.

The selection of the article format before the creation allows to have and use a better editor that targets the article format.

Do not use git:// protocol

Some submodules (e.g. the ada-ado submodule) use git:// instead of ssh:// or https://. The unauthenticated git protocol on port 9418 is no longer supported by GitHub.

No macOS support?

It would be nice to have macOS support as well. Is it on the cards? If there is a list of things that need to be in order for macOS builds to go through fine, I would be glad (as would others I'm sure) to try and help out.

Add command line support to register a new user

The AWA framework provides a set of commands for the server management (start, stop, setup, list).

A command to register a new user with an email address is useful to register users and disable signup.
In that case, only users that are registered by the sysadmin can access the web application.

Unable to configure on Windows

When running

./configure --prefix=/usr/local

On Windows 10 within msys2 I get the following:


configure: error: Building Ada EL requires the Ada Utility Library.
You should build and install the Ada Utility Library component.
It must be available and found by gprbuild.
This project was not found in the ADA_PROJECT_PATH environment variable.
This project was not found in ../utilada_base nor in ../ada-util-*.
The component is available at [email protected]:stcarrez/ada-util.git.
Please, download and configure Ada Utility Library.
The current configuration was using:
gprbuild
ADA_PROJECT_PATH=

configure: error: ./configure failed for ada-el


I would assume any interdependencies on the modules would have been handled so I am a little uncertain if this is the ada-util module or something else. Thank you very much!

Compilation errors building using Alire

What I did:

git clone --recurse-submodules https://github.com/stcarrez/ada-awa.git
cd ada-awa
alr build

On commit: dbbc6c6

Compilation errors:

awa-commands-migrate.adb:44:38: "Upgrade_List" not declared in "Databases"
awa-commands-migrate.adb:51:31: "Scan_Migration" not declared in "Databases"
awa-commands-migrate.adb:68:43: "MIGRATE_PATHS_CONFIG" not declared in "Configs"
awa-commands-migrate.adb:69:67: "MIGRATE_PATHS_CONFIG" not declared in "Configs"
awa-commands-migrate.adb:78:68: "Migrate_Paths_config" not declared in "Configs"
awa-commands-migrate.adb:80:10: invalid prefix in selected component "List"
awa-commands-migrate.adb:85:28: "Sort_Migration" not declared in "Databases"
awa-commands-migrate.adb:88:34: "Run_Migration" not declared in "Databases"
awa-commands-migrate.adb:97:34: "Prepare_Migration" not declared in "Databases"

   compilation of awa-commands-migrate.adb failed

gprbuild: *** compilation phase failed
error: Command ["gprbuild", "-s", "-j0", "-p", "-P", "/home/mgr/src/github/stcarrez/ada-awa/.alire/awa_blogs.gpr"] exited with code 4
error: Compilation failed.

ADO don't find db drivers on fedora

Hello,
I've installed AWA with Alire, but it seems Ado can't find dependencies for :

  • mysql/mariadb
  • mysqlite
  • postgres
  • openssl

I'm sure i've installed all the package needed and follow your instruction on your blog to make a test:

alr init demo
cd demo
alr with awa
alr with dynamo
alr with servletada_aws
alr build

alr exec -- dynamo create-project -l apache --web demo [email protected]
alr build

but when i start the server i still have :
Some internal error occurred: Exception ADO.CONFIGS.CONNECTION_ERROR: Database driver 'postgres' not found

Something i missed ??

Configuration to authenticate with GitHub is incomplete

The configuration to authenticate by using GitHub OAuth is incomplete.

The awa/config/users.xml configuration file is missing the following parameters:

  • github.request_url
  • github.scope
  • github.callback_url
  • github.issuer

Avoid using gnatprep for the configuration of mail factory

The AWA mail plugin is uses a factory whose implementation is generated by gnatprep.

This is nice but it requires running gnatprep before building the project.

By providing a factory ready to be used in a specific directory, we can eliminate this step.

Configure the authenticate methods during the web setup

The setup command provides a web setup for the AWA application and it must be improved:

  • we must be able to easily choose whether user registration is enabled/disabled,
  • we should choose the authenticate methods (Email, Google, Facebook, Twitter, Github, Gitlab, Yahoo!),
  • we should allow to enter the selected OAuth configuration.

Error with fresh install: wrong use of interface type in tagged conversion

Hi Stephane,

I trying to install AWA using Alire gut I got a compilation error.

Step to reproduce:

alr init --bin demo_awa
cd demo_awa
alr with awa
alr build

The trace of alr build is:

alr build
warn: Generating possibly incomplete environment because of missing dependencies
ⓘ gnat>=9: no build needed.
ⓘ Building demo_awa/demo_awa.gpr...
Compile
   [Ada]          el-expressions-nodes.adb
   [Ada]          util-properties-basic.adb
   [Ada]          util-properties-discrete.adb
   [Ada]          util-properties.adb
   [Ada]          util-properties-bundles.adb
   [Ada]          util-log-locations.adb
   [Ada]          util-log-appenders-rolling_files.adb
   [Ada]          util-log-appenders-files.adb
el-expressions-nodes.adb:517:61: error: wrong use of interface type in tagged conversion
el-expressions-nodes.adb:517:61: error: add 'Class to the target interface type

   compilation of el-expressions-nodes.adb failed

gprbuild: *** compilation phase failed
error: Command ["gprbuild", "-s", "-j0", "-p", "-P", "/workspaces/PhD_XP/alr_test/demo_awa/demo_awa.gpr"] exited with code 4
error: Compilation failed.

Am I the only one with this problem?

My setup:
I running the full GNAT environment into a Docker container (with VS Code docker dev tools).
I using a GNAT Pro 24.0

Add command line for database schema migration

With ADO 2.4, we will have the support for database schema migration and handle the upgrade of schema.

We can now have a command in the AWA library to help in the schema migration.

The command should be able to list the SQL files that must be executed without actually executing them.
It should also be able to run the migration scripts by its own.

Application name not recognized by some AWA commands

Several AWA commands can use the application name to execute the command on a specific application.
Giving the application name results in an error message.
The application name must be given with a initial '/' to be matched correctly which is strange.

Image module does not handle SVG correctly

If we upload an SVG image, the Image module fails to identify the dimension. We get can exception while parsing the output of convert. The thumbnail job fails and terminates with an error.

[2023-03-05 08:05:54] INFO  - AWA.Images.Module - : Dimension  --export-png= -  45.. 58
[2023-03-05 08:05:54] ERROR - AWA.Jobs.Services - : Exception when executing job AWA.IMAGES.MODULES.THUMBNAIL_JOB_DEFINITION.S_FACTORY
Exception when executing job AWA.IMAGES.MODULES.THUMBNAIL_JOB_DEFINITION.S_FACTORY
[2023-03-05 08:05:55] ERROR - AWA.Jobs.Services - : Exception:: Exception CONSTRAINT_ERROR: bad input for 'Value: "--e" at [/src/adafr/ada-france/bin/adafr-server]
0x1600e02 system__val_util__bad_value at ???
0x15fcfcc system__val_int__impl__scan_integer at ???
0x15fd055 system__val_int__impl__value_integer at ???
0x71b555 Awa.Images.Modules.Create_Thumbnail at awa-images-modules.adb:267
0x71cbbd Awa.Images.Modules.Build_Thumbnail at awa-images-modules.adb:306
0x71a331 Awa.Images.Modules.Do_Thumbnail_Job at awa-images-modules.adb:202
0x718a0e Awa.Images.Modules.Thumbnail_Worker at awa-images-modules.adb:53

Cannot use entity-permission for the url-policy

When we have an entity permission like:

  <entity-permission>
    <name>member-view</name>
    <entity-type>awa_workspace</entity-type>
    <description>Grant the member view </description>
    <sql>
       SELECT acl.id FROM awa_acl AS acl
            WHERE acl.entity_type = :entity_type
            AND acl.user_id = :user_id
            AND acl.entity_id = 1
            AND acl.permission = $permission[member-view]
    </sql>
  </entity-permission>

if we want to use the permission in an url-policy like:

  <url-policy>
    <permission>member-view</permission>
    <url-pattern>/members/admin/.*</url-pattern>
    <url-pattern>/members/.*</url-pattern>
  </url-policy>

then the entity-permission is always rejected because when we evaluate it there is no entity-id to evaluate and the permission controller immediately reject the permission even if the SQL query does not make reference to the entity-id.

If the SQL does not references the :entity_id parameter, then the controller should proceed and run the SQL query to check the permission (instead of rejecting without checking).

Error generated when a blog article makes a reference to a non existing image

If a blog article contains a reference to an image that is not found, the SQL query that is executed to retrieve the
information can return a NULL column and when this happens an error is raised.

When such error occurs, the rest of the blog article is not visible and we stop at the missing image.
We should better continue and skip the image (this is the behavior of other blog systems).

Invalid install instructions on wiki installation page

The wiki installation page https://github.com/stcarrez/ada-awa/wiki/Installation has the following instructions

git clone [email protected]:stcarrez/ada-awa.git ada-awa
cd ada-awa
./configure --with-git --prefix=$HOME/install-awa

This does not work. The --with-git option is not an available option for the configure script.

Instead I executed the following commands to install ada-awa

git clone --recursive [email protected]:stcarrez/ada-awa.git ada-awa
cd ada-awa
./configure --prefix=$HOME/install-awa

This does work. I was able to configure, build and install ada-awa.

getting started

Hello, i'm getting started on Linux platform (Centos 7) and after I build my web app "hello" when server run I've the 404 on http://localhost:8080/hello/index.html
The server log say:

INFO : Reading module configuration file setup.xml
INFO : Reading file setup.xml
ERROR: setup.xml: File 'setup.xml' does not exist.

[root@vmcentos7 hello]# bin/hello-server
INFO : Register bindings: http://java.sun.com/jsf/core
INFO : Register bindings: http://java.sun.com/jsf/html
INFO : Register bindings: http://java.sun.com/jstl/core
INFO : Register bindings: http://java.sun.com/jsf/facelets
INFO : Register bindings: http://code.google.com/p/ada-asf/util
INFO : Register bindings: http://code.google.com/p/ada-asf/ajax
INFO : Register bindings: http://code.google.com/p/ada-asf/widget
INFO : Register bean class ASF.Beans.Map_Bean
DEBUG: Add namespace fn:http://java.sun.com/jsp/jstl/functions
DEBUG: Adding config log4j.appender.console = Console
DEBUG: Adding config openid.provider.orange = http://openid.orange.fr
DEBUG: Adding config log4j.logger.ASF.Views.Nodes.Reader = INFO
DEBUG: Adding config google-plus.secret = PUT-HERE_GOOGLE-SECRET
DEBUG: Adding config google-plus.client_id = PUT-HERE-GOOGLE-CLIENT-ID.apps.googleusercontent.com
DEBUG: Adding config log4j.logger.ASF = DEBUG
DEBUG: Adding config dynamo_author = eqcola
DEBUG: Adding config log4j.logger.AWA.Modules = WARN
DEBUG: Adding config log4j.logger.AWA = DEBUG
DEBUG: Adding config log4j.appender.result = File
DEBUG: Adding config bundle.dir = bundles
DEBUG: Adding config dynamo_is_lib = FALSE
DEBUG: Adding config app_name = Null
DEBUG: Adding config log4j.appender.result.File = hello.log
DEBUG: Adding config openid.callback_url = http://localhost:8080/hello/auth/verify
DEBUG: Adding config dynamo_is_ado = FALSE
DEBUG: Adding config log4j.rootCategory = DEBUG,console,result
DEBUG: Adding config bundle.var.samplesMsg = samples
DEBUG: Adding config openid.provider.myopenid = http://www.myopenid.com/server
DEBUG: Adding config log4j.logger.Util.Log = WARN
DEBUG: Adding config counters.counter_limit = 10
DEBUG: Adding config contextPath = /hello
DEBUG: Adding config log4j.logger.Util.Serialize.IO = INFO
DEBUG: Adding config database = mysql://localhost:3306/hello?user=hello
DEBUG: Adding config dynamo_is_tool = FALSE
DEBUG: Adding config view.dir = web
DEBUG: Adding config facebook.secret = PUT-HERE-YOUR-FACEBOOK-API-SECRET
DEBUG: Adding config log4j.logger.Util = DEBUG
DEBUG: Adding config openid.realm = http://localhost:8080/hello/auth
DEBUG: Adding config app_search_dirs = .
DEBUG: Adding config log4j.logger.ADO.Databases = INFO
DEBUG: Adding config dynamo_license = apache
DEBUG: Adding config dynamo_is_gtk = FALSE
DEBUG: Adding config awa_dispatcher_count = 0
DEBUG: Adding config dynamo_author_email = [email protected]
DEBUG: Adding config log4j.appender.console.layout = level-message
DEBUG: Adding config openid.provider.yahoo = http://open.login.yahooapis.com/openid20/www.yahoo.com/xrds
DEBUG: Adding config facebook.scope = email
DEBUG: Adding config web.dir = web
DEBUG: Adding config view.escape_unknown_tags = true
DEBUG: Adding config counters.counter_age_limit = 1
DEBUG: Adding config app.modules.dir = config
DEBUG: Adding config log4j.logger.Util.Serialize.Mappers = WARN
DEBUG: Adding config view.debug = true
DEBUG: Adding config dynamo_is_web = TRUE
DEBUG: Adding config view.ext = .html
DEBUG: Adding config openid.provider.google = https://www.google.com/accounts/o8/id
DEBUG: Adding config view.ignore_spaces = false
DEBUG: Adding config log4j.logger.log = WARN
DEBUG: Adding config facebook.client_id = PUT-HERE-YOUR-FACEBOOK-CLIENT-ID
DEBUG: Adding config app.config = awa.xml
DEBUG: Adding config log4j.logger.Util.Properties = DEBUG
DEBUG: Adding config log4j.appender.console.level = DEBUG
DEBUG: Adding config user.auth-filter.redirect = /hello/auth/login.html
DEBUG: Adding config app_url_base = http://localhost:8080
DEBUG: Adding config log4j.logger.AWA.Applications.Configs = WARN
INFO : Set facelet search directory to: 'web'
INFO : Initialize bundle factory to load from bundles
INFO : Register bean 'samplesMsg' in scope
INFO : Using page /setup/install.html for http error 404
INFO : Add servlet 'redirect'
INFO : Add servlet 'faces'
INFO : Add servlet 'files'
INFO : File servlet using directory 'web'
INFO : Add servlet mapping .html -> redirect
INFO : Adding route .html
INFO : Add servlet mapping /setup/
.html -> faces
INFO : Adding route /setup/
.html
INFO : Add servlet mapping *.css -> files
INFO : Adding route *.css
INFO : Add servlet mapping *.js -> files
INFO : Adding route *.js
INFO : Add servlet mapping *.png -> files
INFO : Adding route *.png
INFO : Register bindings: http://code.google.com/p/ada-awa/jsf
DEBUG: Add namespace fn:http://java.sun.com/jsp/jstl/functions
INFO : Reading module configuration file setup.xml
INFO : Reading file setup.xml
ERROR: setup.xml: File 'setup.xml' does not exist.
INFO : Get driver mysql
INFO : Register driver mysql
INFO : Register driver sqlite
INFO : Set connection URI: mysql://localhost:3306/hello?user=hello
`

Thanks in advance.
Regards

facebook and google authentication (suggestion)

There appear to be some barriers appearing like mandatory https and a privacy policy URL (at least for facebook but we can expect Google to follow suit), for OAUTH authentication. Perhaps it is useful to include this as part of the project.

The AWA redirect cookie is not removed

Sometimes AWA set the cookie RURL to remember a redirection page when a user accesses a page that requires authentication. The cookie is not removed after the redirection.

Configuration to authenticate with Gitlab is incomplete

The awa/config/users.xml configuration file is missing some correct setup for the OAuth configuration to authenticate with Gitlab.

The following configurations are missing:

  • gitlab.request_url
  • gitlab.scope
  • gitlab.callback_url
  • gitlab.issuer

Docker build fails in current checkout

I attempted a Docker build using ada-awa/docker/Dockerfile.

The commands I issued were

$ cd ada-awa/docker
$ sudo docker build -t ada-awa .

Here is the output showing the build error

.
.
.
awa-events-models.ads:37:06: file "ado-audits.ads" not found
awa-events-models.ads:37:06: "AWA.EVENTS.MODELS (body)" depends on "AWA.EVENTS.MODELS (spec)"
awa-events-models.ads:37:06: "AWA.EVENTS.MODELS (spec)" depends on "AWA.USERS.MODELS (spec)"
awa-events-models.ads:37:06: "AWA.USERS.MODELS (spec)" depends on "ADO.AUDITS (spec)"
awa-audits-models.ads:34:06: file "ado-audits.ads" not found
awa-audits-models.ads:34:06: "AWA.AUDITS.MODELS (body)" depends on "AWA.AUDITS.MODELS (spec)"
awa-audits-models.ads:34:06: "AWA.AUDITS.MODELS (spec)" depends on "AWA.USERS.MODELS (spec)"
awa-audits-models.ads:34:06: "AWA.USERS.MODELS (spec)" depends on "ADO.AUDITS (spec)"
awa-oauth-models.ads:34:06: file "ado-audits.ads" not found
awa-oauth-models.ads:34:06: "AWA.OAUTH.MODELS (body)" depends on "AWA.OAUTH.MODELS (spec)"
awa-oauth-models.ads:34:06: "AWA.OAUTH.MODELS (spec)" depends on "AWA.USERS.MODELS (spec)"
awa-oauth-models.ads:34:06: "AWA.USERS.MODELS (spec)" depends on "ADO.AUDITS (spec)"

   compilation of awa-oauth-models.adb failed
   compilation of awa-audits-models.adb failed
   compilation of awa-events-models.adb failed

gprbuild: *** compilation phase failed
rules.mk:108: recipe for target 'local-build' failed
make[1]: *** [local-build] Error 4
Makefile:119: recipe for target 'build' failed
make: *** [build] Error 2
The command '/bin/sh -c mkdir -p /usr/src    && cd /usr/src    && git clone https://github.com/stcarrez/ada-awa.git ada-awa    && cd ada-awa    && git submodule init    && git submodule update    && ./confi
sable-shared --prefix=/usr    && make -s    && make -s install' returned a non-zero code: 2

It seems that the submodule ada-ado (and others) are not to the latest version. ado-audits.ads is a relatively new file which is not in the version that is checked out (by the git submodule update command) in the ada-ado submodule.

If the intent of the Dockerfile is to build with the latest source in all submodules then a possible fix is to add --recursive --remote to the git submodule update command in Dockerfile.

That is, in Dockerfile replace
&& git submodule update
with
&& git submodule update --recursive --remote

If the intent of the Dockerfile is to build with the current commited submodules then a process needs to be put in place to insure that submodules are committed in the main project whenever the main project is dependent on a submodule change.

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.