Skip to content

Commit b5b3deb

Browse files
committed
v0.1.6
**Changes** - Fix index template permissions - Add simple error pages for 401, 403, 404 and 500 - Project renamed to apache-fancy-pages
1 parent 9a88025 commit b5b3deb

File tree

16 files changed

+631
-128
lines changed

16 files changed

+631
-128
lines changed

README.md

Lines changed: 37 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
1-
# apache-fancy-index
1+
# apache-fancy-pages
22

3-
> Modern drop in replacement for default Apache index page.
3+
> Modern drop in replacement for default Apache index/error pages.
44
55
```
6-
___ ___ _
7-
| __|_ _ _ _ __ _ _|_ _|_ _ __| |_____ __
8-
| _/ _` | ' \/ _| || || || ' \/ _` / -_) \ /
9-
|_|\__,_|_||_\__|\_, |___|_||_\__,_\___/_\_\
10-
|__/
6+
___ ___
7+
| __|_ _ _ _ __ _ _| _ \__ _ __ _ ___ ___
8+
| _/ _` | ' \/ _| || | _/ _` / _` / -_|_-<
9+
|_|\__,_|_||_\__|\_, |_| \__,_\__, \___/__/
10+
|__/ |___/
1111
1212
```
1313

1414
![preview_dark](/screenshots/after_dark.png)
15+
![preview_401](/screenshots/401_dark.png)
1516

1617

1718
## Features
1819
- Responsive design
1920
- Breadcrumb navigation
2021
- Search/Filter results
21-
- Light/Dark theme based on user prefered color scheme
22+
- Light/Dark theme based on user prefered color scheme
23+
- Replacement for default error pages: 401, 403, 404, 500
2224

2325
## Requirements
2426
- Apache >= 2.4
@@ -34,14 +36,14 @@
3436

3537
```.language-bash
3638
apt-get update
37-
apt-get install apache-fancy-index
39+
apt-get install apache-fancy-pages
3840
```
3941
4042
Alternatively, you can download the latest `.deb` package from release tags and install it using `dpkg -i`:
4143
4244
- Enable fancy-index conf:
4345
44-
The `fancy-index.conf` contains an alias for url `/fancy-index` to serve template, style, script and icons files. Enable this conf to set *apache-fancy-index* enabled everywhere `Options Indexes` is enabled.
46+
The `fancy-index.conf` contains an alias for url `/fancy-pages` to serve template, style, script and icons files. Enable this conf to set *fancy-index* enabled everywhere `Options Indexes` is enabled.
4547
4648
```
4749
a2enconf fancy-index
@@ -51,25 +53,38 @@
5153
Voila!
5254
5355
54-
### Other distros/manual install
56+
- Setup fancy-index tests:
57+
58+
You can enable the `fancy-index-tests` conf to test index with fake content. The `tests` directory contain empty files with various extensions.
5559
56-
1. Clone this repo on github (could be ***not*** up to date with the latest build).
60+
```
61+
a2enconf fancy-index-tests
62+
systemctl reload apache2
63+
```
5764
58-
2. Copy content of the folder `/assets/` to `/usr/share/apache-fancy-index`. Adjust permissions to be readable by web server.
65+
`Tests` directory is then available to the following url: `EXAMPLE.COM/fancy-index-tests/`.
5966
60-
3. Copy the files in `/conf/` to apache conf available directory (debian `/etc/apache2/conf-available`)
6167
62-
4. Enable conf and restart Apache.
68+
- Enable fancy-error conf:
6369
70+
The `fancy-error.conf` contains an alias for url `/fancy-error` to serve templates on error and prevent them to be directly requested.
71+
72+
```
73+
a2enconf fancy-error
74+
systemctl reload apache2
75+
```
6476
77+
Voila!
6578
66-
## Setup tests directory
6779
68-
You can enable the `fancy-index-tests` conf to test index with fake content. The `tests` directory contain empty files with various extensions.
80+
### Other distros/manual install
81+
82+
1. Clone this repo on github (could be ***not*** up to date with the latest build).
83+
84+
2. Copy content of the folder `/assets/` to `/usr/share/apache-fancy-pages`. Adjust permissions to be readable by web server.
85+
86+
3. Copy the files in `/conf/` to apache conf available directory (in debian `/etc/apache2/conf-available`)
87+
88+
4. Enable conf and restart Apache.
6989
70-
```
71-
a2enconf fancy-index-tests
72-
systemctl reload apache2
73-
```
7490
75-
`Tests` directory is then available to the following url: `EXAMPLE.COM/fancy-index-tests/`.

assets/FOOTER.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
</section>
44
<footer id="section-footer">
55
<div class="row">
6-
<p>Apache Fancy Index v0.1.5 | © 2021 Christophe Buliard | <a target="_blank" href="https://github.com/kristuff/apache-fancy-index" rel="no-referer">Source code</a> </p>
6+
<p>Apache Fancy Pages v0.1.6 | © 2021 Christophe Buliard | <a target="_blank" href="https://github.com/kristuff/apache-fancy-pages" rel="no-referer">Source code</a> </p>
77
</div>
88
</footer>
9-
<script src="/fancy-index/js/script.js"></script>
9+
<script src="/fancy-pages/js/script.js"></script>
1010
</body>
1111
</html>

assets/HEADER.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<meta http-equiv="X-UA-Compatible" content="IE=edge">
66
<meta name="viewport" content="width=device-width, initial-scale=1.0">
77
<title></title>
8-
<link rel="stylesheet" type="text/css" href="/fancy-index/css/style.css">
8+
<link rel="stylesheet" type="text/css" href="/fancy-pages/css/style.css">
99
</head>
1010
<body>
1111
<header id="section-header">

assets/css/style.css

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/**
2-
* ___ ___ _
3-
* | __|_ _ _ _ __ _ _|_ _|_ _ __| |_____ __
4-
* | _/ _` | ' \/ _| || || || ' \/ _` / -_) \ /
5-
* |_|\__,_|_||_\__|\_, |___|_||_\__,_\___/_\_\
6-
* |__/
2+
* ___ ___
3+
* | __|_ _ _ _ __ _ _| _ \__ _ __ _ ___ ___
4+
* | _/ _` | ' \/ _| || | _/ _` / _` / -_|_-<
5+
* |_|\__,_|_||_\__|\_, |_| \__,_\__, \___/__/
6+
* |__/ |___/
77
*
8-
* This file is part of kristuff/apache-fancy-index.
9-
* Version 0.1.5 - Copyright (c) 2021 Kristuff <[email protected]>
8+
* This file is part of kristuff/apache-fancy-pages.
9+
* Version 0.1.6 - Copyright (c) 2021 Kristuff <[email protected]>
1010
*
1111
* For the full copyright and license information, please view the LICENSE
1212
* file that was distributed with this source code.

assets/error/401.html

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<meta content="width=device-width, initial-scale=1, maximum-scale=1" name="viewport">
7+
<title>Unauthorized (401)</title>
8+
<link rel="stylesheet" type="text/css" href="/fancy-pages/css/style.css">
9+
<style>
10+
11+
:root {
12+
--color-bg: #eee;
13+
--color-highlight: #000000;
14+
--color-text: #404040;
15+
--color-border:#bbbbbb;
16+
}
17+
@media (prefers-color-scheme: dark) {
18+
:root {
19+
--color-bg:#1f242b;
20+
--color-highlight: #ffffff;
21+
--color-text: #bbb;
22+
--color-border:#2b323b;
23+
}
24+
* {
25+
scrollbar-color:#313137 #171b20;
26+
}
27+
}
28+
29+
*,
30+
*::after,
31+
*::before {
32+
box-sizing: border-box;
33+
}
34+
35+
html {
36+
line-height: 1.15;
37+
-webkit-text-size-adjust: 100%;
38+
}
39+
40+
body {
41+
margin: 0;
42+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
43+
font-weight: 400;
44+
color: #666;
45+
color: var(--color-text);
46+
background-color:#fff;
47+
background-color: var(--color-bg);
48+
font-size: 15px;
49+
}
50+
51+
h1 {
52+
margin-top: 0;
53+
font-size: 36px;
54+
font-weight: normal;
55+
color: var(--color-highlight);
56+
font-weight:300;
57+
}
58+
59+
.emoj {
60+
font-size: 70px;
61+
margin-right: 25px;
62+
}
63+
64+
p {
65+
font-size: 18px;
66+
color: var(--color-text);
67+
line-height: 1.2em;
68+
font-weight:300;
69+
}
70+
71+
h3 {
72+
color: var(--color-text);
73+
font-size: 22px;
74+
font-weight: normal;
75+
line-height: 28px;
76+
font-weight:300;
77+
}
78+
79+
hr {
80+
max-width: 800px;
81+
margin: 18px auto;
82+
border: 0;
83+
border-bottom: 1px solid var(--color-border);
84+
}
85+
86+
.container {
87+
margin: auto;
88+
text-align: center;
89+
display: flex;
90+
flex-wrap: wrap;
91+
height: 100vh;
92+
width: 100%;
93+
align-items: center;
94+
}
95+
.content {
96+
margin: auto;
97+
width: 100%;
98+
padding: 10px;
99+
max-width: 560px;
100+
text-align: left;
101+
}
102+
103+
</style>
104+
</head>
105+
106+
<body>
107+
<div class="container">
108+
<div class="content">
109+
<h1><span class="emoj">:(</span>401 Unauthorized</h3>
110+
<hr/>
111+
<h3>This server could not verify that you are authorized to access the document requested. Either you supplied the wrong credentials (e.g., bad password), or your browser doesn't understand how to supply the credentials required.</h3>
112+
</div>
113+
</div>
114+
</body>
115+
</html>

assets/error/403.html

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<meta content="width=device-width, initial-scale=1, maximum-scale=1" name="viewport">
7+
<title>Forbidden (403)</title>
8+
<style>
9+
10+
:root {
11+
--color-bg: #eee;
12+
--color-highlight: #000000;
13+
--color-text: #404040;
14+
--color-border:#bbbbbb;
15+
}
16+
@media (prefers-color-scheme: dark) {
17+
:root {
18+
--color-bg:#1f242b;
19+
--color-highlight: #ffffff;
20+
--color-text: #bbb;
21+
--color-border:#2b323b;
22+
}
23+
* {
24+
scrollbar-color:#313137 #171b20;
25+
}
26+
}
27+
28+
*,
29+
*::after,
30+
*::before {
31+
box-sizing: border-box;
32+
}
33+
34+
html {
35+
line-height: 1.15;
36+
-webkit-text-size-adjust: 100%;
37+
}
38+
39+
body {
40+
margin: 0;
41+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
42+
font-weight: 400;
43+
color: #666;
44+
color: var(--color-text);
45+
background-color:#fff;
46+
background-color: var(--color-bg);
47+
font-size: 15px;
48+
}
49+
50+
h1 {
51+
margin-top: 0;
52+
font-size: 36px;
53+
font-weight: normal;
54+
color: var(--color-highlight);
55+
font-weight:300;
56+
}
57+
58+
.emoj {
59+
font-size: 70px;
60+
margin-right: 25px;
61+
}
62+
63+
p {
64+
font-size: 18px;
65+
color: var(--color-text);
66+
line-height: 1.2em;
67+
font-weight:300;
68+
}
69+
70+
h3 {
71+
color: var(--color-text);
72+
font-size: 22px;
73+
font-weight: normal;
74+
line-height: 28px;
75+
font-weight:300;
76+
}
77+
78+
hr {
79+
max-width: 800px;
80+
margin: 18px auto;
81+
border: 0;
82+
border-bottom: 1px solid var(--color-border);
83+
}
84+
85+
.container {
86+
margin: auto;
87+
text-align: center;
88+
display: flex;
89+
flex-wrap: wrap;
90+
height: 100vh;
91+
width: 100%;
92+
align-items: center;
93+
}
94+
.content {
95+
margin: auto;
96+
width: 100%;
97+
padding: 10px;
98+
max-width: 400px;
99+
text-align: left;
100+
}
101+
102+
</style>
103+
</head>
104+
105+
<body>
106+
<div class="container">
107+
<div class="content">
108+
<h1><span class="emoj">:(</span>403 Forbidden</h3>
109+
<hr/>
110+
<h3>You don't have permission to access this resource.</h3>
111+
</div>
112+
</div>
113+
</body>
114+
</html>

0 commit comments

Comments
 (0)