0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
MyWeb is a simple web application for managing blog posts, media files, and animations.
It is built with Go and uses a bbolt + storm database for dynamic content.
- Blogs - A page for looking at blog descriptions to navigate to the full blog post.
- Media - Upload media files and automatically convert them to webp if possible.
- Animations - A page for displaying pictures and videos with short descriptions.
- Manage - A page for managing blog posts, media files, and animations.
- Use a reverse proxy such as [Caddy](https://caddyserver.com/) to serve the application.
- Only listen on 127.0.0.1 or a local network address.
- Use a firewall to block all incoming traffic except for the reverse proxy.
1. Set up configuration:
- Edit the webhome/myweb.conf file.
- Set the URL, maintainer name, and email.
- Set the listen ip or port if needed.
```sh
nano webhome/myweb.conf
```
2. Make a bcrypt password for the admin user:
- Run the following command to create a password hash.
- Replace "username" and "password" with your desired admin username and password.
```sh
name="username" \
pass="password" \
caddy hash-password --plaintext="$name:$pass" > webhome/userpass
```
- You can also use another implementation of bcrypt to create the password hash.
- Format the file as `hash` where hash is the hash of the string "username:password".
3. Copy the webhome directory to your http user directory:
```sh
sudo cp -r ./webhome ~httpuser/
sudo chown httpuser ~httpuser/webhome
```
4. Build the application:
```sh
go build -ldflags="-w -s" -trimpath -o build/
```
5. Install the application:
```sh
sudo install ./build/myweb /usr/local/bin/myweb
```
1. Edit the service file:
- Edit the `myweb.service` file.
- Change the User to the user that your web server runs as.
- Change the WorkingDirectory to the directory where you copied the webhome directory.
- Change the ExecStart to the path where you installed the application if different.
2. Install the systemd service:
```sh
sudo install ./myweb.service /etc/systemd/system/myweb.service
sudo systemctl daemon-reload
```
3. Start the service:
```sh
sudo systemctl start myweb
sudo systemctl enable myweb
sudo systemctl status myweb
```
```sh
myweb /path/to/myweb.conf
```
1. Log in to the manage page:
- Go to the manage page at `/manage/`.
- Log in with the username and password you created earlier.
- Select management options from the menu.
This project is licensed under the MIT License.