summaryrefslogtreecommitdiff
path: root/main.go
AgeCommit message (Collapse)Author
2024-05-04Add explicit startup / shutdown log messagesxengineering
This makes it easier to read the logs and follows the pattern to move log messages more to the main() function instead of spreading them accross the whole code base.
2024-05-04model: Add storage.Exists() and storage.Create()xengineering
These new methods provide essential functionality related to the storage folder.
2024-05-04model: Introduce type Storagexengineering
This new type definition will make it easier to handle the storage directory of Ceres and related functionality which can be implemented with methods.
2024-05-01Make build-time version information mandatoryxengineering
This ensures that Ceres is never executed without Git version information. This removes the requirement to check for this on every use. To ensure the server does not work with an incompatible storage directory it is in every case needed to know the exact version of the running executable.
2024-05-01Add --config flagxengineering
This re-enables config file support.
2024-05-01Do not remove storage folderxengineering
This is not useful in production. Furthermore in the debug use case the default storage path is now ./storage which can easily be removed by `rm -rf storage`. This also allows to not remove the storage folder for further analysis of the storage folder.
2024-05-01Use default storage path instead of temp dirxengineering
2024-05-01Use default config for HTTP addressxengineering
2024-05-01model: Add version.txt file to storage folderxengineering
This prepares the ability to check for compatibility between a Ceres executable build and an existing storage folder.
2024-05-01view: Add /version endpointxengineering
This allows to get the server version via HTTP. The output of `git describe --dirty --always` and a line break is returned together with HTTP 200. If the server build contains no version information an error message and HTTP 404 is returned.
2024-05-01Add --version flagxengineering
This allows to identify the version of a Ceres executable build.
2024-04-30Add command line help pagexengineering
This is expected functionality for a command line application.
2024-03-04model: Create test data with Go instead of SQLxengineering
This allows to formulate the test data with an object-based model which is easier than writing it down in a relational model.
2024-03-03controller: Provide recipe create via HTTPxengineering
2024-03-03Add ID to URL in recipe updatesxengineering
This makes the update URL more consistent with the other ones. A check ensures consistency of the URL and JSON ID values.
2024-03-03view: Add 'Read' suffix to function namesxengineering
This reflects that these HTTP handler functions implement one of the four CRUD methods create, read update and delete.
2024-03-03controller: Provide recipe deletion via HTTPxengineering
2024-03-03view: Send forms as JSON with JavaScriptxengineering
While forms can be send without JavaScript this new approach has the benefit that the whole data is send as one JSON. This JSON format can also be used for an API or testing.
2024-03-03controller: Update recipe based on JSONxengineering
2024-02-15view: Add HTTP 204 handler for /favicon.icoxengineering
Otherwise e.g. the Firefox browser throws an error on the console.
2024-02-15view: Add index handlerxengineering
2024-02-13view: Implement GET handler for model.Recipexengineering
2024-02-13view: Implement GET handler for model.Recipesxengineering
2023-12-27Provide CSS via HTTP serverxengineering
This is a simple first HTTP handler and is required to display the website with the intended design.
2023-12-27Add HTTP server without handlersxengineering
This adds the infrastructure to add HTTP handlers. It already sets up the HTTP server and makes sure it is started and stopped.
2023-12-27Shutdown only on OS signalxengineering
This is the intended behaviour for production and also for debugging to at least inspect the data directory of Ceres.
2023-12-27model: Implement database connectionxengineering
The already implemented storage folder should contain a sqlite database to store most parts of the Ceres user data.
2023-12-27model: Implement temporary storage directoryxengineering
This temporary directory is provided to store the user data for the Ceres recipe server during development and testing.
2023-09-17Remove complete implementationxengineering
Restarting from scratch seems to be the fastest approach to switch to sqlite and get rid of some other structural mistakes from the past.
2023-04-13Automate /var/lib/ceres creationxengineering
That way only the system user setup and ownership change has to be done by the packager / installer.
2023-04-02Switch from MariaDB to filesxengineering
Using a database is way more complex (see the commit statistics of this commit) than using files to store recipe data. Also administration and usage is simpler.
2023-02-12Centralize templatingxengineering
This makes templating easier and allows to use partial templates.
2023-02-11Apply go fmt *.goxengineering
This auto-applies the recommended Go codestyle.
2023-02-11Move shutdown code to main.goxengineering
This has nothing to do with the database. Because the db is now a global pointer the shutdown code can live in main.go.
2023-02-11Rework loggingxengineering
Logging during a request is at the moment not really needed. Printing the config to the log was a stupid idea too.
2023-02-11Switch to global database pointerxengineering
Passing the database pointer around is a lot of text and has no benefit.
2023-02-11Switch webserver to global config structxengineering
2023-02-11Migrate database to global config structxengineering
2023-02-11Remove obvious comments from main.goxengineering
2023-02-09Make config a global structxengineering
Passing the config completly or just partial around via function arguments creates a lot of noice and does not have benefits. The only downside is that it is possible to write the config after initialization but it is realistic that this can be avoided.
2023-02-09Split setupRoutes() and runServer()xengineering
2023-02-08Move all sources to package mainxengineering
This project is not so big that it needs multiple packages.
2022-11-11Remove systemd related partsxengineering
This repository is just about the generic source code. Adapting it to a certain Linux distribution which might be systemd based is up to a packaging repository.
2022-11-07Add existing workxengineering