Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move to Axum and feature expansion #7

Closed
wants to merge 16 commits into from

Conversation

archification
Copy link
Contributor

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.

@archification
Copy link
Contributor Author

Closing the PR. There were too many changes here.
Will submit another PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant