From f5dcf4d10723eb975ced1b102a39f39be5fec698 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 17 May 2026 03:44:36 +0000 Subject: [PATCH] first --- .dockerignore | 51 ++ .gitattributes | 9 + .github/dependabot.yml | 12 + .github/workflows/ci.yml | 124 ++++ .gitignore | 37 ++ .kamal/hooks/docker-setup.sample | 3 + .kamal/hooks/post-app-boot.sample | 3 + .kamal/hooks/post-deploy.sample | 14 + .kamal/hooks/post-proxy-reboot.sample | 3 + .kamal/hooks/pre-app-boot.sample | 3 + .kamal/hooks/pre-build.sample | 51 ++ .kamal/hooks/pre-connect.sample | 47 ++ .kamal/hooks/pre-deploy.sample | 122 ++++ .kamal/hooks/pre-proxy-reboot.sample | 3 + .kamal/secrets | 19 + .rubocop.yml | 8 + .ruby-version | 1 + Dockerfile | 76 +++ Gemfile | 68 ++ Gemfile.lock | 414 ++++++++++++ README.md | 3 + Rakefile | 6 + app/assets/images/.keep | 0 app/assets/stylesheets/actiontext.css | 440 +++++++++++++ app/assets/stylesheets/application.css | 349 ++++++++++ app/assets/stylesheets/spiraleye.css | 529 +++++++++++++++ app/assets/stylesheets/spirit.css | 15 + app/channels/application_cable/connection.rb | 16 + app/controllers/application_controller.rb | 23 + app/controllers/concerns/.keep | 0 app/controllers/concerns/authentication.rb | 52 ++ app/controllers/fun_controller.rb | 10 + app/controllers/miniblog_controller.rb | 10 + app/controllers/passwords_controller.rb | 35 + app/controllers/posts_controller.rb | 63 ++ app/controllers/scraps_controller.rb | 53 ++ app/controllers/sessions_controller.rb | 21 + app/controllers/shrines_controller.rb | 6 + app/controllers/updates_controller.rb | 57 ++ app/controllers/welcome_controller.rb | 10 + app/helpers/application_helper.rb | 2 + app/helpers/fun_helper.rb | 2 + app/helpers/miniblog_helper.rb | 2 + app/helpers/posts_helper.rb | 2 + app/helpers/scraps_helper.rb | 2 + app/helpers/shrines_helper.rb | 2 + app/helpers/updates_helper.rb | 2 + app/helpers/welcome_helper.rb | 2 + app/javascript/application.js | 6 + app/javascript/controllers/application.js | 9 + .../controllers/hello_controller.js | 7 + app/javascript/controllers/index.js | 4 + app/javascript/sorter.js | 544 ++++++++++++++++ app/jobs/application_job.rb | 7 + app/mailers/application_mailer.rb | 4 + app/mailers/passwords_mailer.rb | 6 + app/models/application_record.rb | 3 + app/models/concerns/.keep | 0 app/models/current.rb | 4 + app/models/miniblog.rb | 2 + app/models/post.rb | 6 + app/models/scrap.rb | 5 + app/models/session.rb | 3 + app/models/update.rb | 9 + app/models/user.rb | 6 + app/views/active_storage/blobs/_blob.html.erb | 14 + app/views/fun/b5sorter.html.erb | 602 ++++++++++++++++++ app/views/fun/index.html.erb | 38 ++ .../action_text/contents/_content.html.erb | 3 + app/views/layouts/application.html.erb | 39 ++ app/views/layouts/mailer.html.erb | 13 + app/views/layouts/mailer.text.erb | 1 + app/views/miniblog/index.html.erb | 12 + app/views/passwords/edit.html.erb | 9 + app/views/passwords/new.html.erb | 8 + app/views/passwords_mailer/reset.html.erb | 6 + app/views/passwords_mailer/reset.text.erb | 4 + app/views/posts/edit.html.erb | 20 + app/views/posts/index.html.erb | 34 + app/views/posts/new.html.erb | 24 + app/views/posts/show.html.erb | 0 app/views/pwa/manifest.json.erb | 22 + app/views/pwa/service-worker.js | 26 + app/views/scraps/edit.html.erb | 0 app/views/scraps/index.html.erb | 25 + app/views/scraps/new.html.erb | 33 + app/views/scraps/show.html.erb | 20 + app/views/sessions/new.html.erb | 11 + app/views/shrines/index.html.erb | 6 + app/views/shrines/spiraleye.html.erb | 72 +++ app/views/shrines/spiraleyeabout.html.erb | 93 +++ app/views/shrines/spiraleyeabtsite.html.erb | 70 ++ app/views/shrines/spiraleyefanworks.html.erb | 84 +++ app/views/shrines/spiraleyeggallery.html.erb | 75 +++ app/views/shrines/spiraleyelinks.html.erb | 81 +++ app/views/shrines/spirit.html.erb | 22 + app/views/shrines/spirithc.html.erb | 17 + app/views/shrines/spiritquiz.html.erb | 10 + app/views/shrines/spiritsc.html.erb | 35 + app/views/shrines/spirittimeline.html.erb | 32 + app/views/updates/edit.html.erb | 0 app/views/updates/index.html.erb | 14 + app/views/updates/new.html.erb | 24 + app/views/updates/show.html.erb | 0 app/views/welcome/homepage.html.erb | 25 + app/views/welcome/index.html.erb | 6 + bin/brakeman | 7 + bin/bundler-audit | 6 + bin/ci | 6 + bin/dev | 2 + bin/docker-entrypoint | 8 + bin/importmap | 4 + bin/jobs | 6 + bin/kamal | 27 + bin/rails | 4 + bin/rake | 4 + bin/rubocop | 8 + bin/setup | 35 + bin/thrust | 5 + config.ru | 6 + config/application.rb | 27 + config/boot.rb | 4 + config/bundler-audit.yml | 5 + config/cable.yml | 17 + config/cache.yml | 16 + config/ci.rb | 23 + config/credentials.yml.enc | 1 + config/database.yml | 41 ++ config/deploy.yml | 126 ++++ config/environment.rb | 5 + config/environments/development.rb | 78 +++ config/environments/production.rb | 90 +++ config/environments/test.rb | 53 ++ config/importmap.rb | 9 + config/initializers/assets.rb | 7 + .../initializers/content_security_policy.rb | 29 + .../initializers/filter_parameter_logging.rb | 8 + config/initializers/inflections.rb | 16 + config/initializers/session_store.rb | 5 + config/locales/en.yml | 31 + config/puma.rb | 42 ++ config/queue.yml | 18 + config/recurring.yml | 15 + config/routes.rb | 57 ++ config/storage.yml | 27 + lib/tasks/.keep | 0 log/.keep | 0 public/400.html | 135 ++++ public/404.html | 135 ++++ public/406-unsupported-browser.html | 135 ++++ public/422.html | 135 ++++ public/500.html | 135 ++++ public/icon.ico | Bin 0 -> 21662 bytes public/icon.png | Bin 0 -> 5383 bytes public/icon.svg | 216 +++++++ public/robots.txt | 1 + script/.keep | 0 test/application_system_test_case.rb | 5 + test/controllers/.keep | 0 test/controllers/articles_controller_test.rb | 7 + test/controllers/comments_controller_test.rb | 7 + test/controllers/passwords_controller_test.rb | 67 ++ test/controllers/profiles_controller_test.rb | 7 + test/controllers/sessions_controller_test.rb | 33 + test/controllers/welcome_controller_test.rb | 8 + test/fixtures/action_text/rich_texts.yml | 4 + test/fixtures/articles.yml | 13 + test/fixtures/comments.yml | 13 + test/fixtures/files/.keep | 0 test/fixtures/profiles.yml | 15 + test/fixtures/users.yml | 9 + test/helpers/.keep | 0 test/integration/.keep | 0 test/mailers/.keep | 0 .../previews/passwords_mailer_preview.rb | 7 + test/models/.keep | 0 test/models/article_test.rb | 7 + test/models/comment_test.rb | 7 + test/models/profile_test.rb | 7 + test/models/user_test.rb | 8 + test/system/.keep | 0 test/test_helper.rb | 16 + test/test_helpers/session_test_helper.rb | 19 + tmp/.keep | 0 tmp/pids/.keep | 0 vendor/.keep | 0 vendor/javascript/.keep | 0 187 files changed, 7066 insertions(+) create mode 100644 .dockerignore create mode 100644 .gitattributes create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/ci.yml create mode 100644 .gitignore create mode 100755 .kamal/hooks/docker-setup.sample create mode 100755 .kamal/hooks/post-app-boot.sample create mode 100755 .kamal/hooks/post-deploy.sample create mode 100755 .kamal/hooks/post-proxy-reboot.sample create mode 100755 .kamal/hooks/pre-app-boot.sample create mode 100755 .kamal/hooks/pre-build.sample create mode 100755 .kamal/hooks/pre-connect.sample create mode 100755 .kamal/hooks/pre-deploy.sample create mode 100755 .kamal/hooks/pre-proxy-reboot.sample create mode 100644 .kamal/secrets create mode 100644 .rubocop.yml create mode 100644 .ruby-version create mode 100644 Dockerfile create mode 100644 Gemfile create mode 100644 Gemfile.lock create mode 100644 README.md create mode 100644 Rakefile create mode 100644 app/assets/images/.keep create mode 100644 app/assets/stylesheets/actiontext.css create mode 100644 app/assets/stylesheets/application.css create mode 100644 app/assets/stylesheets/spiraleye.css create mode 100644 app/assets/stylesheets/spirit.css create mode 100644 app/channels/application_cable/connection.rb create mode 100644 app/controllers/application_controller.rb create mode 100644 app/controllers/concerns/.keep create mode 100644 app/controllers/concerns/authentication.rb create mode 100644 app/controllers/fun_controller.rb create mode 100644 app/controllers/miniblog_controller.rb create mode 100644 app/controllers/passwords_controller.rb create mode 100644 app/controllers/posts_controller.rb create mode 100644 app/controllers/scraps_controller.rb create mode 100644 app/controllers/sessions_controller.rb create mode 100644 app/controllers/shrines_controller.rb create mode 100644 app/controllers/updates_controller.rb create mode 100644 app/controllers/welcome_controller.rb create mode 100644 app/helpers/application_helper.rb create mode 100644 app/helpers/fun_helper.rb create mode 100644 app/helpers/miniblog_helper.rb create mode 100644 app/helpers/posts_helper.rb create mode 100644 app/helpers/scraps_helper.rb create mode 100644 app/helpers/shrines_helper.rb create mode 100644 app/helpers/updates_helper.rb create mode 100644 app/helpers/welcome_helper.rb create mode 100644 app/javascript/application.js create mode 100644 app/javascript/controllers/application.js create mode 100644 app/javascript/controllers/hello_controller.js create mode 100644 app/javascript/controllers/index.js create mode 100644 app/javascript/sorter.js create mode 100644 app/jobs/application_job.rb create mode 100644 app/mailers/application_mailer.rb create mode 100644 app/mailers/passwords_mailer.rb create mode 100644 app/models/application_record.rb create mode 100644 app/models/concerns/.keep create mode 100644 app/models/current.rb create mode 100644 app/models/miniblog.rb create mode 100644 app/models/post.rb create mode 100644 app/models/scrap.rb create mode 100644 app/models/session.rb create mode 100644 app/models/update.rb create mode 100644 app/models/user.rb create mode 100644 app/views/active_storage/blobs/_blob.html.erb create mode 100644 app/views/fun/b5sorter.html.erb create mode 100644 app/views/fun/index.html.erb create mode 100644 app/views/layouts/action_text/contents/_content.html.erb create mode 100644 app/views/layouts/application.html.erb create mode 100644 app/views/layouts/mailer.html.erb create mode 100644 app/views/layouts/mailer.text.erb create mode 100644 app/views/miniblog/index.html.erb create mode 100644 app/views/passwords/edit.html.erb create mode 100644 app/views/passwords/new.html.erb create mode 100644 app/views/passwords_mailer/reset.html.erb create mode 100644 app/views/passwords_mailer/reset.text.erb create mode 100644 app/views/posts/edit.html.erb create mode 100644 app/views/posts/index.html.erb create mode 100644 app/views/posts/new.html.erb create mode 100644 app/views/posts/show.html.erb create mode 100644 app/views/pwa/manifest.json.erb create mode 100644 app/views/pwa/service-worker.js create mode 100644 app/views/scraps/edit.html.erb create mode 100644 app/views/scraps/index.html.erb create mode 100644 app/views/scraps/new.html.erb create mode 100644 app/views/scraps/show.html.erb create mode 100644 app/views/sessions/new.html.erb create mode 100644 app/views/shrines/index.html.erb create mode 100644 app/views/shrines/spiraleye.html.erb create mode 100644 app/views/shrines/spiraleyeabout.html.erb create mode 100644 app/views/shrines/spiraleyeabtsite.html.erb create mode 100644 app/views/shrines/spiraleyefanworks.html.erb create mode 100644 app/views/shrines/spiraleyeggallery.html.erb create mode 100644 app/views/shrines/spiraleyelinks.html.erb create mode 100644 app/views/shrines/spirit.html.erb create mode 100644 app/views/shrines/spirithc.html.erb create mode 100644 app/views/shrines/spiritquiz.html.erb create mode 100644 app/views/shrines/spiritsc.html.erb create mode 100644 app/views/shrines/spirittimeline.html.erb create mode 100644 app/views/updates/edit.html.erb create mode 100644 app/views/updates/index.html.erb create mode 100644 app/views/updates/new.html.erb create mode 100644 app/views/updates/show.html.erb create mode 100644 app/views/welcome/homepage.html.erb create mode 100644 app/views/welcome/index.html.erb create mode 100755 bin/brakeman create mode 100755 bin/bundler-audit create mode 100755 bin/ci create mode 100755 bin/dev create mode 100755 bin/docker-entrypoint create mode 100755 bin/importmap create mode 100755 bin/jobs create mode 100755 bin/kamal create mode 100755 bin/rails create mode 100755 bin/rake create mode 100755 bin/rubocop create mode 100755 bin/setup create mode 100755 bin/thrust create mode 100644 config.ru create mode 100644 config/application.rb create mode 100644 config/boot.rb create mode 100644 config/bundler-audit.yml create mode 100644 config/cable.yml create mode 100644 config/cache.yml create mode 100644 config/ci.rb create mode 100644 config/credentials.yml.enc create mode 100644 config/database.yml create mode 100644 config/deploy.yml create mode 100644 config/environment.rb create mode 100644 config/environments/development.rb create mode 100644 config/environments/production.rb create mode 100644 config/environments/test.rb create mode 100644 config/importmap.rb create mode 100644 config/initializers/assets.rb create mode 100644 config/initializers/content_security_policy.rb create mode 100644 config/initializers/filter_parameter_logging.rb create mode 100644 config/initializers/inflections.rb create mode 100644 config/initializers/session_store.rb create mode 100644 config/locales/en.yml create mode 100644 config/puma.rb create mode 100644 config/queue.yml create mode 100644 config/recurring.yml create mode 100644 config/routes.rb create mode 100644 config/storage.yml create mode 100644 lib/tasks/.keep create mode 100644 log/.keep create mode 100644 public/400.html create mode 100644 public/404.html create mode 100644 public/406-unsupported-browser.html create mode 100644 public/422.html create mode 100644 public/500.html create mode 100644 public/icon.ico create mode 100644 public/icon.png create mode 100644 public/icon.svg create mode 100644 public/robots.txt create mode 100644 script/.keep create mode 100644 test/application_system_test_case.rb create mode 100644 test/controllers/.keep create mode 100644 test/controllers/articles_controller_test.rb create mode 100644 test/controllers/comments_controller_test.rb create mode 100644 test/controllers/passwords_controller_test.rb create mode 100644 test/controllers/profiles_controller_test.rb create mode 100644 test/controllers/sessions_controller_test.rb create mode 100644 test/controllers/welcome_controller_test.rb create mode 100644 test/fixtures/action_text/rich_texts.yml create mode 100644 test/fixtures/articles.yml create mode 100644 test/fixtures/comments.yml create mode 100644 test/fixtures/files/.keep create mode 100644 test/fixtures/profiles.yml create mode 100644 test/fixtures/users.yml create mode 100644 test/helpers/.keep create mode 100644 test/integration/.keep create mode 100644 test/mailers/.keep create mode 100644 test/mailers/previews/passwords_mailer_preview.rb create mode 100644 test/models/.keep create mode 100644 test/models/article_test.rb create mode 100644 test/models/comment_test.rb create mode 100644 test/models/profile_test.rb create mode 100644 test/models/user_test.rb create mode 100644 test/system/.keep create mode 100644 test/test_helper.rb create mode 100644 test/test_helpers/session_test_helper.rb create mode 100644 tmp/.keep create mode 100644 tmp/pids/.keep create mode 100644 vendor/.keep create mode 100644 vendor/javascript/.keep diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..325bfc0 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,51 @@ +# See https://docs.docker.com/engine/reference/builder/#dockerignore-file for more about ignoring files. + +# Ignore git directory. +/.git/ +/.gitignore + +# Ignore bundler config. +/.bundle + +# Ignore all environment files. +/.env* + +# Ignore all default key files. +/config/master.key +/config/credentials/*.key + +# Ignore all logfiles and tempfiles. +/log/* +/tmp/* +!/log/.keep +!/tmp/.keep + +# Ignore pidfiles, but keep the directory. +/tmp/pids/* +!/tmp/pids/.keep + +# Ignore storage (uploaded files in development and any SQLite databases). +/storage/* +!/storage/.keep +/tmp/storage/* +!/tmp/storage/.keep + +# Ignore assets. +/node_modules/ +/app/assets/builds/* +!/app/assets/builds/.keep +/public/assets + +# Ignore CI service files. +/.github + +# Ignore Kamal files. +/config/deploy*.yml +/.kamal + +# Ignore development files +/.devcontainer + +# Ignore Docker-related files +/.dockerignore +/Dockerfile* diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..8dc4323 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,9 @@ +# See https://git-scm.com/docs/gitattributes for more about git attribute files. + +# Mark the database schema as having been generated. +db/schema.rb linguist-generated + +# Mark any vendored files as having been vendored. +vendor/* linguist-vendored +config/credentials/*.yml.enc diff=rails_credentials +config/credentials.yml.enc diff=rails_credentials diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..83610cf --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,12 @@ +version: 2 +updates: +- package-ecosystem: bundler + directory: "/" + schedule: + interval: weekly + open-pull-requests-limit: 10 +- package-ecosystem: github-actions + directory: "/" + schedule: + interval: weekly + open-pull-requests-limit: 10 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..4adf8d4 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,124 @@ +name: CI + +on: + pull_request: + push: + branches: [ main ] + +jobs: + scan_ruby: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v5 + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + + - name: Scan for common Rails security vulnerabilities using static analysis + run: bin/brakeman --no-pager + + - name: Scan for known security vulnerabilities in gems used + run: bin/bundler-audit + + scan_js: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v5 + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + + - name: Scan for security vulnerabilities in JavaScript dependencies + run: bin/importmap audit + + lint: + runs-on: ubuntu-latest + env: + RUBOCOP_CACHE_ROOT: tmp/rubocop + steps: + - name: Checkout code + uses: actions/checkout@v5 + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + + - name: Prepare RuboCop cache + uses: actions/cache@v4 + env: + DEPENDENCIES_HASH: ${{ hashFiles('.ruby-version', '**/.rubocop.yml', '**/.rubocop_todo.yml', 'Gemfile.lock') }} + with: + path: ${{ env.RUBOCOP_CACHE_ROOT }} + key: rubocop-${{ runner.os }}-${{ env.DEPENDENCIES_HASH }}-${{ github.ref_name == github.event.repository.default_branch && github.run_id || 'default' }} + restore-keys: | + rubocop-${{ runner.os }}-${{ env.DEPENDENCIES_HASH }}- + + - name: Lint code for consistent style + run: bin/rubocop -f github + + test: + runs-on: ubuntu-latest + + # services: + # redis: + # image: valkey/valkey:8 + # ports: + # - 6379:6379 + # options: --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5 + steps: + - name: Checkout code + uses: actions/checkout@v5 + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + + - name: Run tests + env: + RAILS_ENV: test + # RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }} + # REDIS_URL: redis://localhost:6379/0 + run: bin/rails db:test:prepare test + + system-test: + runs-on: ubuntu-latest + + # services: + # redis: + # image: valkey/valkey:8 + # ports: + # - 6379:6379 + # options: --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5 + steps: + - name: Checkout code + uses: actions/checkout@v5 + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + + - name: Run System Tests + env: + RAILS_ENV: test + # RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }} + # REDIS_URL: redis://localhost:6379/0 + run: bin/rails db:test:prepare test:system + + - name: Keep screenshots from failed system tests + uses: actions/upload-artifact@v4 + if: failure() + with: + name: screenshots + path: ${{ github.workspace }}/tmp/screenshots + if-no-files-found: ignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a2ba79a --- /dev/null +++ b/.gitignore @@ -0,0 +1,37 @@ +# See https://help.github.com/articles/ignoring-files for more about ignoring files. +# +# Temporary files generated by your text editor or operating system +# belong in git's global ignore instead: +# `$XDG_CONFIG_HOME/git/ignore` or `~/.config/git/ignore` + +# Ignore bundler config. +/.bundle + +# Ignore all environment files. +/.env* + +# Ignore all logfiles and tempfiles. +/log/* +/tmp/* +!/log/.keep +!/tmp/.keep + +# Ignore pidfiles, but keep the directory. +/tmp/pids/* +!/tmp/pids/ +!/tmp/pids/.keep + +# Ignore storage (uploaded files in development and any SQLite databases). +/storage/* +!/storage/.keep +/tmp/storage/* +!/tmp/storage/ +!/tmp/storage/.keep +/storage +storage/ +/public/assets + +# Ignore key files for decrypting credentials and more. +/config/*.key +/public/assets +db/ diff --git a/.kamal/hooks/docker-setup.sample b/.kamal/hooks/docker-setup.sample new file mode 100755 index 0000000..2fb07d7 --- /dev/null +++ b/.kamal/hooks/docker-setup.sample @@ -0,0 +1,3 @@ +#!/bin/sh + +echo "Docker set up on $KAMAL_HOSTS..." diff --git a/.kamal/hooks/post-app-boot.sample b/.kamal/hooks/post-app-boot.sample new file mode 100755 index 0000000..70f9c4b --- /dev/null +++ b/.kamal/hooks/post-app-boot.sample @@ -0,0 +1,3 @@ +#!/bin/sh + +echo "Booted app version $KAMAL_VERSION on $KAMAL_HOSTS..." diff --git a/.kamal/hooks/post-deploy.sample b/.kamal/hooks/post-deploy.sample new file mode 100755 index 0000000..fd364c2 --- /dev/null +++ b/.kamal/hooks/post-deploy.sample @@ -0,0 +1,14 @@ +#!/bin/sh + +# A sample post-deploy hook +# +# These environment variables are available: +# KAMAL_RECORDED_AT +# KAMAL_PERFORMER +# KAMAL_VERSION +# KAMAL_HOSTS +# KAMAL_ROLES (if set) +# KAMAL_DESTINATION (if set) +# KAMAL_RUNTIME + +echo "$KAMAL_PERFORMER deployed $KAMAL_VERSION to $KAMAL_DESTINATION in $KAMAL_RUNTIME seconds" diff --git a/.kamal/hooks/post-proxy-reboot.sample b/.kamal/hooks/post-proxy-reboot.sample new file mode 100755 index 0000000..1435a67 --- /dev/null +++ b/.kamal/hooks/post-proxy-reboot.sample @@ -0,0 +1,3 @@ +#!/bin/sh + +echo "Rebooted kamal-proxy on $KAMAL_HOSTS" diff --git a/.kamal/hooks/pre-app-boot.sample b/.kamal/hooks/pre-app-boot.sample new file mode 100755 index 0000000..45f7355 --- /dev/null +++ b/.kamal/hooks/pre-app-boot.sample @@ -0,0 +1,3 @@ +#!/bin/sh + +echo "Booting app version $KAMAL_VERSION on $KAMAL_HOSTS..." diff --git a/.kamal/hooks/pre-build.sample b/.kamal/hooks/pre-build.sample new file mode 100755 index 0000000..c5a5567 --- /dev/null +++ b/.kamal/hooks/pre-build.sample @@ -0,0 +1,51 @@ +#!/bin/sh + +# A sample pre-build hook +# +# Checks: +# 1. We have a clean checkout +# 2. A remote is configured +# 3. The branch has been pushed to the remote +# 4. The version we are deploying matches the remote +# +# These environment variables are available: +# KAMAL_RECORDED_AT +# KAMAL_PERFORMER +# KAMAL_VERSION +# KAMAL_HOSTS +# KAMAL_ROLES (if set) +# KAMAL_DESTINATION (if set) + +if [ -n "$(git status --porcelain)" ]; then + echo "Git checkout is not clean, aborting..." >&2 + git status --porcelain >&2 + exit 1 +fi + +first_remote=$(git remote) + +if [ -z "$first_remote" ]; then + echo "No git remote set, aborting..." >&2 + exit 1 +fi + +current_branch=$(git branch --show-current) + +if [ -z "$current_branch" ]; then + echo "Not on a git branch, aborting..." >&2 + exit 1 +fi + +remote_head=$(git ls-remote $first_remote --tags $current_branch | cut -f1) + +if [ -z "$remote_head" ]; then + echo "Branch not pushed to remote, aborting..." >&2 + exit 1 +fi + +if [ "$KAMAL_VERSION" != "$remote_head" ]; then + echo "Version ($KAMAL_VERSION) does not match remote HEAD ($remote_head), aborting..." >&2 + exit 1 +fi + +exit 0 diff --git a/.kamal/hooks/pre-connect.sample b/.kamal/hooks/pre-connect.sample new file mode 100755 index 0000000..77744bd --- /dev/null +++ b/.kamal/hooks/pre-connect.sample @@ -0,0 +1,47 @@ +#!/usr/bin/env ruby + +# A sample pre-connect check +# +# Warms DNS before connecting to hosts in parallel +# +# These environment variables are available: +# KAMAL_RECORDED_AT +# KAMAL_PERFORMER +# KAMAL_VERSION +# KAMAL_HOSTS +# KAMAL_ROLES (if set) +# KAMAL_DESTINATION (if set) +# KAMAL_RUNTIME + +hosts = ENV["KAMAL_HOSTS"].split(",") +results = nil +max = 3 + +elapsed = Benchmark.realtime do + results = hosts.map do |host| + Thread.new do + tries = 1 + + begin + Socket.getaddrinfo(host, 0, Socket::AF_UNSPEC, Socket::SOCK_STREAM, nil, Socket::AI_CANONNAME) + rescue SocketError + if tries < max + puts "Retrying DNS warmup: #{host}" + tries += 1 + sleep rand + retry + else + puts "DNS warmup failed: #{host}" + host + end + end + + tries + end + end.map(&:value) +end + +retries = results.sum - hosts.size +nopes = results.count { |r| r == max } + +puts "Prewarmed %d DNS lookups in %.2f sec: %d retries, %d failures" % [ hosts.size, elapsed, retries, nopes ] diff --git a/.kamal/hooks/pre-deploy.sample b/.kamal/hooks/pre-deploy.sample new file mode 100755 index 0000000..05b3055 --- /dev/null +++ b/.kamal/hooks/pre-deploy.sample @@ -0,0 +1,122 @@ +#!/usr/bin/env ruby + +# A sample pre-deploy hook +# +# Checks the Github status of the build, waiting for a pending build to complete for up to 720 seconds. +# +# Fails unless the combined status is "success" +# +# These environment variables are available: +# KAMAL_RECORDED_AT +# KAMAL_PERFORMER +# KAMAL_VERSION +# KAMAL_HOSTS +# KAMAL_COMMAND +# KAMAL_SUBCOMMAND +# KAMAL_ROLES (if set) +# KAMAL_DESTINATION (if set) + +# Only check the build status for production deployments +if ENV["KAMAL_COMMAND"] == "rollback" || ENV["KAMAL_DESTINATION"] != "production" + exit 0 +end + +require "bundler/inline" + +# true = install gems so this is fast on repeat invocations +gemfile(true, quiet: true) do + source "https://rubygems.org" + + gem "octokit" + gem "faraday-retry" +end + +MAX_ATTEMPTS = 72 +ATTEMPTS_GAP = 10 + +def exit_with_error(message) + $stderr.puts message + exit 1 +end + +class GithubStatusChecks + attr_reader :remote_url, :git_sha, :github_client, :combined_status + + def initialize + @remote_url = github_repo_from_remote_url + @git_sha = `git rev-parse HEAD`.strip + @github_client = Octokit::Client.new(access_token: ENV["GITHUB_TOKEN"]) + refresh! + end + + def refresh! + @combined_status = github_client.combined_status(remote_url, git_sha) + end + + def state + combined_status[:state] + end + + def first_status_url + first_status = combined_status[:statuses].find { |status| status[:state] == state } + first_status && first_status[:target_url] + end + + def complete_count + combined_status[:statuses].count { |status| status[:state] != "pending"} + end + + def total_count + combined_status[:statuses].count + end + + def current_status + if total_count > 0 + "Completed #{complete_count}/#{total_count} checks, see #{first_status_url} ..." + else + "Build not started..." + end + end + + private + def github_repo_from_remote_url + url = `git config --get remote.origin.url`.strip.delete_suffix(".git") + if url.start_with?("https://github.com/") + url.delete_prefix("https://github.com/") + elsif url.start_with?("git@github.com:") + url.delete_prefix("git@github.com:") + else + url + end + end +end + + +$stdout.sync = true + +begin + puts "Checking build status..." + + attempts = 0 + checks = GithubStatusChecks.new + + loop do + case checks.state + when "success" + puts "Checks passed, see #{checks.first_status_url}" + exit 0 + when "failure" + exit_with_error "Checks failed, see #{checks.first_status_url}" + when "pending" + attempts += 1 + end + + exit_with_error "Checks are still pending, gave up after #{MAX_ATTEMPTS * ATTEMPTS_GAP} seconds" if attempts == MAX_ATTEMPTS + + puts checks.current_status + sleep(ATTEMPTS_GAP) + checks.refresh! + end +rescue Octokit::NotFound + exit_with_error "Build status could not be found" +end diff --git a/.kamal/hooks/pre-proxy-reboot.sample b/.kamal/hooks/pre-proxy-reboot.sample new file mode 100755 index 0000000..061f805 --- /dev/null +++ b/.kamal/hooks/pre-proxy-reboot.sample @@ -0,0 +1,3 @@ +#!/bin/sh + +echo "Rebooting kamal-proxy on $KAMAL_HOSTS..." diff --git a/.kamal/secrets b/.kamal/secrets new file mode 100644 index 0000000..3c8de04 --- /dev/null +++ b/.kamal/secrets @@ -0,0 +1,19 @@ +# Secrets defined here are available for reference under registry/password, env/secret, builder/secrets, +# and accessories/*/env/secret in config/deploy.yml. All secrets should be pulled from either +# password manager, ENV, or a file. DO NOT ENTER RAW CREDENTIALS HERE! This file needs to be safe for git. + +# Example of extracting secrets from 1password (or another compatible pw manager) +# SECRETS=$(kamal secrets fetch --adapter 1password --account your-account --from Vault/Item KAMAL_REGISTRY_PASSWORD RAILS_MASTER_KEY) +# KAMAL_REGISTRY_PASSWORD=$(kamal secrets extract KAMAL_REGISTRY_PASSWORD ${SECRETS}) +# RAILS_MASTER_KEY=$(kamal secrets extract RAILS_MASTER_KEY ${SECRETS}) + +# Example of extracting secrets from Rails credentials +# KAMAL_REGISTRY_PASSWORD=$(rails credentials:fetch kamal.registry_password) + +# Use a GITHUB_TOKEN if private repositories are needed for the image +# GITHUB_TOKEN=$(gh config get -h github.com oauth_token) + +# Grab the registry password from ENV +KAMAL_REGISTRY_PASSWORD=$KAMAL_REGISTRY_PASSWORD +# Improve security by using a password manager. Never check config/master.key into git! +RAILS_MASTER_KEY=$(cat config/master.key) diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 0000000..f9d86d4 --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,8 @@ +# Omakase Ruby styling for Rails +inherit_gem: { rubocop-rails-omakase: rubocop.yml } + +# Overwrite or add rules to create your own house style +# +# # Use `[a, [b, c]]` not `[ a, [ b, c ] ]` +# Layout/SpaceInsideArrayLiteralBrackets: +# Enabled: false diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 0000000..fdeaef8 --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +ruby-3.4.7 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..8149c5d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,76 @@ +# syntax=docker/dockerfile:1 +# check=error=true + +# This Dockerfile is designed for production, not development. Use with Kamal or build'n'run by hand: +# docker build -t galaxy . +# docker run -d -p 80:80 -e RAILS_MASTER_KEY= --name galaxy galaxy + +# For a containerized dev environment, see Dev Containers: https://guides.rubyonrails.org/getting_started_with_devcontainer.html + +# Make sure RUBY_VERSION matches the Ruby version in .ruby-version +ARG RUBY_VERSION=3.4.7 +FROM docker.io/library/ruby:$RUBY_VERSION-slim AS base + +# Rails app lives here +WORKDIR /rails + +# Install base packages +RUN apt-get update -qq && \ + apt-get install --no-install-recommends -y curl libjemalloc2 libvips sqlite3 && \ + ln -s /usr/lib/$(uname -m)-linux-gnu/libjemalloc.so.2 /usr/local/lib/libjemalloc.so && \ + rm -rf /var/lib/apt/lists /var/cache/apt/archives + +# Set production environment variables and enable jemalloc for reduced memory usage and latency. +ENV RAILS_ENV="production" \ + BUNDLE_DEPLOYMENT="1" \ + BUNDLE_PATH="/usr/local/bundle" \ + BUNDLE_WITHOUT="development" \ + LD_PRELOAD="/usr/local/lib/libjemalloc.so" + +# Throw-away build stage to reduce size of final image +FROM base AS build + +# Install packages needed to build gems +RUN apt-get update -qq && \ + apt-get install --no-install-recommends -y build-essential git libyaml-dev pkg-config && \ + rm -rf /var/lib/apt/lists /var/cache/apt/archives + +# Install application gems +COPY Gemfile Gemfile.lock vendor ./ + +RUN bundle install && \ + rm -rf ~/.bundle/ "${BUNDLE_PATH}"/ruby/*/cache "${BUNDLE_PATH}"/ruby/*/bundler/gems/*/.git && \ + # -j 1 disable parallel compilation to avoid a QEMU bug: https://github.com/rails/bootsnap/issues/495 + bundle exec bootsnap precompile -j 1 --gemfile + +# Copy application code +COPY . . + +# Precompile bootsnap code for faster boot times. +# -j 1 disable parallel compilation to avoid a QEMU bug: https://github.com/rails/bootsnap/issues/495 +RUN bundle exec bootsnap precompile -j 1 app/ lib/ + +# Precompiling assets for production without requiring secret RAILS_MASTER_KEY +RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile + + + + +# Final stage for app image +FROM base + +# Run and own only the runtime files as a non-root user for security +RUN groupadd --system --gid 1000 rails && \ + useradd rails --uid 1000 --gid 1000 --create-home --shell /bin/bash +USER 1000:1000 + +# Copy built artifacts: gems, application +COPY --chown=rails:rails --from=build "${BUNDLE_PATH}" "${BUNDLE_PATH}" +COPY --chown=rails:rails --from=build /rails /rails + +# Entrypoint prepares the database. +ENTRYPOINT ["/rails/bin/docker-entrypoint"] + +# Start server via Thruster by default, this can be overwritten at runtime +EXPOSE 3000 +CMD ["./bin/thrust", "./bin/rails", "server"] diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..a012ce7 --- /dev/null +++ b/Gemfile @@ -0,0 +1,68 @@ +source "https://rubygems.org" + +# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main" +gem "rails", "~> 8.1.1" +# The modern asset pipeline for Rails [https://github.com/rails/propshaft] +gem "propshaft" +# Use sqlite3 as the database for Active Record +gem "sqlite3", ">= 2.1" +# Use the Puma web server [https://github.com/puma/puma] +gem "puma", ">= 5.0" +# Use JavaScript with ESM import maps [https://github.com/rails/importmap-rails] +gem "importmap-rails" +# Hotwire's SPA-like page accelerator [https://turbo.hotwired.dev] +gem "turbo-rails" +# Hotwire's modest JavaScript framework [https://stimulus.hotwired.dev] +gem "stimulus-rails" +# Build JSON APIs with ease [https://github.com/rails/jbuilder] +gem "jbuilder" + +# Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword] +gem "bcrypt", "~> 3.1.7" + +# Windows does not include zoneinfo files, so bundle the tzinfo-data gem +gem "tzinfo-data", platforms: %i[ windows jruby ] + +# Use the database-backed adapters for Rails.cache, Active Job, and Action Cable +gem "solid_cache" +gem "solid_queue" +gem "solid_cable" + +gem "rss" + +# Reduces boot times through caching; required in config/boot.rb +gem "bootsnap", require: false + +# Deploy this application anywhere as a Docker container [https://kamal-deploy.org] +gem "kamal", require: false + +# Add HTTP asset caching/compression and X-Sendfile acceleration to Puma [https://github.com/basecamp/thruster/] +gem "thruster", require: false + +# Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images] +gem "image_processing", "~> 1.2" + +group :development, :test do + # See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem + gem "debug", platforms: %i[ mri windows ], require: "debug/prelude" + + # Audits gems for known security defects (use config/bundler-audit.yml to ignore issues) + gem "bundler-audit", require: false + + # Static analysis for security vulnerabilities [https://brakemanscanner.org/] + gem "brakeman", require: false + + # Omakase Ruby styling [https://github.com/rails/rubocop-rails-omakase/] + gem "rubocop-rails-omakase", require: false +end + +group :development do + # Use console on exceptions pages [https://github.com/rails/web-console] + gem "web-console" +end + +group :test do + # Use system testing [https://guides.rubyonrails.org/testing.html#system-testing] + gem "capybara" + gem "selenium-webdriver" +end diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..1d104ea --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,414 @@ +GEM + remote: https://rubygems.org/ + specs: + action_text-trix (2.1.15) + railties + actioncable (8.1.1) + actionpack (= 8.1.1) + activesupport (= 8.1.1) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + zeitwerk (~> 2.6) + actionmailbox (8.1.1) + actionpack (= 8.1.1) + activejob (= 8.1.1) + activerecord (= 8.1.1) + activestorage (= 8.1.1) + activesupport (= 8.1.1) + mail (>= 2.8.0) + actionmailer (8.1.1) + actionpack (= 8.1.1) + actionview (= 8.1.1) + activejob (= 8.1.1) + activesupport (= 8.1.1) + mail (>= 2.8.0) + rails-dom-testing (~> 2.2) + actionpack (8.1.1) + actionview (= 8.1.1) + activesupport (= 8.1.1) + nokogiri (>= 1.8.5) + rack (>= 2.2.4) + rack-session (>= 1.0.1) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + useragent (~> 0.16) + actiontext (8.1.1) + action_text-trix (~> 2.1.15) + actionpack (= 8.1.1) + activerecord (= 8.1.1) + activestorage (= 8.1.1) + activesupport (= 8.1.1) + globalid (>= 0.6.0) + nokogiri (>= 1.8.5) + actionview (8.1.1) + activesupport (= 8.1.1) + builder (~> 3.1) + erubi (~> 1.11) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + activejob (8.1.1) + activesupport (= 8.1.1) + globalid (>= 0.3.6) + activemodel (8.1.1) + activesupport (= 8.1.1) + activerecord (8.1.1) + activemodel (= 8.1.1) + activesupport (= 8.1.1) + timeout (>= 0.4.0) + activestorage (8.1.1) + actionpack (= 8.1.1) + activejob (= 8.1.1) + activerecord (= 8.1.1) + activesupport (= 8.1.1) + marcel (~> 1.0) + activesupport (8.1.1) + base64 + bigdecimal + concurrent-ruby (~> 1.0, >= 1.3.1) + connection_pool (>= 2.2.5) + drb + i18n (>= 1.6, < 2) + json + logger (>= 1.4.2) + minitest (>= 5.1) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) + uri (>= 0.13.1) + addressable (2.8.7) + public_suffix (>= 2.0.2, < 7.0) + ast (2.4.3) + base64 (0.3.0) + bcrypt (3.1.20) + bcrypt_pbkdf (1.1.1) + bigdecimal (3.3.1) + bindex (0.8.1) + bootsnap (1.18.6) + msgpack (~> 1.2) + brakeman (7.1.1) + racc + builder (3.3.0) + bundler-audit (0.9.2) + bundler (>= 1.2.0, < 3) + thor (~> 1.0) + capybara (3.40.0) + addressable + matrix + mini_mime (>= 0.1.3) + nokogiri (~> 1.11) + rack (>= 1.6.0) + rack-test (>= 0.6.3) + regexp_parser (>= 1.5, < 3.0) + xpath (~> 3.2) + concurrent-ruby (1.3.5) + connection_pool (2.5.4) + crass (1.0.6) + date (3.5.0) + debug (1.11.0) + irb (~> 1.10) + reline (>= 0.3.8) + dotenv (3.1.8) + drb (2.2.3) + ed25519 (1.4.0) + erb (5.1.3) + erubi (1.13.1) + et-orbi (1.4.0) + tzinfo + ffi (1.17.2-aarch64-linux-gnu) + ffi (1.17.2-aarch64-linux-musl) + ffi (1.17.2-arm-linux-gnu) + ffi (1.17.2-arm-linux-musl) + ffi (1.17.2-x86_64-linux-gnu) + ffi (1.17.2-x86_64-linux-musl) + fugit (1.12.1) + et-orbi (~> 1.4) + raabro (~> 1.4) + globalid (1.3.0) + activesupport (>= 6.1) + i18n (1.14.7) + concurrent-ruby (~> 1.0) + image_processing (1.14.0) + mini_magick (>= 4.9.5, < 6) + ruby-vips (>= 2.0.17, < 3) + importmap-rails (2.2.2) + actionpack (>= 6.0.0) + activesupport (>= 6.0.0) + railties (>= 6.0.0) + io-console (0.8.1) + irb (1.15.3) + pp (>= 0.6.0) + rdoc (>= 4.0.0) + reline (>= 0.4.2) + jbuilder (2.14.1) + actionview (>= 7.0.0) + activesupport (>= 7.0.0) + json (2.16.0) + kamal (2.8.2) + activesupport (>= 7.0) + base64 (~> 0.2) + bcrypt_pbkdf (~> 1.0) + concurrent-ruby (~> 1.2) + dotenv (~> 3.1) + ed25519 (~> 1.4) + net-ssh (~> 7.3) + sshkit (>= 1.23.0, < 2.0) + thor (~> 1.3) + zeitwerk (>= 2.6.18, < 3.0) + language_server-protocol (3.17.0.5) + lint_roller (1.1.0) + logger (1.7.0) + loofah (2.24.1) + crass (~> 1.0.2) + nokogiri (>= 1.12.0) + mail (2.9.0) + logger + mini_mime (>= 0.1.1) + net-imap + net-pop + net-smtp + marcel (1.1.0) + matrix (0.4.3) + mini_magick (5.3.1) + logger + mini_mime (1.1.5) + minitest (5.26.0) + msgpack (1.8.0) + net-imap (0.5.12) + date + net-protocol + net-pop (0.1.2) + net-protocol + net-protocol (0.2.2) + timeout + net-scp (4.1.0) + net-ssh (>= 2.6.5, < 8.0.0) + net-sftp (4.0.0) + net-ssh (>= 5.0.0, < 8.0.0) + net-smtp (0.5.1) + net-protocol + net-ssh (7.3.0) + nio4r (2.7.5) + nokogiri (1.18.10-aarch64-linux-gnu) + racc (~> 1.4) + nokogiri (1.18.10-aarch64-linux-musl) + racc (~> 1.4) + nokogiri (1.18.10-arm-linux-gnu) + racc (~> 1.4) + nokogiri (1.18.10-arm-linux-musl) + racc (~> 1.4) + nokogiri (1.18.10-x86_64-linux-gnu) + racc (~> 1.4) + nokogiri (1.18.10-x86_64-linux-musl) + racc (~> 1.4) + ostruct (0.6.3) + parallel (1.27.0) + parser (3.3.10.0) + ast (~> 2.4.1) + racc + pp (0.6.3) + prettyprint + prettyprint (0.2.0) + prism (1.6.0) + propshaft (1.3.1) + actionpack (>= 7.0.0) + activesupport (>= 7.0.0) + rack + psych (5.2.6) + date + stringio + public_suffix (6.0.2) + puma (7.1.0) + nio4r (~> 2.0) + raabro (1.4.0) + racc (1.8.1) + rack (3.2.4) + rack-session (2.1.1) + base64 (>= 0.1.0) + rack (>= 3.0.0) + rack-test (2.2.0) + rack (>= 1.3) + rackup (2.2.1) + rack (>= 3) + rails (8.1.1) + actioncable (= 8.1.1) + actionmailbox (= 8.1.1) + actionmailer (= 8.1.1) + actionpack (= 8.1.1) + actiontext (= 8.1.1) + actionview (= 8.1.1) + activejob (= 8.1.1) + activemodel (= 8.1.1) + activerecord (= 8.1.1) + activestorage (= 8.1.1) + activesupport (= 8.1.1) + bundler (>= 1.15.0) + railties (= 8.1.1) + rails-dom-testing (2.3.0) + activesupport (>= 5.0.0) + minitest + nokogiri (>= 1.6) + rails-html-sanitizer (1.6.2) + loofah (~> 2.21) + nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) + railties (8.1.1) + actionpack (= 8.1.1) + activesupport (= 8.1.1) + irb (~> 1.13) + rackup (>= 1.0.0) + rake (>= 12.2) + thor (~> 1.0, >= 1.2.2) + tsort (>= 0.2) + zeitwerk (~> 2.6) + rainbow (3.1.1) + rake (13.3.1) + rdoc (6.15.1) + erb + psych (>= 4.0.0) + tsort + regexp_parser (2.11.3) + reline (0.6.2) + io-console (~> 0.5) + rexml (3.4.4) + rss (0.3.1) + rexml + rubocop (1.81.7) + json (~> 2.3) + language_server-protocol (~> 3.17.0.2) + lint_roller (~> 1.1.0) + parallel (~> 1.10) + parser (>= 3.3.0.2) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 2.9.3, < 3.0) + rubocop-ast (>= 1.47.1, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 2.4.0, < 4.0) + rubocop-ast (1.47.1) + parser (>= 3.3.7.2) + prism (~> 1.4) + rubocop-performance (1.26.1) + lint_roller (~> 1.1) + rubocop (>= 1.75.0, < 2.0) + rubocop-ast (>= 1.47.1, < 2.0) + rubocop-rails (2.33.4) + activesupport (>= 4.2.0) + lint_roller (~> 1.1) + rack (>= 1.1) + rubocop (>= 1.75.0, < 2.0) + rubocop-ast (>= 1.44.0, < 2.0) + rubocop-rails-omakase (1.1.0) + rubocop (>= 1.72) + rubocop-performance (>= 1.24) + rubocop-rails (>= 2.30) + ruby-progressbar (1.13.0) + ruby-vips (2.2.5) + ffi (~> 1.12) + logger + rubyzip (3.2.2) + securerandom (0.4.1) + selenium-webdriver (4.38.0) + base64 (~> 0.2) + logger (~> 1.4) + rexml (~> 3.2, >= 3.2.5) + rubyzip (>= 1.2.2, < 4.0) + websocket (~> 1.0) + solid_cable (3.0.12) + actioncable (>= 7.2) + activejob (>= 7.2) + activerecord (>= 7.2) + railties (>= 7.2) + solid_cache (1.0.9) + activejob (>= 7.2) + activerecord (>= 7.2) + railties (>= 7.2) + solid_queue (1.2.4) + activejob (>= 7.1) + activerecord (>= 7.1) + concurrent-ruby (>= 1.3.1) + fugit (~> 1.11) + railties (>= 7.1) + thor (>= 1.3.1) + sqlite3 (2.8.0-aarch64-linux-gnu) + sqlite3 (2.8.0-aarch64-linux-musl) + sqlite3 (2.8.0-arm-linux-gnu) + sqlite3 (2.8.0-arm-linux-musl) + sqlite3 (2.8.0-x86_64-linux-gnu) + sqlite3 (2.8.0-x86_64-linux-musl) + sshkit (1.24.0) + base64 + logger + net-scp (>= 1.1.2) + net-sftp (>= 2.1.2) + net-ssh (>= 2.8.0) + ostruct + stimulus-rails (1.3.4) + railties (>= 6.0.0) + stringio (3.1.7) + thor (1.4.0) + thruster (0.1.16) + thruster (0.1.16-aarch64-linux) + thruster (0.1.16-x86_64-linux) + timeout (0.4.4) + tsort (0.2.0) + turbo-rails (2.0.20) + actionpack (>= 7.1.0) + railties (>= 7.1.0) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + unicode-display_width (3.2.0) + unicode-emoji (~> 4.1) + unicode-emoji (4.1.0) + uri (1.1.1) + useragent (0.16.11) + web-console (4.2.1) + actionview (>= 6.0.0) + activemodel (>= 6.0.0) + bindex (>= 0.4.0) + railties (>= 6.0.0) + websocket (1.2.11) + websocket-driver (0.8.0) + base64 + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.5) + xpath (3.2.0) + nokogiri (~> 1.8) + zeitwerk (2.7.3) + +PLATFORMS + aarch64-linux + aarch64-linux-gnu + aarch64-linux-musl + arm-linux-gnu + arm-linux-musl + x86_64-linux + x86_64-linux-gnu + x86_64-linux-musl + +DEPENDENCIES + bcrypt (~> 3.1.7) + bootsnap + brakeman + bundler-audit + capybara + debug + image_processing (~> 1.2) + importmap-rails + jbuilder + kamal + propshaft + puma (>= 5.0) + rails (~> 8.1.1) + rss + rubocop-rails-omakase + selenium-webdriver + solid_cable + solid_cache + solid_queue + sqlite3 (>= 2.1) + stimulus-rails + thruster + turbo-rails + tzinfo-data + web-console + +BUNDLED WITH + 2.6.9 diff --git a/README.md b/README.md new file mode 100644 index 0000000..4cc5c89 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +this is the code for my silly personal playground site. i use it to learn rails stuff on! it's a mess, don't use this code, or do if you want idk i cant stop you + +this is accessible at https://lesbian.kissing.computer, currently diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..9a5ea73 --- /dev/null +++ b/Rakefile @@ -0,0 +1,6 @@ +# Add your own tasks in files placed in lib/tasks ending in .rake, +# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. + +require_relative "config/application" + +Rails.application.load_tasks diff --git a/app/assets/images/.keep b/app/assets/images/.keep new file mode 100644 index 0000000..e69de29 diff --git a/app/assets/stylesheets/actiontext.css b/app/assets/stylesheets/actiontext.css new file mode 100644 index 0000000..9b6bcb0 --- /dev/null +++ b/app/assets/stylesheets/actiontext.css @@ -0,0 +1,440 @@ +/* + * Default Trix editor styles. See Action Text overwrites below. +*/ + +trix-editor { + border: 1px solid #bbb; + border-radius: 3px; + margin: 0; + padding: 0.4em 0.6em; + min-height: 5em; + outline: none; } + +trix-toolbar * { + box-sizing: border-box; } + +trix-toolbar .trix-button-row { + display: flex; + flex-wrap: nowrap; + justify-content: space-between; + overflow-x: auto; } + +trix-toolbar .trix-button-group { + display: flex; + margin-bottom: 10px; + border: 1px solid #bbb; + border-top-color: #ccc; + border-bottom-color: #888; + border-radius: 3px; } + trix-toolbar .trix-button-group:not(:first-child) { + margin-left: 1.5vw; } + @media (max-width: 768px) { + trix-toolbar .trix-button-group:not(:first-child) { + margin-left: 0; } } + +trix-toolbar .trix-button-group-spacer { + flex-grow: 1; } + @media (max-width: 768px) { + trix-toolbar .trix-button-group-spacer { + display: none; } } + +trix-toolbar .trix-button { + position: relative; + float: left; + color: rgba(0, 0, 0, 0.6); + font-size: 0.75em; + font-weight: 600; + white-space: nowrap; + padding: 0 0.5em; + margin: 0; + outline: none; + border: none; + border-bottom: 1px solid #ddd; + border-radius: 0; + background: transparent; } + trix-toolbar .trix-button:not(:first-child) { + border-left: 1px solid #ccc; } + trix-toolbar .trix-button.trix-active { + background: #cbeefa; + color: black; } + trix-toolbar .trix-button:not(:disabled) { + cursor: pointer; } + trix-toolbar .trix-button:disabled { + color: rgba(0, 0, 0, 0.125); } + @media (max-width: 768px) { + trix-toolbar .trix-button { + letter-spacing: -0.01em; + padding: 0 0.3em; } } + +trix-toolbar .trix-button--icon { + font-size: inherit; + width: 2.6em; + height: 1.6em; + max-width: calc(0.8em + 4vw); + text-indent: -9999px; } + @media (max-width: 768px) { + trix-toolbar .trix-button--icon { + height: 2em; + max-width: calc(0.8em + 3.5vw); } } + trix-toolbar .trix-button--icon::before { + display: inline-block; + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + opacity: 0.6; + content: ""; + background-position: center; + background-repeat: no-repeat; + background-size: contain; } + @media (max-width: 768px) { + trix-toolbar .trix-button--icon::before { + right: 6%; + left: 6%; } } + trix-toolbar .trix-button--icon.trix-active::before { + opacity: 1; } + trix-toolbar .trix-button--icon:disabled::before { + opacity: 0.125; } + +trix-toolbar .trix-button--icon-attach::before { + background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M10.5%2018V7.5c0-2.25%203-2.25%203%200V18c0%204.125-6%204.125-6%200V7.5c0-6.375%209-6.375%209%200V18%22%20stroke%3D%22%23000%22%20stroke-width%3D%222%22%20stroke-miterlimit%3D%2210%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E"); + top: 8%; + bottom: 4%; } + +trix-toolbar .trix-button--icon-bold::before { + background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M6.522%2019.242a.5.5%200%200%201-.5-.5V5.35a.5.5%200%200%201%20.5-.5h5.783c1.347%200%202.46.345%203.24.982.783.64%201.216%201.562%201.216%202.683%200%201.13-.587%202.129-1.476%202.71a.35.35%200%200%200%20.049.613c1.259.56%202.101%201.742%202.101%203.22%200%201.282-.483%202.334-1.363%203.063-.876.726-2.132%201.12-3.66%201.12h-5.89ZM9.27%207.347v3.362h1.97c.766%200%201.347-.17%201.733-.464.38-.291.587-.716.587-1.27%200-.53-.183-.928-.513-1.198-.334-.273-.838-.43-1.505-.43H9.27Zm0%205.606v3.791h2.389c.832%200%201.448-.177%201.853-.497.399-.315.614-.786.614-1.423%200-.62-.22-1.077-.63-1.385-.418-.313-1.053-.486-1.905-.486H9.27Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E"); } + +trix-toolbar .trix-button--icon-italic::before { + background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M9%205h6.5v2h-2.23l-2.31%2010H13v2H6v-2h2.461l2.306-10H9V5Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E"); } + +trix-toolbar .trix-button--icon-link::before { + background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M18.948%205.258a4.337%204.337%200%200%200-6.108%200L11.217%206.87a.993.993%200%200%200%200%201.41c.392.39%201.027.39%201.418%200l1.623-1.613a2.323%202.323%200%200%201%203.271%200%202.29%202.29%200%200%201%200%203.251l-2.393%202.38a3.021%203.021%200%200%201-4.255%200l-.05-.049a1.007%201.007%200%200%200-1.418%200%20.993.993%200%200%200%200%201.41l.05.049a5.036%205.036%200%200%200%207.091%200l2.394-2.38a4.275%204.275%200%200%200%200-6.072Zm-13.683%2013.6a4.337%204.337%200%200%200%206.108%200l1.262-1.255a.993.993%200%200%200%200-1.41%201.007%201.007%200%200%200-1.418%200L9.954%2017.45a2.323%202.323%200%200%201-3.27%200%202.29%202.29%200%200%201%200-3.251l2.344-2.331a2.579%202.579%200%200%201%203.631%200c.392.39%201.027.39%201.419%200a.993.993%200%200%200%200-1.41%204.593%204.593%200%200%200-6.468%200l-2.345%202.33a4.275%204.275%200%200%200%200%206.072Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E"); } + +trix-toolbar .trix-button--icon-strike::before { + background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M6%2014.986c.088%202.647%202.246%204.258%205.635%204.258%203.496%200%205.713-1.728%205.713-4.463%200-.275-.02-.536-.062-.781h-3.461c.398.293.573.654.573%201.123%200%201.035-1.074%201.787-2.646%201.787-1.563%200-2.773-.762-2.91-1.924H6ZM6.432%2010h3.763c-.632-.314-.914-.715-.914-1.273%200-1.045.977-1.739%202.432-1.739%201.475%200%202.52.723%202.617%201.914h2.764c-.05-2.548-2.11-4.238-5.39-4.238-3.145%200-5.392%201.719-5.392%204.316%200%20.363.04.703.12%201.02ZM4%2011a1%201%200%201%200%200%202h15a1%201%200%201%200%200-2H4Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E"); } + +trix-toolbar .trix-button--icon-quote::before { + background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M4.581%208.471c.44-.5%201.056-.834%201.758-.995C8.074%207.17%209.201%207.822%2010%208.752c1.354%201.578%201.33%203.555.394%205.277-.941%201.731-2.788%203.163-4.988%203.56a.622.622%200%200%201-.653-.317c-.113-.205-.121-.49.16-.764.294-.286.567-.566.791-.835.222-.266.413-.54.524-.815.113-.28.156-.597.026-.908-.128-.303-.39-.524-.72-.69a3.02%203.02%200%200%201-1.674-2.7c0-.905.283-1.59.72-2.088Zm9.419%200c.44-.5%201.055-.834%201.758-.995%201.734-.306%202.862.346%203.66%201.276%201.355%201.578%201.33%203.555.395%205.277-.941%201.731-2.789%203.163-4.988%203.56a.622.622%200%200%201-.653-.317c-.113-.205-.122-.49.16-.764.294-.286.567-.566.791-.835.222-.266.412-.54.523-.815.114-.28.157-.597.026-.908-.127-.303-.39-.524-.72-.69a3.02%203.02%200%200%201-1.672-2.701c0-.905.283-1.59.72-2.088Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E"); } + +trix-toolbar .trix-button--icon-heading-1::before { + background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M21.5%207.5v-3h-12v3H14v13h3v-13h4.5ZM9%2013.5h3.5v-3h-10v3H6v7h3v-7Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E"); } + +trix-toolbar .trix-button--icon-code::before { + background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M3.293%2011.293a1%201%200%200%200%200%201.414l4%204a1%201%200%201%200%201.414-1.414L5.414%2012l3.293-3.293a1%201%200%200%200-1.414-1.414l-4%204Zm13.414%205.414%204-4a1%201%200%200%200%200-1.414l-4-4a1%201%200%201%200-1.414%201.414L18.586%2012l-3.293%203.293a1%201%200%200%200%201.414%201.414Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E"); } + +trix-toolbar .trix-button--icon-bullet-list::before { + background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M5%207.5a1.5%201.5%200%201%200%200-3%201.5%201.5%200%200%200%200%203ZM8%206a1%201%200%200%201%201-1h11a1%201%200%201%201%200%202H9a1%201%200%200%201-1-1Zm1%205a1%201%200%201%200%200%202h11a1%201%200%201%200%200-2H9Zm0%206a1%201%200%201%200%200%202h11a1%201%200%201%200%200-2H9Zm-2.5-5a1.5%201.5%200%201%201-3%200%201.5%201.5%200%200%201%203%200ZM5%2019.5a1.5%201.5%200%201%200%200-3%201.5%201.5%200%200%200%200%203Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E"); } + +trix-toolbar .trix-button--icon-number-list::before { + background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M3%204h2v4H4V5H3V4Zm5%202a1%201%200%200%201%201-1h11a1%201%200%201%201%200%202H9a1%201%200%200%201-1-1Zm1%205a1%201%200%201%200%200%202h11a1%201%200%201%200%200-2H9Zm0%206a1%201%200%201%200%200%202h11a1%201%200%201%200%200-2H9Zm-3.5-7H6v1l-1.5%202H6v1H3v-1l1.667-2H3v-1h2.5ZM3%2017v-1h3v4H3v-1h2v-.5H4v-1h1V17H3Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E"); } + +trix-toolbar .trix-button--icon-undo::before { + background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M3%2014a1%201%200%200%200%201%201h6a1%201%200%201%200%200-2H6.257c2.247-2.764%205.151-3.668%207.579-3.264%202.589.432%204.739%202.356%205.174%205.405a1%201%200%200%200%201.98-.283c-.564-3.95-3.415-6.526-6.825-7.095C11.084%207.25%207.63%208.377%205%2011.39V8a1%201%200%200%200-2%200v6Zm2-1Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E"); } + +trix-toolbar .trix-button--icon-redo::before { + background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M21%2014a1%201%200%200%201-1%201h-6a1%201%200%201%201%200-2h3.743c-2.247-2.764-5.151-3.668-7.579-3.264-2.589.432-4.739%202.356-5.174%205.405a1%201%200%200%201-1.98-.283c.564-3.95%203.415-6.526%206.826-7.095%203.08-.513%206.534.614%209.164%203.626V8a1%201%200%201%201%202%200v6Zm-2-1Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E"); } + +trix-toolbar .trix-button--icon-decrease-nesting-level::before { + background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M5%206a1%201%200%200%201%201-1h12a1%201%200%201%201%200%202H6a1%201%200%200%201-1-1Zm4%205a1%201%200%201%200%200%202h9a1%201%200%201%200%200-2H9Zm-3%206a1%201%200%201%200%200%202h12a1%201%200%201%200%200-2H6Zm-3.707-5.707a1%201%200%200%200%200%201.414l2%202a1%201%200%201%200%201.414-1.414L4.414%2012l1.293-1.293a1%201%200%200%200-1.414-1.414l-2%202Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E"); } + +trix-toolbar .trix-button--icon-increase-nesting-level::before { + background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M5%206a1%201%200%200%201%201-1h12a1%201%200%201%201%200%202H6a1%201%200%200%201-1-1Zm4%205a1%201%200%201%200%200%202h9a1%201%200%201%200%200-2H9Zm-3%206a1%201%200%201%200%200%202h12a1%201%200%201%200%200-2H6Zm-2.293-2.293%202-2a1%201%200%200%200%200-1.414l-2-2a1%201%200%201%200-1.414%201.414L3.586%2012l-1.293%201.293a1%201%200%201%200%201.414%201.414Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E"); } + +trix-toolbar .trix-dialogs { + position: relative; } + +trix-toolbar .trix-dialog { + position: absolute; + top: 0; + left: 0; + right: 0; + font-size: 0.75em; + padding: 15px 10px; + background: #fff; + box-shadow: 0 0.3em 1em #ccc; + border-top: 2px solid #888; + border-radius: 5px; + z-index: 5; } + +trix-toolbar .trix-input--dialog { + font-size: inherit; + font-weight: normal; + padding: 0.5em 0.8em; + margin: 0 10px 0 0; + border-radius: 3px; + border: 1px solid #bbb; + background-color: #fff; + box-shadow: none; + outline: none; + -webkit-appearance: none; + -moz-appearance: none; } + trix-toolbar .trix-input--dialog.validate:invalid { + box-shadow: #F00 0px 0px 1.5px 1px; } + +trix-toolbar .trix-button--dialog { + font-size: inherit; + padding: 0.5em; + border-bottom: none; } + +trix-toolbar .trix-dialog--link { + max-width: 600px; } + +trix-toolbar .trix-dialog__link-fields { + display: flex; + align-items: baseline; } + trix-toolbar .trix-dialog__link-fields .trix-input { + flex: 1; } + trix-toolbar .trix-dialog__link-fields .trix-button-group { + flex: 0 0 content; + margin: 0; } + +trix-editor [data-trix-mutable]:not(.attachment__caption-editor) { + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; } + +trix-editor [data-trix-mutable]::-moz-selection, +trix-editor [data-trix-cursor-target]::-moz-selection, trix-editor [data-trix-mutable] ::-moz-selection { + background: none; } + +trix-editor [data-trix-mutable]::selection, +trix-editor [data-trix-cursor-target]::selection, trix-editor [data-trix-mutable] ::selection { + background: none; } + +trix-editor .attachment__caption-editor:focus[data-trix-mutable]::-moz-selection { + background: highlight; } + +trix-editor .attachment__caption-editor:focus[data-trix-mutable]::selection { + background: highlight; } + +trix-editor [data-trix-mutable].attachment.attachment--file { + box-shadow: 0 0 0 2px highlight; + border-color: transparent; } + +trix-editor [data-trix-mutable].attachment img { + box-shadow: 0 0 0 2px highlight; } + +trix-editor .attachment { + position: relative; } + trix-editor .attachment:hover { + cursor: default; } + +trix-editor .attachment--preview .attachment__caption:hover { + cursor: text; } + +trix-editor .attachment__progress { + position: absolute; + z-index: 1; + height: 20px; + top: calc(50% - 10px); + left: 5%; + width: 90%; + opacity: 0.9; + transition: opacity 200ms ease-in; } + trix-editor .attachment__progress[value="100"] { + opacity: 0; } + +trix-editor .attachment__caption-editor { + display: inline-block; + width: 100%; + margin: 0; + padding: 0; + font-size: inherit; + font-family: inherit; + line-height: inherit; + color: inherit; + text-align: center; + vertical-align: top; + border: none; + outline: none; + -webkit-appearance: none; + -moz-appearance: none; } + +trix-editor .attachment__toolbar { + position: absolute; + z-index: 1; + top: -0.9em; + left: 0; + width: 100%; + text-align: center; } + +trix-editor .trix-button-group { + display: inline-flex; } + +trix-editor .trix-button { + position: relative; + float: left; + color: #666; + white-space: nowrap; + font-size: 80%; + padding: 0 0.8em; + margin: 0; + outline: none; + border: none; + border-radius: 0; + background: transparent; } + trix-editor .trix-button:not(:first-child) { + border-left: 1px solid #ccc; } + trix-editor .trix-button.trix-active { + background: #cbeefa; } + trix-editor .trix-button:not(:disabled) { + cursor: pointer; } + +trix-editor .trix-button--remove { + text-indent: -9999px; + display: inline-block; + padding: 0; + outline: none; + width: 1.8em; + height: 1.8em; + line-height: 1.8em; + border-radius: 50%; + background-color: #fff; + border: 2px solid highlight; + box-shadow: 1px 1px 6px rgba(0, 0, 0, 0.25); } + trix-editor .trix-button--remove::before { + display: inline-block; + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + opacity: 0.7; + content: ""; + background-image: url("data:image/svg+xml,%3Csvg%20height%3D%2224%22%20width%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M19%206.41%2017.59%205%2012%2010.59%206.41%205%205%206.41%2010.59%2012%205%2017.59%206.41%2019%2012%2013.41%2017.59%2019%2019%2017.59%2013.41%2012z%22%2F%3E%3Cpath%20d%3D%22M0%200h24v24H0z%22%20fill%3D%22none%22%2F%3E%3C%2Fsvg%3E"); + background-position: center; + background-repeat: no-repeat; + background-size: 90%; } + trix-editor .trix-button--remove:hover { + border-color: #333; } + trix-editor .trix-button--remove:hover::before { + opacity: 1; } + +trix-editor .attachment__metadata-container { + position: relative; } + +trix-editor .attachment__metadata { + position: absolute; + left: 50%; + top: 2em; + transform: translate(-50%, 0); + max-width: 90%; + padding: 0.1em 0.6em; + font-size: 0.8em; + color: #fff; + background-color: rgba(0, 0, 0, 0.7); + border-radius: 3px; } + trix-editor .attachment__metadata .attachment__name { + display: inline-block; + max-width: 100%; + vertical-align: bottom; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; } + trix-editor .attachment__metadata .attachment__size { + margin-left: 0.2em; + white-space: nowrap; } + +.trix-content { + line-height: 1.5; + overflow-wrap: break-word; + word-break: break-word; } + .trix-content * { + box-sizing: border-box; + margin: 0; + padding: 0; } + .trix-content h1 { + font-size: 1.2em; + line-height: 1.2; } + .trix-content blockquote { + border: 0 solid #ccc; + border-left-width: 0.3em; + margin-left: 0.3em; + padding-left: 0.6em; } + .trix-content [dir=rtl] blockquote, + .trix-content blockquote[dir=rtl] { + border-width: 0; + border-right-width: 0.3em; + margin-right: 0.3em; + padding-right: 0.6em; } + .trix-content li { + margin-left: 1em; } + .trix-content [dir=rtl] li { + margin-right: 1em; } + .trix-content pre { + display: inline-block; + width: 100%; + vertical-align: top; + font-family: monospace; + font-size: 0.9em; + padding: 0.5em; + white-space: pre; + background-color: #eee; + overflow-x: auto; } + .trix-content img { + max-width: 100%; + height: auto; } + .trix-content .attachment { + display: inline-block; + position: relative; + max-width: 100%; } + .trix-content .attachment a { + color: inherit; + text-decoration: none; } + .trix-content .attachment a:hover, .trix-content .attachment a:visited:hover { + color: inherit; } + .trix-content .attachment__caption { + text-align: center; } + .trix-content .attachment__caption .attachment__name + .attachment__size::before { + content: ' \2022 '; } + .trix-content .attachment--preview { + width: 100%; + text-align: center; } + .trix-content .attachment--preview .attachment__caption { + color: #666; + font-size: 0.9em; + line-height: 1.2; } + .trix-content .attachment--file { + color: #333; + line-height: 1; + margin: 0 2px 2px 2px; + padding: 0.4em 1em; + border: 1px solid #bbb; + border-radius: 5px; } + .trix-content .attachment-gallery { + display: flex; + flex-wrap: wrap; + position: relative; } + .trix-content .attachment-gallery .attachment { + flex: 1 0 33%; + padding: 0 0.5em; + max-width: 33%; } + .trix-content .attachment-gallery.attachment-gallery--2 .attachment, .trix-content .attachment-gallery.attachment-gallery--4 .attachment { + flex-basis: 50%; + max-width: 50%; } + +/* + * We need to override trix.css’s image gallery styles to accommodate the + * element we wrap around attachments. Otherwise, + * images in galleries will be squished by the max-width: 33%; rule. +*/ +.trix-content .attachment-gallery > action-text-attachment, +.trix-content .attachment-gallery > .attachment { + flex: 1 0 33%; + padding: 0 0.5em; + max-width: 33%; +} + +.trix-content .attachment-gallery.attachment-gallery--2 > action-text-attachment, +.trix-content .attachment-gallery.attachment-gallery--2 > .attachment, .trix-content .attachment-gallery.attachment-gallery--4 > action-text-attachment, +.trix-content .attachment-gallery.attachment-gallery--4 > .attachment { + flex-basis: 50%; + max-width: 50%; +} + +.trix-content action-text-attachment .attachment { + padding: 0 !important; + max-width: 100% !important; +} diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css new file mode 100644 index 0000000..31851b1 --- /dev/null +++ b/app/assets/stylesheets/application.css @@ -0,0 +1,349 @@ + + + + body { + + background-image: url("https://file.garden/aJzQmzrHVB4BLKwu/tumblrbg.gif"); + font-family: ms gothic; + font-weight: 900; + } + + .mainaboutbox { + background-image: url("https://file.garden/aJzQmzrHVB4BLKwu/sky.png"); + width: 990px; + height: 550px; + margin: 0 auto; + padding: 2%; + overflow-y: scroll; + border: 8px double white; + box-shadow: 10px 10px 4px #ffeab0; + + + + } + .shelf { + background:url("https://file.garden/aJzQmzrHVB4BLKwu/MYWOOD.png"); + line-height: 150px; + text-decoration: underline white 5px; + padding: 0px 20px; + outline: #5d1c27 solid 15px; + border: #863133 solid 5px; + position: relative; + vertical-align: text-bottom; + margin: 30px 0; + image-rendering: pixelated; + } + + .postz img { + width: 50px; + + + } + .mainaboutbox2 { + background-image: url("https://file.garden/aJzQmzrHVB4BLKwu/sky.png"); + width: 450px; + overflow: scroll; + height: 550px; + text-align: center; + margin: 0 auto; + font-size:20px; + padding: 2%; + border: 8px double white; + box-shadow: 10px 10px 4px #ffeab0; + + + + } + .header { + + padding-left: 6px; + + margin-bottom:10px; + font-size: 10px; + + } + a { + color: #000; + } + + a:visited { + color: #000; + + } + #statuscafe { + padding: .5em; + background-image: url('images/xraytech.jpg'); + border: 1px solid midnightblue; +} + +#statuscafe a { + + color:black; + +} + + +#statuscafe-username { + margin-bottom: .5em; color:black; + +} +#statuscafe-content { + margin: 0 1em 0.5em 1em; + color:black; + +} +.navigate { + background-image: url("https://file.garden/aJzQmzrHVB4BLKwu/sky.png"); + border: 2px dashed yellow; + width: 450px; + } + +.favoritestuff { +border: 5px double white; +width: 250px; +height: 180px; +position: absolute; +background-image: url("https://file.garden/aJzQmzrHVB4BLKwu/tumblrbg.gif"); +overflow-y: scroll; +} + +.etc { +border: 5px double white; +width: 250px; +height: 180px; +left:300px; +position: absolute; +background-image: url("https://file.garden/aJzQmzrHVB4BLKwu/tumblrbg.gif"); +overflow-y: scroll; +} + .badges { + + border: 5px groove white; + width: 290px; + height: 520px; + background:rgba(255, 255, 255, .5); + margin-left:650px; + overflow: scroll; + top:270px; + padding: 0.5%; + position: absolute; + + + + } + + .buttons { + color: #000; + background-image: url("https://file.garden/aJzQmzrHVB4BLKwu/tumblrbg.gif"); + border: 4px dashed yellow; + padding: 5px; + } + + .listening { + border: 5px groove white; + width: 280px; + height: 250px; + background:rgba(255, 255, 255, .5); + margin-top: 10px; + margin-left: 495px; + overflow: scroll; + padding: 0.5%; + position: absolute; + + + } + + #pictureofme { + + width: 250px; + position: absolute; + + background-size: 105%; + background-repeat: no-repeat; + height: 250px; + margin-left: 5px; + } + + + .maininfo { + + height: 443px; + width: 600px; + border: 5px double white; + overflow-y: scroll; + padding: 7px; + position: relative; + margin-left: 10px; + background:rgba(255, 255, 255, .5); + + } + #mainTable{ + +font-size: 19px; + +font-family: 'Times New Roman', serif; + +text-align: center; + +vertical-align: middle; + +width: 410px; + +margin-left: auto; + +margin-right: auto; + +border-collapse: separate; + +border-spacing: 10px 5px; + +} + +#leftField{ + +width: 120px; + +height: 150px; + +border: 1px solid #000; + +cursor: pointer; + +} +middleField{ + +width: 120px; + +height: 70px; + +border: 1px solid #000; + +cursor: pointer; + +} + +#rightField{ + +width: 120px; + +height: 150px; + +border: 1px solid #000; + +cursor: pointer; + +} + + .scrapbox { + + height: 443px; + width: 600px; + border: 5px double white; + overflow: scroll; + padding: 7px; + margin:0 auto; + background:rgba(255, 255, 255, .5); + + } + + + .favorites { + + border: 5px groove white; + width: 200px; + height: 250px; + background:rgba(255, 255, 255, .5); + + overflow: scroll; + padding: 0.5%; + position: absolute; + margin-top: 10px; + margin-left: 6px; + + + + } + + .fronter { + position: absolute; + right: 0px; + top: 0px; + + } + + .pkfronters--member-list--pronouns, +.pkfronters--member-card--pronouns +{ + word-break: break-word; +} + +.pkfronters--member-list--pronouns::before, +.pkfronters--member-card--pronouns::before +{ + content: '\0020('; +} + +.pkfronters--member-list--pronouns::after, +.pkfronters--member-card--pronouns::after +{ + content: ')\0020'; +} + +.pkfronters--member-card-container +{ + display: flex; + flex-flow: row wrap; + gap: 1rem; +} + +.pkfronters--member-card +{ + display: flex; + flex-flow: column wrap; + align-items: center; + max-width: 8em; + background: #fff2b8; + color: #000; +} + +.pkfronters--member-card--avatar +{ + min-width: 6rem; + width: 6rem; + min-height: 6rem; + height: 6rem; + margin: 0 0 0.5rem 0; + border-radius: 4px; + border: 4px solid transparent; +} + +.pkfronters--member-card--name +{ + text-align: center; +} + +.marquee { + margin:0 auto; + background: #fff; + color: #000; + border: 3px double white; + align-content: center; + + } + + h1 { + + font-size: 22px; + border: 3px dotted white; + } + +/* + * This is a manifest file that'll be compiled into application.css. + * + * With Propshaft, assets are served efficiently without preprocessing steps. You can still include + * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard + * cascading order, meaning styles declared later in the document or manifest will override earlier ones, + * depending on specificity. + * + * Consider organizing styles into separate files for maintainability. + */ diff --git a/app/assets/stylesheets/spiraleye.css b/app/assets/stylesheets/spiraleye.css new file mode 100644 index 0000000..a97f355 --- /dev/null +++ b/app/assets/stylesheets/spiraleye.css @@ -0,0 +1,529 @@ +/* -------------------------------------------------------- */ +/* VARIABLES */ +/* -------------------------------------------------------- */ + +/* Variables are used like this: var(--text-color) */ +:root { + /* Background Colors: */ + --background-color: #d1eed9; + --content-background-color: #ffffff; + --sidebar-background-color: #ffffff; + + /* Text Colors: */ + --text-color: #000000; + --sidebar-text-color: #000000; + --link-color: #008127; + --link-color-hover: #10ec10; + + /* Text: */ + --font: Monaco, monospace; + --heading-font: Lucida Console, monospace; + --font-size: 15px; + + /* Other Settings: */ + --margin: 10px; + --padding: 20px; + --border: 9px solid #000000; + --round-borders: 0px; + --sidebar-width: 480px; +} + +/* -------------------------------------------------------- */ +/* BASICS */ +/* -------------------------------------------------------- */ + +* { + box-sizing: border-box; +} + + .mainelouisa { + display: flex; + align-items: center; + justify-content: center; + min-height: 100vh; + font-size: var(--font-size); + margin: 0; + padding: var(--margin); + color: var(--text-color); + font-family: var(--font); + line-height: 1.2; + background: var(--background-color); + background-image: url("https://file.garden/aJzQmzrHVB4BLKwu/eyebg.png"); + +} + +::selection { + /* (Text highlighted by the user) */ + background: rgba(0, 0, 0, 0.2); +} + +mark { + /* Text highlighted by using the element */ + text-shadow: 1px 1px 4px var(--link-color); + background-color: inherit; + color: var(--text-color); +} + +/* Links: */ +a { + text-decoration: underline; +} + +a, +a:visited { + color: var(--link-color); +} + +.maiddnelouisa { +margin: 0 auto; + background-image: url("https://file.garden/aJzQmzrHVB4BLKwu/eyebg.png"); +} + +a:hover, +a:focus { + color: var(--link-color-hover); + text-decoration: none; +} + +/* -------------------------------------------------------- */ +/* LAYOUT */ +/* -------------------------------------------------------- */ + +.layout { + width: 1000px; + display: grid; + grid-gap: var(--margin); + grid-template: ".headerspiral .headerspiral" auto "leftSidebar .mainspiral" auto "footer footer" auto / var(--sidebar-width) auto; + /* Confused by the grid? Check out my tutorial: https://petrapixel.neocities.org/coding/positioning-tutorial#grid */ +} + +.mainspiral { + + overflow-y: auto; +position: absolute; + + background: var(--content-background-color); + border: var(--border); + border-radius: var(--round-borders); +} + +/* -------------------------------------------------------- */ +/* .headerspiral */ +/* -------------------------------------------------------- */ + +.headerspiral { + grid-area: header; + font-size: 1.2em; + border: var(--border); + border-radius: var(--round-borders); + background: var(--content-background-color); +} + +.headerspiral-content { + padding: var(--padding); +} + +.headerspiral-title { + font-family: var(--heading-font); + font-size: 1.5em; + font-weight: bold; +} + +.headerspiral-image img { + width: 90%; + height: auto; + text-align: center; +} + +/* -------------------------------------------------------- */ +/* SIDEBARS */ +/* -------------------------------------------------------- */ + +aside { + grid-area: aside; + border: var(--border); + border-radius: var(--round-borders); + overflow: hidden; + background: var(--sidebar-background-color); + padding: var(--padding); + color: var(--sidebar-text-color); +} + +.left-sidebar { + grid-area: leftSidebar; +} + +.right-sidebar { + grid-area: rightSidebar; +} + +.sidebar-title { + font-weight: bold; + font-size: 1.2em; + font-family: var(--heading-font); +} + +.sidebar-section:not(:last-child) { + margin-bottom: 3em; +} + +.sidebar-section ul, +.sidebar-section ol { + padding-left: 1.5em; +} + +.sidebar-section > *:not(p):not(ul):not(ol):not(blockquote) { + margin-top: 10px; +} + +/* Sidebar Blockquote: */ + +.sidebar-section blockquote { + background: rgba(0, 0, 0, 0.1); + padding: 15px; + margin: 1em 0; + border-radius: 10px; + overflow: hidden; +} + +.sidebar-section blockquote > *:first-child { + margin-top: 0; +} + +.sidebar-section blockquote > *:last-child { + margin-bottom: 0; +} + +/* Site Button: */ + +.site-button { + display: flex; + flex-direction: column; + align-items: center; +} + +.site-button textarea { + font-family: monospace; + font-size: 0.7em; +} + +/* -------------------------------------------------------- */ +/* FOOTER */ +/* -------------------------------------------------------- */ + +.footerspiral { + grid-area: footer; + border: var(--border); + border-radius: var(--round-borders); + overflow: hidden; + font-size: 0.75em; + padding: 15px; + background: var(--content-background-color); + display: flex; + justify-content: center; +} + +.footerspiral a, +.footerspiral a:visited { + color: var(--link-color); +} + +.footerspiral a:hover, +.footerspiral a:focus { + color: var(--link-color-hover); +} + +/* -------------------------------------------------------- */ +/* NAVIGATION */ +/* -------------------------------------------------------- */ + +nav { + margin-bottom: 3em; +} + +nav .sidebar-title { + margin-bottom: 0.5em; +} + +nav ul { + margin: 0 -5px; + padding: 0; + list-style: none; + user-select: none; +} + +nav ul li { + margin-bottom: 0; +} + +nav > ul li > a, +nav > ul li > strong { + display: inline-block; +} + +nav > ul li > a, +nav > ul li > details summary, +nav > ul li > strong { + padding: 5px 10px; +} + +nav > ul li > a.active, +nav > ul li > details.active summary { + font-weight: bold; +} + +nav ul summary { + cursor: pointer; +} + +nav ul ul li > a { + padding-left: 30px; +} + +/* NAVIGATION IN .headerspiral */ + +.headerspiral nav { + margin-bottom: 0; +} + +.headerspiral nav ul { + display: flex; + flex-wrap: wrap; + margin: 0; +} + +.headerspiral nav ul li { + position: relative; +} + +.headerspiral nav ul li:first-child > a { + padding-left: 0; +} + +.headerspiral nav ul li:last-child > a { + padding-right: 0; +} + +/* Subnavigation (Drop-Down): */ + +.headerspiral nav ul ul { + background: var(--content-background-color); + display: none; + position: absolute; + top: 100%; + left: 10px; + padding: 0.5em; + z-index: 1; + border: var(--border); + min-width: 100%; + box-shadow: 0px 1px 5px rgba(0,0,0,0.2); +} + +.headerspiral nav ul li:hover ul, +.headerspiral nav ul li:focus-within ul { + display: block; +} + +.headerspiral nav ul li strong { + color: var(--link-color); + text-decoration: underline; + font-weight: normal; +} + +.headerspiral nav ul ul li a { + display: block; + padding-left: 0; + padding-right: 0; +} + +/* -------------------------------------------------------- */ +/* CONTENT */ +/* -------------------------------------------------------- */ + +.mainspiral { + line-height: 1.5; +} + +.mainspiral a, +.mainspiral a:visited { + color: var(--link-color); +} + +.mainspiral a:hover, +.mainspiral a:focus { + color: var(--link-color-hover); + text-decoration-style: wavy; +} + +.mainspiral p, +.mainspiral .image, +.mainspiral .full-width-image, +.mainspiral .two-columns { + margin: 0.75em 0; +} + +.mainspiral ol, +.mainspiral ul { + margin: 0.5em 0; + padding-left: 1.5em; +} + +.mainspiral ol li, +.mainspiral ul li { + margin-bottom: 0.2em; + line-height: 1.3; +} + +.mainspiral ol { + padding-left: 2em; +} + +.mainspiral blockquote { + background: rgba(0, 0, 0, 0.1); + padding: 15px; + margin: 1em 0; + border-radius: 10px; +} + +.mainspiral pre { + margin: 1em 0 1.5em; +} + +.mainspiral code { + text-transform: none; +} + +.mainspiral center { + margin: 1em 0; + padding: 0 1em; +} + +.mainspiral hr { + border: 0; + border-top: var(--border); + margin: 1.5em 0; +} + +/* HEADINGS: */ + +.mainspiral h1, +.mainspiral h2, +.mainspiral h3, +.mainspiral h4, +.mainspiral h5, +.mainspiral h6 { + font-family: var(--heading-font); + margin-bottom: 0; + line-height: 1.5; +} + +.mainspiral h1:first-child, +.mainspiral h2:first-child, +.mainspiral h3:first-child, +.mainspiral h4:first-child, +.mainspiral h5:first-child, +.mainspiral h6:first-child { + margin-top: 0; +} + +.mainspiral h1 { + font-size: 1.5em; +} + +.mainspiral h2 { + font-size: 1.4em; +} + +.mainspiral h3 { + font-size: 1.3em; +} + +.mainspiral h4 { + font-size: 1.2em; +} + +.mainspiral h5 { + font-size: 1.1em; +} + +.mainspiral h6 { + font-size: 1em; +} + +/* COLUMNS: */ + +.two-columns { + display: flex; +} + +.two-columns > * { + flex: 1 1 0; + margin: 0; +} + +.two-columns > *:first-child { + padding-right: 0.75em; +} + +.two-columns > *:last-child { + padding-left: 0.75em; +} + +/* -------------------------------------------------------- */ +/* CONTENT IMAGES */ +/* -------------------------------------------------------- */ + +.image { + display: block; + width: auto; + height: auto; + max-width: 100%; +} + +.full-width-image { + display: block; + width: 100%; + height: auto; +} + +.images { + display: flex; + width: calc(100% + 5px + 5px); + margin-left: -5px; + margin-right: -5px; +} + +.images img { + width: 100%; + height: auto; + padding: 5px; + margin: 0; + overflow: hidden; +} + +/* -------------------------------------------------------- */ +/* ACCESSIBILITY */ +/* -------------------------------------------------------- */ + +/* please do not remove this. */ + +#skip-to-content-link { + position: fixed; + top: 0; + left: 0; + display: inline-block; + padding: 0.375rem 0.75rem; + line-height: 1; + font-size: 1.25rem; + background-color: var(--content-background-color); + color: var(--text-color); + transform: translateY(-3rem); + transition: transform 0.1s ease-in; + z-index: 99999999999; +} + +#skip-to-content-link:focus, +#skip-to-content-link:focus-within { + transform: translateY(0); +} + diff --git a/app/assets/stylesheets/spirit.css b/app/assets/stylesheets/spirit.css new file mode 100644 index 0000000..dff549f --- /dev/null +++ b/app/assets/stylesheets/spirit.css @@ -0,0 +1,15 @@ +.bodyspirit { + line-height: 1; + background-color: pink; + color: white; + font-size: 20px; + background-image: url('https://i.ibb.co/kgSHN1YJ/backstar-1.gif'); + text-align: center; +} + + +.bodyspirit a { + color: lightblue; +} + + diff --git a/app/channels/application_cable/connection.rb b/app/channels/application_cable/connection.rb new file mode 100644 index 0000000..4264c74 --- /dev/null +++ b/app/channels/application_cable/connection.rb @@ -0,0 +1,16 @@ +module ApplicationCable + class Connection < ActionCable::Connection::Base + identified_by :current_user + + def connect + set_current_user || reject_unauthorized_connection + end + + private + def set_current_user + if session = Session.find_by(id: cookies.signed[:session_id]) + self.current_user = session.user + end + end + end +end diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb new file mode 100644 index 0000000..f624feb --- /dev/null +++ b/app/controllers/application_controller.rb @@ -0,0 +1,23 @@ +class ApplicationController < ActionController::Base + include Authentication + # Only allow modern browsers supporting webp images, web push, badges, import maps, CSS nesting, and CSS :has. + allow_browser versions: :modern + + # Changes to the importmap will invalidate the etag for HTML responses + stale_when_importmap_changes + helper_method :current_user + + private + + def current_user + + @current_user ||= User.find_by(id: session[:user_id]) if session[:user_id] + end + + def authenticate_user! + unless Current.user + redirect_to new_session_path, alert: "You must be logged in to access this page." + end + end +end + diff --git a/app/controllers/concerns/.keep b/app/controllers/concerns/.keep new file mode 100644 index 0000000..e69de29 diff --git a/app/controllers/concerns/authentication.rb b/app/controllers/concerns/authentication.rb new file mode 100644 index 0000000..3538f48 --- /dev/null +++ b/app/controllers/concerns/authentication.rb @@ -0,0 +1,52 @@ +module Authentication + extend ActiveSupport::Concern + + included do + before_action :require_authentication + helper_method :authenticated? + end + + class_methods do + def allow_unauthenticated_access(**options) + skip_before_action :require_authentication, **options + end + end + + private + def authenticated? + resume_session + end + + def require_authentication + resume_session || request_authentication + end + + def resume_session + Current.session ||= find_session_by_cookie + end + + def find_session_by_cookie + Session.find_by(id: cookies.signed[:session_id]) if cookies.signed[:session_id] + end + + def request_authentication + session[:return_to_after_authenticating] = request.url + redirect_to new_session_path + end + + def after_authentication_url + session.delete(:return_to_after_authenticating) || root_url + end + + def start_new_session_for(user) + user.sessions.create!(user_agent: request.user_agent, ip_address: request.remote_ip).tap do |session| + Current.session = session + cookies.signed.permanent[:session_id] = { value: session.id, httponly: true, same_site: :lax } + end + end + + def terminate_session + Current.session.destroy + cookies.delete(:session_id) + end +end diff --git a/app/controllers/fun_controller.rb b/app/controllers/fun_controller.rb new file mode 100644 index 0000000..b6de130 --- /dev/null +++ b/app/controllers/fun_controller.rb @@ -0,0 +1,10 @@ +class FunController < ApplicationController + allow_unauthenticated_access + + def index + end + def spirit + end + def show + end +end diff --git a/app/controllers/miniblog_controller.rb b/app/controllers/miniblog_controller.rb new file mode 100644 index 0000000..16d804f --- /dev/null +++ b/app/controllers/miniblog_controller.rb @@ -0,0 +1,10 @@ +class MiniblogController < ApplicationController + + allow_unauthenticated_access + + def index + @updates = Miniblog.order(created_at: :desc) + end + + +end diff --git a/app/controllers/passwords_controller.rb b/app/controllers/passwords_controller.rb new file mode 100644 index 0000000..f95ec78 --- /dev/null +++ b/app/controllers/passwords_controller.rb @@ -0,0 +1,35 @@ +class PasswordsController < ApplicationController + allow_unauthenticated_access + before_action :set_user_by_token, only: %i[ edit update ] + rate_limit to: 10, within: 3.minutes, only: :create, with: -> { redirect_to new_password_path, alert: "Try again later." } + + def new + end + + def create + if user = User.find_by(email_address: params[:email_address]) + PasswordsMailer.reset(user).deliver_later + end + + redirect_to new_session_path, notice: "Password reset instructions sent (if user with that email address exists)." + end + + def edit + end + + def update + if @user.update(params.permit(:password, :password_confirmation)) + @user.sessions.destroy_all + redirect_to new_session_path, notice: "Password has been reset." + else + redirect_to edit_password_path(params[:token]), alert: "Passwords did not match." + end + end + + private + def set_user_by_token + @user = User.find_by_password_reset_token!(params[:token]) + rescue ActiveSupport::MessageVerifier::InvalidSignature + redirect_to new_password_path, alert: "Password reset link is invalid or has expired." + end +end diff --git a/app/controllers/posts_controller.rb b/app/controllers/posts_controller.rb new file mode 100644 index 0000000..6010014 --- /dev/null +++ b/app/controllers/posts_controller.rb @@ -0,0 +1,63 @@ +class PostsController < ApplicationController + + before_action :authenticate_user!, only: [:new, :create, :edit, :update, :destroy] + allow_unauthenticated_access(only: [:index, :show]) + + def index + @posts = Post.all.order(created_at: :desc) + @post = Post.find_by(params[:id]) + end + + def show + @post = Post.find(params[:id]) + + end + + def new + @user = Current.user + @post = Post.new + end + + def create + @post = Post.new(post_params) + if @post.save + redirect_to posts_path, notice: "post created." + else + render :new, status: :unprocessable_entity, notice: "U fucked up somewhere." + end + end + + def edit + @post = Post.find(params[:id]) + end + + def update + @post = Post.find(params[:id]) + if @post.update(post_params) + redirect_to posts_path, notice: "post edited." + else + render :edit, status: :unprocessable_entity, notice: "U fucked up somewhere." + end + end + + def destroy + @post = Post.find(params[:id]) + @post.destroy + + redirect_to posts_path, notice: "Post deleted." + end + + private + + + def post_params + params.require(:post).permit(:text, :icon_image) + end + def set_user + @user = Current.user + end + + + + +end diff --git a/app/controllers/scraps_controller.rb b/app/controllers/scraps_controller.rb new file mode 100644 index 0000000..24d3ed2 --- /dev/null +++ b/app/controllers/scraps_controller.rb @@ -0,0 +1,53 @@ +class ScrapsController < ApplicationController + allow_unauthenticated_access(only: %i[index show]) +def index + @scraps = Scrap.all +end + def edit + @scrap = Scrap.find(params[:id]) + end + + def update + @scrap = Scrap.find(params[:id]) + if @scrap.update(scrap_params) + redirect_to posts_path, notice: "scrap edited." + else + render :edit, status: :unprocessable_entity, notice: "U fucked up somewhere." + end + end + +def new +@scrap = Scrap.new +end + +def create + @scrap = Scrap.new(scrap_params) + if @scrap.save + redirect_to scraps_path, notice: "scrap created." + else + render :new, status: :unprocessable_entity, notice: "U fucked up somewhere." + end + end + +def destroy + @scrap = Scrap.find(params[:id]) + @scrap.destroy + redirect_to scrap_path(@scrap), notice: "Member deleted." + +end + +def show + @scrap = Scrap.find_by(id: params[:id]) + if @scrap.nil? + flash[:alert] = "Scrapbook entry not found" + redirect_to scraps_path + return + end +end + +private + + def scrap_params + params.require(:scrap).permit(:text, :image, :music, :mood, :notes) + end +end diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb new file mode 100644 index 0000000..cf7fccd --- /dev/null +++ b/app/controllers/sessions_controller.rb @@ -0,0 +1,21 @@ +class SessionsController < ApplicationController + allow_unauthenticated_access only: %i[ new create ] + rate_limit to: 10, within: 3.minutes, only: :create, with: -> { redirect_to new_session_path, alert: "Try again later." } + + def new + end + + def create + if user = User.authenticate_by(params.permit(:email_address, :password)) + start_new_session_for user + redirect_to after_authentication_url + else + redirect_to new_session_path, alert: "Try another email address or password." + end + end + + def destroy + terminate_session + redirect_to new_session_path, status: :see_other + end +end diff --git a/app/controllers/shrines_controller.rb b/app/controllers/shrines_controller.rb new file mode 100644 index 0000000..9a55d0a --- /dev/null +++ b/app/controllers/shrines_controller.rb @@ -0,0 +1,6 @@ +class ShrinesController < ApplicationController + allow_unauthenticated_access + + def spiraleye + end +end diff --git a/app/controllers/updates_controller.rb b/app/controllers/updates_controller.rb new file mode 100644 index 0000000..45a8ab0 --- /dev/null +++ b/app/controllers/updates_controller.rb @@ -0,0 +1,57 @@ +class UpdatesController < ApplicationController + + before_action :authenticate_user!, only: [:new, :create, :edit, :update, :destroy] + allow_unauthenticated_access(only: [:index, :show]) + + def index + @updates = Update.order(created_at: :desc) + end + + def show + + end + + def new + @user = Current.user + @update = Update.new + end + + def create + @update = Update.new(update_params) + if Updates.save + redirect_to updates_path, notice: "Update created." + else + render :new, status: :unprocessable_entity, notice: "U fucked up somewhere." + end + end + + def edit + end + + def update + if @update.update(post_params) + redirect_to updates_path, notice: "Update edited." + else + render :edit, status: :unprocessable_entity, notice: "U fucked up somewhere." + end + end + + def destroy + @update.destroy + redirect_to updates_path, notice: "Post deleted." + end + + private + + + def update_params + params.require(:update).permit(:text, :icon_image) + end + def set_user + @user = Current.user + end + +end + + + diff --git a/app/controllers/welcome_controller.rb b/app/controllers/welcome_controller.rb new file mode 100644 index 0000000..e28c992 --- /dev/null +++ b/app/controllers/welcome_controller.rb @@ -0,0 +1,10 @@ +class WelcomeController < ApplicationController + allow_unauthenticated_access(only: %i[index show homepage]) + + def index + end + def show + end + def homepage + end +end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb new file mode 100644 index 0000000..de6be79 --- /dev/null +++ b/app/helpers/application_helper.rb @@ -0,0 +1,2 @@ +module ApplicationHelper +end diff --git a/app/helpers/fun_helper.rb b/app/helpers/fun_helper.rb new file mode 100644 index 0000000..933f0e8 --- /dev/null +++ b/app/helpers/fun_helper.rb @@ -0,0 +1,2 @@ +module FunHelper +end diff --git a/app/helpers/miniblog_helper.rb b/app/helpers/miniblog_helper.rb new file mode 100644 index 0000000..82dcd95 --- /dev/null +++ b/app/helpers/miniblog_helper.rb @@ -0,0 +1,2 @@ +module MiniblogHelper +end diff --git a/app/helpers/posts_helper.rb b/app/helpers/posts_helper.rb new file mode 100644 index 0000000..a7b8cec --- /dev/null +++ b/app/helpers/posts_helper.rb @@ -0,0 +1,2 @@ +module PostsHelper +end diff --git a/app/helpers/scraps_helper.rb b/app/helpers/scraps_helper.rb new file mode 100644 index 0000000..1d5137c --- /dev/null +++ b/app/helpers/scraps_helper.rb @@ -0,0 +1,2 @@ +module ScrapsHelper +end diff --git a/app/helpers/shrines_helper.rb b/app/helpers/shrines_helper.rb new file mode 100644 index 0000000..1a4f242 --- /dev/null +++ b/app/helpers/shrines_helper.rb @@ -0,0 +1,2 @@ +module ShrinesHelper +end diff --git a/app/helpers/updates_helper.rb b/app/helpers/updates_helper.rb new file mode 100644 index 0000000..a9af2d4 --- /dev/null +++ b/app/helpers/updates_helper.rb @@ -0,0 +1,2 @@ +module UpdatesHelper +end diff --git a/app/helpers/welcome_helper.rb b/app/helpers/welcome_helper.rb new file mode 100644 index 0000000..eeead45 --- /dev/null +++ b/app/helpers/welcome_helper.rb @@ -0,0 +1,2 @@ +module WelcomeHelper +end diff --git a/app/javascript/application.js b/app/javascript/application.js new file mode 100644 index 0000000..9ae56c5 --- /dev/null +++ b/app/javascript/application.js @@ -0,0 +1,6 @@ +// Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails +import "@hotwired/turbo-rails" +import "controllers" + +import "trix" +import "@rails/actiontext" diff --git a/app/javascript/controllers/application.js b/app/javascript/controllers/application.js new file mode 100644 index 0000000..1213e85 --- /dev/null +++ b/app/javascript/controllers/application.js @@ -0,0 +1,9 @@ +import { Application } from "@hotwired/stimulus" + +const application = Application.start() + +// Configure Stimulus development experience +application.debug = false +window.Stimulus = application + +export { application } diff --git a/app/javascript/controllers/hello_controller.js b/app/javascript/controllers/hello_controller.js new file mode 100644 index 0000000..5975c07 --- /dev/null +++ b/app/javascript/controllers/hello_controller.js @@ -0,0 +1,7 @@ +import { Controller } from "@hotwired/stimulus" + +export default class extends Controller { + connect() { + this.element.textContent = "Hello World!" + } +} diff --git a/app/javascript/controllers/index.js b/app/javascript/controllers/index.js new file mode 100644 index 0000000..1156bf8 --- /dev/null +++ b/app/javascript/controllers/index.js @@ -0,0 +1,4 @@ +// Import and register all your controllers from the importmap via controllers/**/*_controller +import { application } from "controllers/application" +import { eagerLoadControllersFrom } from "@hotwired/stimulus-loading" +eagerLoadControllersFrom("controllers", application) diff --git a/app/javascript/sorter.js b/app/javascript/sorter.js new file mode 100644 index 0000000..08d9594 --- /dev/null +++ b/app/javascript/sorter.js @@ -0,0 +1,544 @@ + + diff --git a/app/jobs/application_job.rb b/app/jobs/application_job.rb new file mode 100644 index 0000000..d394c3d --- /dev/null +++ b/app/jobs/application_job.rb @@ -0,0 +1,7 @@ +class ApplicationJob < ActiveJob::Base + # Automatically retry jobs that encountered a deadlock + # retry_on ActiveRecord::Deadlocked + + # Most jobs are safe to ignore if the underlying records are no longer available + # discard_on ActiveJob::DeserializationError +end diff --git a/app/mailers/application_mailer.rb b/app/mailers/application_mailer.rb new file mode 100644 index 0000000..3c34c81 --- /dev/null +++ b/app/mailers/application_mailer.rb @@ -0,0 +1,4 @@ +class ApplicationMailer < ActionMailer::Base + default from: "from@example.com" + layout "mailer" +end diff --git a/app/mailers/passwords_mailer.rb b/app/mailers/passwords_mailer.rb new file mode 100644 index 0000000..4f0ac7f --- /dev/null +++ b/app/mailers/passwords_mailer.rb @@ -0,0 +1,6 @@ +class PasswordsMailer < ApplicationMailer + def reset(user) + @user = user + mail subject: "Reset your password", to: user.email_address + end +end diff --git a/app/models/application_record.rb b/app/models/application_record.rb new file mode 100644 index 0000000..b63caeb --- /dev/null +++ b/app/models/application_record.rb @@ -0,0 +1,3 @@ +class ApplicationRecord < ActiveRecord::Base + primary_abstract_class +end diff --git a/app/models/concerns/.keep b/app/models/concerns/.keep new file mode 100644 index 0000000..e69de29 diff --git a/app/models/current.rb b/app/models/current.rb new file mode 100644 index 0000000..2bef56d --- /dev/null +++ b/app/models/current.rb @@ -0,0 +1,4 @@ +class Current < ActiveSupport::CurrentAttributes + attribute :session + delegate :user, to: :session, allow_nil: true +end diff --git a/app/models/miniblog.rb b/app/models/miniblog.rb new file mode 100644 index 0000000..96174c1 --- /dev/null +++ b/app/models/miniblog.rb @@ -0,0 +1,2 @@ +class Miniblog < ApplicationRecord +end diff --git a/app/models/post.rb b/app/models/post.rb new file mode 100644 index 0000000..61e4c9a --- /dev/null +++ b/app/models/post.rb @@ -0,0 +1,6 @@ +class Post < ApplicationRecord +has_one_attached :icon_image +has_rich_text :text + + +end diff --git a/app/models/scrap.rb b/app/models/scrap.rb new file mode 100644 index 0000000..830668c --- /dev/null +++ b/app/models/scrap.rb @@ -0,0 +1,5 @@ +class Scrap < ApplicationRecord +has_one_attached :image +has_rich_text :text +has_rich_text :notes +end diff --git a/app/models/session.rb b/app/models/session.rb new file mode 100644 index 0000000..cf376fb --- /dev/null +++ b/app/models/session.rb @@ -0,0 +1,3 @@ +class Session < ApplicationRecord + belongs_to :user +end diff --git a/app/models/update.rb b/app/models/update.rb new file mode 100644 index 0000000..fb84e43 --- /dev/null +++ b/app/models/update.rb @@ -0,0 +1,9 @@ +class Update < ApplicationRecord +belongs_to :member +has_one_attached :icon_image + has_rich_text :text + validates :text, presence:true + +end + + diff --git a/app/models/user.rb b/app/models/user.rb new file mode 100644 index 0000000..ce13d2b --- /dev/null +++ b/app/models/user.rb @@ -0,0 +1,6 @@ +class User < ApplicationRecord + has_secure_password + has_many :sessions, dependent: :destroy + has_many :updates + normalizes :email_address, with: ->(e) { e.strip.downcase } +end diff --git a/app/views/active_storage/blobs/_blob.html.erb b/app/views/active_storage/blobs/_blob.html.erb new file mode 100644 index 0000000..49ba357 --- /dev/null +++ b/app/views/active_storage/blobs/_blob.html.erb @@ -0,0 +1,14 @@ +
attachment--<%= blob.filename.extension %>"> + <% if blob.representable? %> + <%= image_tag blob.representation(resize_to_limit: local_assigns[:in_gallery] ? [ 800, 600 ] : [ 1024, 768 ]) %> + <% end %> + +
+ <% if caption = blob.try(:caption) %> + <%= caption %> + <% else %> + <%= blob.filename %> + <%= number_to_human_size blob.byte_size %> + <% end %> +
+
diff --git a/app/views/fun/b5sorter.html.erb b/app/views/fun/b5sorter.html.erb new file mode 100644 index 0000000..fda5fe1 --- /dev/null +++ b/app/views/fun/b5sorter.html.erb @@ -0,0 +1,602 @@ + +<%= javascript_tag do %> +var namMember = new Array( + +"John Sheridan", + +"Delenn", + +"Londo Mollari", + +"Jeffrey Sinclair", + +"Michael Garibaldi", + +"G'Kar", + +"Lyta Alexander", + +"Talia Winters", + +"Susan Ivanova", + +"Na'toth", + +"Lennier", + +"Vir Cotto", + +"Mr. Morden", + +"Antono Refa", + +"Cartagia", + +"Virini", + +"Alfred Bester", + +"David Corwin", + +"Marcus Cole", + +"Stephen Franklin", + +"Byron Gordon", + +"Neroon", + +"Elizabeth Lochley", + +"Zack Allan", + +"Lorien", + +"Warren Keffer", + +"Ambassador Kosh", + +"Ulkesh/Kosh II", + +"Zathras", + +"Ta'Lon", + +"Catherine Sakai" + + +); + + + +//********************************************************* + + + +var lstMember = new Array(); + +var parent = new Array(); + +var equal = new Array(); + +var rec = new Array(); + +var cmp1,cmp2; + +var head1,head2; + +var nrec; + + + +var numQuestion; + +var totalSize; + +var finishSize; + +var finishFlag; + + + +//The initialization of the variable+++++++++++++++++++++++++++++++++++++++++++++ + +function initList(){ + +var n = 0; + +var mid; + +var i; + + + +//The sequence that you should sort + +lstMember[n] = new Array(); + +for (i=0; i=2) { + +mid = Math.ceil(lstMember[i].length/2); + +lstMember[n] = new Array(); + +lstMember[n] = lstMember[i].slice(0,mid); + +totalSize += lstMember[n].length; + +parent[n] = i; + +n++; + +lstMember[n] = new Array(); + +lstMember[n] = lstMember[i].slice(mid,lstMember[i].length); + +totalSize += lstMember[n].length; + +parent[n] = i; + +n++; + +} + +} + + + +//Preserve this sequence + +for (i=0; i0) { + +rec[nrec] = lstMember[cmp2][head2]; + +head2++; + +nrec++; + +finishSize++; + +while (equal[rec[nrec-1]]!=-1) { + +rec[nrec] = lstMember[cmp2][head2]; + +head2++; + +nrec++; + +finishSize++; + +} + +} + +else { + +rec[nrec] = lstMember[cmp1][head1]; + +head1++; + +nrec++; + +finishSize++; + +while (equal[rec[nrec-1]]!=-1) { + +rec[nrec] = lstMember[cmp1][head1]; + +head1++; + +nrec++; + +finishSize++; + +} + +equal[rec[nrec-1]] = lstMember[cmp2][head2]; + +rec[nrec] = lstMember[cmp2][head2]; + +head2++; + +nrec++; + +finishSize++; + +while (equal[rec[nrec-1]]!=-1) { + +rec[nrec] = lstMember[cmp2][head2]; + +head2++; + +nrec++; + +finishSize++; + +} + +} + + + +//Processing after finishing with one list + +if (head1"+Math.floor(finishSize*100/totalSize)+"% sorted."; + +document.getElementById("battleNumber").innerHTML = str; + + + +showResult(); + +finishFlag = 1; + +} + +else { + +showImage(); + +} + +} + + + +//The results+++++++++++++++++++++++++++++++++++++++++++++++ + +//順位=Rank/Grade/Position/Standing/Status + +//名前=Identification term + +function showResult() { + +var ranking = 1; + +var sameRank = 1; + +var str = ""; + +var i; + + + +str += ""; + +str += "
rank<\/td>options<\/td><\/tr>"; + + + +for (i=0; i"+ranking+"<\/td>"+namMember[lstMember[0][i]]+"<\/td><\/tr>"; + +if (i"+Math.floor(finishSize*100/totalSize)+"% sorted."; + +var str1 = ""+toNameFace(lstMember[cmp1][head1]); + +var str2 = ""+toNameFace(lstMember[cmp2][head2]); + + + +document.getElementById("battleNumber").innerHTML = str0; + +document.getElementById("leftField").innerHTML = str1; + +document.getElementById("rightField").innerHTML = str2; + + + +numQuestion++; + +} + + +document.addEventListener("turbo:load", function () { + initList(); + showImage(); +}); +//Convert numeric value into a name (emoticon)+++++++++++++++++++++++++++++++ + +function toNameFace(n){ + +var str = namMember[n]; + + + +/* + +str += '
'; + +switch(n) { + +//case -1 Because it is a sample, delete it + +case -1: str+=""; break; + +}*/ + +return str; + +} + +<% end %> + + +

+



+BABYLON 5 FAVORITE CHARACTER SORTER

pick who you like better in each battle to get an accurate list of your
favorite characters from the show. does not include crusade.
note: hitting 'no opinion' or 'I like both' frequently will negatively affect your results.

+ + + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
battle #1
0% sorted.
+ +I like both + +
+ +no opinion + +
+ +

+ +
+ +
+ +
+

+



used with permission.

created by biasorter. +
+ diff --git a/app/views/fun/index.html.erb b/app/views/fun/index.html.erb new file mode 100644 index 0000000..cf07f13 --- /dev/null +++ b/app/views/fun/index.html.erb @@ -0,0 +1,38 @@ +
+

little pixel library!!

+a book-related pixel clique :') +

+my pixel covers underlined in pink...
+
+The Orange Eats Creeps by Grace KrilanovichSerious Weakness by Porpentine Charity HeartscapeWar and Peace by Leo TolstoyHouse of Leaves by Mark Z. Danielewski +
+
+

Things I Made

+
AO3 Clone in HTML
+ + +A while ago I made a semi-functional AO3 clone in HTML/css. You use this by copying and pasting your works into the work template, then updating the profile and tag pages to link to each work. +

+It's insane, but if you're curious or up for a tedious project, or are dreaming of hosting OTW-Archive one day and want to spin up a prototype, you can download it here.

+ +
+ +
Babylon 5 favorite character sorter
+ I didn't code this, biasorter on Tumblr did, I just made it B5. Do you want to know your ultimate favs in B5? Check it out here! +
+
Graphics
+janestamp +flexstamp +cliffstamp +larrystamp +ritastamp +maurastamp +laurastamp +vicstamp +babylon5stamp
DOOM-PATROL +ALIEN-GENDER +YAY-LESBIANS +BUTCH-LESBIAN +FEMME-LESBIAN-1
+ + diff --git a/app/views/layouts/action_text/contents/_content.html.erb b/app/views/layouts/action_text/contents/_content.html.erb new file mode 100644 index 0000000..9e3c0d0 --- /dev/null +++ b/app/views/layouts/action_text/contents/_content.html.erb @@ -0,0 +1,3 @@ +
+ <%= yield -%> +
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb new file mode 100644 index 0000000..2f114cd --- /dev/null +++ b/app/views/layouts/application.html.erb @@ -0,0 +1,39 @@ + + + + <%= content_for(:title) || "alien-kissing-computer" %> + + + + + <%= csrf_meta_tags %> + <%= csp_meta_tag %> + + <%= yield :head %> + + <%# Enable PWA manifest for installable apps (make sure to enable in config/routes.rb too!) %> + <%#= tag.link rel: "manifest", href: pwa_manifest_path(format: :json) %> + + + + + <%# Includes all stylesheet files in app/assets/stylesheets %> + <%= stylesheet_link_tag :app, "data-turbo-track": "reload" %> + <%= javascript_importmap_tags %> + + + +
+ <% if authenticated? %> + <%= button_to "Sign out", session_path, method: :delete %> + <% else %> + <%= link_to "🛸", new_session_path %> + <% end %> +
+ <%= yield %> +
source
+ + diff --git a/app/views/layouts/mailer.html.erb b/app/views/layouts/mailer.html.erb new file mode 100644 index 0000000..3aac900 --- /dev/null +++ b/app/views/layouts/mailer.html.erb @@ -0,0 +1,13 @@ + + + + + + + + + <%= yield %> + + diff --git a/app/views/layouts/mailer.text.erb b/app/views/layouts/mailer.text.erb new file mode 100644 index 0000000..37f0bdd --- /dev/null +++ b/app/views/layouts/mailer.text.erb @@ -0,0 +1 @@ +<%= yield %> diff --git a/app/views/miniblog/index.html.erb b/app/views/miniblog/index.html.erb new file mode 100644 index 0000000..3fcb07a --- /dev/null +++ b/app/views/miniblog/index.html.erb @@ -0,0 +1,12 @@ +
+
+

Recent Updates

+ +<% if current_user.present? %> + + <%= link_to 'New', new_updates_path(@update) %> + + <% end %> +
+
+ diff --git a/app/views/passwords/edit.html.erb b/app/views/passwords/edit.html.erb new file mode 100644 index 0000000..9f0c87c --- /dev/null +++ b/app/views/passwords/edit.html.erb @@ -0,0 +1,9 @@ +

Update your password

+ +<%= tag.div(flash[:alert], style: "color:red") if flash[:alert] %> + +<%= form_with url: password_path(params[:token]), method: :put do |form| %> + <%= form.password_field :password, required: true, autocomplete: "new-password", placeholder: "Enter new password", maxlength: 72 %>
+ <%= form.password_field :password_confirmation, required: true, autocomplete: "new-password", placeholder: "Repeat new password", maxlength: 72 %>
+ <%= form.submit "Save" %> +<% end %> diff --git a/app/views/passwords/new.html.erb b/app/views/passwords/new.html.erb new file mode 100644 index 0000000..44efb2b --- /dev/null +++ b/app/views/passwords/new.html.erb @@ -0,0 +1,8 @@ +

Forgot your password?

+ +<%= tag.div(flash[:alert], style: "color:red") if flash[:alert] %> + +<%= form_with url: passwords_path do |form| %> + <%= form.email_field :email_address, required: true, autofocus: true, autocomplete: "username", placeholder: "Enter your email address", value: params[:email_address] %>
+ <%= form.submit "Email reset instructions" %> +<% end %> diff --git a/app/views/passwords_mailer/reset.html.erb b/app/views/passwords_mailer/reset.html.erb new file mode 100644 index 0000000..1b09154 --- /dev/null +++ b/app/views/passwords_mailer/reset.html.erb @@ -0,0 +1,6 @@ +

+ You can reset your password on + <%= link_to "this password reset page", edit_password_url(@user.password_reset_token) %>. + + This link will expire in <%= distance_of_time_in_words(0, @user.password_reset_token_expires_in) %>. +

diff --git a/app/views/passwords_mailer/reset.text.erb b/app/views/passwords_mailer/reset.text.erb new file mode 100644 index 0000000..aecee82 --- /dev/null +++ b/app/views/passwords_mailer/reset.text.erb @@ -0,0 +1,4 @@ +You can reset your password on +<%= edit_password_url(@user.password_reset_token) %> + +This link will expire in <%= distance_of_time_in_words(0, @user.password_reset_token_expires_in) %>. diff --git a/app/views/posts/edit.html.erb b/app/views/posts/edit.html.erb new file mode 100644 index 0000000..cfa7150 --- /dev/null +++ b/app/views/posts/edit.html.erb @@ -0,0 +1,20 @@ +
+ +
+<%= form_with model: [@post] do |f| %> + +
+ <%= f.label :text %> + <%= f.rich_text_area :text %> +
+ + + <%= f.label :icon_image %> + <%= f.file_field :icon_image %> +
+ + <%= f.submit "Edit Update" %> +<% end %> + +
+ diff --git a/app/views/posts/index.html.erb b/app/views/posts/index.html.erb new file mode 100644 index 0000000..5582267 --- /dev/null +++ b/app/views/posts/index.html.erb @@ -0,0 +1,34 @@ + +
+<% if authenticated? %> + <%= link_to 'New Update', new_post_path %> + <% else %> + . +<% end %> +
+

Recent Updates

+ +
+
+<% @posts.each do |post| %> + + <% if post.icon_image.attached? %> + <%= image_tag post.icon_image %> + <% else %> + 🛸 + <% end %> <%= time_ago_in_words(@post.created_at) %> ago

<% if authenticated? %> +| + <%= link_to 'Edit', edit_post_path(post) %> + <%= link_to 'Destroy', post_path(post), data: { + turbo_method: :delete, + turbo_confirm: "Are you sureee?" + } %> + <% else %> + <% end %> + <%= post.text %> +
+<% end %> + +
+
+ diff --git a/app/views/posts/new.html.erb b/app/views/posts/new.html.erb new file mode 100644 index 0000000..e6bc92f --- /dev/null +++ b/app/views/posts/new.html.erb @@ -0,0 +1,24 @@ +
+<% if authenticated? %> + <%= link_to 'New Update', new_post_path %> + <% else %> + . +<% end %> +
+<%= form_with model: [@post] do |f| %> + +
+ <%= f.label :text %> + <%= f.rich_text_area :text %> +
+ + + <%= f.label :icon_image %> + <%= f.file_field :icon_image %> +
+ + <%= f.submit "Create Update" %> +<% end %> + +
+
diff --git a/app/views/posts/show.html.erb b/app/views/posts/show.html.erb new file mode 100644 index 0000000..e69de29 diff --git a/app/views/pwa/manifest.json.erb b/app/views/pwa/manifest.json.erb new file mode 100644 index 0000000..0e14b66 --- /dev/null +++ b/app/views/pwa/manifest.json.erb @@ -0,0 +1,22 @@ +{ + "name": "Playground", + "icons": [ + { + "src": "/icon.png", + "type": "image/png", + "sizes": "512x512" + }, + { + "src": "/icon.png", + "type": "image/png", + "sizes": "512x512", + "purpose": "maskable" + } + ], + "start_url": "/", + "display": "standalone", + "scope": "/", + "description": "Playground.", + "theme_color": "red", + "background_color": "red" +} diff --git a/app/views/pwa/service-worker.js b/app/views/pwa/service-worker.js new file mode 100644 index 0000000..b3a13fb --- /dev/null +++ b/app/views/pwa/service-worker.js @@ -0,0 +1,26 @@ +// Add a service worker for processing Web Push notifications: +// +// self.addEventListener("push", async (event) => { +// const { title, options } = await event.data.json() +// event.waitUntil(self.registration.showNotification(title, options)) +// }) +// +// self.addEventListener("notificationclick", function(event) { +// event.notification.close() +// event.waitUntil( +// clients.matchAll({ type: "window" }).then((clientList) => { +// for (let i = 0; i < clientList.length; i++) { +// let client = clientList[i] +// let clientPath = (new URL(client.url)).pathname +// +// if (clientPath == event.notification.data.path && "focus" in client) { +// return client.focus() +// } +// } +// +// if (clients.openWindow) { +// return clients.openWindow(event.notification.data.path) +// } +// }) +// ) +// }) diff --git a/app/views/scraps/edit.html.erb b/app/views/scraps/edit.html.erb new file mode 100644 index 0000000..e69de29 diff --git a/app/views/scraps/index.html.erb b/app/views/scraps/index.html.erb new file mode 100644 index 0000000..a890ec6 --- /dev/null +++ b/app/views/scraps/index.html.erb @@ -0,0 +1,25 @@ +
+<% if authenticated? %> + <%= link_to 'New Scrap', new_scrap_path %> + <% else %> + . +<% end %>

+

SCRAPBOOK

+random thoughts longer than miniblog length will go here :)

