sophuwu.site > myweb
personal website in go to show blogs and art
Clone this repository git clone https://sophuwu.site/myweb

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

Recommendations

Installation

  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.

      nano webhome/myweb.conf
      
      1. 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”.

  2. 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
    
    1. Build the application: sh go build -ldflags="-w -s" -trimpath -o build/
  3. Install the application:

    sudo install ./build/myweb /usr/local/bin/myweb
    

    Systemd Service

    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.
    1. Install the systemd service: sh sudo install ./myweb.service /etc/systemd/system/myweb.service sudo systemctl daemon-reload
  4. 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

  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.

License

This project is licensed under the MIT License.