.github |
ライセンスの修正 |
2024-09-01T04:24:23+09:00 | |
.gitignore |
. |
2023-06-22T22:20:31+09:00 | |
CHANGELOG.md |
ヘルプとバージョン表示(CLI)の削除 |
2024-06-06T15:34:59+09:00 | |
LICENSE.txt |
ライセンスの修正 |
2024-09-01T04:24:23+09:00 | |
Makefile |
GNU Make→BSD Make |
2024-06-06T15:19:05+09:00 | |
README.md |
OpenBSD向け |
2023-05-31T11:39:51+09:00 | |
checkers.go |
バージョン2.0.0に |
2023-05-10T15:29:26+09:00 | |
config.go |
ヘルプとバージョン表示(CLI)の削除 |
2024-06-06T15:34:59+09:00 | |
config.json |
バグを修正 |
2023-07-04T10:03:52+09:00 | |
go.mod |
ポート番号の修正 + 言語はliblocale化 + 複数言語対応 |
2023-07-17T02:28:52+09:00 | |
go.sum |
ポート番号の修正 + 言語はliblocale化 + 複数言語対応 |
2023-07-17T02:28:52+09:00 | |
links.sample.json |
もう少しシンプルに |
2023-02-28T15:25:09+09:00 | |
locale |
ライセンスの修正 |
2024-09-01T04:24:23+09:00 | |
logo.jpg |
もう少しシンプルに |
2023-02-28T15:25:09+09:00 | |
main.go |
ヘルプとバージョン表示(CLI)の削除 |
2024-06-06T15:34:59+09:00 | |
makers.go |
バージョン2.0.0に |
2023-05-10T15:29:26+09:00 | |
srv.go |
ヘルプとバージョン表示(CLI)の削除 |
2024-06-06T15:34:59+09:00 | |
static |
ライセンスの修正 |
2024-09-01T04:24:23+09:00 | |
urloli.1 |
ヘルプとバージョン表示(CLI)の削除 |
2024-06-06T15:34:59+09:00 | |
view |
ライセンスの修正 |
2024-09-01T04:24:23+09:00 |
クッソ小さいURL短縮作成ソフトだわ〜♡
make
doas make install
nvim /etc/rc.d/urloli
#!/bin/ksh
daemon="/usr/local/bin/urloli -s"
. /etc/rc.d/rc.subr
rc_bg=YES
rc_reload=NO
rc_cmd $1
chmod +x /etc/rc.d/urloli
rcctl enable urloli
rcctl start urloli
nvim /usr/local/etc/rc.d/urloli
#!/bin/sh
# PROVIDE: urloli
# REQUIRE: NETWORKING SYSLOG
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable urloli:
#
#urloli_enable="YES"
. /etc/rc.subr
name="urloli"
rcvar="urloli_enable"
load_rc_config $name
: ${urloli_enable:="NO"}
: ${urloli_facility:="daemon"}
: ${urloli_priority:="debug"}
command="/usr/local/bin/${name}"
procname="/usr/local/bin/${name}"
pidfile="/var/run/${name}.pid"
start_cmd="${name}_start"
urloli_start() {
for d in /var/db/urloli /var/log/urloli; do
if [ ! -e "$d" ]; then
mkdir "$d"
fi
done
/usr/sbin/daemon -S -l ${urloli_facility} -s ${urloli_priority} -T ${name} \
-p ${pidfile} \
/usr/bin/env -i \
"PATH=/usr/local/bin:${PATH}" \
$command
}
run_rc_command "$1"
sysrc urloli_enable=YES
service start urloli
nvim /etc/rc.d/urloli
#!/bin/sh
#
# /etc/rc.d/urloli: start/stop the urloli daemon
#
SSD=/sbin/start-stop-daemon
NAME=urloli
PROG=/usr/bin/$NAME
PIOD=/run/$NAME.pid
case $1 in
start)
$SSD --start --pidfile $PID --exec $PROG
;;
stop)
$SSD --stop --retry 10 --pidfile $PID
;;
restart)
$0 stop
$0 start
;;
status)
$SSD --status --pidfile $PID
case $? in
0) echo "$PROG は実行中。pid $(cat $PID)" ;;
1) echo "$PROG は実行していませんが、pidファイルは「 $PID 」として存在しそう" ;;
3) echo "$PROG は停止中" ;;
4) echo "状況不明" ;;
esac
;;
*)
echo "usage: $0 [start|sto@|restart|status]"
;;
esac
# End of file
nvim /etc/init.d/urloli
#!/bin/sh
#
# chkconfig: 35 90 12
# description: URL Loli server
#
NAME=urloli
DESC=urloli
DAEMON=/usr/bin/$NAME
start () {
echo "URLロリサーバーは開始中:\n"
/usr/bin/urloli -s 9910 &>/dev/null &
touch /var/lock/subsys/urloli
echo
}
stop () {
echo "URLロリサーバーは終了中:\n"
pkill urloli
rm -f /var/lock/subsys/urloli
echo
}
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
;;
restart|reload|condrestart)
stop
start
;;
*)
echo $"Usage: $0 {start|stop|restart|status}"
exit 1
esac
nvim /etc/relayd.conf
# $OpenBSD: relayd.conf,v 1.5 2018/05/06 20:56:55 benno Exp $
#
relayd_address="0.0.0.0"
table <urloli> { 127.0.0.1 }
http protocol reverse_proxy {
tls keypair "DOMAIN"
match request header append "X-Forwarded-For" value "$REMOTE_ADDR"
match request header append "X-Forwarded-Port" value "$REMOTE_PORT"
match response header set "Referrer-Policy" value "same-origin"
match response header set "X-Frame-Options" value "deny"
match response header set "X-XSS-Protection" value "1; mode=block"
match response header set "X-Content-Type-Options" value "nosniff"
match response header set "Strict-Transport-Security" value "max-age=31536000; includeSubDomains; preload"
match response header set "Cache-Control" value "max-age=86400"
pass request quick header "Host" value "urlo.li" forward to <urloli>
return error
pass
}
relay www {
listen on $relayd_address port 443 tls
protocol $relayd_address
forward to <urloli> check tcp port 9910
}
server {
server_name DOMAIN www.DOMAIN;
root /var/www/htdocs/urloli;
access_log off;
error_log off;
if ($host = www.DOMAIN) {
return 301 https://DOMAIN$request_uri;
}
location /static {
try_files $uri $uri/ /static/$args;
}
location / {
proxy_pass http://localhost:9910;
}
listen [::]:443 ssl ipv6only=on;
listen 443 ssl;
ssl_certificate /etc/letsencrypt/live/DOMAIN/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/DOMAIN/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf
}
server {
if ($host = DOMAIN) {
return 301 https://DOMAIN$request_uri;
}
if ($host = www.DOMAIN) {
return 301 https://DOMAIN$request_uri;
}
listen 80;
listen [::]:80;
server_name DOMAIN www.DOMAIN;
return 404;
}
Copyright © 2018-2024 by 076.moe Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
公式ページ: https://urlo.li/
0
1
0