Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.git
.github
*.md
config/
34 changes: 34 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Timezone (IANA format, e.g. Europe/Moscow, Asia/Yekaterinburg)
# Список: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
TZ=Europe/Moscow

# Уровень логирования: debug, info, warn, error
LOG_LEVEL=info

# Учётные данные HeadHunter
HH_PHONE=+79991234567
HH_PASSWORD=your_password

# ID резюме (из URL: hh.ru/resume/<ID>)
HH_RESUME_ID=abc123def456

# Название резюме для уведомлений (необязательно)
HH_RESUME_TITLE=Golang-разработчик

# Время подъёма через запятую в формате HH:MM
SCHEDULE_TIMES=10:00,13:00,18:00

# Максимальная случайная задержка перед подъёмом (формат Go duration: 5m, 30s)
SCHEDULE_JITTER=5m

# URL для webhook уведомлений (необязательно)
WEBHOOK_URL=http://apprise:8000/notify

# Bearer-токен для авторизации webhook запросов (необязательно)
WEBHOOK_SECRET=your_webhook_secret

# Отправлять уведомление при успешном подъёме (true/false)
WEBHOOK_NOTIFY_ON_SUCCESS=true

# Таймаут HTTP запросов (формат Go duration: 30s, 1m)
HTTP_TIMEOUT=30s
52 changes: 52 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Build and push Docker image

on:
push:
tags:
- 'v*'
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=latest

- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ debug/
# ================================

docker-compose.override.yml
.dockerignore

# ================================
# Прочее
Expand Down
36 changes: 36 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# syntax=docker/dockerfile:1
FROM golang:1.24-alpine AS builder

WORKDIR /app

COPY go.mod go.sum ./
RUN go mod download && go mod verify

COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build \
-ldflags="-s -w" \
-trimpath \
-o /out/hhraiser \
./cmd/hhraiser

FROM alpine:3.21

RUN apk add --no-cache \
tzdata \
ca-certificates \
&& addgroup -S hhraiser \
&& adduser -S -G hhraiser hhraiser

COPY --from=builder /out/hhraiser /app/hhraiser

RUN mkdir -p /config && chown hhraiser:hhraiser /config

VOLUME ["/config"]

ENV HH_CONFIG_DIR=/config \
TZ=UTC \
LOG_LEVEL=info

USER hhraiser

ENTRYPOINT ["/app/hhraiser"]
27 changes: 26 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,31 @@
- Уведомления об успехе и ошибках через webhook
- Уведомления о запуске и остановке приложения
- Поддержка часовых поясов
- Готов к запуску в Docker

## Быстрый старт

```yaml
services:
hhraiser:
image: ghcr.io/rycln/hhraiser:latest
container_name: hhraiser
environment:
- TZ=Europe/Moscow
- HH_PHONE=+79991234567
- HH_PASSWORD=your_password
- HH_RESUME_ID=abc123def456
- HH_RESUME_TITLE=Golang-разработчик
- SCHEDULE_TIMES=10:00,13:00,18:00
- SCHEDULE_JITTER=5m
- WEBHOOK_URL=http://apprise:8000/notify
- WEBHOOK_SECRET=your_webhook_secret
- WEBHOOK_NOTIFY_ON_SUCCESS=true
- LOG_LEVEL=info
volumes:
- ./config:/config
restart: unless-stopped
```

## Конфигурация

Expand Down Expand Up @@ -39,7 +64,7 @@ HH_PHONE=+79991234567
HH_PASSWORD=your_password
HH_RESUME_ID=abc123def456
HH_RESUME_TITLE=Golang-разработчик
SCHEDULE_TIMES=10:00,14:00,18:00
SCHEDULE_TIMES=10:00,13:00,18:00
SCHEDULE_JITTER=5m
```

Expand Down
19 changes: 19 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
services:
hhraiser:
image: ghcr.io/rycln/hhraiser:latest
container_name: hhraiser
environment:
- TZ=Europe/Moscow
- HH_PHONE=+79991234567
- HH_PASSWORD=your_password
- HH_RESUME_ID=abc123def456
- HH_RESUME_TITLE=Golang-разработчик
- SCHEDULE_TIMES=10:00,13:00,18:00
- SCHEDULE_JITTER=5m
- WEBHOOK_URL=http://apprise:8000/notify
- WEBHOOK_SECRET=your_webhook_secret
- WEBHOOK_NOTIFY_ON_SUCCESS=true
- LOG_LEVEL=info
volumes:
- ./config:/config
restart: unless-stopped
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/rycln/hhraiser

go 1.22.2
go 1.24

require (
github.com/caarlos0/env/v11 v11.4.0
Expand Down
Loading