+
+<% @scraps.each do |scrap| %> + + + + <%= truncate(scrap.text.to_plain_text, length: 350) %> (<%= link_to 'Read', scrap_path(scrap) %>) | <%= time_ago_in_words(scrap.created_at) %> ago +
+<% if authenticated? %> +| + <%= link_to 'Edit', edit_scrap_path(scrap) %> + <%= link_to 'Destroy', scrap_path(scrap), data: { + turbo_method: :delete, + turbo_confirm: "Are you sureee?" + } %> + <% else %> + <% end %>


+ <% end %> diff --git a/app/views/scraps/new.html.erb b/app/views/scraps/new.html.erb new file mode 100644 index 0000000..06225c8 --- /dev/null +++ b/app/views/scraps/new.html.erb @@ -0,0 +1,33 @@ +<% if authenticated? %> + <%= link_to 'New Scrap', new_scrap_path %> + <% else %> + . +<% end %> +
+<%= form_with model: [@scrap] do |f| %> + +
+ <%= f.label :text %> + <%= f.rich_text_area :text %> +
+ +
+ <%= f.label :image %> + <%= f.file_field :image %> +
+
+ <%= f.label :mood %> + <%= f.text_area :mood %> +
+ +
+ <%= f.label :music %> + <%= f.text_area :music %> +
+ +
+ <%= f.label :notes %> + <%= f.rich_text_area :notes %> +
+ <%= f.submit "Create Scrap" %> +<% end %> diff --git a/app/views/scraps/show.html.erb b/app/views/scraps/show.html.erb new file mode 100644 index 0000000..5d99866 --- /dev/null +++ b/app/views/scraps/show.html.erb @@ -0,0 +1,20 @@ +
+
+<%= link_to '[ b a c k . . ? ]', scraps_path %> +

