mirror of
https://github.com/clowzed/sero
synced 2024-06-16 05:15:04 +02:00
implemented clean urls
This commit is contained in:
parent
4d7c7468dc
commit
405f8ad6fa
|
@ -73,6 +73,7 @@ One key feature that it is self-hosted. This gives users more flexibility and co
|
||||||
- Easy upload with cli tool
|
- Easy upload with cli tool
|
||||||
- Custom 404.html `(on 404 status user will see your 404.html)`
|
- Custom 404.html `(on 404 status user will see your 404.html)`
|
||||||
- Custom 503.html `new` `(on disabled site)`
|
- Custom 503.html `new` `(on disabled site)`
|
||||||
|
- Clean urls
|
||||||
|
|
||||||
## 🔌 Built With
|
## 🔌 Built With
|
||||||
- `Rust`
|
- `Rust`
|
||||||
|
@ -121,7 +122,7 @@ Simply open a [docker-compose.yml](https://github.com/clowzed/sero/blob/master/d
|
||||||
|
|
||||||
2. Configure desired limits if you want (you can skip this)
|
2. Configure desired limits if you want (you can skip this)
|
||||||
|
|
||||||
| environment variable | description | already setted |
|
| environment variable | description | already set |
|
||||||
|----------------------|----------------------------------------------------|-----------------|
|
|----------------------|----------------------------------------------------|-----------------|
|
||||||
| MAX_USERS | Maximum amount of users to be registered | 1 |
|
| MAX_USERS | Maximum amount of users to be registered | 1 |
|
||||||
| MAX_SITES_PER_USER | Maximum amount of sites which each user can upload | 100 |
|
| MAX_SITES_PER_USER | Maximum amount of sites which each user can upload | 100 |
|
||||||
|
|
|
@ -138,6 +138,17 @@ impl SitesService {
|
||||||
path: String,
|
path: String,
|
||||||
connection: &T,
|
connection: &T,
|
||||||
) -> Result<Option<(bool, std::path::PathBuf)>, SiteServiceError> {
|
) -> Result<Option<(bool, std::path::PathBuf)>, SiteServiceError> {
|
||||||
|
let parsed_path = PathBuf::from(&path);
|
||||||
|
|
||||||
|
let path = match parsed_path.extension() {
|
||||||
|
Some(_) => path,
|
||||||
|
None => parsed_path
|
||||||
|
.with_extension("html")
|
||||||
|
.to_str()
|
||||||
|
.unwrap_or_default()
|
||||||
|
.to_string(),
|
||||||
|
};
|
||||||
|
|
||||||
let files = subdomain
|
let files = subdomain
|
||||||
.find_related(FileEntity)
|
.find_related(FileEntity)
|
||||||
.filter(FileColumn::UserPath.is_in([&path, "404.html"]))
|
.filter(FileColumn::UserPath.is_in([&path, "404.html"]))
|
||||||
|
|
Loading…
Reference in a new issue