MyWeb
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.
Features
- 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.
Recommendations
- Use a reverse proxy such as Caddy 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.
Installation
Set up configuration:
Edit the webhome/myweb.conf file.
Set the URL, maintainer name, and email.
Set the listen ip or port if needed.
nano webhome/myweb.conf
- 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”.
Copy the webhome directory to your http user directory:
# Copy files to http user directory. Use the actual user name for httpuser on your system. sudo cp -r ./webhome ~httpuser/ # Change the owner of directory only, so the server can create new files. sudo chown httpuser ~httpuser/webhome
- Build the application:
sh go build -ldflags="-w -s" -trimpath -o build/
- Build the application:
Install the application:
sudo install ./build/myweb /usr/local/bin/myweb
Systemd Service
- 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.
- Install the systemd service:
sh sudo install ./myweb.service /etc/systemd/system/myweb.service sudo systemctl daemon-reload
Start the service:
sudo systemctl start myweb sudo systemctl enable myweb sudo systemctl status myweb
Run from Command Line
myweb /path/to/myweb.conf
Manage Content
- 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.
- Go to the manage page at
License
This project is licensed under the MIT License.