SCRAPBOOK ENTRY #<%= @scrap.id %>

+ <%= @scrap.text %> + +

+

+



+<% if @scrap.music.present? %> + Current Music: + <%= @scrap.music %> + <% end %> +

+<% if @scrap.mood.present? %> +

+ Current Mood: + <%= @scrap.mood %>

+ <% end %> +
diff --git a/app/views/sessions/new.html.erb b/app/views/sessions/new.html.erb new file mode 100644 index 0000000..ff641c4 --- /dev/null +++ b/app/views/sessions/new.html.erb @@ -0,0 +1,11 @@ +<%= tag.div(flash[:alert], style: "color:red") if flash[:alert] %> +<%= tag.div(flash[:notice], style: "color:green") if flash[:notice] %> + +<%= form_with url: session_path do |form| %> + <%= form.email_field :email_address, required: true, autofocus: true, autocomplete: "username", placeholder: "Enter your email address", value: params[:email_address] %>
+ <%= form.password_field :password, required: true, autocomplete: "current-password", placeholder: "Enter your password", maxlength: 72 %>
+ <%= form.submit "Sign in" %> +<% end %> +
+ +<%= link_to "Forgot password?", new_password_path %> diff --git a/app/views/shrines/index.html.erb b/app/views/shrines/index.html.erb new file mode 100644 index 0000000..7e49049 --- /dev/null +++ b/app/views/shrines/index.html.erb @@ -0,0 +1,6 @@ +
+SPIRAL EYE - A shrine to Elouisa from Palia;
+AMBITION - A shrine to Morden from Babylon 5; currently hosted off-site
+SPIRIT - A shrine to the fictional Negative Spirit species from Doom Patrol TV;
+coming soon...
+SHADOW OF A GHOST - A shrine to Anna Sheridan from Babylon 5. diff --git a/app/views/shrines/spiraleye.html.erb b/app/views/shrines/spiraleye.html.erb new file mode 100644 index 0000000..f56cc36 --- /dev/null +++ b/app/views/shrines/spiraleye.html.erb @@ -0,0 +1,72 @@ + +
+ + + + Skip to content + +
+ + + + + +
+
+ +
+
+
a crawly conundrum
+ + + + +
+ + + + + + +
+ +
+ + + + +
+spiral eye, a fan-shrine for the wonderful elouisa from the video game palia. +

