Skip to content

Commit 4381d9b

Browse files
committed
.
1 parent ac4e4b9 commit 4381d9b

File tree

9 files changed

+41
-57
lines changed

9 files changed

+41
-57
lines changed

.devcontainer/Dockerfile

Lines changed: 26 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,34 @@
1-
FROM mcr.microsoft.com/devcontainers/ruby:3.4-bullseye
1+
FROM ruby:3.4.6-alpine3.21
2+
3+
SHELL ["/bin/sh", "-o", "pipefail", "-c"]
4+
5+
RUN apk add --no-cache \
6+
bash \
7+
build-base \
8+
curl \
9+
git \
10+
libxml2-dev \
11+
libxslt-dev \
12+
nodejs \
13+
npm \
14+
openssl-dev \
15+
python3 \
16+
tzdata
17+
18+
ARG USER=vscode
19+
ARG UID=1000
20+
ARG GID=1000
21+
22+
RUN addgroup -g "$GID" "$USER" \
23+
&& adduser -D -G "$USER" -u "$UID" "$USER"
224

3-
# Install Node.js 20
4-
RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \
5-
&& apt-get install -y nodejs
6-
7-
# Install system dependencies
8-
RUN apt-get update && apt-get install -y \
9-
build-essential \
10-
git \
11-
curl \
12-
&& rm -rf /var/lib/apt/lists/*
13-
14-
# Install development gems
15-
RUN gem install rubocop
16-
17-
# Install global npm packages
18-
RUN npm install -g prettier
19-
20-
# Create vscode user
21-
RUN groupadd --gid 1000 vscode \
22-
&& useradd --uid 1000 --gid vscode --shell /bin/bash --create-home vscode
23-
24-
# Set up workspace
2525
WORKDIR /workspace
26-
RUN chown -R vscode:vscode /workspace
26+
RUN chown -R "$USER":"$USER" /workspace
2727

28-
# Switch to vscode user
29-
USER vscode
28+
ENV BUNDLE_PATH=/usr/local/bundle
3029

31-
# Set up environment
32-
RUN echo 'export BUNDLE_PATH="/usr/local/bundle"' >> ~/.bashrc
30+
USER "$USER"
3331

34-
# Expose port
3532
EXPOSE 3000
3633

37-
# Keep container running
3834
CMD ["sleep", "infinity"]

.github/copilot-instructions.md

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,11 @@ Fix rubocop `RSpec/MultipleExpectations` adding rspec tag `:aggregate_failures`.
4141
- ✅ Add caching headers where appropriate (`Rack::Cache`).
4242
- ✅ Errors: friendly messages for users, detailed logging internally.
4343
-**Frontend**: Use Astro components in `frontend/src/`. Keep it simple.
44-
-**CSS**: Use frontend styles in `frontend/public/styles.css`. Water.css for fallback.
44+
-**CSS**: Use frontend styles provided by Astro Starlight.
4545
-**Specs**: RSpec for Ruby, build tests for frontend.
4646

4747
## Don't
48+
4849
- ❌ Don't use Ruby's URI class or addressable gem directly. Strictly use `Html2rss::Url` only.
4950
- ❌ Don't bypass SSRF filter or weaken CSP.
5051
- ❌ Don't add databases, ORMs, or background jobs.
@@ -53,23 +54,6 @@ Fix rubocop `RSpec/MultipleExpectations` adding rspec tag `:aggregate_failures`.
5354
- ❌ Don't modify `frontend/dist/` - it's generated by build process.
5455
- ❌ NEVER expose the auth token a user provides.
5556

56-
## Project Structure
57-
58-
- `app.rb` – main Roda app
59-
- `app/` – core modules (config, cache, ssrf, health)
60-
- `routes/` – route handlers (`hash_branch`)
61-
- `helpers/` – pure helper modules (`module_function`)
62-
- `views/` – ERB templates (fallback)
63-
- `public/` – static assets (CSS/JS, minimal)
64-
- `frontend/` – Astro frontend application
65-
- `src/pages/` – Astro pages (index.astro, gallery.astro)
66-
- `src/layouts/` – Astro layouts (Layout.astro)
67-
- `public/` – frontend static assets
68-
- `package.json` – Node.js dependencies
69-
- `astro.config.mjs` – Astro configuration
70-
- `config/feeds.yml` – feed definitions
71-
- `spec/` – RSpec tests + VCR cassettes
72-
7357
## Environment
7458

7559
- `RACK_ENV` – environment
@@ -78,6 +62,7 @@ Fix rubocop `RSpec/MultipleExpectations` adding rspec tag `:aggregate_failures`.
7862
- `SENTRY_DSN` (optional)
7963

8064
### Verification Steps
65+
8166
- Run `ruby -c app.rb` to check syntax
8267
- Run `bundle exec rspec` to verify tests
8368
- Check `bundle install` removes unused dependencies

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,5 @@
4040
/frontend/dist/
4141
/frontend/.astro/
4242
/frontend/node_modules/
43-
/frontend/package-lock.json
4443
/public/frontend
4544
.yardoc

.vscode/extensions.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"recommendations": [
33
"redhat.vscode-yaml",
44
"esbenp.prettier-vscode",
5-
"github.copilot",
65
"shopify.ruby-lsp"
76
]
87
}

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ group :development do
3030
gem 'rubocop-rake', require: false
3131
gem 'rubocop-rspec', require: false
3232
gem 'rubocop-thread_safety', require: false
33+
gem 'ruby-lsp', require: false
3334
gem 'yard', require: false
3435
end
3536

Gemfile.lock

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@ GEM
142142
rack-unreloader (2.1.0)
143143
rainbow (3.1.1)
144144
rake (13.2.1)
145+
rbs (3.9.5)
146+
logger
145147
regexp_parser (2.11.3)
146148
reverse_markdown (3.0.0)
147149
nokogiri
@@ -190,6 +192,10 @@ GEM
190192
rubocop-thread_safety (0.7.2)
191193
lint_roller (~> 1.1)
192194
rubocop (~> 1.72, >= 1.72.1)
195+
ruby-lsp (0.26.1)
196+
language_server-protocol (~> 3.17.0)
197+
prism (>= 1.2, < 2.0)
198+
rbs (>= 3, < 5)
193199
ruby-progressbar (1.13.0)
194200
sanitize (7.0.0)
195201
crass (~> 1.0.2)
@@ -255,6 +261,7 @@ DEPENDENCIES
255261
rubocop-rake
256262
rubocop-rspec
257263
rubocop-thread_safety
264+
ruby-lsp
258265
sentry-ruby
259266
simplecov
260267
ssrf_filter
@@ -268,7 +275,7 @@ CHECKSUMS
268275
ast (2.4.3) sha256=954615157c1d6a382bc27d690d973195e79db7f55e9765ac7c481c60bdb4d383
269276
base64 (0.3.0) sha256=27337aeabad6ffae05c265c450490628ef3ebd4b67be58257393227588f5a97b
270277
bigdecimal (3.2.3) sha256=ffd11d1ac67a0d3b2f44aec0a6487210b3f813f363dd11f1fcccf5ba00da4e1b
271-
byebug (12.0.0) sha256=d4a150d291cca40b66ec9ca31f754e93fed8aa266a17335f71bb0afa7fca1a1e
278+
byebug (12.0.0)
272279
climate_control (1.2.0) sha256=36b21896193fa8c8536fa1cd843a07cf8ddbd03aaba43665e26c53ec1bd70aa5
273280
concurrent-ruby (1.3.5) sha256=813b3e37aca6df2a21a3b9f1d497f8cbab24a2b94cab325bffe65ee0f6cbebc6
274281
crack (1.0.0) sha256=c83aefdb428cdc7b66c7f287e488c796f055c0839e6e545fec2c7047743c4a49
@@ -321,6 +328,7 @@ CHECKSUMS
321328
rack-unreloader (2.1.0) sha256=18879cf2ced8ca21a01836bca706f65cce6ebe3f7d9d8a5157ce68ca62c7263a
322329
rainbow (3.1.1) sha256=039491aa3a89f42efa1d6dec2fc4e62ede96eb6acd95e52f1ad581182b79bc6a
323330
rake (13.2.1) sha256=46cb38dae65d7d74b6020a4ac9d48afed8eb8149c040eccf0523bec91907059d
331+
rbs (3.9.5)
324332
regexp_parser (2.11.3) sha256=ca13f381a173b7a93450e53459075c9b76a10433caadcb2f1180f2c741fc55a4
325333
reverse_markdown (3.0.0) sha256=ab228386765a0259835873cd07054b62939c40f620c77c247eafaaa3b23faca4
326334
rexml (3.4.4) sha256=19e0a2c3425dfbf2d4fc1189747bdb2f849b6c5e74180401b15734bc97b5d142
@@ -337,6 +345,7 @@ CHECKSUMS
337345
rubocop-rake (0.7.1) sha256=3797f2b6810c3e9df7376c26d5f44f3475eda59eb1adc38e6f62ecf027cbae4d
338346
rubocop-rspec (3.6.0) sha256=c0e4205871776727e54dee9cc91af5fd74578001551ba40e1fe1a1ab4b404479
339347
rubocop-thread_safety (0.7.2) sha256=bd51449c420b1ddda5672b71a39706367402beb55aaf19fc020c1868717f31f6
348+
ruby-lsp (0.26.1)
340349
ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33
341350
sanitize (7.0.0) sha256=269d1b9d7326e69307723af5643ec032ff86ad616e72a3b36d301ac75a273984
342351
sentry-ruby (5.24.0) sha256=420b15f4d81cf1cfddc4cb73d2282bcbaf111fe3554a6aa142f4cee2b870c437

Makefile

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ setup: ## Full development setup
2323

2424
dev: ## Start development server with live reload
2525
@echo "Starting html2rss-web development environment..."
26-
@echo "Ruby server: http://localhost:3000"
27-
@echo "Astro dev server: http://localhost:3001 (with live reload)"
28-
@echo "Main development URL: http://localhost:3001"
29-
@echo ""
3026
@bin/dev
3127

3228
dev-ruby: ## Start Ruby server only

app.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def development? = self.class.development?
153153

154154
r.get do
155155
JSON.generate({ success: true,
156-
data: { api: { name: 'html2rss-web API', version: '1.0.0',
156+
data: { api: { name: 'html2rss-web API',
157157
description: 'RESTful API for converting websites to RSS feeds' } } })
158158
end
159159
end

app/api/v1/health.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ def show(request)
2626
health: {
2727
status: 'healthy',
2828
timestamp: Time.now.iso8601,
29-
version: '1.0.0',
3029
environment: ENV.fetch('RACK_ENV', 'development'),
3130
uptime: Process.clock_gettime(Process::CLOCK_MONOTONIC),
3231
checks: {}

0 commit comments

Comments
 (0)