~jan0sch/smederee

Summary: Smederee (low german: forge/smithy) - A frugal platform which is dedicated to help people build great software together.

Latest changes

2023-03-20 (Mon), 8:11 AM - Jens Grassel - 38f99902c1056d24cd1d3166943a694679d114aa

Code Cleanup

- remove unused imports
- remove unused variables
2023-03-19 (Sun), 1:11 PM - Jens Grassel - 252c14a83f46a13760979e5af3a79fb46772670a

Refactoring: Heavy Refactoring to move tickets into separate module.

This patch is _huge_ and breaks out the already implemented tickets features
(labels and milestones) into a separate module. Very likely the ticketing
will move into a service of its own so this will ease things further down
the road. But yes, it has complicated things now. ;-)

BREAKING CHANGES
----------------

- mod...

Clone this repository

Smederee (low german: forge/smithy)

A frugal platform which is dedicated to help people build great software together.

License

This code is licensed under the GNU Affero General Public License 3.0 or later, see the LICENSE file for details.

System requirements

  • Java 17 (or higher)
  • PostgreSQL 13 (or higher)
    • The time zone of the DBMS is expected to be set to Etc/UTC!
  • Darcs
  • colordiff (for coloured diffs)

Developer guide

For development and testing you need to install sbt. Please see CONTRIBUTING.md for details how to to contribute to the project.

During development you can start (and restart) the application via the reStart sbt task provided by the sbt-revolver plugin.

Cloning via ssh has the following constraints currently:

  1. An RSA key is required!
  2. A custom port is used!
  3. Problems with newer SSH implementations due to changed scp!

Using a custom ssh port

To make darcs use the custom port either set the SSH_PORT environment variable (SSH_PORT=30983 darcs clone ...) or configure your ssh client accordingly in ~/.ssh/config. Something like this should be sufficient:

# Only use configured identities even if there are more available.
IdentitiesOnly yes
IdentityFile ~/.ssh/id_ed25519

Host darcs.smeder.ee
  IdentityFile ~/.ssh/id_rsa
  Port 30983
  User darcs

With such a configuration you should be able to use darcs clone etc. without having to set the environment variable.

Fixing problems with scp

On some systems the scp command will use sftp internally which will cause operations to break because we currently do not have a working SFTP repository access layer. But you can circumvent the issue by providing a flag (custom scp command to darcs) by using the DARCS_SCP environment variable:

% DARCS_SCP="scp -O" SSH_PORT=30983 darcs clone ...

Protecting endpoints

If an endpoint is intended to be used only by guests (users that are not logged in) then it should be implemented two times:

  1. a regular endpoint (HttpRoutes) with the intended implementation
  2. a protected endpoint (AuthedRoutes) with:
    • a simple redirect (SeeOther) or error page
    • put within a middleware with fall through

Tests

Tests are included in the project. You can run them via the appropriate sbt tasks test and IntegrationTest/test. The latter will execute the integration tests. Be aware that the integration tests might need a working database.

Deployment guide

Please ensure that the system requirements are met and that you have the credentials needed to access the database.

Database setup

The application uses schemas which may reside in a single database or not but it is important that the configured database users have all necessary permissions on that schemas. This can be achieved in a multitude of ways:

  1. The schema is created beforehand by the administrator with the correct owner, for example: CREATE SCHEMA "hub" AUTHORIZATION smederee_hub;
  2. The database is owned by the user and the schema will be created on the first application start automatically.

Please note that different users (modules) sharing the same database (which is possible due to the schema separation) need CONNECT and CREATE permissions on the database.

GRANT CONNECT, CREATE ON DATABASE <database name> TO <role name>;

TODO

Coloured diffs

  1. Install colordiff
  2. Configure the $SMEDEREE_USER/.darcs/defaults file to contain the following line:
    diff diff-command colordiff -rN -u %1 %2