established oct 15, 2025; last updated oct 17, 2025.

+

this site will update as palia updates.

+

+ +
+
+ + + + + + + + + + +
+
diff --git a/app/views/shrines/spiraleyeabout.html.erb b/app/views/shrines/spiraleyeabout.html.erb new file mode 100644 index 0000000..3668b41 --- /dev/null +++ b/app/views/shrines/spiraleyeabout.html.erb @@ -0,0 +1,93 @@ + +
+ + + + Skip to content + +
+ + + + + +
+
+ +
+
+
a crawly conundrum
+ + + + +
+ + + + + + +
+ +
+ + + + +
+
"There are several people in Palia who have a thirst for knowledge, and Elouisa is one of them. While her twin sister, Caleri, satiates her desire for information with books, Elouisa explores the world to learn. She enjoys the weird things in life, and if you get close to her, you’ll be dragged along on some of her expeditions. + +Elouisa enjoys Bugs and anything you can gather from the overworld like Sundrop Lilies or Wild Green Onions." - Source +

Background



+ *note: I am still working through Elouisa's quests, so this may not be comprehensive.

+ Elouisa is an adult Majiri.

Growing up with her twin sister, Caleri, their parents put a significant amount of pressure on both of them --- pressure that shifted entirely to Caleri when Elouisa's mental illness developed later in her life. She is the older twin by a few minutes.

