Compare commits

...

1 Commits

Author SHA1 Message Date
iratusmachina 06375de8bd Updating README.md 2025-01-01 00:41:16 -05:00
4 changed files with 28 additions and 9 deletions

View File

@ -65,8 +65,8 @@ jbowen.dev/cereal (download)
* [x] Figure how to do log rotation as part of this app's function
* [x] Add tests
* [x] Add systemd.service and explanation
* [ ] Add Dockerfile and explanation
* [ ] Add mirror to Github
* [x] Add Dockerfile and explanation
* [x] Add mirror to Github
* [ ] Add Github action
* [ ] Figure how to use `goreleaser` [here](https://nfpm.goreleaser.com/) to release deb and rpm packages (so basically split it, goreleaser for github and woodpecker for Woodpecker)
* [ ] Update README.md

View File

@ -3,10 +3,15 @@
Also found [here](https://iratusmachina.com/#production-go-systemd-attempt-four)
```sh
$ cp <BINARY> /usr/local/bin
$ git clone https://git.iratusmachina.com/iratusmachina/gocustomurls.git gurls
$ cd gurls
$ make build
$ sudo cp <BINARY> /usr/local/bin
$ sudo mkdir -p /var/lib/<your user>
$ sed -i 's/$MYUSER/<your user>/g' gocustomurls.service
$ sed -i 's/$MYUSER/<your user>/g' config.json
$ // change your port to a port you want, say 9090
$ sudo cp gocustomurls.service /etc/systemd/system/
$ sudo useradd --system --comment 'Go Custom Urls Service' --no-create-home <your user>
useradd: failed to reset the lastlog entry of UID 992: No such file or directory
@ -34,4 +39,11 @@ $ sudo systemctl status gocustomurls.service
CPU: 14ms
CGroup: /system.slice/gocustomurls.service
└─4020 /usr/local/bin/gocustomurls -conf /var/lib/<your user>/config.json
$ http --body "http://<vanity_url>?go-get=1"
<html>
<head>
...
</head>
</html>
```

View File

@ -3,23 +3,30 @@
Also found [here](https://iratusmachina.com/#production-go-systemd-attempt-five)
```sh
$ git clone https://git.iratusmachina.com/iratusmachina/gocustomurls.git
$ sudo useradd --system --comment 'Go Custom Urls Service' --no-create-home <your user>
useradd: failed to reset the lastlog entry of UID 992: No such file or directory
$ sudo passwd -d <your user>
passwd: password changed.
$ getent passwd <your user>
<your user>:x:992:991:Go Custom Urls Service:/home/<your user>:/bin/bash
$ sudo mkdir -p /var/lib/<your user>/appfiles/otherfiles
$ sudo cp docker-compose.yml /var/lib/<your user>/appfiles/
$ sudo cp Dockerfile.1 /var/lib/<your user>/appfiles/Dockerfile
$ sudo mkdir -p /var/lib/<your user>/appfiles
$ // change your port in docker-compose.yml to a port you want, say 9090
$ sudo cp docker-compose.yml /var/lib/<your user>
$ sudo cp Dockerfile.1 /var/lib/<your user>/Dockerfile
$ sed -i 's/$MYUSER/<your user>/g' gocustomurls.service
$ sed -i 's/$MYUSER/<your user>/g' config.json
$ sudo cp config.json /var/lib/<your user>/appfiles/othefiles
$ sudo cp rules.json /var/lib/<your user>/appfiles/otherfiles
$ // change your port in config.json to a port you want, say 9090
$ sudo cp config.json /var/lib/<your user>/appfiles
$ sudo cp rules.json /var/lib/<your user>/appfiles
$ sudo chmod -R 770 /var/lib/<your user>
$ sudo chown -R <your user>:<your user> /var/lib/<your user>
$ sudo cp gocustomurls.service /etc/systemd/system/
$ sudo systemctl daemon-reload
$ // You would get an error with permissions like below
$ // denied while trying to connect to the Docker daemon socket at unix://var/run/docker.sock
$ // solve with the command below
$ sudo usermod -aG docker <your user>
$ sudo systemctl start gocustomurls.service
● gocustomurls.service - GocustomUrls. A custom url mapper for go packages!
Loaded: loaded (/etc/systemd/system/gocustomurls.service; disabled; preset: disabled)

View File

@ -18,4 +18,4 @@ services:
ports:
- "7070:7070"
volumes:
- ${PWD}/otherfiles:/home/${USERNAME}
- ${PWD}/appfiles:/home/${USERNAME}