Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We moved away from Rocket to Axum.
Files are embedded within the binary at compile time. If the program is run and there is no config.toml file present, it will prompt the user if they would like to generate files. This will create a default config.toml file, unarchive all images of Chase, create directories, create a home.html and error.html, all in the right places. Then the program can be run again which will actually start the server.
New images can be placed in public/chase and the server will begin serving them without any additional attention.
The media paths within the config.toml file can be either absolute or relative. This allows the server to safely pull media from any directory on the whole machine.
SSL can be enabled within the config.toml file. If it is enabled, ensure that the key and cert files are in the correct position. A path to each of these files can be configured in the config.toml file.
Directory structure of assets has been maintained.
All output is colorized for readability. This is done by using the functions located in src/solarized. The clear function is also located here.
I don't have very much experience with docker at all and I've left the docker files untouched as a result. Everything should compile and function normally without docker on it's own and I'll leave the docker configuration up to you if any is needed.
Files that are embedded in the binary are listed in constants.rs and are generated with generate.rs. Keep in mind that the images are embedded by way of the chase.zip file. If needed, remove chase.zip and make a new one or simply add new images to the existing chase.zip.
The logic for inserting tags for media files into html can be found in media.rs. Some functions used in this file are defined in utils.rs.
The logic for reading the configuration file are stored in config.rs. As config.rs can define ip, port, ssl enabling, and routes, functions in this file are used by both routes.rs and main.rs.