mirror of
https://github.com/Alexander-D-Karpov/webring.git
synced 2026-03-16 22:07:41 +03:00
Introduce full user system and approval workflow
——————————————————————————————————————————
Login & sessions
Telegram one‑click login (/login → /auth/telegram) with HMAC verification
New users and sessions tables; telegram_id now optional, TTL‑based cleanup job
Secure session_id cookie (configurable TTL and Secure/SameSite flags)
User dashboard (/user)
Lists the member’s sites and their uptime status
Forms to submit new site or update requests; validation and slug/url sanitisation
View pending requests with change diff
Request storage
update_requests table captures create/update ops as JSONB “changed_fields”
Admin review
/admin/requests interface to approve / reject queued requests
Approval auto‑creates sites (with ordered display_order) or patches existing ones, then refreshes favicon
Super‑admin panel
/admin/setup lists all users, toggle is_admin and forcibly logs them out
Notifications
On every new request, all admins with a Telegram ID receive a Markdown summary via bot API
Public UI tweaks
Header shows login/logout, role‑aware links and call‑to‑action cards
/submit page creates a queued request
Config & env
Added TELEGRAM_BOT_TOKEN, TELEGRAM_BOT_USERNAME, SESSION_TTL_HOURS, SESSION_SECURE_COOKIE
.env.template updated accordingly
Migrations 004–010
Users, sessions, foreign key on sites, display_order, update_requests, telegram_id nullability
BREAKING CHANGE
Environment must supply Telegram bot credentials
Database must be migrated; existing “dashboard” auth remains but admin routes are now session‑protected where applicable
113 lines
1.8 KiB
YAML
113 lines
1.8 KiB
YAML
run:
|
|
timeout: 5m
|
|
issues-exit-code: 1
|
|
tests: true
|
|
|
|
output:
|
|
formats:
|
|
- format: colored-line-number
|
|
path: stdout
|
|
print-issued-lines: true
|
|
print-linter-name: true
|
|
|
|
linters-settings:
|
|
errcheck:
|
|
check-type-assertions: true
|
|
check-blank: true
|
|
goconst:
|
|
min-len: 3
|
|
min-occurrences: 3
|
|
gocritic:
|
|
enabled-tags:
|
|
- diagnostic
|
|
- experimental
|
|
- opinionated
|
|
- performance
|
|
- style
|
|
gofmt:
|
|
simplify: true
|
|
goimports:
|
|
local-prefixes: webring
|
|
revive:
|
|
min-confidence: 0
|
|
govet:
|
|
enable:
|
|
- shadow
|
|
disable:
|
|
- fieldalignment
|
|
ineffassign:
|
|
check-exported: false
|
|
lll:
|
|
line-length: 120
|
|
misspell:
|
|
locale: US
|
|
nakedret:
|
|
max-func-lines: 30
|
|
prealloc:
|
|
simple: true
|
|
range-loops: true
|
|
for-loops: false
|
|
unparam:
|
|
check-exported: false
|
|
mnd:
|
|
checks:
|
|
- argument
|
|
- case
|
|
- condition
|
|
- operation
|
|
- return
|
|
- assign
|
|
depguard:
|
|
rules:
|
|
main:
|
|
deny:
|
|
# Intentionally empty - allow all imports for this project
|
|
- pkg: ""
|
|
|
|
linters:
|
|
enable:
|
|
- bodyclose
|
|
- copyloopvar
|
|
- dogsled
|
|
- dupl
|
|
- errcheck
|
|
- exhaustive
|
|
- gochecknoinits
|
|
- goconst
|
|
- gocritic
|
|
- gocyclo
|
|
- gofmt
|
|
- goimports
|
|
- revive
|
|
- goprintffuncname
|
|
- gosec
|
|
- gosimple
|
|
- govet
|
|
- ineffassign
|
|
- lll
|
|
- misspell
|
|
- nakedret
|
|
- noctx
|
|
- nolintlint
|
|
- rowserrcheck
|
|
- staticcheck
|
|
- stylecheck
|
|
- typecheck
|
|
- unconvert
|
|
- unparam
|
|
- unused
|
|
- whitespace
|
|
|
|
issues:
|
|
exclude-rules:
|
|
- path: _test\.go
|
|
linters:
|
|
- dupl
|
|
- path: cmd/
|
|
linters:
|
|
- gochecknoinits
|
|
- text: "weak cryptographic primitive"
|
|
linters:
|
|
- gosec
|
|
max-issues-per-linter: 0
|
|
max-same-issues: 0 |