Skip to content

Commit

Permalink
Fix mongoid raises not found error, and config updates
Browse files Browse the repository at this point in the history
  • Loading branch information
aldwin7894 committed Apr 9, 2023
1 parent 62c739a commit 4e1d7b9
Show file tree
Hide file tree
Showing 14 changed files with 67 additions and 56 deletions.
6 changes: 4 additions & 2 deletions .trunk/trunk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,16 @@ lint:
- db/**
- node_modules/**
enabled:
- eslint@8.37.0:
- eslint@8.38.0:
packages:
- eslint-config-airbnb-base
- eslint-config-prettier
- eslint-import-resolver-alias
- eslint-plugin-html-erb
- eslint-plugin-import
- eslint-plugin-prettier
- eslint-plugin-tailwindcss
- rubocop@1.39.0:
- rubocop@1.49.0:
packages:
- rubocop-packaging
- rubocop-performance
Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ GEM
rubocop-performance (1.16.0)
rubocop (>= 1.7.0, < 2.0)
rubocop-ast (>= 0.4.0)
rubocop-rails (2.18.0)
rubocop-rails (2.19.0)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.33.0, < 2.0)
Expand Down Expand Up @@ -557,7 +557,7 @@ GEM
websocket-extensions (0.1.5)
xpath (3.2.0)
nokogiri (~> 1.8)
yard (0.9.26)
yard (0.9.29)
zeitwerk (2.6.7)

PLATFORMS
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 aldwin7894
Copyright (c) 2022-2023 aldwin7894

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# My Personal Web App

[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=aldwin7894_aldwin7894&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=aldwin7894_aldwin7894)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=aldwin7894:project-cyan&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=aldwin7894:project-cyan)
[![CodeQL](https://github.com/aldwin7894/project-cyan/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/aldwin7894/project-cyan/actions/workflows/codeql-analysis.yml)

###### _Nothing to see here, lol_
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/home_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def browserconfig; end
def site; end

def ping
render plain: "Welcome to aldwin7894"
render plain: "Welcome to project-cyan"
end

private
Expand Down
8 changes: 4 additions & 4 deletions app/views/home/site.webmanifest.erb
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"lang": "en",
"name": "aldwin7894",
"short_name": "aldwin7894",
"name": "project-cyan",
"short_name": "project-cyan",
"icons": [
{
"src": "<%= vite_asset_url 'favicon/android-chrome-192x192.png' %>",
"src": "<%= vite_asset_url "favicon/android-chrome-192x192.png" %>",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "<%= vite_asset_url 'favicon/android-chrome-512x512.png' %>",
"src": "<%= vite_asset_url "favicon/android-chrome-512x512.png" %>",
"sizes": "512x512",
"type": "image/png"
}
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/_content.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<footer class="dark:text-[#bfb3a4] text-gray-400 p-4 bg-[#151515] shadow md:flex md:items-center md:justify-between md:p-6 hidden">
<div class="xs:flex-col container flex flex-row gap-2">
<span class="xs:text-center xs:order-3 flex-1 text-sm">© 2022 aldwin7894. All Rights Reserved.</span>
<span class="xs:text-center xs:order-3 flex-1 text-sm">© 2022-2023 aldwin7894. All Rights Reserved.</span>
<%= link_to "Home", root_path, class: "hover:text-cyan-600 text-center text-md xs:order-1 px-2", target: "_top" %>
<%= link_to "AniList Follow Checker", anilist_index_path, class: "hover:text-cyan-600 text-center text-md xs:order-2 px-2", target: "_top" %>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/anilist.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width,initial-scale=1" />
<meta http-equiv="content-type" content="text/html" />
<meta charset="UTF-8" />
<meta name="keywords" content="aldwin7894, CyanNyan, CyanNyann, AniList, AL, MyAnimeList, MAL, last.fm">
<meta name="keywords" content="aldwin7894, CyanNyan, CyanNyann, AniList, AL, MyAnimeList, MAL, last.fm, project-cyan">
<meta name="description" content="Checks your following and followers list on AniList, and also lists out users that you don't follow yet or doesn't follow you.">
<meta name="author" content="aldwin7894">

Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width,initial-scale=1" />
<meta http-equiv="content-type" content="text/html" />
<meta charset="UTF-8" />
<meta name="keywords" content="aldwin7894, CyanNyan, CyanNyann, AniList, AL, MyAnimeList, MAL, last.fm">
<meta name="keywords" content="aldwin7894, CyanNyan, CyanNyann, AniList, AL, MyAnimeList, MAL, last.fm, project-cyan">
<meta name="description" content="aldwin7894's personal web app which contains some random stats about anime, games and music (and probably some useful tools in the near future :3).">
<meta name="author" content="aldwin7894">

Expand Down
39 changes: 24 additions & 15 deletions config/mongoid.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
production:
clients:
default:
uri: <%= ENV.fetch("DATABASE_URL") %>
options:
auth_mech: :scram
auth_source: admin
max_pool_size: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
raise_not_found_error: false

development:
# Configure available database clients. (required)
clients:
Expand Down Expand Up @@ -133,7 +123,7 @@ development:
# a connection in server versions >= 3.4. Note that the name cannot
# exceed 128 bytes. It is also used as the database name if the
# database name is not explicitly defined. (default: nil)
# app_name: MyApplicationName
app_name: project-cyan

# Mark belongs_to associations as required by default, so that saving a
# model with a missing belongs_to association will trigger a validation
Expand Down Expand Up @@ -172,7 +162,7 @@ development:
# Use ActiveSupport's time zone in time operations instead of
# the Ruby default time zone. See the time zone section below for
# further information. (default: true)
# use_activesupport_time_zone: true
use_activesupport_time_zone: true

# Return stored times as UTC. See the time zone section below for
# further information. Most applications should not use this option.
Expand All @@ -186,10 +176,29 @@ development:
test:
clients:
default:
database: aldwin7894_test
hosts:
- localhost:27017
uri: <%= ENV.fetch("DATABASE_URL") %>
options:
auth_mech: :scram
auth_source: admin
read:
mode: :primary
max_pool_size: 1
options:
app_name: project-cyan
raise_not_found_error: false
use_activesupport_time_zone: true

production:
clients:
default:
uri: <%= ENV.fetch("DATABASE_URL") %>
options:
auth_mech: :scram
auth_source: admin
max_pool_size: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
skip_version_check: true
safe: true
options:
app_name: project-cyan
raise_not_found_error: false
use_activesupport_time_zone: true
8 changes: 4 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: "3.9"

services:
db:
container_name: aldwin7894-mongo
container_name: project-cyan-mongo
image: mongo:4.4
restart: always
environment:
Expand All @@ -14,7 +14,7 @@ services:
volumes:
- dbdata:/data/db
redis:
container_name: aldwin7894-redis
container_name: project-cyan-redis
image: redis:alpine
command: redis-server /usr/local/etc/redis/redis.conf
restart: always
Expand All @@ -31,7 +31,7 @@ services:
timeout: 5s
retries: 5
redisinsight:
container_name: aldwin7894-redisinsight
container_name: project-cyan-redisinsight
image: redislabs/redisinsight:latest
restart: always
ports:
Expand All @@ -51,7 +51,7 @@ services:
- OCCSON_PASSPHRASE
- RAILS_MASTER_KEY
- RAILS_ASSET_HOST
container_name: aldwin7894-app
container_name: project-cyan-app
image: aldwin7894/project-cyan:prod
restart: always
depends_on:
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"postcss-import": "^15.1.0",
"postcss-preset-env": "^8.3.0",
"rollup-plugin-gzip": "^3.1.0",
"sass": "^1.60.0",
"sass": "^1.61.0",
"tailwindcss": "^3.3.1",
"tailwindcss-animatecss": "^3.0.4",
"terser": "^5.16.8",
Expand All @@ -50,7 +50,7 @@
"devDependencies": {
"@types/node": "^18.15.11",
"@typescript-eslint/parser": "^5.57.1",
"eslint": "^8.37.0",
"eslint": "^8.38.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-prettier": "^8.8.0",
"eslint-import-resolver-alias": "^1.1.2",
Expand All @@ -59,7 +59,7 @@
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-tailwindcss": "^3.11.0",
"prettier": "^2.8.7",
"typescript": "^5.0.3"
"typescript": "^5.0.4"
},
"engines": {
"node": "18.12.0",
Expand Down
6 changes: 3 additions & 3 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
sonar.projectKey=aldwin7894_aldwin7894
sonar.projectKey=aldwin7894:project-cyan
sonar.organization=aldwin7894

# This is the name and version displayed in the SonarCloud UI.
#sonar.projectName=aldwin7894
#sonar.projectVersion=1.0
sonar.projectName=project-cyan
sonar.projectVersion=1.0

# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
#sonar.sources=.
Expand Down
34 changes: 17 additions & 17 deletions yarn.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4e1d7b9

Please sign in to comment.