Rename project to Glimmer for luci.ooo
Rebrand from "urlshort" to "Glimmer" across the entire codebase: Go module/imports, build targets, HTML templates, deploy scripts (including renaming service files), config, and README. Co-Authored-By: Claude Opus 4.6 <[email protected]>
This commit is contained in:
1 parent
5abdf2b6f2
commit
1bfad9ed7c
19 files changed
+104
-104
No files matched your search
@@ -1,20 +1,20 @@
|
||||
#!/bin/sh
|
||||
### BEGIN INIT INFO
|
||||
# Provides: urlshort
|
||||
# Provides: glimmer
|
||||
# Required-Start: $network $local_fs $remote_fs
|
||||
# Required-Stop: $network $local_fs $remote_fs
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: URL Shortener
|
||||
# Description: URL Shortener and Pastebin server
|
||||
# Short-Description: Glimmer
|
||||
# Description: Glimmer and Pastebin server
|
||||
### END INIT INFO
|
||||
|
||||
NAME=urlshort
|
||||
DAEMON=/opt/urlshort/urlshort
|
||||
DAEMON_ARGS="-config /etc/urlshort/config.toml"
|
||||
NAME=glimmer
|
||||
DAEMON=/opt/glimmer/glimmer
|
||||
DAEMON_ARGS="-config /etc/glimmer/config.toml"
|
||||
PIDFILE=/var/run/$NAME.pid
|
||||
LOGFILE=/var/log/$NAME.log
|
||||
RUN_AS=urlshort
|
||||
RUN_AS=glimmer
|
||||
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
[Unit]
|
||||
Description=URL Shortener
|
||||
Description=Glimmer
|
||||
Documentation=https://github.com/
|
||||
After=network.target
|
||||
Wants=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=urlshort
|
||||
Group=urlshort
|
||||
WorkingDirectory=/opt/urlshort
|
||||
ExecStart=/opt/urlshort/urlshort -config /etc/urlshort/config.toml
|
||||
User=glimmer
|
||||
Group=glimmer
|
||||
WorkingDirectory=/opt/glimmer
|
||||
ExecStart=/opt/glimmer/glimmer -config /etc/glimmer/config.toml
|
||||
Restart=on-failure
|
||||
RestartSec=5
|
||||
TimeoutStopSec=10
|
||||
@@ -17,13 +17,13 @@ TimeoutStopSec=10
|
||||
# Logging
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
SyslogIdentifier=urlshort
|
||||
SyslogIdentifier=glimmer
|
||||
|
||||
# Hardening
|
||||
NoNewPrivileges=true
|
||||
PrivateTmp=true
|
||||
ProtectSystem=strict
|
||||
ReadWritePaths=/var/lib/urlshort
|
||||
ReadWritePaths=/var/lib/glimmer
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
+22
-22
@@ -1,16 +1,16 @@
|
||||
#!/bin/sh
|
||||
# install.sh — Install urlshort as a system service on Ubuntu/Debian
|
||||
# install.sh — Install glimmer as a system service on Ubuntu/Debian
|
||||
# Works with systemd (Ubuntu 15.04+) and SysV init (older systems)
|
||||
# Run as root: sudo ./install.sh
|
||||
|
||||
set -e
|
||||
|
||||
BINARY_SRC="./urlshort"
|
||||
INSTALL_DIR="/opt/urlshort"
|
||||
CONFIG_DIR="/etc/urlshort"
|
||||
DATA_DIR="/var/lib/urlshort"
|
||||
SERVICE_USER="urlshort"
|
||||
SERVICE_NAME="urlshort"
|
||||
BINARY_SRC="./glimmer"
|
||||
INSTALL_DIR="/opt/glimmer"
|
||||
CONFIG_DIR="/etc/glimmer"
|
||||
DATA_DIR="/var/lib/glimmer"
|
||||
SERVICE_USER="glimmer"
|
||||
SERVICE_NAME="glimmer"
|
||||
|
||||
# ── Helpers ───────────────────────────────────────────────────────────────────
|
||||
|
||||
@@ -29,11 +29,11 @@ has_systemd() {
|
||||
|
||||
require_root
|
||||
|
||||
[ -f "$BINARY_SRC" ] || die "Binary '$BINARY_SRC' not found. Build first: GOOS=linux GOARCH=arm go build -o urlshort ."
|
||||
[ -f "./deploy/urlshort.service" ] || die "deploy/urlshort.service not found."
|
||||
[ -f "./deploy/urlshort.init" ] || die "deploy/urlshort.init not found."
|
||||
[ -f "$BINARY_SRC" ] || die "Binary '$BINARY_SRC' not found. Build first: GOOS=linux GOARCH=arm go build -o glimmer ."
|
||||
[ -f "./deploy/glimmer.service" ] || die "deploy/glimmer.service not found."
|
||||
[ -f "./deploy/glimmer.init" ] || die "deploy/glimmer.init not found."
|
||||
|
||||
echo "Installing urlshort..."
|
||||
echo "Installing glimmer..."
|
||||
|
||||
# ── Create service user ───────────────────────────────────────────────────────
|
||||
|
||||
@@ -53,10 +53,10 @@ chmod 750 "$DATA_DIR"
|
||||
|
||||
# ── Install binary ────────────────────────────────────────────────────────────
|
||||
|
||||
info "Installing binary to $INSTALL_DIR/urlshort"
|
||||
cp "$BINARY_SRC" "$INSTALL_DIR/urlshort"
|
||||
chown root:root "$INSTALL_DIR/urlshort"
|
||||
chmod 755 "$INSTALL_DIR/urlshort"
|
||||
info "Installing binary to $INSTALL_DIR/glimmer"
|
||||
cp "$BINARY_SRC" "$INSTALL_DIR/glimmer"
|
||||
chown root:root "$INSTALL_DIR/glimmer"
|
||||
chmod 755 "$INSTALL_DIR/glimmer"
|
||||
|
||||
# ── Install config (only if not already present) ──────────────────────────────
|
||||
|
||||
@@ -64,12 +64,12 @@ if [ ! -f "$CONFIG_DIR/config.toml" ]; then
|
||||
info "Installing default config to $CONFIG_DIR/config.toml"
|
||||
cp ./config.toml "$CONFIG_DIR/config.toml"
|
||||
# Point the database path at the data directory
|
||||
sed -i 's|path = .*|path = "/var/lib/urlshort/urls.db"|' "$CONFIG_DIR/config.toml"
|
||||
sed -i 's|path = .*|path = "/var/lib/glimmer/urls.db"|' "$CONFIG_DIR/config.toml"
|
||||
chown root:"$SERVICE_USER" "$CONFIG_DIR/config.toml"
|
||||
chmod 640 "$CONFIG_DIR/config.toml"
|
||||
echo ""
|
||||
echo " ** IMPORTANT: Edit $CONFIG_DIR/config.toml and set admin.password_hash."
|
||||
echo " Generate a hash with: $INSTALL_DIR/urlshort -hash-password 'yourpassword'"
|
||||
echo " Generate a hash with: $INSTALL_DIR/glimmer -hash-password 'yourpassword'"
|
||||
echo ""
|
||||
else
|
||||
info "Config already exists at $CONFIG_DIR/config.toml — skipping"
|
||||
@@ -79,17 +79,17 @@ fi
|
||||
|
||||
if has_systemd; then
|
||||
info "Installing systemd service"
|
||||
cp ./deploy/urlshort.service /etc/systemd/system/urlshort.service
|
||||
chmod 644 /etc/systemd/system/urlshort.service
|
||||
cp ./deploy/glimmer.service /etc/systemd/system/glimmer.service
|
||||
chmod 644 /etc/systemd/system/glimmer.service
|
||||
systemctl daemon-reload
|
||||
systemctl enable "$SERVICE_NAME"
|
||||
info "Service enabled. Start with: systemctl start $SERVICE_NAME"
|
||||
info "View logs with: journalctl -u $SERVICE_NAME -f"
|
||||
else
|
||||
info "systemd not found — installing SysV init script"
|
||||
cp ./deploy/urlshort.init /etc/init.d/urlshort
|
||||
chmod 755 /etc/init.d/urlshort
|
||||
update-rc.d urlshort defaults
|
||||
cp ./deploy/glimmer.init /etc/init.d/glimmer
|
||||
chmod 755 /etc/init.d/glimmer
|
||||
update-rc.d glimmer defaults
|
||||
info "Service enabled. Start with: service $SERVICE_NAME start"
|
||||
info "View logs with: tail -f /var/log/$SERVICE_NAME.log"
|
||||
fi
|
||||
|
||||
Reference in new issue
Block a user