With her best friend, Gabrina, she took on a significant interest in cryptids and the paranormal, and with Gabrina they were the "paranormal pals". One night, however, after Elouisa begged her to look for a Brighteyes---a cryptid creature--- Gabrina took a lantern made of Flow to their hunt. Elouisa, knowing the Brighteyes feared Flow, extinguished the light, and Gabrina disappeared. Later, she reappeared with a broken arm and began to shun Elouisa for her interest in the paranormal just like everyone else had.

Likes

+ Favorite items to be gifted: +
  • Rainbow-tipped butterfly
  • +
  • Aquamarine gemstone
  • +
  • Flowtato fries
  • +
  • Albino eel
  • +
  • Any bug or fish
  • +

    Theories

    +Elouisa has a variety of paranormal theories. Here are a few: +
  • Humans did not go extinct; they went underground
  • +
  • Auni may be a cryptid
  • +
  • Bugs may be travelers from another dimension
  • +
  • Ancient flowbugs have butts that give off pure Flow energy, and have a psychic link with Silverwing eggs
  • +
  • Fish can communicate psychically with plants
  • +
  • Palium prevents eavesdropping
  • +
  • Gabrina was switched with a Brightfiend, a copy of a person that actually spies for the Brightworld
  • +
  • Cutthroat Trout are the serial killers of the fish world
  • +
    +You can learn about the webmaster here! + +

    +
    +
    + + + + + + + + + + +
    +
    diff --git a/app/views/shrines/spiraleyeabtsite.html.erb b/app/views/shrines/spiraleyeabtsite.html.erb new file mode 100644 index 0000000..5db8d3b --- /dev/null +++ b/app/views/shrines/spiraleyeabtsite.html.erb @@ -0,0 +1,70 @@ + +
    + + + + Skip to content + +
    + + + + + +
    +
    + +
    +
    +
    a crawly conundrum
    + + + + +
    + + + + + + +
    + +
    + +

    About the Site

    +

    I fell in love with Palia immediately after I started playing it in January 2024. I found myself drawn to almost every character, but I found myself particularly drawn to Elouisa when I met her. I decided to make a fansite in October 2025, after the Ghost of You shrine challenge inspired me to get into making websites dedicated to characters I love. While this isn't for that challenge specifically, it was a huge inspiration to me.

    +

    I love Palia because I love playing video games but I really suck at video games that involve combat-related mechanics. because of this, I never looked into video games as a whole, instead sticking to playing The Sims and making my own browser-based text games. However, Palia's holistic nature -- the ability to have so many skills, the amount of villagers to interact with, the quests, the items, the lack of fall damage or player injury mechanics or any kind, the focus on calmness without rejecting plot --- this got me to be more interested in video games, and I've found myself branching out more and more since I started playing. It has really given me an appreciation for the medium - all genres, not just Palia's.

    +

    I love Elouisa because... well. I see myself in her. I too struggle with the same mental illness she does, I have the same hyperniche and whimsical nature she does, and many parts of me have been rejected for being too eccentric like she was. I just want the best for her forever. Also she's hot.

    +

    About the Webmaster

    + I'm Agnes (it/zhe/xe/she), a 24 year old computer hobbyist. I run a variety of websites for fun. I really love fantasy and sci-fi, and I've been a writer and artist my whole life. I have been a fan of computers since I was 5 and was given (supervised!) access to what we called back then "the computer room". I love creativity. I also love women. That's about it. + +
    +
    + + + + + + + + + + +
    +
    diff --git a/app/views/shrines/spiraleyefanworks.html.erb b/app/views/shrines/spiraleyefanworks.html.erb new file mode 100644 index 0000000..d1f73ae --- /dev/null +++ b/app/views/shrines/spiraleyefanworks.html.erb @@ -0,0 +1,84 @@ + +
    + + + + Skip to content + + diff --git a/app/views/shrines/spiraleyeggallery.html.erb b/app/views/shrines/spiraleyeggallery.html.erb new file mode 100644 index 0000000..febab79 --- /dev/null +++ b/app/views/shrines/spiraleyeggallery.html.erb @@ -0,0 +1,75 @@ + +
    + + + + Skip to content + +
    + + + + + +
    +
    + +
    +
    +
    a crawly conundrum
    + + + + +
    + + + + + + +
    + +
    + + + + +
    A collection of Elouisa screenshots. + +

    Elouisa's Room

    + +

    Elouisa Concept Art

    +by sasha frantseva..
    +
    +

    + +
    +
    + + + + + + + + + + +
    +
    diff --git a/app/views/shrines/spiraleyelinks.html.erb b/app/views/shrines/spiraleyelinks.html.erb new file mode 100644 index 0000000..28ad2f2 --- /dev/null +++ b/app/views/shrines/spiraleyelinks.html.erb @@ -0,0 +1,81 @@ + +
    + + + + Skip to content + +
    + + + + + +
    +
    + +
    +
    +
    a crawly conundrum
    + + + + +
    + + + + + + +
    + +
    + + + + + + Link to me-- + (Please do NOT hotlink! Upload to your own site or image hosting platform 🙂)
    + + + + +
    + Links out---
    + +
    + Guestbook +
    + Leave me a message! + +
    +
    + + + + + + + + + + +
    +
    diff --git a/app/views/shrines/spirit.html.erb b/app/views/shrines/spirit.html.erb new file mode 100644 index 0000000..348ed57 --- /dev/null +++ b/app/views/shrines/spirit.html.erb @@ -0,0 +1,22 @@ +
    +

    +

    HOME QUIZZES EXPLANATION SCREENSHOTS & VIDEOS WORLDBUILDING

    + + + Welcome to the homepage of the Negative Spirits! This is a fanpage for the fictional species known as the Negative Spirits from the show Doom Patrol on DC Universe (then, later, HBO Max).

    +

    WHY NOT THE COMICS?

    + I originally fell in love with the Negative Spirit and their species while watching the Doom Patrol show in 2019. While I respect the comics as the basis of the media I love, I don't really care about them as much as the show. However, much of the lore in the headcanons zone is based tangentially on Gerard Way's run of Doom Patrol. +

    WHAT ARE NEGATIVE SPIRITS?

    + Negative Spirits are a fictional alien race from the show Doom Patrol, based on the comic series by DC Comics. While the show they come from is based largely on a specific run from the comics (Morrison's), I consider TV Negative Spirits to be divergent from comic Negative Spirits. Negative Spirits are noncorporeal aliens formed of pure energy that have a variety of powers, such as immortality, psychic ability, interdimensional travel, electrocution and electricity manipulation, flight, and possession of human hosts (though it makes them radioactive, but this can be contained via emotional bonding with host). +

    WHY DO THEY FASCINATE ME SO MUCH?

    + The Negative Spirits have been shown to be extremely emotionally sensitive, at least according to Niles Caulder. Larry's Negative Spirit, specifically, is my favorite character in the whole universe, and I find its heroic nature to be very beautiful. Larry doesn't want to intervene, doesn't want to help, only wants to hide and shrivel away, but his Negative Spirit forces him to help. Larry doesn't want to heal from his trauma and his Negative Spirit helps him confront his demons. His Negative Spirit helps save the world and fight evil and wants to be in the center of it all, and it has no reason to do this as the world has only been unkind and cruel to it during 95% of its time on earth.

    + Now, the Negative Spirit is still an asshole, but that's also part of why I love it. It puts Larry on the ceiling when he tries to communicate with it. It repeatedly leaves Larry's body (which knocks him unconscious). It crashes Larry's bus after he calls it a parasite. But there are also so many tender moments between them--Larry saying they have an untraditional connection in Frances Patrol, Larry saying he believes in it, their general closeness during the 6 month time skip between 1x14 and 1x15, Larry falling asleep with his hand over his chest as it emitted its glow, Larry's attempted sacrifice and it choosing to stay, and of course the face touch. Negative Spirits are, well, aliens with complex emotional states! Larry's NS only seems to lash out when Larry is cruel to it, as Larry's self hatred is extremely torturous to live with---Negative spirits are merged with their host's mind and thoughts on top of being incredibly emotionally sensitive already.

    + And then there's Valentina Vostok, who is Larry's narrative parallel. A glimpse into what could be for him. Her Negative Spirit has bonded with her entirely, they "fell in love", and they have perfect communication. Larry thinks this has made her entirely alien, but her and her Spirit were alone in a ship with two corpses for Fifty Years, so that kind of isolation rusts the connection to humanity a bit. Valentina acts detached from Earth, more serene, and so does her Spirit; this indicates to me that merging with a Negative Spirit can be a beautiful thing under the right circumstances. Or maybe the most desperate circumstances. +

    I love the Negative Spirits so much.

    LINK TO ME!!

    + button

    +Contact
    +Agnes the Alien
    +alienhospitals@gmail.com
    +kissing.computer
    + + diff --git a/app/views/shrines/spirithc.html.erb b/app/views/shrines/spirithc.html.erb new file mode 100644 index 0000000..6ae252d --- /dev/null +++ b/app/views/shrines/spirithc.html.erb @@ -0,0 +1,17 @@ +

    +

    HOME QUIZZES EXPLANATION SCREENSHOTS & VIDEOS WORLDBUILDING

    + +

    HEADCANONS/WORLDBUILDING

    +Most of this is based on the Gerard Way comics.
    +
    +negative spirits experience everything more intensely than we do. emotions especially, but also sensations and experiences. it's almost unbearable for them, and a major emphasis in spirit society is on dealing with these emotions. hence, creativity is encouraged as an outlet for them, and those particularly good at expressing themselves are highly respected - an example of this is the great poets.

    +the naming rule. in the comics, the only named spirits have four letter first and last names; hence, it is my opinion that in the negative space, spirits are usually given names that have only four letters. spirits may choose any name they wish over the course of their existence, but the "default" spirit names when created have four letters only.

    +speaking of creation... negative spirits do not reproduce sexually, they are incapable of it. instead, to reproduce, they use a system similar to the loom theory from doctor who. the family extracts negative energy from their existence. to create a new being, the spirits need at least one source of negative energy, though there can be more than one source, and the more sources a spirit has, the more powerful they are. the spirit is then woven together and has the knowledge of their source spirits as well, but must adjust to life on their own. when a spirit extracts their energy, they lose an aspect of themselves, whether it is a memory, a trait, a skill, or something else, so many spirits are hesitant to reproduce. +

    spirits are immortal. they do not die in their own habitat ever. if the dimension gets too populated beyond what it can sustain, the great sun expands it further; therefore the negative space is technically infinite.

    negative spirits mate for life. unless they don't. there is the idea of a b'keh, a soul pairing. this can be of any kind; platonic, romantic, undefined. some have more than one. once they find their soulmate, both/all are taken to what is called a realization sequence -- they are briefly transported into a psychic projection involving the two spirits that displays meaningful imagery to them and generally lets them know that they've found their soulmate(s). however, many spirits do not participate in this aspect of spirit culture and those who choose not to do not experience realization sequences. everything in the negative space is voluntary, which is why being involuntarily forced out of the negative space was so hard for larry's spirit. +the soulmates are said to be chosen by... +

    the great sun. this is the negative space's concept of the being that created the negative space, it is not deified in the traditional human sense but rather considered a personal friend of each negative spirit. there are many different views of the great sun, and many different belief systems, but most of them have the great sun as a central figure. the great sun is a being that lives within the fabric that composes the dimension; it created the Hall of N'Hal first before anything else in the dimension, hence N'Hal hall is considered the atelier of the dimension. religion in the negative space is different than on earth; in the negative space the great sun is prayed to, yes, and is considered to be very powerful, but it is considered offensive to the great sun to worship it or give offerings, because the great sun is supposed to be seen as similar to any negative spiritit is a friend, not a deity to them. its warmth embraces everyone. +
    +Contact
    +Agnes Alien
    +spirits@alien.hospital
    +
    diff --git a/app/views/shrines/spiritquiz.html.erb b/app/views/shrines/spiritquiz.html.erb new file mode 100644 index 0000000..0b5e67c --- /dev/null +++ b/app/views/shrines/spiritquiz.html.erb @@ -0,0 +1,10 @@ +

    +

    HOME QUIZZES EXPLANATION SCREENSHOTS & VIDEOS WORLDBUILDING

    QUIZZES!

    +

    Which Negative Spirit are you?

    psst..not showing up? refresh the page!

    +
    + +Got an idea for a quiz? Email me!
    +
    +Contact
    +Agnes Alien
    +spirits@alien.hospital
    diff --git a/app/views/shrines/spiritsc.html.erb b/app/views/shrines/spiritsc.html.erb new file mode 100644 index 0000000..0ebf895 --- /dev/null +++ b/app/views/shrines/spiritsc.html.erb @@ -0,0 +1,35 @@ +
    +

    HOME QUIZZES EXPLANATION SCREENSHOTS & VIDEOS WORLDBUILDING

    + +

    Screenshots & Videos

    +

    Larry Trainor's Negative Spirit Screenshots

    +DP-S01-E01-0164-Copy +DP-S01-E02-1390-Copy +DP-S01-E04-0130-Copy +DP-S01-E04-0765-Copy +DP-S01-E06-1157 +DP-S01-E13-0109 +DP-S01-E13-0124-Copy +DP-S01-E13-0199 +DP-S01-E13-0238 +DP-S01-E13-0924 +DP-S01-E13-0936-Copy +DP-S01-E13-1210 +DP-S01-E13-1216-Copy +DP-S02-E01-0941 +maxresdefault-4 q +

    Larry Trainor's Negative Spirit Videos

    + + +

    Valentina Vostok's Negative Spirit Screencaps

    +DP-S02-E06-0539 +DP-S02-E06-0538 +DP-S02-E06-0454 +
    +Contact
    +Agnes Alien
    +spirits@alien.hospital
    + diff --git a/app/views/shrines/spirittimeline.html.erb b/app/views/shrines/spirittimeline.html.erb new file mode 100644 index 0000000..5718d46 --- /dev/null +++ b/app/views/shrines/spirittimeline.html.erb @@ -0,0 +1,32 @@ +
    + +

    +

    HOME QUIZZES EXPLANATION SCREENSHOTS & VIDEOS WORLDBUILDING

    + +

    Timeline

    +Note: As I am primarily a show fan, feel free to email me any corrections. I probably missed something.

    +

    Comics

    +June 1963. The first Doom Patrol comic story featuring Larry Trainor/Negative Man, an Air Force test pilot fused to an alien negative spirit, is released. (My Greatest Adventure #80)
    +September 1977. After Larry Trainor's death, the Negative Spirit inside of him is transferred to Valentina Vostok of the Soviet Air Force. (Showcase vol 1 #94)
    +February 1989. The Negative Spirit, potentially known as Mercurius, originally thought to be a projection of Larry's consciousness, is revealed to be its own unique being. (Doom Patrol Vol 2 #19)
    +February 1989. The Negative Spirit, Larry Trainor, and Dr. Eleanor Poole merge to become a different being known as Rebis, who is not any of them. (Doom Patrol vol 2 #19)
    +December 2016. In Gerard Way's run of Doom Patrol, Larry's Negative Spirit is known as Keeg Bovo. He is introduced for the first time. This may or may not be the same individual as Mercurius. (Doom Patrol vol 6 #2) +January 2017. Keeg Bovo takes Larry Trainor and Cliff Steele to his dimension, the Negative Space. (Doom Patrol vol 6 #4)
    +August 2019. Larry Trainor becomes Positive Man. (Weight of the Worlds #2)
    +July 2023. We learn that Keeg Bovo left Larry Trainor sometime after he became positive man. (Unstoppable Doom Patrol #4)

    + +

    Live Action Adaptation

    +February 2019. The first episode of Doom Patrol, introducing Larry Trainor's live action/cgi Negative Spirit, premieres on DC Universe.
    +July 2020. Space Patrol airs and introduces Valentina Vostok, a one-episode character who has a Spirit of her own.
    +September 2021. The episode Vacay Patrol, season 3 episode 2, writes the Negative Spirit off. It tells Larry it wants to take him to space, but abandons him, leaving for its dimension and sending Larry back home.
    +October 2021. Keeg, the infant son of Larry Trainor and his Negative Spirit, is born.
    +December 2022. In the show, Larry Trainor travels to the future and sees an adult version of his son, Keeg, and his own ghost in a dystopian apocalypse as the final season premieres.
    +April 2023. In an adjacent universe, Titans, another DC show, has its own version of the Negative Spirit. This Spirit is an adult; however, as Larry's negative Spirit carries only signatures of blue, this Spirit carries both blue and red signatures, just as Larry's infant son does. It is unclear if this is the original Negative Spirit of Larry's or an adult version of Larry's son.
    +November 2023. Larry's Negative Spirit makes an appearance once more as Larry time travels back to 1996. The Spirit possesses past!Larry's body and speaks to present!Larry.
    +November 2023. Doom Patrol ends.
    + +
    +Contact
    +Agnes Alien
    +spirits@alien.hospital
    + diff --git a/app/views/updates/edit.html.erb b/app/views/updates/edit.html.erb new file mode 100644 index 0000000..e69de29 diff --git a/app/views/updates/index.html.erb b/app/views/updates/index.html.erb new file mode 100644 index 0000000..b11eab5 --- /dev/null +++ b/app/views/updates/index.html.erb @@ -0,0 +1,14 @@ + +
    +<% if authenticated? %> + <%= link_to 'New Update', new_update_path %> + <% else %> + . +<% end %> +
    +

    Recent Updates

    + +v +
    +
    + diff --git a/app/views/updates/new.html.erb b/app/views/updates/new.html.erb new file mode 100644 index 0000000..1b44c07 --- /dev/null +++ b/app/views/updates/new.html.erb @@ -0,0 +1,24 @@ +
    +<% if authenticated? %> + <%= link_to 'New Update', new_update_path %> + <% else %> + . +<% end %> +
    +<%= form_with model: [@update] do |f| %> + +
    + <%= f.label :text %> + <%= f.rich_text_area :text %> +
    + + + <%= f.label :icon_image %> + <%= f.file_field :icon_image %> +
    + + <%= f.submit "Create Update" %> +<% end %> + +
    +
    diff --git a/app/views/updates/show.html.erb b/app/views/updates/show.html.erb new file mode 100644 index 0000000..e69de29 diff --git a/app/views/welcome/homepage.html.erb b/app/views/welcome/homepage.html.erb new file mode 100644 index 0000000..5329870 --- /dev/null +++ b/app/views/welcome/homepage.html.erb @@ -0,0 +1,25 @@ +
    + +

    hi! i'm agnes of kissingcomputer. this site is a bit sillier than my main site; i put whatever i want on here, and this one is also hand-coded in ruby on rails. it's a playground and a scrapbook and a garden and everything possible, and it's an eternal work in progress. feel free to check out what i have here :-) UPDATES: May 15, 2026.... site built and established! + +
    interests...
    + tv: star trek (various), babylon 5, the orville, doom patrol, ghosts us, pluribus, severance, sitcoms, extraordinary, gravity falls, charmed (both), yellowjackets

    + music: doechii, megan, aaliyah, cupcakke, most female-vocalist r&b rap, bloc party, depeche mode, pet shop boys, purity ring, soft cell, tears for fears, meg myers, emilie autumn, omd, nova twins, poe, placebo +
    + movies: i saw the tv glow, venom 1, madagascar franchise, ready or not, kung fu panda +
    + books: the orange eats creeps (grace krilanovich), porpentine charity heartscape's work, jenny slate's work, wayfarers series (becky chambers) +
    + hobbies: writing, crochet, web development, embroidery, sewing, mixed media/collage stuff, thrifting, jewelry making +
    +
    +
    +
    + +
    + + +
    + + +
    diff --git a/app/views/welcome/index.html.erb b/app/views/welcome/index.html.erb new file mode 100644 index 0000000..4a9f703 --- /dev/null +++ b/app/views/welcome/index.html.erb @@ -0,0 +1,6 @@ +
    +welcome to my house. i use this for a lot of things i don't really do on my main site, it's my messy little rails playground! +

    this site contains blinking gifs, bright colors, and may potentially contain adult content.

    + + + diff --git a/bin/brakeman b/bin/brakeman new file mode 100755 index 0000000..ace1c9b --- /dev/null +++ b/bin/brakeman @@ -0,0 +1,7 @@ +#!/usr/bin/env ruby +require "rubygems" +require "bundler/setup" + +ARGV.unshift("--ensure-latest") + +load Gem.bin_path("brakeman", "brakeman") diff --git a/bin/bundler-audit b/bin/bundler-audit new file mode 100755 index 0000000..e2ef226 --- /dev/null +++ b/bin/bundler-audit @@ -0,0 +1,6 @@ +#!/usr/bin/env ruby +require_relative "../config/boot" +require "bundler/audit/cli" + +ARGV.concat %w[ --config config/bundler-audit.yml ] if ARGV.empty? || ARGV.include?("check") +Bundler::Audit::CLI.start diff --git a/bin/ci b/bin/ci new file mode 100755 index 0000000..4137ad5 --- /dev/null +++ b/bin/ci @@ -0,0 +1,6 @@ +#!/usr/bin/env ruby +require_relative "../config/boot" +require "active_support/continuous_integration" + +CI = ActiveSupport::ContinuousIntegration +require_relative "../config/ci.rb" diff --git a/bin/dev b/bin/dev new file mode 100755 index 0000000..5f91c20 --- /dev/null +++ b/bin/dev @@ -0,0 +1,2 @@ +#!/usr/bin/env ruby +exec "./bin/rails", "server", *ARGV diff --git a/bin/docker-entrypoint b/bin/docker-entrypoint new file mode 100755 index 0000000..ed31659 --- /dev/null +++ b/bin/docker-entrypoint @@ -0,0 +1,8 @@ +#!/bin/bash -e + +# If running the rails server then create or migrate existing database +if [ "${@: -2:1}" == "./bin/rails" ] && [ "${@: -1:1}" == "server" ]; then + ./bin/rails db:prepare +fi + +exec "${@}" diff --git a/bin/importmap b/bin/importmap new file mode 100755 index 0000000..36502ab --- /dev/null +++ b/bin/importmap @@ -0,0 +1,4 @@ +#!/usr/bin/env ruby + +require_relative "../config/application" +require "importmap/commands" diff --git a/bin/jobs b/bin/jobs new file mode 100755 index 0000000..dcf59f3 --- /dev/null +++ b/bin/jobs @@ -0,0 +1,6 @@ +#!/usr/bin/env ruby + +require_relative "../config/environment" +require "solid_queue/cli" + +SolidQueue::Cli.start(ARGV) diff --git a/bin/kamal b/bin/kamal new file mode 100755 index 0000000..cbe59b9 --- /dev/null +++ b/bin/kamal @@ -0,0 +1,27 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'kamal' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +bundle_binstub = File.expand_path("bundle", __dir__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300).include?("This file was generated by Bundler") + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("kamal", "kamal") diff --git a/bin/rails b/bin/rails new file mode 100755 index 0000000..efc0377 --- /dev/null +++ b/bin/rails @@ -0,0 +1,4 @@ +#!/usr/bin/env ruby +APP_PATH = File.expand_path("../config/application", __dir__) +require_relative "../config/boot" +require "rails/commands" diff --git a/bin/rake b/bin/rake new file mode 100755 index 0000000..4fbf10b --- /dev/null +++ b/bin/rake @@ -0,0 +1,4 @@ +#!/usr/bin/env ruby +require_relative "../config/boot" +require "rake" +Rake.application.run diff --git a/bin/rubocop b/bin/rubocop new file mode 100755 index 0000000..5a20504 --- /dev/null +++ b/bin/rubocop @@ -0,0 +1,8 @@ +#!/usr/bin/env ruby +require "rubygems" +require "bundler/setup" + +# Explicit RuboCop config increases performance slightly while avoiding config confusion. +ARGV.unshift("--config", File.expand_path("../.rubocop.yml", __dir__)) + +load Gem.bin_path("rubocop", "rubocop") diff --git a/bin/setup b/bin/setup new file mode 100755 index 0000000..81be011 --- /dev/null +++ b/bin/setup @@ -0,0 +1,35 @@ +#!/usr/bin/env ruby +require "fileutils" + +APP_ROOT = File.expand_path("..", __dir__) + +def system!(*args) + system(*args, exception: true) +end + +FileUtils.chdir APP_ROOT do + # This script is a way to set up or update your development environment automatically. + # This script is idempotent, so that you can run it at any time and get an expectable outcome. + # Add necessary setup steps to this file. + + puts "== Installing dependencies ==" + system("bundle check") || system!("bundle install") + + # puts "\n== Copying sample files ==" + # unless File.exist?("config/database.yml") + # FileUtils.cp "config/database.yml.sample", "config/database.yml" + # end + + puts "\n== Preparing database ==" + system! "bin/rails db:prepare" + system! "bin/rails db:reset" if ARGV.include?("--reset") + + puts "\n== Removing old logs and tempfiles ==" + system! "bin/rails log:clear tmp:clear" + + unless ARGV.include?("--skip-server") + puts "\n== Starting development server ==" + STDOUT.flush # flush the output before exec(2) so that it displays + exec "bin/dev" + end +end diff --git a/bin/thrust b/bin/thrust new file mode 100755 index 0000000..36bde2d --- /dev/null +++ b/bin/thrust @@ -0,0 +1,5 @@ +#!/usr/bin/env ruby +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("thruster", "thrust") diff --git a/config.ru b/config.ru new file mode 100644 index 0000000..4a3c09a --- /dev/null +++ b/config.ru @@ -0,0 +1,6 @@ +# This file is used by Rack-based servers to start the application. + +require_relative "config/environment" + +run Rails.application +Rails.application.load_server diff --git a/config/application.rb b/config/application.rb new file mode 100644 index 0000000..c7f6c46 --- /dev/null +++ b/config/application.rb @@ -0,0 +1,27 @@ +require_relative "boot" + +require "rails/all" + +# Require the gems listed in Gemfile, including any gems +# you've limited to :test, :development, or :production. +Bundler.require(*Rails.groups) + +module Galaxy + class Application < Rails::Application + # Initialize configuration defaults for originally generated Rails version. + config.load_defaults 8.1 + + # Please, add to the `ignore` list any other `lib` subdirectories that do + # not contain `.rb` files, or that should not be reloaded or eager loaded. + # Common ones are `templates`, `generators`, or `middleware`, for example. + config.autoload_lib(ignore: %w[assets tasks]) + + # Configuration for the application, engines, and railties goes here. + # + # These settings can be overridden in specific environments using the files + # in config/environments, which are processed later. + # + # config.time_zone = "Central Time (US & Canada)" + # config.eager_load_paths << Rails.root.join("extras") + end +end diff --git a/config/boot.rb b/config/boot.rb new file mode 100644 index 0000000..988a5dd --- /dev/null +++ b/config/boot.rb @@ -0,0 +1,4 @@ +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +require "bundler/setup" # Set up gems listed in the Gemfile. +require "bootsnap/setup" # Speed up boot time by caching expensive operations. diff --git a/config/bundler-audit.yml b/config/bundler-audit.yml new file mode 100644 index 0000000..e74b3af --- /dev/null +++ b/config/bundler-audit.yml @@ -0,0 +1,5 @@ +# Audit all gems listed in the Gemfile for known security problems by running bin/bundler-audit. +# CVEs that are not relevant to the application can be enumerated on the ignore list below. + +ignore: + - CVE-THAT-DOES-NOT-APPLY diff --git a/config/cable.yml b/config/cable.yml new file mode 100644 index 0000000..b9adc5a --- /dev/null +++ b/config/cable.yml @@ -0,0 +1,17 @@ +# Async adapter only works within the same process, so for manually triggering cable updates from a console, +# and seeing results in the browser, you must do so from the web console (running inside the dev process), +# not a terminal started via bin/rails console! Add "console" to any action or any ERB template view +# to make the web console appear. +development: + adapter: async + +test: + adapter: test + +production: + adapter: solid_cable + connects_to: + database: + writing: cable + polling_interval: 0.1.seconds + message_retention: 1.day diff --git a/config/cache.yml b/config/cache.yml new file mode 100644 index 0000000..e20236f --- /dev/null +++ b/config/cache.yml @@ -0,0 +1,16 @@ +default: &default + database: cache + store_options: + # Cap age of oldest cache entry to fulfill retention policies + # max_age: <%= 60.days.to_i %> + max_size: <%= 256.megabytes %> + namespace: <%= Rails.env %> + +development: + <<: *default + +test: + <<: *default + +production: + <<: *default diff --git a/config/ci.rb b/config/ci.rb new file mode 100644 index 0000000..e56a92e --- /dev/null +++ b/config/ci.rb @@ -0,0 +1,23 @@ +# Run using bin/ci + +CI.run do + step "Setup", "bin/setup --skip-server" + + step "Style: Ruby", "bin/rubocop" + + step "Security: Gem audit", "bin/bundler-audit" + step "Security: Importmap vulnerability audit", "bin/importmap audit" + step "Security: Brakeman code analysis", "bin/brakeman --quiet --no-pager --exit-on-warn --exit-on-error" + + step "Tests: Rails", "bin/rails test" + step "Tests: System", "bin/rails test:system" + step "Tests: Seeds", "env RAILS_ENV=test bin/rails db:seed:replant" + + # Optional: set a green GitHub commit status to unblock PR merge. + # Requires the `gh` CLI and `gh extension install basecamp/gh-signoff`. + # if success? + # step "Signoff: All systems go. Ready for merge and deploy.", "gh signoff" + # else + # failure "Signoff: CI failed. Do not merge or deploy.", "Fix the issues and try again." + # end +end diff --git a/config/credentials.yml.enc b/config/credentials.yml.enc new file mode 100644 index 0000000..6ccf09e --- /dev/null +++ b/config/credentials.yml.enc @@ -0,0 +1 @@ +gmTYs49qp2xhxHCKegYT5VVWYljwcajBxDsAOP0gkkKbOoOnTofa0OQZBftCwpQrFhzfxO/rSdSRj4B8VwCZqSI3ZacdOOYqounut1LcSKIi3W1NL5Or/3JN8+PfXx4G2Uw9W9LFL6Hgd5AgLeTrCwSmwAnn/3AqnXSIxfyn81wnsRgrhjfrV0Db7dXYt9kupIlosXUXdkXmd4teXW5zGkiOaYHVoLz2aDsG0yb1Xs3o9LI8cb7vIc0ZjX5XAXbaQwf/UWFdvl9/0A8kWLx1mFKmeNH7Hhp7u1zD20H59QRtg1XP2ALKjFhcfFOPBWT8EEIcAQM+AQUziYANmrJUc6rMlWXL+cSFH1lznclcsnxouJheb+wyCRF2jDdY+TZd12tkco/PGOx5n+uwqFuBGzhQvbdUlYUcKFW1FgruIxafzLSyB/x+JbRpIKzR/nMNSqoMZhBCcKv5n7DBsTkgOSwjDZkwdScYoEgkW3s70oxBpjzYGxamQLQC--JT0Gb0BOQH7FUbwc--1+5NNKn2F5VrSefCJHKWnQ== \ No newline at end of file diff --git a/config/database.yml b/config/database.yml new file mode 100644 index 0000000..693252b --- /dev/null +++ b/config/database.yml @@ -0,0 +1,41 @@ +# SQLite. Versions 3.8.0 and up are supported. +# gem install sqlite3 +# +# Ensure the SQLite 3 gem is defined in your Gemfile +# gem "sqlite3" +# +default: &default + adapter: sqlite3 + max_connections: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> + timeout: 5000 + +development: + <<: *default + database: storage/development.sqlite3 + +# Warning: The database defined as "test" will be erased and +# re-generated from your development database when you run "rake". +# Do not set this db to the same as development or production. +test: + <<: *default + database: storage/test.sqlite3 + + +# Store production database in the storage/ directory, which by default +# is mounted as a persistent Docker volume in config/deploy.yml. +production: + primary: + <<: *default + database: storage/production.sqlite3 + cache: + <<: *default + database: storage/production_cache.sqlite3 + migrations_paths: db/cache_migrate + queue: + <<: *default + database: storage/production_queue.sqlite3 + migrations_paths: db/queue_migrate + cable: + <<: *default + database: storage/production_cable.sqlite3 + migrations_paths: db/cable_migrate diff --git a/config/deploy.yml b/config/deploy.yml new file mode 100644 index 0000000..4eca235 --- /dev/null +++ b/config/deploy.yml @@ -0,0 +1,126 @@ +<% require "dotenv"; Dotenv.load(".env") %> +# Name of your application. Used to uniquely configure containers. +service: alienkissingcomputer + +# Name of the container image (use your-user/app-name on external registries). +image: aggieonline/galaxy + +# Deploy to these servers. +servers: + web: + - 192.168.4.36 + + + # job: + # hosts: + # - 192.168.0.1 + # cmd: bin/jobs + +# Enable SSL auto certification via Let's Encrypt and allow for multiple apps on a single web server. +# If used with Cloudflare, set encryption mode in SSL/TLS setting to "Full" to enable CF-to-app encryption. +# +# Using an SSL proxy like this requires turning on config.assume_ssl and config.force_ssl in production.rb! +# +# Don't use this when deploying to multiple web servers (then you have to terminate SSL at your load balancer). +# +proxy: + ssl: false + host: alien.kissing.computer + app_port: 3000 + +# Where you keep your container images. +registry: + # Alternatives: hub.docker.com / registry.digitalocean.com / ghcr.io / ... + + # Needed for authenticated registries. + username: aggieonline + + # Always use an access token rather than real password when possible. + password: + - KAMAL_REGISTRY_PASSWORD + +# Inject ENV variables into containers (secrets come from .kamal/secrets). +env: + secret: + - RAILS_MASTER_KEY + - KAMAL_REGISTRY_PASSWORD + clear: + # Run the Solid Queue Supervisor inside the web server's Puma process to do jobs. + # When you start using multiple servers, you should split out job processing to a dedicated machine. + SOLID_QUEUE_IN_PUMA: true + + # Set number of processes dedicated to Solid Queue (default: 1) + # JOB_CONCURRENCY: 3 + + # Set number of cores available to the application on each server (default: 1). + # WEB_CONCURRENCY: 2 + + # Match this to any external database server to configure Active Record correctly + # Use galaxy-db for a db accessory server on same machine via local kamal docker network. + # DB_HOST: 192.168.0.2 + + # Log everything from Rails + # RAILS_LOG_LEVEL: debug + +# Aliases are triggered with "bin/kamal ". You can overwrite arguments on invocation: +# "bin/kamal logs -r job" will tail logs from the first server in the job section. +aliases: + console: app exec --interactive --reuse "bin/rails console" + shell: app exec --interactive --reuse "bash" + logs: app logs -f + dbc: app exec --interactive --reuse "bin/rails dbconsole --include-password" + +# Use a persistent storage volume for sqlite database files and local Active Storage files. +# Recommended to change this to a mounted volume path that is backed up off server. +volumes: + - "/home/pj/galaxy/storage:/rails/storage" + +# Bridge fingerprinted assets, like JS and CSS, between versions to avoid +# hitting 404 on in-flight requests. Combines all files from new and old +# version inside the asset_path. +# asset_path: /rails/public/assets + + +# Configure the image builder. +builder: + arch: amd64 + + + # # Build image via remote server (useful for faster amd64 builds on arm64 computers) + # remote: ssh://docker@docker-builder-server + # + # # Pass arguments and secrets to the Docker build process + # args: + # RUBY_VERSION: ruby-3.4.7 + # secrets: + # - GITHUB_TOKEN + # - RAILS_MASTER_KEY + +# Use a different ssh user than root +# ssh: +# user: app + +# Use accessory services (secrets come from .kamal/secrets). +# accessories: +# db: +# image: mysql:8.0 +# host: 192.168.0.2 +# # Change to 3306 to expose port to the world instead of just local network. +# port: "127.0.0.1:3306:3306" +# env: +# clear: +# MYSQL_ROOT_HOST: '%' +# secret: +# - MYSQL_ROOT_PASSWORD +# files: +# - config/mysql/production.cnf:/etc/mysql/my.cnf +# - db/production.sql:/docker-entrypoint-initdb.d/setup.sql +# directories: +# - data:/var/lib/mysql +# redis: +# image: valkey/valkey:8 +# host: 192.168.0.2 +# port: 6379 +# directories: +# - data:/data + diff --git a/config/environment.rb b/config/environment.rb new file mode 100644 index 0000000..cac5315 --- /dev/null +++ b/config/environment.rb @@ -0,0 +1,5 @@ +# Load the Rails application. +require_relative "application" + +# Initialize the Rails application. +Rails.application.initialize! diff --git a/config/environments/development.rb b/config/environments/development.rb new file mode 100644 index 0000000..75243c3 --- /dev/null +++ b/config/environments/development.rb @@ -0,0 +1,78 @@ +require "active_support/core_ext/integer/time" + +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # Make code changes take effect immediately without server restart. + config.enable_reloading = true + + # Do not eager load code on boot. + config.eager_load = false + + # Show full error reports. + config.consider_all_requests_local = true + + # Enable server timing. + config.server_timing = true + + # Enable/disable Action Controller caching. By default Action Controller caching is disabled. + # Run rails dev:cache to toggle Action Controller caching. + if Rails.root.join("tmp/caching-dev.txt").exist? + config.action_controller.perform_caching = true + config.action_controller.enable_fragment_cache_logging = true + config.public_file_server.headers = { "cache-control" => "public, max-age=#{2.days.to_i}" } + else + config.action_controller.perform_caching = false + end + + # Change to :null_store to avoid any caching. + config.cache_store = :memory_store + + # Store uploaded files on the local file system (see config/storage.yml for options). + config.active_storage.service = :local + + # Don't care if the mailer can't send. + config.action_mailer.raise_delivery_errors = false + + # Make template changes take effect immediately. + config.action_mailer.perform_caching = false + + # Set localhost to be used by links generated in mailer templates. + config.action_mailer.default_url_options = { host: "localhost", port: 3000 } + + # Print deprecation notices to the Rails logger. + config.active_support.deprecation = :log + + # Raise an error on page load if there are pending migrations. + config.active_record.migration_error = :page_load + + # Highlight code that triggered database queries in logs. + config.active_record.verbose_query_logs = true + + # Append comments with runtime information tags to SQL queries in logs. + config.active_record.query_log_tags_enabled = true + + # Highlight code that enqueued background job in logs. + config.active_job.verbose_enqueue_logs = true + + # Highlight code that triggered redirect in logs. + config.action_dispatch.verbose_redirect_logs = true + + # Suppress logger output for asset requests. + config.assets.quiet = true + + # Raises error for missing translations. + # config.i18n.raise_on_missing_translations = true + + # Annotate rendered view with file names. + config.action_view.annotate_rendered_view_with_filenames = true + + # Uncomment if you wish to allow Action Cable access from any origin. + # config.action_cable.disable_request_forgery_protection = true + + # Raise error when a before_action's only/except options reference missing actions. + config.action_controller.raise_on_missing_callback_actions = true + + # Apply autocorrection by RuboCop to files generated by `bin/rails generate`. + # config.generators.apply_rubocop_autocorrect_after_generate! +end diff --git a/config/environments/production.rb b/config/environments/production.rb new file mode 100644 index 0000000..a3f4d74 --- /dev/null +++ b/config/environments/production.rb @@ -0,0 +1,90 @@ +require "active_support/core_ext/integer/time" + +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # Code is not reloaded between requests. + config.enable_reloading = false + + # Eager load code on boot for better performance and memory savings (ignored by Rake tasks). + config.eager_load = true + + # Full error reports are disabled. + config.consider_all_requests_local = false + + # Turn on fragment caching in view templates. + config.action_controller.perform_caching = true + + # Cache assets for far-future expiry since they are all digest stamped. + config.public_file_server.headers = { "cache-control" => "public, max-age=#{1.year.to_i}" } + + # Enable serving of images, stylesheets, and JavaScripts from an asset server. + # config.asset_host = "http://assets.example.com" + + # Store uploaded files on the local file system (see config/storage.yml for options). + config.active_storage.service = :local + + # Assume all access to the app is happening through a SSL-terminating reverse proxy. + config.assume_ssl = true + + # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. + config.force_ssl = false + + # Skip http-to-https redirect for the default health check endpoint. + config.ssl_options = { redirect: { exclude: ->(request) { request.path == "/up" } } } + + # Log to STDOUT with the current request id as a default log tag. + config.log_tags = [ :request_id ] + config.logger = ActiveSupport::TaggedLogging.logger(STDOUT) + + # Change to "debug" to log everything (including potentially personally-identifiable information!). + config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info") + + # Prevent health checks from clogging up the logs. + config.silence_healthcheck_path = "/up" + + # Don't log any deprecations. + config.active_support.report_deprecations = false + + # Replace the default in-process memory cache store with a durable alternative. + config.cache_store = :solid_cache_store + + # Replace the default in-process and non-durable queuing backend for Active Job. + config.active_job.queue_adapter = :solid_queue + config.solid_queue.connects_to = { database: { writing: :queue } } + + # Ignore bad email addresses and do not raise email delivery errors. + # Set this to true and configure the email server for immediate delivery to raise delivery errors. + # config.action_mailer.raise_delivery_errors = false + + # Set host to be used by links generated in mailer templates. + config.action_mailer.default_url_options = { host: "example.com" } + + # Specify outgoing SMTP server. Remember to add smtp/* credentials via bin/rails credentials:edit. + # config.action_mailer.smtp_settings = { + # user_name: Rails.application.credentials.dig(:smtp, :user_name), + # password: Rails.application.credentials.dig(:smtp, :password), + # address: "smtp.example.com", + # port: 587, + # authentication: :plain + # } + + # Enable locale fallbacks for I18n (makes lookups for any locale fall back to + # the I18n.default_locale when a translation cannot be found). + config.i18n.fallbacks = true + + # Do not dump schema after migrations. + config.active_record.dump_schema_after_migration = false + + # Only use :id for inspections in production. + config.active_record.attributes_for_inspect = [ :id ] + + # Enable DNS rebinding protection and other `Host` header attacks. + # config.hosts = [ + # "example.com", # Allow requests from example.com + # /.*\.example\.com/ # Allow requests from subdomains like `www.example.com` + # ] + # + # Skip DNS rebinding protection for the default health check endpoint. + # config.host_authorization = { exclude: ->(request) { request.path == "/up" } } +end diff --git a/config/environments/test.rb b/config/environments/test.rb new file mode 100644 index 0000000..c2095b1 --- /dev/null +++ b/config/environments/test.rb @@ -0,0 +1,53 @@ +# The test environment is used exclusively to run your application's +# test suite. You never need to work with it otherwise. Remember that +# your test database is "scratch space" for the test suite and is wiped +# and recreated between test runs. Don't rely on the data there! + +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # While tests run files are not watched, reloading is not necessary. + config.enable_reloading = false + + # Eager loading loads your entire application. When running a single test locally, + # this is usually not necessary, and can slow down your test suite. However, it's + # recommended that you enable it in continuous integration systems to ensure eager + # loading is working properly before deploying your code. + config.eager_load = ENV["CI"].present? + + # Configure public file server for tests with cache-control for performance. + config.public_file_server.headers = { "cache-control" => "public, max-age=3600" } + + # Show full error reports. + config.consider_all_requests_local = true + config.cache_store = :null_store + + # Render exception templates for rescuable exceptions and raise for other exceptions. + config.action_dispatch.show_exceptions = :rescuable + + # Disable request forgery protection in test environment. + config.action_controller.allow_forgery_protection = false + + # Store uploaded files on the local file system in a temporary directory. + config.active_storage.service = :test + + # Tell Action Mailer not to deliver emails to the real world. + # The :test delivery method accumulates sent emails in the + # ActionMailer::Base.deliveries array. + config.action_mailer.delivery_method = :test + + # Set host to be used by links generated in mailer templates. + config.action_mailer.default_url_options = { host: "example.com" } + + # Print deprecation notices to the stderr. + config.active_support.deprecation = :stderr + + # Raises error for missing translations. + # config.i18n.raise_on_missing_translations = true + + # Annotate rendered view with file names. + # config.action_view.annotate_rendered_view_with_filenames = true + + # Raise error when a before_action's only/except options reference missing actions. + config.action_controller.raise_on_missing_callback_actions = true +end diff --git a/config/importmap.rb b/config/importmap.rb new file mode 100644 index 0000000..6ed7577 --- /dev/null +++ b/config/importmap.rb @@ -0,0 +1,9 @@ +# Pin npm packages by running ./bin/importmap + +pin "application" +pin "@hotwired/turbo-rails", to: "turbo.min.js" +pin "@hotwired/stimulus", to: "stimulus.min.js" +pin "@hotwired/stimulus-loading", to: "stimulus-loading.js" +pin_all_from "app/javascript/controllers", under: "controllers" +pin "trix" +pin "@rails/actiontext", to: "actiontext.esm.js" diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb new file mode 100644 index 0000000..4873244 --- /dev/null +++ b/config/initializers/assets.rb @@ -0,0 +1,7 @@ +# Be sure to restart your server when you modify this file. + +# Version of your assets, change this if you want to expire all your assets. +Rails.application.config.assets.version = "1.0" + +# Add additional assets to the asset load path. +# Rails.application.config.assets.paths << Emoji.images_path diff --git a/config/initializers/content_security_policy.rb b/config/initializers/content_security_policy.rb new file mode 100644 index 0000000..d51d713 --- /dev/null +++ b/config/initializers/content_security_policy.rb @@ -0,0 +1,29 @@ +# Be sure to restart your server when you modify this file. + +# Define an application-wide content security policy. +# See the Securing Rails Applications Guide for more information: +# https://guides.rubyonrails.org/security.html#content-security-policy-header + +# Rails.application.configure do +# config.content_security_policy do |policy| +# policy.default_src :self, :https +# policy.font_src :self, :https, :data +# policy.img_src :self, :https, :data +# policy.object_src :none +# policy.script_src :self, :https +# policy.style_src :self, :https +# # Specify URI for violation reports +# # policy.report_uri "/csp-violation-report-endpoint" +# end +# +# # Generate session nonces for permitted importmap, inline scripts, and inline styles. +# config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s } +# config.content_security_policy_nonce_directives = %w(script-src style-src) +# +# # Automatically add `nonce` to `javascript_tag`, `javascript_include_tag`, and `stylesheet_link_tag` +# # if the corresponding directives are specified in `content_security_policy_nonce_directives`. +# # config.content_security_policy_nonce_auto = true +# +# # Report violations without enforcing the policy. +# # config.content_security_policy_report_only = true +# end diff --git a/config/initializers/filter_parameter_logging.rb b/config/initializers/filter_parameter_logging.rb new file mode 100644 index 0000000..c0b717f --- /dev/null +++ b/config/initializers/filter_parameter_logging.rb @@ -0,0 +1,8 @@ +# Be sure to restart your server when you modify this file. + +# Configure parameters to be partially matched (e.g. passw matches password) and filtered from the log file. +# Use this to limit dissemination of sensitive information. +# See the ActiveSupport::ParameterFilter documentation for supported notations and behaviors. +Rails.application.config.filter_parameters += [ + :passw, :email, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn, :cvv, :cvc +] diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb new file mode 100644 index 0000000..3860f65 --- /dev/null +++ b/config/initializers/inflections.rb @@ -0,0 +1,16 @@ +# Be sure to restart your server when you modify this file. + +# Add new inflection rules using the following format. Inflections +# are locale specific, and you may define rules for as many different +# locales as you wish. All of these examples are active by default: +# ActiveSupport::Inflector.inflections(:en) do |inflect| +# inflect.plural /^(ox)$/i, "\\1en" +# inflect.singular /^(ox)en/i, "\\1" +# inflect.irregular "person", "people" +# inflect.uncountable %w( fish sheep ) +# end + +# These inflection rules are supported but not enabled by default: +# ActiveSupport::Inflector.inflections(:en) do |inflect| +# inflect.acronym "RESTful" +# end diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb new file mode 100644 index 0000000..5587a3d --- /dev/null +++ b/config/initializers/session_store.rb @@ -0,0 +1,5 @@ +Rails.application.config.session_store :cookie_store, + key: '_your_app_session', + secure: Rails.env.production?, + httponly: true, + same_site: :strict # diff --git a/config/locales/en.yml b/config/locales/en.yml new file mode 100644 index 0000000..6c349ae --- /dev/null +++ b/config/locales/en.yml @@ -0,0 +1,31 @@ +# Files in the config/locales directory are used for internationalization and +# are automatically loaded by Rails. If you want to use locales other than +# English, add the necessary files in this directory. +# +# To use the locales, use `I18n.t`: +# +# I18n.t "hello" +# +# In views, this is aliased to just `t`: +# +# <%= t("hello") %> +# +# To use a different locale, set it with `I18n.locale`: +# +# I18n.locale = :es +# +# This would use the information in config/locales/es.yml. +# +# To learn more about the API, please read the Rails Internationalization guide +# at https://guides.rubyonrails.org/i18n.html. +# +# Be aware that YAML interprets the following case-insensitive strings as +# booleans: `true`, `false`, `on`, `off`, `yes`, `no`. Therefore, these strings +# must be quoted to be interpreted as strings. For example: +# +# en: +# "yes": yup +# enabled: "ON" + +en: + hello: "Hello world" diff --git a/config/puma.rb b/config/puma.rb new file mode 100644 index 0000000..38c4b86 --- /dev/null +++ b/config/puma.rb @@ -0,0 +1,42 @@ +# This configuration file will be evaluated by Puma. The top-level methods that +# are invoked here are part of Puma's configuration DSL. For more information +# about methods provided by the DSL, see https://puma.io/puma/Puma/DSL.html. +# +# Puma starts a configurable number of processes (workers) and each process +# serves each request in a thread from an internal thread pool. +# +# You can control the number of workers using ENV["WEB_CONCURRENCY"]. You +# should only set this value when you want to run 2 or more workers. The +# default is already 1. You can set it to `auto` to automatically start a worker +# for each available processor. +# +# The ideal number of threads per worker depends both on how much time the +# application spends waiting for IO operations and on how much you wish to +# prioritize throughput over latency. +# +# As a rule of thumb, increasing the number of threads will increase how much +# traffic a given process can handle (throughput), but due to CRuby's +# Global VM Lock (GVL) it has diminishing returns and will degrade the +# response time (latency) of the application. +# +# The default is set to 3 threads as it's deemed a decent compromise between +# throughput and latency for the average Rails application. +# +# Any libraries that use a connection pool or another resource pool should +# be configured to provide at least as many connections as the number of +# threads. This includes Active Record's `pool` parameter in `database.yml`. +threads_count = ENV.fetch("RAILS_MAX_THREADS", 3) +threads threads_count, threads_count + +# Specifies the `port` that Puma will listen on to receive requests; default is 3000. +port ENV.fetch("PORT", 3000) + +# Allow puma to be restarted by `bin/rails restart` command. +plugin :tmp_restart + +# Run the Solid Queue supervisor inside of Puma for single-server deployments. +plugin :solid_queue if ENV["SOLID_QUEUE_IN_PUMA"] + +# Specify the PID file. Defaults to tmp/pids/server.pid in development. +# In other environments, only set the PID file if requested. +pidfile ENV["PIDFILE"] if ENV["PIDFILE"] diff --git a/config/queue.yml b/config/queue.yml new file mode 100644 index 0000000..9eace59 --- /dev/null +++ b/config/queue.yml @@ -0,0 +1,18 @@ +default: &default + dispatchers: + - polling_interval: 1 + batch_size: 500 + workers: + - queues: "*" + threads: 3 + processes: <%= ENV.fetch("JOB_CONCURRENCY", 1) %> + polling_interval: 0.1 + +development: + <<: *default + +test: + <<: *default + +production: + <<: *default diff --git a/config/recurring.yml b/config/recurring.yml new file mode 100644 index 0000000..b4207f9 --- /dev/null +++ b/config/recurring.yml @@ -0,0 +1,15 @@ +# examples: +# periodic_cleanup: +# class: CleanSoftDeletedRecordsJob +# queue: background +# args: [ 1000, { batch_size: 500 } ] +# schedule: every hour +# periodic_cleanup_with_command: +# command: "SoftDeletedRecord.due.delete_all" +# priority: 2 +# schedule: at 5am every day + +production: + clear_solid_queue_finished_jobs: + command: "SolidQueue::Job.clear_finished_in_batches(sleep_between_batches: 0.3)" + schedule: every hour at minute 12 diff --git a/config/routes.rb b/config/routes.rb new file mode 100644 index 0000000..4835845 --- /dev/null +++ b/config/routes.rb @@ -0,0 +1,57 @@ +Rails.application.routes.draw do + resource :session + resources :passwords, param: :token + # Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html + root "welcome#index" + # Reveal health status on /up that returns 200 if the app boots with no exceptions, otherwise 500. + # Can be used by load balancers and uptime monitors to verify that the app is live. + get "up" => "rails/health#show", as: :rails_health_check + get "/welcome/homepage", to: "welcome#homepage" + + #shrines shrines shrines + + + get "/shrines/mordenambition", to: "shrines#mordenambition" + get "/shrines/mordenlethal", to: "shrines#mordenlethal" + get "/shrines/mordenidol", to: "shrines#mordenidol" + get "/shrines/mordendelirious", to: "shrines#mordendelirious" + get "/shrines/mordenrelease", to: "shrines#mordenrelease" + # spiral eye + get "/shrines/spiraleye", to: "shrines#spiraleye" + get "/shrines/spiraleyefanworks", to: "shrines#spiraleyefanworks" + get "/shrines/spiraleyeggallery", to: "shrines#spiraleyeggallery" + get "/shrines/spiraleyelinks", to: "shrines#spiraleyelinks" + get "/shrines/spiraleyeabout", to: "shrines#spiraleyeabout" + get "/shrines/spiraleyeabtsite", to: "shrines#spiraleyeabtsite" + + + + #spirit + get "/shrines/spirit", to: "shrines#spirit" + get "/shrines/spirittimeline", to: "shrines#spirittimeline" + get "/shrines/spirithc", to: "shrines#spirithc" + get "/shrines/spiritquiz", to: "shrines#spiritquiz" + get "/shrines/spiritsc", to: "shrines#spiritsc" + # Render dynamic PWA files from app/views/pwa/* (remember to link manifest in application.html.erb) + # get "manifest" => "rails/pwa#manifest", as: :pwa_manifest + # get "service-worker" => "rails/pwa#service_worker", as: :pwa_service_worker + + get "/fun/b5sorter", to: "fun#b5sorter" + resources :miniblog + resources :updates + resources :posts + resources :fun + resources :scraps + # Defines the root path route ("/") + # root "posts#index" + resources :shrines + resources :ambition + resource :idol + resource :release + resource :lethal + resource :delirious + resource :spiraleye + resource :spirit + resource :shadow + +end diff --git a/config/storage.yml b/config/storage.yml new file mode 100644 index 0000000..927dc53 --- /dev/null +++ b/config/storage.yml @@ -0,0 +1,27 @@ +test: + service: Disk + root: <%= Rails.root.join("tmp/storage") %> + +local: + service: Disk + root: <%= Rails.root.join("storage") %> + +# Use bin/rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key) +# amazon: +# service: S3 +# access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %> +# secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %> +# region: us-east-1 +# bucket: your_own_bucket-<%= Rails.env %> + +# Remember not to checkin your GCS keyfile to a repository +# google: +# service: GCS +# project: your_project +# credentials: <%= Rails.root.join("path/to/gcs.keyfile") %> +# bucket: your_own_bucket-<%= Rails.env %> + +# mirror: +# service: Mirror +# primary: local +# mirrors: [ amazon, google, microsoft ] diff --git a/lib/tasks/.keep b/lib/tasks/.keep new file mode 100644 index 0000000..e69de29 diff --git a/log/.keep b/log/.keep new file mode 100644 index 0000000..e69de29 diff --git a/public/400.html b/public/400.html new file mode 100644 index 0000000..640de03 --- /dev/null +++ b/public/400.html @@ -0,0 +1,135 @@ + + + + + + + The server cannot process the request due to a client error (400 Bad Request) + + + + + + + + + + + + + +
    +
    + +
    +
    +

    The server cannot process the request due to a client error. Please check the request and try again. If you're the application owner check the logs for more information.

    +
    +
    + + + + diff --git a/public/404.html b/public/404.html new file mode 100644 index 0000000..d7f0f14 --- /dev/null +++ b/public/404.html @@ -0,0 +1,135 @@ + + + + + + + The page you were looking for doesn't exist (404 Not found) + + + + + + + + + + + + + +
    +
    + +
    +
    +

    The page you were looking for doesn't exist. You may have mistyped the address or the page may have moved. If you're the application owner check the logs for more information.

    +
    +
    + + + + diff --git a/public/406-unsupported-browser.html b/public/406-unsupported-browser.html new file mode 100644 index 0000000..43d2811 --- /dev/null +++ b/public/406-unsupported-browser.html @@ -0,0 +1,135 @@ + + + + + + + Your browser is not supported (406 Not Acceptable) + + + + + + + + + + + + + +
    +
    + +
    +
    +

    Your browser is not supported.
    Please upgrade your browser to continue.

    +
    +
    + + + + diff --git a/public/422.html b/public/422.html new file mode 100644 index 0000000..f12fb4a --- /dev/null +++ b/public/422.html @@ -0,0 +1,135 @@ + + + + + + + The change you wanted was rejected (422 Unprocessable Entity) + + + + + + + + + + + + + +
    +
    + +
    +
    +

    The change you wanted was rejected. Maybe you tried to change something you didn't have access to. If you're the application owner check the logs for more information.

    +
    +
    + + + + diff --git a/public/500.html b/public/500.html new file mode 100644 index 0000000..e4eb18a --- /dev/null +++ b/public/500.html @@ -0,0 +1,135 @@ + + + + + + + We're sorry, but something went wrong (500 Internal Server Error) + + + + + + + + + + + + + +
    +
    + +
    +
    +

    We're sorry, but something went wrong.
    If you're the application owner check the logs for more information.

    +
    +
    + + + + diff --git a/public/icon.ico b/public/icon.ico new file mode 100644 index 0000000000000000000000000000000000000000..f7f75e9d203f95d11cce31b1ce617a87b75fc9b2 GIT binary patch literal 21662 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 EKX7rPQUCw| literal 0 HcmV?d00001 diff --git a/public/icon.svg b/public/icon.svg new file mode 100644 index 0000000..8217817 --- /dev/null +++ b/public/icon.svg @@ -0,0 +1,216 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/robots.txt b/public/robots.txt new file mode 100644 index 0000000..c19f78a --- /dev/null +++ b/public/robots.txt @@ -0,0 +1 @@ +# See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file diff --git a/script/.keep b/script/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/application_system_test_case.rb b/test/application_system_test_case.rb new file mode 100644 index 0000000..cee29fd --- /dev/null +++ b/test/application_system_test_case.rb @@ -0,0 +1,5 @@ +require "test_helper" + +class ApplicationSystemTestCase < ActionDispatch::SystemTestCase + driven_by :selenium, using: :headless_chrome, screen_size: [ 1400, 1400 ] +end diff --git a/test/controllers/.keep b/test/controllers/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/controllers/articles_controller_test.rb b/test/controllers/articles_controller_test.rb new file mode 100644 index 0000000..0a82cbb --- /dev/null +++ b/test/controllers/articles_controller_test.rb @@ -0,0 +1,7 @@ +require "test_helper" + +class ArticlesControllerTest < ActionDispatch::IntegrationTest + # test "the truth" do + # assert true + # end +end diff --git a/test/controllers/comments_controller_test.rb b/test/controllers/comments_controller_test.rb new file mode 100644 index 0000000..3f25e01 --- /dev/null +++ b/test/controllers/comments_controller_test.rb @@ -0,0 +1,7 @@ +require "test_helper" + +class CommentsControllerTest < ActionDispatch::IntegrationTest + # test "the truth" do + # assert true + # end +end diff --git a/test/controllers/passwords_controller_test.rb b/test/controllers/passwords_controller_test.rb new file mode 100644 index 0000000..e1a1b03 --- /dev/null +++ b/test/controllers/passwords_controller_test.rb @@ -0,0 +1,67 @@ +require "test_helper" + +class PasswordsControllerTest < ActionDispatch::IntegrationTest + setup { @user = User.take } + + test "new" do + get new_password_path + assert_response :success + end + + test "create" do + post passwords_path, params: { email_address: @user.email_address } + assert_enqueued_email_with PasswordsMailer, :reset, args: [ @user ] + assert_redirected_to new_session_path + + follow_redirect! + assert_notice "reset instructions sent" + end + + test "create for an unknown user redirects but sends no mail" do + post passwords_path, params: { email_address: "missing-user@example.com" } + assert_enqueued_emails 0 + assert_redirected_to new_session_path + + follow_redirect! + assert_notice "reset instructions sent" + end + + test "edit" do + get edit_password_path(@user.password_reset_token) + assert_response :success + end + + test "edit with invalid password reset token" do + get edit_password_path("invalid token") + assert_redirected_to new_password_path + + follow_redirect! + assert_notice "reset link is invalid" + end + + test "update" do + assert_changes -> { @user.reload.password_digest } do + put password_path(@user.password_reset_token), params: { password: "new", password_confirmation: "new" } + assert_redirected_to new_session_path + end + + follow_redirect! + assert_notice "Password has been reset" + end + + test "update with non matching passwords" do + token = @user.password_reset_token + assert_no_changes -> { @user.reload.password_digest } do + put password_path(token), params: { password: "no", password_confirmation: "match" } + assert_redirected_to edit_password_path(token) + end + + follow_redirect! + assert_notice "Passwords did not match" + end + + private + def assert_notice(text) + assert_select "div", /#{text}/ + end +end diff --git a/test/controllers/profiles_controller_test.rb b/test/controllers/profiles_controller_test.rb new file mode 100644 index 0000000..2c4ab0b --- /dev/null +++ b/test/controllers/profiles_controller_test.rb @@ -0,0 +1,7 @@ +require "test_helper" + +class ProfilesControllerTest < ActionDispatch::IntegrationTest + # test "the truth" do + # assert true + # end +end diff --git a/test/controllers/sessions_controller_test.rb b/test/controllers/sessions_controller_test.rb new file mode 100644 index 0000000..07d72ef --- /dev/null +++ b/test/controllers/sessions_controller_test.rb @@ -0,0 +1,33 @@ +require "test_helper" + +class SessionsControllerTest < ActionDispatch::IntegrationTest + setup { @user = User.take } + + test "new" do + get new_session_path + assert_response :success + end + + test "create with valid credentials" do + post session_path, params: { email_address: @user.email_address, password: "password" } + + assert_redirected_to root_path + assert cookies[:session_id] + end + + test "create with invalid credentials" do + post session_path, params: { email_address: @user.email_address, password: "wrong" } + + assert_redirected_to new_session_path + assert_nil cookies[:session_id] + end + + test "destroy" do + sign_in_as(User.take) + + delete session_path + + assert_redirected_to new_session_path + assert_empty cookies[:session_id] + end +end diff --git a/test/controllers/welcome_controller_test.rb b/test/controllers/welcome_controller_test.rb new file mode 100644 index 0000000..76c560c --- /dev/null +++ b/test/controllers/welcome_controller_test.rb @@ -0,0 +1,8 @@ +require "test_helper" + +class WelcomeControllerTest < ActionDispatch::IntegrationTest + test "should get index" do + get welcome_index_url + assert_response :success + end +end diff --git a/test/fixtures/action_text/rich_texts.yml b/test/fixtures/action_text/rich_texts.yml new file mode 100644 index 0000000..8b371ea --- /dev/null +++ b/test/fixtures/action_text/rich_texts.yml @@ -0,0 +1,4 @@ +# one: +# record: name_of_fixture (ClassOfFixture) +# name: content +# body:

    In a million stars!

    diff --git a/test/fixtures/articles.yml b/test/fixtures/articles.yml new file mode 100644 index 0000000..67df8c2 --- /dev/null +++ b/test/fixtures/articles.yml @@ -0,0 +1,13 @@ +# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + title: MyString + text: MyText + mood: MyText + music: MyText + +two: + title: MyString + text: MyText + mood: MyText + music: MyText diff --git a/test/fixtures/comments.yml b/test/fixtures/comments.yml new file mode 100644 index 0000000..0deb955 --- /dev/null +++ b/test/fixtures/comments.yml @@ -0,0 +1,13 @@ +# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + commenter: MyString + website: MyString + body: MyText + article: one + +two: + commenter: MyString + website: MyString + body: MyText + article: two diff --git a/test/fixtures/files/.keep b/test/fixtures/files/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/fixtures/profiles.yml b/test/fixtures/profiles.yml new file mode 100644 index 0000000..35c3c34 --- /dev/null +++ b/test/fixtures/profiles.yml @@ -0,0 +1,15 @@ +# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + bio: MyText + avatar: MyString + location: MyString + website: MyString + user: one + +two: + bio: MyText + avatar: MyString + location: MyString + website: MyString + user: two diff --git a/test/fixtures/users.yml b/test/fixtures/users.yml new file mode 100644 index 0000000..0951563 --- /dev/null +++ b/test/fixtures/users.yml @@ -0,0 +1,9 @@ +<% password_digest = BCrypt::Password.create("password") %> + +one: + email_address: one@example.com + password_digest: <%= password_digest %> + +two: + email_address: two@example.com + password_digest: <%= password_digest %> diff --git a/test/helpers/.keep b/test/helpers/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/integration/.keep b/test/integration/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/mailers/.keep b/test/mailers/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/mailers/previews/passwords_mailer_preview.rb b/test/mailers/previews/passwords_mailer_preview.rb new file mode 100644 index 0000000..01d07ec --- /dev/null +++ b/test/mailers/previews/passwords_mailer_preview.rb @@ -0,0 +1,7 @@ +# Preview all emails at http://localhost:3000/rails/mailers/passwords_mailer +class PasswordsMailerPreview < ActionMailer::Preview + # Preview this email at http://localhost:3000/rails/mailers/passwords_mailer/reset + def reset + PasswordsMailer.reset(User.take) + end +end diff --git a/test/models/.keep b/test/models/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/models/article_test.rb b/test/models/article_test.rb new file mode 100644 index 0000000..9c9ba95 --- /dev/null +++ b/test/models/article_test.rb @@ -0,0 +1,7 @@ +require "test_helper" + +class ArticleTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/comment_test.rb b/test/models/comment_test.rb new file mode 100644 index 0000000..5a6feda --- /dev/null +++ b/test/models/comment_test.rb @@ -0,0 +1,7 @@ +require "test_helper" + +class CommentTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/profile_test.rb b/test/models/profile_test.rb new file mode 100644 index 0000000..701636f --- /dev/null +++ b/test/models/profile_test.rb @@ -0,0 +1,7 @@ +require "test_helper" + +class ProfileTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/user_test.rb b/test/models/user_test.rb new file mode 100644 index 0000000..83445c4 --- /dev/null +++ b/test/models/user_test.rb @@ -0,0 +1,8 @@ +require "test_helper" + +class UserTest < ActiveSupport::TestCase + test "downcases and strips email_address" do + user = User.new(email_address: " DOWNCASED@EXAMPLE.COM ") + assert_equal("downcased@example.com", user.email_address) + end +end diff --git a/test/system/.keep b/test/system/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/test_helper.rb b/test/test_helper.rb new file mode 100644 index 0000000..85c54c6 --- /dev/null +++ b/test/test_helper.rb @@ -0,0 +1,16 @@ +ENV["RAILS_ENV"] ||= "test" +require_relative "../config/environment" +require "rails/test_help" +require_relative "test_helpers/session_test_helper" + +module ActiveSupport + class TestCase + # Run tests in parallel with specified workers + parallelize(workers: :number_of_processors) + + # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. + fixtures :all + + # Add more helper methods to be used by all tests here... + end +end diff --git a/test/test_helpers/session_test_helper.rb b/test/test_helpers/session_test_helper.rb new file mode 100644 index 0000000..0686378 --- /dev/null +++ b/test/test_helpers/session_test_helper.rb @@ -0,0 +1,19 @@ +module SessionTestHelper + def sign_in_as(user) + Current.session = user.sessions.create! + + ActionDispatch::TestRequest.create.cookie_jar.tap do |cookie_jar| + cookie_jar.signed[:session_id] = Current.session.id + cookies["session_id"] = cookie_jar[:session_id] + end + end + + def sign_out + Current.session&.destroy! + cookies.delete("session_id") + end +end + +ActiveSupport.on_load(:action_dispatch_integration_test) do + include SessionTestHelper +end diff --git a/tmp/.keep b/tmp/.keep new file mode 100644 index 0000000..e69de29 diff --git a/tmp/pids/.keep b/tmp/pids/.keep new file mode 100644 index 0000000..e69de29 diff --git a/vendor/.keep b/vendor/.keep new file mode 100644 index 0000000..e69de29 diff --git a/vendor/javascript/.keep b/vendor/javascript/.keep new file mode 100644 index 0000000..e69de29